bin packing: from theory to experiment and back again

79
© 2010 AT&T Intellectual Property. All rights reserved. AT&T and the AT&T logo are trademarks of AT&T Intellectual Property. Bin Packing: From Theory to Experiment and Back Again • David S. Johnson AT&T Labs – Research http://www.research.att.com/~dsj/

Upload: emma

Post on 06-Feb-2016

91 views

Category:

Documents


0 download

DESCRIPTION

Bin Packing: From Theory to Experiment and Back Again. David S. Johnson AT&T Labs – Research http://www.research.att.com/~dsj/. Applications. Packing commercials into station breaks Packing files onto floppy disks Packing MP3 songs onto CDs - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Bin Packing: From Theory to Experiment and Back Again

© 2010 AT&T Intellectual Property. All rights reserved. AT&T and the AT&T logo are trademarks of AT&T Intellectual Property.

Bin Packing: From Theory to Experiment and Back

Again

• David S. Johnson• AT&T Labs – Research• http://www.research.att.com/~dsj/

Page 2: Bin Packing: From Theory to Experiment and Back Again
Page 3: Bin Packing: From Theory to Experiment and Back Again

Applications

• Packing commercials into station breaks

• Packing files onto floppy disks• Packing MP3 songs onto CDs• Packing IP packets into frames,

SONET time slots, etc.• Packing telemetry data into fixed

size packetsStandard Drawback: Bin Packing is NP-complete

Page 4: Bin Packing: From Theory to Experiment and Back Again

OUTLINE

• Worst-Case Performance

• Average-Case Performance

– Classical Models

•Experiments Theory

– Discrete Distributions

•Theory Experiments Theory

Page 5: Bin Packing: From Theory to Experiment and Back Again

First Fit (FF): Put each item in the first bin with enough space

Best Fit (BF): Put each item in the bin that will hold it with the least space left over

First Fit Decreasing, Best Fit Decreasing (FFD,BFD): Start by reordering the items by non-increasing size.

Page 6: Bin Packing: From Theory to Experiment and Back Again

Worst-Case Bounds

• Theorem [Ullman, 1971]. For all lists L,

BF(L), FF(L) ≤ (17/10)OPT(L) + 3.

• Theorem [Johnson, 1973]. For all lists L,

BFD(L), FFD(L) ≤ (11/9)OPT(L) + 4.

(Note 1: 11/9 = 1.222222…)

(Note 2: These bounds are asymptotically tight.)

Page 7: Bin Packing: From Theory to Experiment and Back Again

Lower Bounds: FF and BF

½ +

½ -

OPT: N bins

½ -

½ - ½ +

FF, BF: N/2 bins + N bins = 1.5 OPT

Page 8: Bin Packing: From Theory to Experiment and Back Again

Lower Bounds: FF and BF

1/2 +

1/3 +

OPT: N bins

½ +

FF, BF: N/6 bins + N/2 bins + N bins = 5/3 OPT

1/6 - 21/6 - 2

1/6 - 2

1/6 - 2

1/6 - 2

1/6 - 2

1/6 - 2

1/3 +

1/3 +

Page 9: Bin Packing: From Theory to Experiment and Back Again

Lower Bounds: FF and BF

1/2 +

1/3 +

OPT: N bins

1/7 + 1/1806 + , etc. 1/43 + ,

FF, BF = N(1 + 1/2 + 1/6 + 1/42 + 1/1805 + … )

(1.691..) OPT

Page 10: Bin Packing: From Theory to Experiment and Back Again

“Improving” on FF and BF

Page 11: Bin Packing: From Theory to Experiment and Back Again

“Improving” on FFD and BFD

Page 12: Bin Packing: From Theory to Experiment and Back Again

Average-Case Performance

Page 13: Bin Packing: From Theory to Experiment and Back Again

Progress?

Page 14: Bin Packing: From Theory to Experiment and Back Again

Progress:Faster Computers Bigger Instances

Page 15: Bin Packing: From Theory to Experiment and Back Again

Definitions

Page 16: Bin Packing: From Theory to Experiment and Back Again

Definitions, Continued

Page 17: Bin Packing: From Theory to Experiment and Back Again

Theorems for U[0,1]

Page 18: Bin Packing: From Theory to Experiment and Back Again
Page 19: Bin Packing: From Theory to Experiment and Back Again

Proof Idea for FF, BF:View as a 2-Dimensional Matching

Problem

Page 20: Bin Packing: From Theory to Experiment and Back Again

Distributions U[0,u]

Item sizes uniformly distributed in the interval (0,u], 0 < u < 1

Page 21: Bin Packing: From Theory to Experiment and Back Again

Average Waste for BF under U(0,u]

Page 22: Bin Packing: From Theory to Experiment and Back Again

Measured Average Waste for BF under U(0,.01]

Page 23: Bin Packing: From Theory to Experiment and Back Again

Conjecture

Page 24: Bin Packing: From Theory to Experiment and Back Again

FFD on U(0,u]

Experimental Results from [Bentley, Johnson, Leighton, McGeoch, 1983]

N =

FFD

(L)

– s(

L)

u = .6

u = .5

u = .4

Page 25: Bin Packing: From Theory to Experiment and Back Again

FFD on U(0,u], u 0.5

Page 26: Bin Packing: From Theory to Experiment and Back Again

FFD on U(0,u], u 0.5

Page 27: Bin Packing: From Theory to Experiment and Back Again

FFD on U(0,u], 0.5 u 1

Page 28: Bin Packing: From Theory to Experiment and Back Again

OUTLINE

• Worst-Case Performance

• Average-Case Performance

– Classical Models

•Experiments Theory

– Discrete Distributions

•Theory Experiments Theory

Page 29: Bin Packing: From Theory to Experiment and Back Again

Discrete Distributions

Page 30: Bin Packing: From Theory to Experiment and Back Again

Courcoubetis-Weber

Page 31: Bin Packing: From Theory to Experiment and Back Again

y

x

z

(0,0,0)

(2,1,1)

(0,2,1)

(1,0,2)

Page 32: Bin Packing: From Theory to Experiment and Back Again

Courcoubetis-Weber Theorem

Page 33: Bin Packing: From Theory to Experiment and Back Again

A Flow-Based Linear Program

Page 34: Bin Packing: From Theory to Experiment and Back Again

Theorem [Csirik et al. 2000]

Note: The LP’s for (1) and (3) are both of size polynomial in B, not log(B), and hence “pseudo-polynomial”

Page 35: Bin Packing: From Theory to Experiment and Back Again

0.25

0.00

0.75

0.50

1.00

1/3

1

2/3

Discrete Uniform Distributions

U{3,4}U{6,8}U{12,16}U(0,¾]

Page 36: Bin Packing: From Theory to Experiment and Back Again

Theorem [Coffman et al. 1997]

(Results analogous to those for the corresponding U(0,u])

Page 37: Bin Packing: From Theory to Experiment and Back Again

Experimental Results for Best Fit

0 ≤ u ≤ 1, 1 ≤ j ≤ k = 51

Averages of 25 trials for each distribution, N = 2,048,000

Page 38: Bin Packing: From Theory to Experiment and Back Again

Average Waste under Best Fit(Experimental values for N = 100,000,000 and

200,000,000)

[GJSW, 1993][KRS, 1996]Holds for all j = k-2

Page 39: Bin Packing: From Theory to Experiment and Back Again

Theorem [Kenyon & Mitzenmacher, 2000]

Page 40: Bin Packing: From Theory to Experiment and Back Again

Average wBF(L)/s(L) for U{j,85}

Page 41: Bin Packing: From Theory to Experiment and Back Again

Average wBFD(L)/s(L) for U{j,85}

Page 42: Bin Packing: From Theory to Experiment and Back Again

Averages on the Same Scale

Page 43: Bin Packing: From Theory to Experiment and Back Again

The Discrete Distribution U{6,13}

Page 44: Bin Packing: From Theory to Experiment and Back Again

“Fluid Algorithm” Analysis: U{6,13}

Size = 6 5 4 3 2 1

Amount = β β β β β β

Bin Type =

Amount =

6

6

β/2

β/2β/2

4

4

4

β/3

β/6

β/2

5

5

33

3

3

3

β/8

β/24

22

222

2

β/24

¾β

Page 45: Bin Packing: From Theory to Experiment and Back Again

Expected Waste

Page 46: Bin Packing: From Theory to Experiment and Back Again

Theorem[Coffman, Johnson, McGeoch, Shor, & Weber, 1994-

2008]

Page 47: Bin Packing: From Theory to Experiment and Back Again

U{j,k} for which FFD has Linear Waste

j

k

Page 48: Bin Packing: From Theory to Experiment and Back Again

Minumum j/k for which Waste is Linear

k

j/k

Page 49: Bin Packing: From Theory to Experiment and Back Again

Values of j/k for which Waste is Maximum

k

j/k

Page 50: Bin Packing: From Theory to Experiment and Back Again

Waste as a Function of j and k (mod 6)

Page 51: Bin Packing: From Theory to Experiment and Back Again

K = 8641 = 26335 + 1

Page 52: Bin Packing: From Theory to Experiment and Back Again

Pairs (j,k) where BFD beats FFD

k

j

Page 53: Bin Packing: From Theory to Experiment and Back Again

Pairs (j,k) where FFD beats BFD

k

j

Page 54: Bin Packing: From Theory to Experiment and Back Again

Beating BF and BFD in Theory

Page 55: Bin Packing: From Theory to Experiment and Back Again

Plausible Alternative Approach

Page 56: Bin Packing: From Theory to Experiment and Back Again

The Sum-of-Squares Algorithm (SS)

Page 57: Bin Packing: From Theory to Experiment and Back Again

SS on U{j,100} for 1 ≤ j ≤ 99

j

SS(L

)/s(

L)

BF for N = 10M

SS for N = 1M

SS for N = 100K

SS for N = 10M

Page 58: Bin Packing: From Theory to Experiment and Back Again

Discrete Uniform Distributions II

Page 59: Bin Packing: From Theory to Experiment and Back Again

j

h

Page 60: Bin Packing: From Theory to Experiment and Back Again

K = 101

j

h

Page 61: Bin Packing: From Theory to Experiment and Back Again

K = 120

j

h

Page 62: Bin Packing: From Theory to Experiment and Back Again

j

h

K = 100

h = 18

Page 63: Bin Packing: From Theory to Experiment and Back Again

Results for U{18..j,k}

j

A(L

)/s(

L)

BFSSOPT

Page 64: Bin Packing: From Theory to Experiment and Back Again

Is SS Really this Good?

Page 65: Bin Packing: From Theory to Experiment and Back Again

Conjectures [Csirik et al., 1998]

Page 66: Bin Packing: From Theory to Experiment and Back Again

Why O(log n) Waste?

Page 67: Bin Packing: From Theory to Experiment and Back Again

Theorem [Csirik et al., 2000]

Page 68: Bin Packing: From Theory to Experiment and Back Again

Proving the Conjectures: A Key Lemma

Page 69: Bin Packing: From Theory to Experiment and Back Again

Linear Waste Distributions

Page 70: Bin Packing: From Theory to Experiment and Back Again

Good News

Page 71: Bin Packing: From Theory to Experiment and Back Again

SSF for U{18.. j,100}

Page 72: Bin Packing: From Theory to Experiment and Back Again

Handling Unknown Distributions

--

Page 73: Bin Packing: From Theory to Experiment and Back Again

SS* for U{18.. j,100}

Page 74: Bin Packing: From Theory to Experiment and Back Again

Other Exponents

Page 75: Bin Packing: From Theory to Experiment and Back Again

Variants that Don’t Always Work

B = 10, S = {1,3,4,5,8},

p(1) = p(3) = p(5) = 1/4, p(4) = p(8) = 1/8.

Distribution = (1/8) ( {8,1,1} + {4,3,3} + {5,5} )

Page 76: Bin Packing: From Theory to Experiment and Back Again

Offline Packing Revisited:

The Cutting-Stock Problem

Page 77: Bin Packing: From Theory to Experiment and Back Again

Gilmore-Gomory vs Bin Packing Heuristics

Page 78: Bin Packing: From Theory to Experiment and Back Again

Some Remaining Open Problems

Page 79: Bin Packing: From Theory to Experiment and Back Again