SLIDE 1
Advanced Algorithms – COMS31900 Approximation algorithms part four Asymptotic Polynomial Time Approximation Schemes
Rapha¨ el Clifford Slides by Benjamin Sach
SLIDE 2 Approximation Algorithms Recap
A polynomial time algorithm A is an α-approximation for problem P if, it always outputs a solution s with
Opt α
s Opt (for a maximisation problem) Opt s α · Opt (for a minimisation problem)
A poly-time approximation scheme (PTAS) is a family of algorithms: For any constant ǫ > 0, Aǫ is a (1 + ǫ)-approximation for P It is a (fully) FPTAS if Aǫ takes time polynomial in both n and 1/ǫ A PTAS is allowed to have Aǫ which takes O(n1/ǫ) time
- which is polynomial in n (for any constant ǫ)
i.e. O((n/ǫ)c)
SLIDE 3 Approximation Algorithms Recap
A polynomial time algorithm A is an α-approximation for problem P if, it always outputs a solution s with
Opt α
s Opt (for a maximisation problem) Opt s α · Opt (for a minimisation problem)
We have seen various c-approximations with constant c A poly-time approximation scheme (PTAS) is a family of algorithms: For any constant ǫ > 0, Aǫ is a (1 + ǫ)-approximation for P Last lecture we saw an FPTAS for SUBSETSUM It is a (fully) FPTAS if Aǫ takes time polynomial in both n and 1/ǫ A PTAS is allowed to have Aǫ which takes O(n1/ǫ) time
- which is polynomial in n (for any constant ǫ)
i.e. O((n/ǫ)c)
SLIDE 4
The SUBSETSUM problem
4 4 7 3
2 2 t = 12
SLIDE 5 The SUBSETSUM problem
4 4 7 3
2 2 t = 12
- Let S be a (multi) set of integers and t be a positive integer
here S = {4, 2, 4, 7, 2, 3} and t = 12
SLIDE 6 The SUBSETSUM problem
4 4 7 3
2 2 t = 12
- Let S be a (multi) set of integers and t be a positive integer
here S = {4, 2, 4, 7, 2, 3} and t = 12 Decision Problem Is there a subset, S′ ⊆ S with SIZE(S′) = t?
SLIDE 7 The SUBSETSUM problem
4 4 7 3
2 2 t = 12
- Let S be a (multi) set of integers and t be a positive integer
here S = {4, 2, 4, 7, 2, 3} and t = 12 Decision Problem Is there a subset, S′ ⊆ S with SIZE(S′) = t? where SIZE(S′) =
a∈S′ a
SLIDE 8 The SUBSETSUM problem t = 12
4 4
2
7 3
2
- Let S be a (multi) set of integers and t be a positive integer
here S = {4, 2, 4, 7, 2, 3} and t = 12 Decision Problem Is there a subset, S′ ⊆ S with SIZE(S′) = t? where SIZE(S′) =
a∈S′ a
SLIDE 9 The SUBSETSUM problem t = 12
7 3
2
4 4
2
- Let S be a (multi) set of integers and t be a positive integer
here S = {4, 2, 4, 7, 2, 3} and t = 12 Decision Problem Is there a subset, S′ ⊆ S with SIZE(S′) = t? where SIZE(S′) =
a∈S′ a
SLIDE 10 The SUBSETSUM problem
4 4 7 3
2 2 t = 12
- Let S be a (multi) set of integers and t be a positive integer
here S = {4, 2, 4, 7, 2, 3} and t = 12 Decision Problem Is there a subset, S′ ⊆ S with SIZE(S′) = t? where SIZE(S′) =
a∈S′ a
(last lecture we discussed the NP-hard optimisation version) The decision version is NP-complete
SLIDE 11
The PARTITION problem
4 4 7 3
2 2
The PARTITION problem is a special case of SUBSETSUM
SLIDE 12
The PARTITION problem
4 4 7 3
2 2
The input S is a multi-set of integers The PARTITION problem is a special case of SUBSETSUM
SLIDE 13
The PARTITION problem
4 4 7 3
2 2
The input S is a multi-set of integers but t is always half the sum of item sizes The PARTITION problem is a special case of SUBSETSUM
SLIDE 14
The PARTITION problem
4 4 7 3
2 2 t = 11
The input S is a multi-set of integers but t is always half the sum of item sizes The PARTITION problem is a special case of SUBSETSUM
SLIDE 15
The PARTITION problem
4 4 7 3
2 2 t = 11
The input S is a multi-set of integers but t is always half the sum of item sizes
t = SIZE(S)/2 =
a∈S′ a 2
The PARTITION problem is a special case of SUBSETSUM
SLIDE 16
The PARTITION problem
4 4 7 3
2 2 t = 11
The input S is a multi-set of integers but t is always half the sum of item sizes Decision Problem Is there a subset, S′ ⊆ S with SIZE(S′) = SIZE(S)/2?
t = SIZE(S)/2 =
a∈S′ a 2
The PARTITION problem is a special case of SUBSETSUM
SLIDE 17
The PARTITION problem t = 11
4 4
2
7 3
2
The input S is a multi-set of integers but t is always half the sum of item sizes Decision Problem Is there a subset, S′ ⊆ S with SIZE(S′) = SIZE(S)/2?
t = SIZE(S)/2 =
a∈S′ a 2
The PARTITION problem is a special case of SUBSETSUM
SLIDE 18
The PARTITION problem
7
2 2 t = 11
The input S is a multi-set of integers but t is always half the sum of item sizes Decision Problem Is there a subset, S′ ⊆ S with SIZE(S′) = SIZE(S)/2?
t = SIZE(S)/2 =
a∈S′ a 2
4 4 3
The PARTITION problem is a special case of SUBSETSUM
SLIDE 19
The PARTITION problem
4 4 7 3
2 2 t = 11
The input S is a multi-set of integers but t is always half the sum of item sizes Decision Problem Is there a subset, S′ ⊆ S with SIZE(S′) = SIZE(S)/2?
t = SIZE(S)/2 =
a∈S′ a 2
The PARTITION problem is a special case of SUBSETSUM
SLIDE 20
The PARTITION problem
4 4 7 3
2 2 t = 11
The input S is a multi-set of integers but t is always half the sum of item sizes Decision Problem Is there a subset, S′ ⊆ S with SIZE(S′) = SIZE(S)/2?
t = SIZE(S)/2 =
a∈S′ a 2
The PARTITION problem is a special case of SUBSETSUM
SLIDE 21
The PARTITION problem
4 4 7 3
2 2 t = 11
The input S is a multi-set of integers but t is always half the sum of item sizes Decision Problem Is there a subset, S′ ⊆ S with SIZE(S′) = SIZE(S)/2?
t = SIZE(S)/2 =
a∈S′ a 2
The PARTITION problem is a special case of SUBSETSUM Alternatively... Can we pack S into two bins of size SIZE(S)/2?
SLIDE 22
The PARTITION problem
The input S is a multi-set of integers but t is always half the sum of item sizes Decision Problem Is there a subset, S′ ⊆ S with SIZE(S′) = SIZE(S)/2?
t = SIZE(S)/2 =
a∈S′ a 2
The PARTITION problem is a special case of SUBSETSUM Alternatively... Can we pack S into two bins of size SIZE(S)/2?
4 4 7 3
2 2 t = 11
SLIDE 23
The PARTITION problem
The input S is a multi-set of integers but t is always half the sum of item sizes Decision Problem Is there a subset, S′ ⊆ S with SIZE(S′) = SIZE(S)/2?
t = SIZE(S)/2 =
a∈S′ a 2
The PARTITION problem is a special case of SUBSETSUM Alternatively... Can we pack S into two bins of size SIZE(S)/2?
4 4 3 7
2 2 t = 11
SLIDE 24
The PARTITION problem
The input S is a multi-set of integers but t is always half the sum of item sizes Decision Problem Is there a subset, S′ ⊆ S with SIZE(S′) = SIZE(S)/2?
t = SIZE(S)/2 =
a∈S′ a 2
The PARTITION problem is a special case of SUBSETSUM Alternatively... Can we pack S into two bins of size SIZE(S)/2?
4 4 3 7
2 2 t = 11
The PARTITION problem is also NP-complete
SLIDE 25
PARTITION and BINPACKING
Key Idea Solve the PARTITION problem by approximating BINPACKING
SLIDE 26
PARTITION and BINPACKING
Key Idea Solve the PARTITION problem by approximating BINPACKING
4 4 7 3
2 2 t = 11
SLIDE 27 PARTITION and BINPACKING
Key Idea Solve the PARTITION problem by approximating BINPACKING
4 4 7 3
2 2 t = 11
- Convert the PARTITION instance into a BINPACKING problem
by dividing all item and bin sizes by t = SIZE(S)/2
SLIDE 28 PARTITION and BINPACKING
Key Idea Solve the PARTITION problem by approximating BINPACKING
- Convert the PARTITION instance into a BINPACKING problem
by dividing all item and bin sizes by t = SIZE(S)/2
4 11 4 11 7 11
3 11
2 11 2 11
1
SLIDE 29 PARTITION and BINPACKING
Key Idea Solve the PARTITION problem by approximating BINPACKING
- Convert the PARTITION instance into a BINPACKING problem
by dividing all item and bin sizes by t = SIZE(S)/2
- Now all items are have size at most 1 and the bins have size 1
4 11 4 11 7 11
3 11
2 11 2 11
1
SLIDE 30 PARTITION and BINPACKING
Key Idea Solve the PARTITION problem by approximating BINPACKING
- Convert the PARTITION instance into a BINPACKING problem
by dividing all item and bin sizes by t = SIZE(S)/2
- Now all items are have size at most 1 and the bins have size 1
- The optimal number of bins Optb is 2 iff
the answer to the PARTITION instance is ‘yes’
4 11 4 11 7 11
3 11
2 11 2 11
1
SLIDE 31 PARTITION and BINPACKING
Key Idea Solve the PARTITION problem by approximating BINPACKING
- Convert the PARTITION instance into a BINPACKING problem
by dividing all item and bin sizes by t = SIZE(S)/2
- Now all items are have size at most 1 and the bins have size 1
- The optimal number of bins Optb is 2 iff
the answer to the PARTITION instance is ‘yes’
4 11 4 11 7 11
3 11
2 11 2 11
1
- What does this tell us about approximating BINPACKING?
SLIDE 32 PARTITION and BINPACKING
Key Idea Solve the PARTITION problem by approximating BINPACKING
4 11 4 11 7 11
3 11
2 11 2 11
1
- Assume A is an α-approximation for BINPACKING with α < 3/2
SLIDE 33 PARTITION and BINPACKING
Key Idea Solve the PARTITION problem by approximating BINPACKING
4 11 4 11 7 11
3 11
2 11 2 11
1
- Assume A is an α-approximation for BINPACKING with α < 3/2
A outputs a solution using s bins with Optb s α · Optb
SLIDE 34 PARTITION and BINPACKING
Key Idea Solve the PARTITION problem by approximating BINPACKING
4 11 4 11 7 11
3 11
2 11 2 11
1
- Assume A is an α-approximation for BINPACKING with α < 3/2
A outputs a solution using s bins with Optb s α · Optb
SLIDE 35 PARTITION and BINPACKING
Key Idea Solve the PARTITION problem by approximating BINPACKING
4 11 4 11 7 11
3 11
2 11 2 11
1
- Assume A is an α-approximation for BINPACKING with α < 3/2
A outputs a solution using s bins with Optb s α · Optb
- If Optb > 2 then s > 2
- If Optb = 2 then 2 s α · Optb < (3/2) · Optb = 3
SLIDE 36 PARTITION and BINPACKING
Key Idea Solve the PARTITION problem by approximating BINPACKING
4 11 4 11 7 11
3 11
2 11 2 11
1
- Assume A is an α-approximation for BINPACKING with α < 3/2
A outputs a solution using s bins with Optb s α · Optb
- If Optb > 2 then s > 2
- If Optb = 2 then 2 s α · Optb < (3/2) · Optb = 3
SLIDE 37 PARTITION and BINPACKING
Key Idea Solve the PARTITION problem by approximating BINPACKING
4 11 4 11 7 11
3 11
2 11 2 11
1
- Assume A is an α-approximation for BINPACKING with α < 3/2
A outputs a solution using s bins with Optb s α · Optb
so s = 2
- If Optb = 2 then 2 s α · Optb < (3/2) · Optb = 3
SLIDE 38 PARTITION and BINPACKING
Key Idea Solve the PARTITION problem by approximating BINPACKING
4 11 4 11 7 11
3 11
2 11 2 11
1
- Assume A is an α-approximation for BINPACKING with α < 3/2
A outputs a solution using s bins with Optb s α · Optb
so s = 2
- So A can solve the NP-complete PARTITION problem in polynomial time!
- If Optb = 2 then 2 s α · Optb < (3/2) · Optb = 3
SLIDE 39 PARTITION and BINPACKING
Key Idea Solve the PARTITION problem by approximating BINPACKING
4 11 4 11 7 11
3 11
2 11 2 11
1
- Assume A is an α-approximation for BINPACKING with α < 3/2
A outputs a solution using s bins with Optb s α · Optb
so s = 2
- So A can solve the NP-complete PARTITION problem in polynomial time!
which implies that P = NP
- If Optb = 2 then 2 s α · Optb < (3/2) · Optb = 3
SLIDE 40
PARTITION and BINPACKING
Key Idea Solve the PARTITION problem by approximating BINPACKING
4 11 4 11 7 11
3 11
2 11 2 11
1
Lemma There is no α-approximation for BINPACKING with α < 3/2 unless P = NP
SLIDE 41
PARTITION and BINPACKING
Key Idea Solve the PARTITION problem by approximating BINPACKING
4 11 4 11 7 11
3 11
2 11 2 11
1
Lemma There is no α-approximation for BINPACKING with α < 3/2 unless P = NP We saw that First Fit Decreasing (FFD) is a 3/2-approximation
SLIDE 42
PARTITION and BINPACKING
Key Idea Solve the PARTITION problem by approximating BINPACKING
4 11 4 11 7 11
3 11
2 11 2 11
1
Lemma There is no α-approximation for BINPACKING with α < 3/2 unless P = NP We saw that First Fit Decreasing (FFD) is a 3/2-approximation so this is the best we can do?
SLIDE 43
PARTITION and BINPACKING
Key Idea Solve the PARTITION problem by approximating BINPACKING
4 11 4 11 7 11
3 11
2 11 2 11
1
Lemma There is no α-approximation for BINPACKING with α < 3/2 unless P = NP We saw that First Fit Decreasing (FFD) is a 3/2-approximation so this is the best we can do? In fact, FFD gives a solution using s bins with
Optb s 11 9 · Optb + 1
SLIDE 44
Asymptotic Polynomial time approximation schemes
An asymptotic polynomial time approximation scheme (APTAS) for problem P is a family of algorithms: For any constant ǫ > 0, Aǫ runs in polynomial time (poly-time) There is a constant c > 0 such that and outputs a solution s with Opt s (1 + ǫ) · Opt + c
SLIDE 45
Asymptotic Polynomial time approximation schemes
An asymptotic polynomial time approximation scheme (APTAS) for problem P is a family of algorithms: For any constant ǫ > 0, Aǫ runs in polynomial time (poly-time) There is a constant c > 0 such that and outputs a solution s with Opt s (1 + ǫ) · Opt + c (this is the minimisation version of the definition)
SLIDE 46
Asymptotic Polynomial time approximation schemes
An asymptotic polynomial time approximation scheme (APTAS) for problem P is a family of algorithms: For any constant ǫ > 0, Aǫ runs in polynomial time (poly-time) An APTAS does not have to have running time polynomial in 1/ǫ There is a constant c > 0 such that and outputs a solution s with Opt s (1 + ǫ) · Opt + c (this is the minimisation version of the definition)
SLIDE 47
Asymptotic Polynomial time approximation schemes
An asymptotic polynomial time approximation scheme (APTAS) for problem P is a family of algorithms: For any constant ǫ > 0, Aǫ runs in polynomial time (poly-time) An APTAS does not have to have running time polynomial in 1/ǫ An asymptotic fully PTAS (AFPTAS) is also polynomial in 1/ǫ There is a constant c > 0 such that and outputs a solution s with Opt s (1 + ǫ) · Opt + c (this is the minimisation version of the definition)
SLIDE 48
Asymptotic Polynomial time approximation schemes
An asymptotic polynomial time approximation scheme (APTAS) for problem P is a family of algorithms: For any constant ǫ > 0, Aǫ runs in polynomial time (poly-time) An APTAS does not have to have running time polynomial in 1/ǫ An asymptotic fully PTAS (AFPTAS) is also polynomial in 1/ǫ There is a constant c > 0 such that and outputs a solution s with Opt s (1 + ǫ) · Opt + c (this is the minimisation version of the definition) We will see an APTAS for BINPACKING which uses at most (1 + ǫ) · Opt + 1 bins
SLIDE 49
A special case of BINPACKING
We will now see a special case of BINPACKING which we can solve optimally in polynomial time
4 8 7 8
3 8
1 4 8 4 8 7 8 7 8 4 8
3 8
SLIDE 50
A special case of BINPACKING
We will now see a special case of BINPACKING which we can solve optimally in polynomial time
4 8 7 8
3 8
1 4 8 4 8 7 8 7 8 4 8
3 8
We have n items but
SLIDE 51 A special case of BINPACKING
We will now see a special case of BINPACKING which we can solve optimally in polynomial time
4 8 7 8
3 8
1 4 8 4 8 7 8 7 8 4 8
3 8
We have n items but
- There are cs (a constant) number of different item sizes
SLIDE 52 A special case of BINPACKING
We will now see a special case of BINPACKING which we can solve optimally in polynomial time
4 8 7 8
3 8
1 4 8 4 8 7 8 7 8 4 8
3 8
We have n items but
- There are cs (a constant) number of different item sizes
- At most cb (another constant) items fit in each bin
SLIDE 53 A special case of BINPACKING
We will now see a special case of BINPACKING which we can solve optimally in polynomial time
4 8 7 8
3 8
1 4 8 4 8 7 8 7 8 4 8
3 8
We have n items but
- There are cs (a constant) number of different item sizes
- At most cb (another constant) items fit in each bin
Here cs = 3 and cb = 2
SLIDE 54 A special case of BINPACKING
We will now see a special case of BINPACKING which we can solve optimally in polynomial time
4 8 7 8
3 8
1 4 8 4 8 7 8 7 8 4 8
3 8
We have n items but
- There are cs (a constant) number of different item sizes
- At most cb (another constant) items fit in each bin
Here cs = 3 and cb = 2 How many different ways are there to fill a single bin?
SLIDE 55 A special case of BINPACKING 4 8
3 8 3 8 3 8
4 8 7 8
3 8
4 8 4 8 1 2 3 4 5 6 7 Type:
- We can describe any packing of items into a single bin by its type
cs diff. item sizes cb items fit in each bin
SLIDE 56 A special case of BINPACKING 4 8
3 8 3 8 3 8
4 8 7 8
3 8
4 8 4 8 1 2 3 4 5 6 7 Type:
- We can describe any packing of items into a single bin by its type
- The type of a packed bin determines how many of each item is packed
cs diff. item sizes cb items fit in each bin
SLIDE 57 A special case of BINPACKING 4 8
3 8 3 8 3 8
4 8 7 8
3 8
4 8 4 8 1 2 3 4 5 6 7 Type:
- We can describe any packing of items into a single bin by its type
- The type of a packed bin determines how many of each item is packed
we ignore rearrangement of items
cs diff. item sizes cb items fit in each bin
SLIDE 58 A special case of BINPACKING 4 8
3 8 3 8 3 8
4 8 7 8
3 8
4 8 4 8 1 2 3 4 5 6 7 Type:
- We can describe any packing of items into a single bin by its type
- The type of a packed bin determines how many of each item is packed
we ignore rearrangement of items
3 8
4 8
cs diff. item sizes cb items fit in each bin
SLIDE 59 A special case of BINPACKING 4 8
3 8 3 8 3 8
4 8 7 8
3 8
4 8 4 8 1 2 3 4 5 6 7 Type:
- We can describe any packing of items into a single bin by its type
- The type of a packed bin determines how many of each item is packed
we ignore rearrangement of items
cs diff. item sizes cb items fit in each bin
SLIDE 60 A special case of BINPACKING 4 8
3 8 3 8 3 8
4 8 7 8
3 8
4 8 4 8 1 2 3 4 5 6 7 Type:
- We can describe any packing of items into a single bin by its type
- The type of a packed bin determines how many of each item is packed
we ignore rearrangement of items
- How many types can there be?
cs diff. item sizes cb items fit in each bin
SLIDE 61 A special case of BINPACKING 4 8
3 8 3 8 3 8
4 8 7 8
3 8
4 8 4 8 1 2 3 4 5 6 7 Type:
- We can describe any packing of items into a single bin by its type
- The type of a packed bin determines how many of each item is packed
we ignore rearrangement of items
- How many types can there be?
There are between 0 and cb items of any one size
cs diff. item sizes cb items fit in each bin
SLIDE 62 A special case of BINPACKING 4 8
3 8 3 8 3 8
4 8 7 8
3 8
4 8 4 8 1 2 3 4 5 6 7 Type:
- We can describe any packing of items into a single bin by its type
- The type of a packed bin determines how many of each item is packed
we ignore rearrangement of items
- How many types can there be?
There are between 0 and cb items of any one size There are cs different sizes
cs diff. item sizes cb items fit in each bin
SLIDE 63 A special case of BINPACKING 4 8
3 8 3 8 3 8
4 8 7 8
3 8
4 8 4 8 1 2 3 4 5 6 7 Type:
- We can describe any packing of items into a single bin by its type
- The type of a packed bin determines how many of each item is packed
we ignore rearrangement of items
- How many types can there be?
There are between 0 and cb items of any one size There are cs different sizes The number of types
cs diff. item sizes cb items fit in each bin
SLIDE 64 A special case of BINPACKING 4 8
3 8 3 8 3 8
4 8 7 8
3 8
4 8 4 8 1 2 3 4 5 6 7 Type:
- We can describe any packing of items into a single bin by its type
- The type of a packed bin determines how many of each item is packed
we ignore rearrangement of items
- How many types can there be?
There are between 0 and cb items of any one size There are cs different sizes
(cb + 1) × (cb + 1) × . . . × (cb + 1) cs
The number of types
cs diff. item sizes cb items fit in each bin
SLIDE 65 A special case of BINPACKING 4 8
3 8 3 8 3 8
4 8 7 8
3 8
4 8 4 8 1 2 3 4 5 6 7 Type:
- We can describe any packing of items into a single bin by its type
- The type of a packed bin determines how many of each item is packed
we ignore rearrangement of items
- How many types can there be?
There are between 0 and cb items of any one size There are cs different sizes
(cb + 1) × (cb + 1) × . . . × (cb + 1) cs = (cb + 1)cs
The number of types
cs diff. item sizes cb items fit in each bin
SLIDE 66 A special case of BINPACKING 4 8
3 8 3 8
7 8
3 8
4 8 3 4 5 6
- We can completely describe any packing of S into b n bins
by the number of bins of each type used
7 8 4
3 8 3 8
5
3 8 3 8
5
cb items fit in each bin cs diff. item sizes
SLIDE 67 A special case of BINPACKING 4 8
3 8 3 8
7 8
3 8
4 8 3 4 5 6
- We can completely describe any packing of S into b n bins
by the number of bins of each type used
7 8 4
3 8 3 8
5
3 8 3 8
5
1× Type 3 2× Type 4 3× Type 5 1× Type 6 0× Type 1 0× Type 2 0× Type 7 cb items fit in each bin cs diff. item sizes
SLIDE 68 A special case of BINPACKING 4 8
3 8 3 8
7 8
3 8
4 8 3 4 5 6
- We can completely describe any packing of S into b n bins
we ignore rearrangement of bins by the number of bins of each type used
7 8 4
3 8 3 8
5
3 8 3 8
5
1× Type 3 2× Type 4 3× Type 5 1× Type 6 0× Type 1 0× Type 2 0× Type 7 cb items fit in each bin cs diff. item sizes
SLIDE 69 A special case of BINPACKING
- We can completely describe any packing of S into b n bins
we ignore rearrangement of bins by the number of bins of each type used
4 8
3 8 3 8
7 8
3 8
4 8 3 4 5 6 7 8 4
3 8 3 8
5
3 8 3 8
5
1× Type 3 2× Type 4 3× Type 5 1× Type 6 0× Type 1 0× Type 2 0× Type 7 cb items fit in each bin cs diff. item sizes
SLIDE 70 A special case of BINPACKING 4 8
3 8 3 8
7 8
3 8
4 8 3 4 5 6
- We can completely describe any packing of S into b n bins
we ignore rearrangement of bins by the number of bins of each type used
7 8 4
3 8 3 8
5
3 8 3 8
5
1× Type 3 2× Type 4 3× Type 5 1× Type 6 0× Type 1 0× Type 2 0× Type 7 cb items fit in each bin cs diff. item sizes
SLIDE 71 A special case of BINPACKING 4 8
3 8 3 8
7 8
3 8
4 8 3 4 5 6
- We can completely describe any packing of S into b n bins
we ignore rearrangement of bins
- How different packings can there be?
by the number of bins of each type used
7 8 4
3 8 3 8
5
3 8 3 8
5
1× Type 3 2× Type 4 3× Type 5 1× Type 6 0× Type 1 0× Type 2 0× Type 7 cb items fit in each bin cs diff. item sizes
SLIDE 72 A special case of BINPACKING 4 8
3 8 3 8
7 8
3 8
4 8 3 4 5 6
- We can completely describe any packing of S into b n bins
we ignore rearrangement of bins
- How different packings can there be?
There are between 0 and n bins of any type by the number of bins of each type used
7 8 4
3 8 3 8
5
3 8 3 8
5
1× Type 3 2× Type 4 3× Type 5 1× Type 6 0× Type 1 0× Type 2 0× Type 7 cb items fit in each bin cs diff. item sizes
SLIDE 73 A special case of BINPACKING 4 8
3 8 3 8
7 8
3 8
4 8 3 4 5 6
- We can completely describe any packing of S into b n bins
we ignore rearrangement of bins
- How different packings can there be?
There are between 0 and n bins of any type There are at most (cb + 1)cs different types by the number of bins of each type used
7 8 4
3 8 3 8
5
3 8 3 8
5
1× Type 3 2× Type 4 3× Type 5 1× Type 6 0× Type 1 0× Type 2 0× Type 7 cb items fit in each bin cs diff. item sizes
SLIDE 74 A special case of BINPACKING 4 8
3 8 3 8
7 8
3 8
4 8 3 4 5 6
- We can completely describe any packing of S into b n bins
we ignore rearrangement of bins
- How different packings can there be?
There are between 0 and n bins of any type There are at most (cb + 1)cs different types by the number of bins of each type used
7 8 4
3 8 3 8
5
3 8 3 8
5
number of packings
1× Type 3 2× Type 4 3× Type 5 1× Type 6 0× Type 1 0× Type 2 0× Type 7 cb items fit in each bin cs diff. item sizes
SLIDE 75 A special case of BINPACKING 4 8
3 8 3 8
7 8
3 8
4 8 3 4 5 6
- We can completely describe any packing of S into b n bins
we ignore rearrangement of bins
- How different packings can there be?
There are between 0 and n bins of any type There are at most (cb + 1)cs different types
(n + 1) × (n + 1) × . . . × (n + 1) (cb + 1)cs
by the number of bins of each type used
7 8 4
3 8 3 8
5
3 8 3 8
5
number of packings
1× Type 3 2× Type 4 3× Type 5 1× Type 6 0× Type 1 0× Type 2 0× Type 7 cb items fit in each bin cs diff. item sizes
SLIDE 76 A special case of BINPACKING 4 8
3 8 3 8
7 8
3 8
4 8 3 4 5 6
- We can completely describe any packing of S into b n bins
we ignore rearrangement of bins
- How different packings can there be?
There are between 0 and n bins of any type There are at most (cb + 1)cs different types
(n + 1) × (n + 1) × . . . × (n + 1) (cb + 1)cs = (n+1)(cb+1)cs
by the number of bins of each type used
7 8 4
3 8 3 8
5
3 8 3 8
5
number of packings
1× Type 3 2× Type 4 3× Type 5 1× Type 6 0× Type 1 0× Type 2 0× Type 7 cb items fit in each bin cs diff. item sizes
SLIDE 77 A special case of BINPACKING 4 8
3 8 3 8
7 8
3 8
4 8 3 4 5 6
- We can completely describe any packing of S into b n bins
by the number of bins of each type used
7 8 4
3 8 3 8
5
3 8 3 8
5
1× Type 3 2× Type 4 3× Type 5 1× Type 6 0× Type 1 0× Type 2 0× Type 7 cb items fit in each bin cs diff. item sizes
SLIDE 78 A special case of BINPACKING 4 8
3 8 3 8
7 8
3 8
4 8 3 4 5 6
- We can completely describe any packing of S into b n bins
by the number of bins of each type used
7 8 4
3 8 3 8
5
3 8 3 8
5
- However, not all these different packings are valid
1× Type 3 2× Type 4 3× Type 5 1× Type 6 0× Type 1 0× Type 2 0× Type 7 cb items fit in each bin cs diff. item sizes
SLIDE 79 A special case of BINPACKING 4 8
3 8 3 8
7 8
3 8
4 8 3 4 5 6
- We can completely describe any packing of S into b n bins
by the number of bins of each type used
7 8 4
3 8 3 8
5
3 8 3 8
5
- However, not all these different packings are valid
Many of them use too few or many items of a particular size
1× Type 3 2× Type 4 3× Type 5 1× Type 6 0× Type 1 0× Type 2 0× Type 7 cb items fit in each bin cs diff. item sizes
(in particular the example packing uses too many items of size 3/8)
SLIDE 80 A special case of BINPACKING 4 8
3 8 3 8
7 8
3 8
4 8 3 4 5 6
- We can completely describe any packing of S into b n bins
by the number of bins of each type used
7 8 4
3 8 3 8
5
3 8 3 8
5
- However, not all these different packings are valid
Many of them use too few or many items of a particular size
- We check each of the different packings to see if it is valid
1× Type 3 2× Type 4 3× Type 5 1× Type 6 0× Type 1 0× Type 2 0× Type 7 cb items fit in each bin cs diff. item sizes
(in particular the example packing uses too many items of size 3/8)
SLIDE 81 A special case of BINPACKING 4 8
3 8 3 8
7 8
3 8
4 8 3 4 5 6
- We can completely describe any packing of S into b n bins
by the number of bins of each type used
7 8 4
3 8 3 8
5
3 8 3 8
5
- However, not all these different packings are valid
Many of them use too few or many items of a particular size
- We check each of the different packings to see if it is valid
and output the valid one which uses the fewest bins
1× Type 3 2× Type 4 3× Type 5 1× Type 6 0× Type 1 0× Type 2 0× Type 7 cb items fit in each bin cs diff. item sizes
(in particular the example packing uses too many items of size 3/8)
SLIDE 82 A special case of BINPACKING 4 8
3 8 3 8
7 8
3 8
4 8 3 4 5 6
- We can completely describe any packing of S into b n bins
by the number of bins of each type used
7 8 4
3 8 3 8
5
3 8 3 8
5
- However, not all these different packings are valid
Many of them use too few or many items of a particular size
- We check each of the different packings to see if it is valid
and output the valid one which uses the fewest bins
- This takes O(n · (n + 1)(cb+1)cs ) time and exactly solves BINPACKING
1× Type 3 2× Type 4 3× Type 5 1× Type 6 0× Type 1 0× Type 2 0× Type 7
(i.e. it outputs an optimal packing)
cb items fit in each bin cs diff. item sizes
(in particular the example packing uses too many items of size 3/8)
SLIDE 83
Towards an APTAS
The APTAS for BINPACKING will use a four step process: Step 1 Remove all the small items Step 2 Divide the items into a constant number of groups Only cb of the remaining large items will fit into a single bin Sizes of items in each group are then rounded up to match the size of the largest member This will leave only cs different item sizes Step 3 Use the poly-time algorithm to optimally pack the remaining special case the constants cb and cs will depend on ǫ Step 4 Reverse the grouping from Step 2 and then Remember that the goal is to use b bins where Opt b (1 + ǫ) · Opt + c (for some c) greedily pack all the small items removed in Step 1 (and the largest group is removed)
SLIDE 84 Removing the small items
Lemma Let 0 < ǫ < 1. Given a packing of the items a ∈ S with size a > ǫ/2 into b bins, in polynomial time we can find a packing of all items in S which either uses:
b bins
(1 + ǫ)Opt + 1 bins
SLIDE 85 Removing the small items
Lemma Let 0 < ǫ < 1. Given a packing of the items a ∈ S with size a > ǫ/2 into b bins, in polynomial time we can find a packing of all items in S which either uses:
b bins
(1 + ǫ)Opt + 1 bins
After packing of large items (> ǫ/2)
SLIDE 86 Removing the small items
we pack the small items ( ǫ/2) on top of the large items greedily Lemma Let 0 < ǫ < 1. Given a packing of the items a ∈ S with size a > ǫ/2 into b bins, in polynomial time we can find a packing of all items in S which either uses:
b bins
(1 + ǫ)Opt + 1 bins
After packing of large items (> ǫ/2)
SLIDE 87 Removing the small items
we pack the small items ( ǫ/2) on top of the large items greedily Lemma Let 0 < ǫ < 1. Given a packing of the items a ∈ S with size a > ǫ/2 into b bins, in polynomial time we can find a packing of all items in S which either uses:
b bins
(1 + ǫ)Opt + 1 bins
After packing of large items (> ǫ/2)
SLIDE 88 Removing the small items
we pack the small items ( ǫ/2) on top of the large items greedily Lemma Let 0 < ǫ < 1. Given a packing of the items a ∈ S with size a > ǫ/2 into b bins, in polynomial time we can find a packing of all items in S which either uses:
b bins
(1 + ǫ)Opt + 1 bins
After packing of large items (> ǫ/2) pack the small items anywhere you like - just but don’t use an extra bin unless you have to
SLIDE 89 Removing the small items
we pack the small items ( ǫ/2) on top of the large items greedily Lemma Let 0 < ǫ < 1. Given a packing of the items a ∈ S with size a > ǫ/2 into b bins, in polynomial time we can find a packing of all items in S which either uses:
b bins
(1 + ǫ)Opt + 1 bins
After packing of large items (> ǫ/2)
SLIDE 90 Removing the small items
we pack the small items ( ǫ/2) on top of the large items greedily Either: We don’t use any extra bins
- r every bin (except possibly the last) is 1 − (ǫ/2) full
Lemma Let 0 < ǫ < 1. Given a packing of the items a ∈ S with size a > ǫ/2 into b bins, in polynomial time we can find a packing of all items in S which either uses:
b bins
(1 + ǫ)Opt + 1 bins
After packing of large items (> ǫ/2)
SLIDE 91 Removing the small items
we pack the small items ( ǫ/2) on top of the large items greedily Lemma Let 0 < ǫ < 1. Given a packing of the items a ∈ S with size a > ǫ/2 into b bins, in polynomial time we can find a packing of all items in S which either uses: After packing of large items (> ǫ/2)
b bins
(1 + ǫ)Opt + 1 bins
Either: We don’t use any extra bins
- r every bin (except possibly the last) is 1 − (ǫ/2) full
SLIDE 92 Removing the small items
we pack the small items ( ǫ/2) on top of the large items greedily Lemma Let 0 < ǫ < 1. Given a packing of the items a ∈ S with size a > ǫ/2 into b bins, in polynomial time we can find a packing of all items in S which either uses: After packing of large items (> ǫ/2) Either: We don’t use any extra bins
- r every bin (except possibly the last) is 1 − (ǫ/2) full
b bins
(1 + ǫ)Opt + 1 bins
SLIDE 93 Removing the small items
we pack the small items ( ǫ/2) on top of the large items greedily Lemma Let 0 < ǫ < 1. Given a packing of the items a ∈ S with size a > ǫ/2 into b bins, in polynomial time we can find a packing of all items in S which either uses: After packing of large items (> ǫ/2) Either: We don’t use any extra bins
- r every bin (except possibly the last) is 1 − (ǫ/2) full
b bins
(1 + ǫ)Opt + 1 bins
SLIDE 94 Removing the small items
we pack the small items ( ǫ/2) on top of the large items greedily Lemma Let 0 < ǫ < 1. Given a packing of the items a ∈ S with size a > ǫ/2 into b bins, in polynomial time we can find a packing of all items in S which either uses: After packing of large items (> ǫ/2) Either: We don’t use any extra bins
- r every bin (except possibly the last) is 1 − (ǫ/2) full
b bins
(1 + ǫ)Opt + 1 bins
small items don’t fit in here (so they are very well packed)
1 − ǫ
2
SLIDE 95 Removing the small items
we pack the small items ( ǫ/2) on top of the large items greedily Lemma Let 0 < ǫ < 1. Given a packing of the items a ∈ S with size a > ǫ/2 into b bins, in polynomial time we can find a packing of all items in S which either uses: After packing of large items (> ǫ/2) Either: We don’t use any extra bins
- r every bin (except possibly the last) is 1 − (ǫ/2) full
b bins
(1 + ǫ)Opt + 1 bins
small items don’t fit in here (so they are very well packed)
1 − ǫ
2
this is the +1
SLIDE 96 Removing the small items
Lemma Let 0 < ǫ < 1. Given a packing of the items a ∈ S with size a > ǫ/2 into b bins, in polynomial time we can find a packing of all items in S which either uses:
b bins
(1 + ǫ)Opt + 1 bins
We can now ignore all the small items and focus on finding a good packing of the large items
SLIDE 97 Removing the small items
Lemma Let 0 < ǫ < 1. Given a packing of the items a ∈ S with size a > ǫ/2 into b bins, in polynomial time we can find a packing of all items in S which either uses:
b bins
(1 + ǫ)Opt + 1 bins
We can now ignore all the small items and focus on finding a good packing of the large items How many large items fit in a single bin?
SLIDE 98 Removing the small items
Lemma Let 0 < ǫ < 1. Given a packing of the items a ∈ S with size a > ǫ/2 into b bins, in polynomial time we can find a packing of all items in S which either uses:
b bins
(1 + ǫ)Opt + 1 bins
We can now ignore all the small items and focus on finding a good packing of the large items How many large items fit in a single bin? Each large item is larger than ǫ/2. . .
SLIDE 99 Removing the small items
Lemma Let 0 < ǫ < 1. Given a packing of the items a ∈ S with size a > ǫ/2 into b bins, in polynomial time we can find a packing of all items in S which either uses:
b bins
(1 + ǫ)Opt + 1 bins
We can now ignore all the small items and focus on finding a good packing of the large items How many large items fit in a single bin? Each large item is larger than ǫ/2. . . so at most 2/ǫ
SLIDE 100 Removing the small items
Lemma Let 0 < ǫ < 1. Given a packing of the items a ∈ S with size a > ǫ/2 into b bins, in polynomial time we can find a packing of all items in S which either uses:
b bins
(1 + ǫ)Opt + 1 bins
We can now ignore all the small items and focus on finding a good packing of the large items How many large items fit in a single bin? Each large item is larger than ǫ/2. . . so at most 2/ǫ which is a constant :)
SLIDE 101 Reducing the number of item sizes
- We divide the items by size, into groups of size k
k k
k
1
the smallest group might contain fewer than k items
SLIDE 102 Reducing the number of item sizes
- We divide the items by size, into groups of size k
k k
k
1
the smallest group might contain fewer than k items
- We define a new set of items S′ where each item is rounded up
so each item in a group has the same size
SLIDE 103 Reducing the number of item sizes
- We divide the items by size, into groups of size k
k k
k
1
the smallest group might contain fewer than k items
- We define a new set of items S′ where each item is rounded up
so each item in a group has the same size
SLIDE 104 Reducing the number of item sizes
- We divide the items by size, into groups of size k
k k
k
1
the smallest group might contain fewer than k items
- We define a new set of items S′ where each item is rounded up
so each item in a group has the same size and the largest group is removed
SLIDE 105 Reducing the number of item sizes
- We divide the items by size, into groups of size k
k k
k
1
the smallest group might contain fewer than k items
- We define a new set of items S′ where each item is rounded up
so each item in a group has the same size
- Notice that S′ contains only n/k distinct item sizes
and the largest group is removed
SLIDE 106 Reducing the number of item sizes
- We divide the items by size, into groups of size k
k k
k
1
the smallest group might contain fewer than k items
- We define a new set of items S′ where each item is rounded up
so each item in a group has the same size
- Notice that S′ contains only n/k distinct item sizes
and the largest group is removed (k will be big enough so that n/k 4/ǫ2 - which is a constant)
SLIDE 107
Reducing the number of item sizes
Lemma Let S′ be S after linear grouping (with groups of size k).
Opt(S′) Opt(S) Opt(S′) + k .
. Further, any packing of S′ can be converted into a packing of S in polynomial time using at most k extra bins
SLIDE 108
Reducing the number of item sizes
Lemma Let S′ be S after linear grouping (with groups of size k).
Opt(S′) Opt(S) Opt(S′) + k .
. Here Opt(S) is the optimal number of bins required to pack S Similarly Opt(S′) is the optimal number of bins required to pack S′ Further, any packing of S′ can be converted into a packing of S in polynomial time using at most k extra bins
SLIDE 109
Reducing the number of item sizes
Lemma Let S′ be S after linear grouping (with groups of size k).
Opt(S′) Opt(S) Opt(S′) + k .
. Further, any packing of S′ can be converted into a packing of S in polynomial time using at most k extra bins
SLIDE 110
Reducing the number of item sizes
Lemma Let S′ be S after linear grouping (with groups of size k).
Opt(S′) Opt(S) Opt(S′) + k .
S′ S
SLIDE 111
Reducing the number of item sizes
Proof Lemma Let S′ be S after linear grouping (with groups of size k).
Opt(S′) Opt(S) Opt(S′) + k .
S′ S
SLIDE 112
Reducing the number of item sizes
Proof Lemma Let S′ be S after linear grouping (with groups of size k).
Opt(S′) Opt(S) Opt(S′) + k .
S′ S
If you can pack S into b bins, you can pack S′ into b bins
SLIDE 113
Reducing the number of item sizes
Proof Lemma Let S′ be S after linear grouping (with groups of size k).
Opt(S′) Opt(S) Opt(S′) + k .
S′ S
If you can pack S into b bins, you can pack S′ into b bins Take the packing of S and replace each item as shown unpack these
SLIDE 114
Reducing the number of item sizes
Proof Lemma Let S′ be S after linear grouping (with groups of size k).
Opt(S′) Opt(S) Opt(S′) + k .
S′ S
If you can pack S into b bins, you can pack S′ into b bins Take the packing of S and replace each item as shown Each item from S is replaced with one no larger from S′ unpack these
SLIDE 115
Reducing the number of item sizes
Proof Lemma Let S′ be S after linear grouping (with groups of size k).
Opt(S′) Opt(S) Opt(S′) + k .
S′ S
If you can pack S into b bins, you can pack S′ into b bins Take the packing of S and replace each item as shown Each item from S is replaced with one no larger from S′ So the packing is valid and hence
Opt(S′) Opt(S)
unpack these
SLIDE 116
Reducing the number of item sizes
Proof Lemma Let S′ be S after linear grouping (with groups of size k).
Opt(S′) Opt(S) Opt(S′) + k .
S′ S
If you can pack S′ into b bins, you can pack S into b + k bins
SLIDE 117
Reducing the number of item sizes
Proof Lemma Let S′ be S after linear grouping (with groups of size k).
Opt(S′) Opt(S) Opt(S′) + k .
S′ S
If you can pack S′ into b bins, you can pack S into b + k bins Take the packing of S′ and replace each item as shown
SLIDE 118
Reducing the number of item sizes
Proof Lemma Let S′ be S after linear grouping (with groups of size k).
Opt(S′) Opt(S) Opt(S′) + k .
S′ S
If you can pack S′ into b bins, you can pack S into b + k bins Take the packing of S′ and replace each item as shown
SLIDE 119
Reducing the number of item sizes
Proof Lemma Let S′ be S after linear grouping (with groups of size k).
Opt(S′) Opt(S) Opt(S′) + k .
S′ S
If you can pack S′ into b bins, you can pack S into b + k bins Take the packing of S′ and replace each item as shown Each item from S′ is replaced with one no larger from S
SLIDE 120
Reducing the number of item sizes
Proof Lemma Let S′ be S after linear grouping (with groups of size k).
Opt(S′) Opt(S) Opt(S′) + k .
S′ S
If you can pack S′ into b bins, you can pack S into b + k bins Take the packing of S′ and replace each item as shown Each item from S′ is replaced with one no larger from S The k largest items are given their own extra bins give these k items a bin each
SLIDE 121
Reducing the number of item sizes
Proof Lemma Let S′ be S after linear grouping (with groups of size k).
Opt(S′) Opt(S) Opt(S′) + k .
S′ S
If you can pack S′ into b bins, you can pack S into b + k bins
SLIDE 122
Reducing the number of item sizes
Proof Lemma Let S′ be S after linear grouping (with groups of size k).
Opt(S′) Opt(S) Opt(S′) + k .
S′ S
If you can pack S′ into b bins, you can pack S into b + k bins This gives a valid packing of S
SLIDE 123
Reducing the number of item sizes
Proof Lemma Let S′ be S after linear grouping (with groups of size k).
Opt(S′) Opt(S) Opt(S′) + k .
S′ S
If you can pack S′ into b bins, you can pack S into b + k bins
Opt(S) Opt(S′) + k
This gives a valid packing of S
Hence,
SLIDE 124
Reducing the number of item sizes
Proof Lemma Let S′ be S after linear grouping (with groups of size k).
Opt(S′) Opt(S) Opt(S′) + k .
S′ S
If you can pack S′ into b bins, you can pack S into b + k bins
Opt(S) Opt(S′) + k
This gives a valid packing of S
Hence,
Note that both transformations take polynomial time
SLIDE 125
Reducing the number of item sizes
Lemma Let S′ be S after linear grouping (with groups of size k).
Opt(S′) Opt(S) Opt(S′) + k .
. Further, any packing of S′ can be converted into a packing of S in polynomial time using at most k extra bins
SLIDE 126
Reducing the number of item sizes
Lemma Let S′ be S after linear grouping (with groups of size k).
Opt(S′) Opt(S) Opt(S′) + k .
. We set k = ⌊n · (ǫ2/2)⌋ and let S be the set of large items which implies that. . .
n = |S|
Further, any packing of S′ can be converted into a packing of S in polynomial time using at most k extra bins
SLIDE 127
Reducing the number of item sizes
Lemma Let S′ be S after linear grouping (with groups of size k).
Opt(S′) Opt(S) Opt(S′) + k .
. We set k = ⌊n · (ǫ2/2)⌋ and let S be the set of large items which implies that. . .
k ǫ · Opt(S)
n = |S|
Further, any packing of S′ can be converted into a packing of S in polynomial time using at most k extra bins
SLIDE 128
Reducing the number of item sizes
Lemma Let S′ be S after linear grouping (with groups of size k).
Opt(S′) Opt(S) Opt(S′) + k .
. We set k = ⌊n · (ǫ2/2)⌋ and let S be the set of large items which implies that. . .
k ǫ · Opt(S)
(because each of the n items in S has size at least ǫ/2)
n = |S|
Further, any packing of S′ can be converted into a packing of S in polynomial time using at most k extra bins
SLIDE 129
Reducing the number of item sizes
Lemma Let S′ be S after linear grouping (with groups of size k).
Opt(S′) Opt(S) Opt(S′) + k .
. We set k = ⌊n · (ǫ2/2)⌋ and let S be the set of large items which implies that. . .
k ǫ · Opt(S)
(because each of the n items in S has size at least ǫ/2) If we can find the optimal packing of S′, which uses Opt(S′) bins we can convert it into a packing of S which uses
Opt(S′) + k (1 + ǫ)Opt(S) bins
n = |S|
Further, any packing of S′ can be converted into a packing of S in polynomial time using at most k extra bins
SLIDE 130
Reducing the number of item sizes
Lemma Let S′ be S after linear grouping (with groups of size k).
Opt(S′) Opt(S) Opt(S′) + k .
. We set k = ⌊n · (ǫ2/2)⌋ and let S be the set of large items which implies that. . .
k ǫ · Opt(S)
(because each of the n items in S has size at least ǫ/2) If we can find the optimal packing of S′, which uses Opt(S′) bins we can convert it into a packing of S which uses
Opt(S′) + k (1 + ǫ)Opt(S) bins S′ contains 4/ǫ2 distinct item sizes
and only 2/ǫ items fit in each bin. . .
n = |S|
Further, any packing of S′ can be converted into a packing of S in polynomial time using at most k extra bins
SLIDE 131
Reducing the number of item sizes
Lemma Let S′ be S after linear grouping (with groups of size k).
Opt(S′) Opt(S) Opt(S′) + k .
. We set k = ⌊n · (ǫ2/2)⌋ and let S be the set of large items which implies that. . .
k ǫ · Opt(S)
(because each of the n items in S has size at least ǫ/2) I.e. we can optimally pack S′ in polynomial time. . . If we can find the optimal packing of S′, which uses Opt(S′) bins we can convert it into a packing of S which uses
Opt(S′) + k (1 + ǫ)Opt(S) bins S′ contains 4/ǫ2 distinct item sizes
and only 2/ǫ items fit in each bin. . .
n = |S|
Further, any packing of S′ can be converted into a packing of S in polynomial time using at most k extra bins
SLIDE 132 The overall APTAS
Step 1 Remove all the small items Step 2 Divide the items into k = ⌊n · (ǫ2/2)⌋ different groups Only cb = 2/ǫ of the remaining large items will fit into a single bin Sizes of items in each group are then rounded up to match the size of the largest member This will leave only cs = 4/ǫ2 different item sizes Step 3 Use the poly-time algorithm to optimally pack the remaining special case Step 4 Reverse the grouping from Step 2 and then greedily pack all the small items removed in Step 1 (and the largest group is removed) This takes O
time Theorem For any 0 < ǫ < 1, the algorithm presented runs in polynomial time and returns a packing
- f any set of items using at most (1 + ǫ)Opt + 1 bins
3 4 5 6 4 5 5
SLIDE 133 Conclusions
- There is no α-approximation for BINPACKING with α < 3/2
- We saw an APTAS for BINPACKING. (which uses at most (1 + ǫ) · Opt + 1 bins)
- There is a poly-time algorithm which outputs a solution using at most,
unless P = NP
- This in turn implies that there is no PTAS for BINPACKING
unless P = NP
- The First Fit Decreasing algorithm uses at most,
11 9 · Opt + 1 bins
there is also an AFPTAS for bin packing
Opt+O(log2 Opt) =
Opt
SLIDE 134 Conclusions
- There is no α-approximation for BINPACKING with α < 3/2
- We saw an APTAS for BINPACKING. (which uses at most (1 + ǫ) · Opt + 1 bins)
- There is a poly-time algorithm which outputs a solution using at most,
unless P = NP
- This in turn implies that there is no PTAS for BINPACKING
unless P = NP
- The First Fit Decreasing algorithm uses at most,
11 9 · Opt + 1 bins
there is also an AFPTAS for bin packing
Opt+O(log2 Opt) =
Opt
Whether there is a poly-time algorithm which uses at most Opt + 1 bins is an open problem