Advanced Algorithms COMS31900 Approximation algorithms part four - - PowerPoint PPT Presentation

advanced algorithms coms31900 approximation algorithms
SMART_READER_LITE
LIVE PREVIEW

Advanced Algorithms COMS31900 Approximation algorithms part four - - PowerPoint PPT Presentation

Advanced Algorithms COMS31900 Approximation algorithms part four Asymptotic Polynomial Time Approximation Schemes Rapha el Clifford Slides by Benjamin Sach Approximation Algorithms Recap A polynomial time algorithm A is an


slide-1
SLIDE 1

Advanced Algorithms – COMS31900 Approximation algorithms part four Asymptotic Polynomial Time Approximation Schemes

Rapha¨ el Clifford Slides by Benjamin Sach

slide-2
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
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
SLIDE 4

The SUBSETSUM problem

4 4 7 3

2 2 t = 12

slide-5
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
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
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
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
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
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
SLIDE 11

The PARTITION problem

4 4 7 3

2 2

The PARTITION problem is a special case of SUBSETSUM

slide-12
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
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
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
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
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
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
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
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
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
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
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
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
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
SLIDE 25

PARTITION and BINPACKING

Key Idea Solve the PARTITION problem by approximating BINPACKING

slide-26
SLIDE 26

PARTITION and BINPACKING

Key Idea Solve the PARTITION problem by approximating BINPACKING

4 4 7 3

2 2 t = 11

slide-27
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
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
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
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
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
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
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
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

  • If Optb > 2 then s > 2
slide-35
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
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
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

  • If Optb > 2 then s > 2

so s = 2

  • If Optb = 2 then 2 s α · Optb < (3/2) · Optb = 3
slide-38
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

  • If Optb > 2 then s > 2

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
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

  • If Optb > 2 then s > 2

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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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

  • r

(1 + ǫ)Opt + 1 bins

slide-85
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

  • r

(1 + ǫ)Opt + 1 bins

After packing of large items (> ǫ/2)

slide-86
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

  • r

(1 + ǫ)Opt + 1 bins

After packing of large items (> ǫ/2)

slide-87
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

  • r

(1 + ǫ)Opt + 1 bins

After packing of large items (> ǫ/2)

slide-88
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

  • r

(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
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

  • r

(1 + ǫ)Opt + 1 bins

After packing of large items (> ǫ/2)

slide-90
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

  • r

(1 + ǫ)Opt + 1 bins

After packing of large items (> ǫ/2)

slide-91
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

  • r

(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
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

  • r

(1 + ǫ)Opt + 1 bins

slide-93
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

  • r

(1 + ǫ)Opt + 1 bins

slide-94
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

  • r

(1 + ǫ)Opt + 1 bins

small items don’t fit in here (so they are very well packed)

1 − ǫ

2

slide-95
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

  • r

(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
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

  • r

(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
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

  • r

(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
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

  • r

(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
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

  • r

(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
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

  • r

(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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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

  • n · (n + 1)(4/ǫ2+1)2/ǫ

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
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) =

  • 1 + O(log2 Opt)

Opt

  • ·Opt bins
slide-134
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) =

  • 1 + O(log2 Opt)

Opt

  • ·Opt bins

Whether there is a poly-time algorithm which uses at most Opt + 1 bins is an open problem