25
A tale of 2- dimensional (Guillotine) bin packing Nikhil Bansal (IBM) Andrea Lodi (Univ. of Bologna, Italy) Maxim Sviridenko (IBM)

A tale of 2-dimensional (Guillotine) bin packing Nikhil Bansal (IBM) Andrea Lodi (Univ. of Bologna, Italy) Maxim Sviridenko (IBM)

Embed Size (px)

Citation preview

Page 1: A tale of 2-dimensional (Guillotine) bin packing Nikhil Bansal (IBM) Andrea Lodi (Univ. of Bologna, Italy) Maxim Sviridenko (IBM)

A tale of 2-dimensional (Guillotine) bin packing

Nikhil Bansal (IBM) Andrea Lodi (Univ. of Bologna, Italy)Maxim Sviridenko (IBM)

Page 2: A tale of 2-dimensional (Guillotine) bin packing Nikhil Bansal (IBM) Andrea Lodi (Univ. of Bologna, Italy) Maxim Sviridenko (IBM)

2-d bin Packing ProblemGiven: Collection of rectangles (by height, width)Goal : Pack in min # of unit square bins

Rectangles parallel to bin edges Cannot be rotated

1

4

6

53 2

Rectangles

Bins

12 3

4 56

123

45

6

Page 3: A tale of 2-dimensional (Guillotine) bin packing Nikhil Bansal (IBM) Andrea Lodi (Univ. of Bologna, Italy) Maxim Sviridenko (IBM)

Many Applications

Cloth cutting, steel cutting, wood cutting Truck Loading Placing ads in newspapers Memory allocation in paging systems …

Page 4: A tale of 2-dimensional (Guillotine) bin packing Nikhil Bansal (IBM) Andrea Lodi (Univ. of Bologna, Italy) Maxim Sviridenko (IBM)

Guillotine Bin Packing

Guillotine Cut: Edge to Edge cut across a bin

Page 5: A tale of 2-dimensional (Guillotine) bin packing Nikhil Bansal (IBM) Andrea Lodi (Univ. of Bologna, Italy) Maxim Sviridenko (IBM)

Guillotine Bin Packing

Guillotine Cut: Edge to Edge cut across a bin

k-stage Guillotine Packing [Gilmore, Gomory]

k recursive levels of guillotine cuts to recover all items.

23

1 5

3

6

1

2

4

2-stage 4-stage

Page 6: A tale of 2-dimensional (Guillotine) bin packing Nikhil Bansal (IBM) Andrea Lodi (Univ. of Bologna, Italy) Maxim Sviridenko (IBM)

Non-guillotine Packing

1

23

4

Page 7: A tale of 2-dimensional (Guillotine) bin packing Nikhil Bansal (IBM) Andrea Lodi (Univ. of Bologna, Italy) Maxim Sviridenko (IBM)

Motivation for Guillotine Packings

Practical constraint (simplicity of cutting tool)

Many heuristics are “small” stage packing algorithms

Many column generation techniques

Nice combinatorial properties(2-stage: Shelf Packing)

Shelf Packing

Page 8: A tale of 2-dimensional (Guillotine) bin packing Nikhil Bansal (IBM) Andrea Lodi (Univ. of Bologna, Italy) Maxim Sviridenko (IBM)

Asymptotic approximation ratio1-d Packing: Cannot distinguish in poly time if need 2 or 3 bins (Partition Problem)

Asymptotic Approximation ratio ():If Alg (I) · ¢ Opt(I) + O(1)

Asymptotic PTAS:If Alg(I) · (1+) Opt(I) + f()

Page 9: A tale of 2-dimensional (Guillotine) bin packing Nikhil Bansal (IBM) Andrea Lodi (Univ. of Bologna, Italy) Maxim Sviridenko (IBM)

Previous Work on APTASes

1-d Packing: (1+) Opt + 1 [de La Vega, Lueker 81]

Strip Packing: APTAS [Kenyon, Remila 96]

Square Packing: APTAS [B, Sviridenko 04] [ Correa, Kenyon 04]

General 2-d Packing: No APTAS [B, Sviridenko 04]

2-stage (or Shelf) Packing: APTAS [Caprara, Lodi, Monaci 05]

Shelf Packing

Page 10: A tale of 2-dimensional (Guillotine) bin packing Nikhil Bansal (IBM) Andrea Lodi (Univ. of Bologna, Italy) Maxim Sviridenko (IBM)

Our Result

APTAS for arbitrary 2-d guillotine packing

1) Approximate with O(1) stage packing2) APTAS for O(1) stage packing.

Bit surprising as no APTASfor general 2-d packing.

A large stage guillotine packing

Page 11: A tale of 2-dimensional (Guillotine) bin packing Nikhil Bansal (IBM) Andrea Lodi (Univ. of Bologna, Italy) Maxim Sviridenko (IBM)

Talk outline

APTAS for 1-d packing

APTAS for square packingAPTAS for strip packing

Why no APTAS for general 2-d packing ?

Our algorithm and analysis

Grouping and roundingFractional packingSize classification

Page 12: A tale of 2-dimensional (Guillotine) bin packing Nikhil Bansal (IBM) Andrea Lodi (Univ. of Bologna, Italy) Maxim Sviridenko (IBM)

1-d: Rounding to simple instance

Partition big into O(1) groups, with equal objects

0 1

0 1I’

I

. . .

I’ ¸ I

Page 13: A tale of 2-dimensional (Guillotine) bin packing Nikhil Bansal (IBM) Andrea Lodi (Univ. of Bologna, Italy) Maxim Sviridenko (IBM)

1-d: Rounding to a simpler instance

Partition big into O(1) groups, with equal objects

0 1

0 1I’

I

. . .

I’ ¸ I I’ – { } · I

I’ ¼ I I’ can be solved optimally

Page 14: A tale of 2-dimensional (Guillotine) bin packing Nikhil Bansal (IBM) Andrea Lodi (Univ. of Bologna, Italy) Maxim Sviridenko (IBM)

Filling in smalls

Take solution on bigs. Fill in smalls (i.e. <) greedily.

1) If no more bins need, already optimum.2) If yes, every bin (except maybe 1) filled to 1- Alg(I) · Size(I)/(1-) +1

· Opt/(1-) +1

Page 15: A tale of 2-dimensional (Guillotine) bin packing Nikhil Bansal (IBM) Andrea Lodi (Univ. of Bologna, Italy) Maxim Sviridenko (IBM)

Strip Packing (Cutting Stock)

Given rectangles (height · 1, width · 1) Strip: Width 1, infinite height

Place rectangles (no rotation)to minimize height

12

3

45

6

Page 16: A tale of 2-dimensional (Guillotine) bin packing Nikhil Bansal (IBM) Andrea Lodi (Univ. of Bologna, Italy) Maxim Sviridenko (IBM)

Strip Packing

Kenyon Remila 96: (1+) Opt + 1/2

Key insight: Can split a rectangle arbitrarily along the height

Individual height does not matter.

0 1

3

width

cum

ula

tive h

eig

ht

Page 17: A tale of 2-dimensional (Guillotine) bin packing Nikhil Bansal (IBM) Andrea Lodi (Univ. of Bologna, Italy) Maxim Sviridenko (IBM)

Square Packing: (Small, big) not enough

0 1I

Various square sizes

Identical to 1-d case:Round bigs, easy to solve exactly

Problem: Not clear how to pack smallin gaps without waste?

Small, medium and big

Page 18: A tale of 2-dimensional (Guillotine) bin packing Nikhil Bansal (IBM) Andrea Lodi (Univ. of Bologna, Italy) Maxim Sviridenko (IBM)

General 2-d Packing

Packing with arbitrary rectangles1.698… [Caprara 02]

No APTAS (from 3D Matching)[B., Sviridenko 04]

0 1

1 no order

width

heig

htEach item has unique identity

Bin packs well if and only if the “right” items chosen

Page 19: A tale of 2-dimensional (Guillotine) bin packing Nikhil Bansal (IBM) Andrea Lodi (Univ. of Bologna, Italy) Maxim Sviridenko (IBM)

Guillotine Packing

Arbitrary -> O(1) stage packings[Transformation Procedure]

APTAS for O(1) stage packings.[ Rounding relies on Opt’s structure]

Page 20: A tale of 2-dimensional (Guillotine) bin packing Nikhil Bansal (IBM) Andrea Lodi (Univ. of Bologna, Italy) Maxim Sviridenko (IBM)

Size Classification

H

V B

S

Big: Width > , Height > Horizontal: Width > , Height << Vertical: Height > , Width <<

Rest medium: O() area, ignored

Ignore smallsAllow V and H to be fractionally packed (individual identities not so important)

V

H

<<

medium

Page 21: A tale of 2-dimensional (Guillotine) bin packing Nikhil Bansal (IBM) Andrea Lodi (Univ. of Bologna, Italy) Maxim Sviridenko (IBM)

Transformation procedure (Idea)

If only bigs (i.e. (h,w) > ) -> depth < 1/, degree < 1/

If high depth or degree, lots of regions corresponding to V or HSince fractional (structure does not matter), can prune the tree.

12

3 4

1

2

3 4 Guillotine Tree: Leaf = object, Interior node = region

Page 22: A tale of 2-dimensional (Guillotine) bin packing Nikhil Bansal (IBM) Andrea Lodi (Univ. of Bologna, Italy) Maxim Sviridenko (IBM)

APTAS for O(1) stage packingLemma: Almost Opt solution with O(1) different types of

regions.

Do not know Opt, but can guess regions from a polynomially large set.

k=O(1) possible types of guillotine trees (O(1) stage, O(1) degree, O(1) different regions)

Guess n1 , n2, …, nk : number of each tree type used.

Matching rectangles to leaves in the trees

Make V, H integral. Packing S (smalls) suitably.

Page 23: A tale of 2-dimensional (Guillotine) bin packing Nikhil Bansal (IBM) Andrea Lodi (Univ. of Bologna, Italy) Maxim Sviridenko (IBM)

Constant number of region typesApply 1-d rounding recursively on regions

Round heights of shelves(width irrelevant)

There is an almost Opt solution with O(1) different region types

Page 24: A tale of 2-dimensional (Guillotine) bin packing Nikhil Bansal (IBM) Andrea Lodi (Univ. of Bologna, Italy) Maxim Sviridenko (IBM)

Concluding Remarks

Extensions: 90 degree rotations are allowed (using ideasof Van Stee, Jansen 05)

Running time: n raised to a huge tower of 1/ ’sCan the algorithm be made practical?

Can use to improve guarantee for general 2-d packing?1.698… [Caprara 02]

Best known gap between guillotine and general is 4/3 ?

Page 25: A tale of 2-dimensional (Guillotine) bin packing Nikhil Bansal (IBM) Andrea Lodi (Univ. of Bologna, Italy) Maxim Sviridenko (IBM)

Questions ?