Bin Packing: From Theory to Experiment and Back Again
description
Transcript of Bin Packing: From Theory to Experiment and Back Again
![Page 1: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/1.jpg)
© 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](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/2.jpg)
![Page 3: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/3.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/4.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/5.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/6.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/7.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/8.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/9.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/10.jpg)
“Improving” on FF and BF
![Page 11: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/11.jpg)
“Improving” on FFD and BFD
![Page 12: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/12.jpg)
Average-Case Performance
![Page 13: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/13.jpg)
Progress?
![Page 14: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/14.jpg)
Progress:Faster Computers Bigger Instances
![Page 15: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/15.jpg)
Definitions
![Page 16: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/16.jpg)
Definitions, Continued
![Page 17: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/17.jpg)
Theorems for U[0,1]
![Page 18: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/18.jpg)
![Page 19: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/19.jpg)
Proof Idea for FF, BF:View as a 2-Dimensional Matching
Problem
![Page 20: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/20.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/21.jpg)
Average Waste for BF under U(0,u]
![Page 22: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/22.jpg)
Measured Average Waste for BF under U(0,.01]
![Page 23: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/23.jpg)
Conjecture
![Page 24: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/24.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/25.jpg)
FFD on U(0,u], u 0.5
![Page 26: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/26.jpg)
FFD on U(0,u], u 0.5
![Page 27: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/27.jpg)
FFD on U(0,u], 0.5 u 1
![Page 28: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/28.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/29.jpg)
Discrete Distributions
![Page 30: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/30.jpg)
Courcoubetis-Weber
![Page 31: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/31.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/32.jpg)
Courcoubetis-Weber Theorem
![Page 33: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/33.jpg)
A Flow-Based Linear Program
![Page 34: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/34.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/35.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/36.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/37.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/38.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/39.jpg)
Theorem [Kenyon & Mitzenmacher, 2000]
![Page 40: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/40.jpg)
Average wBF(L)/s(L) for U{j,85}
![Page 41: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/41.jpg)
Average wBFD(L)/s(L) for U{j,85}
![Page 42: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/42.jpg)
Averages on the Same Scale
![Page 43: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/43.jpg)
The Discrete Distribution U{6,13}
![Page 44: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/44.jpg)
“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](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/45.jpg)
Expected Waste
![Page 46: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/46.jpg)
Theorem[Coffman, Johnson, McGeoch, Shor, & Weber, 1994-
2008]
![Page 47: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/47.jpg)
U{j,k} for which FFD has Linear Waste
j
k
![Page 48: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/48.jpg)
Minumum j/k for which Waste is Linear
k
j/k
![Page 49: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/49.jpg)
Values of j/k for which Waste is Maximum
k
j/k
![Page 50: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/50.jpg)
Waste as a Function of j and k (mod 6)
![Page 51: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/51.jpg)
K = 8641 = 26335 + 1
![Page 52: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/52.jpg)
Pairs (j,k) where BFD beats FFD
k
j
![Page 53: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/53.jpg)
Pairs (j,k) where FFD beats BFD
k
j
![Page 54: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/54.jpg)
Beating BF and BFD in Theory
![Page 55: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/55.jpg)
Plausible Alternative Approach
![Page 56: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/56.jpg)
The Sum-of-Squares Algorithm (SS)
![Page 57: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/57.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/58.jpg)
Discrete Uniform Distributions II
![Page 59: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/59.jpg)
j
h
![Page 60: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/60.jpg)
K = 101
j
h
![Page 61: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/61.jpg)
K = 120
j
h
![Page 62: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/62.jpg)
j
h
K = 100
h = 18
![Page 63: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/63.jpg)
Results for U{18..j,k}
j
A(L
)/s(
L)
BFSSOPT
![Page 64: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/64.jpg)
Is SS Really this Good?
![Page 65: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/65.jpg)
Conjectures [Csirik et al., 1998]
![Page 66: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/66.jpg)
Why O(log n) Waste?
![Page 67: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/67.jpg)
Theorem [Csirik et al., 2000]
![Page 68: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/68.jpg)
Proving the Conjectures: A Key Lemma
![Page 69: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/69.jpg)
Linear Waste Distributions
![Page 70: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/70.jpg)
Good News
![Page 71: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/71.jpg)
SSF for U{18.. j,100}
![Page 72: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/72.jpg)
Handling Unknown Distributions
--
![Page 73: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/73.jpg)
SS* for U{18.. j,100}
![Page 74: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/74.jpg)
Other Exponents
![Page 75: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/75.jpg)
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](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/76.jpg)
Offline Packing Revisited:
The Cutting-Stock Problem
![Page 77: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/77.jpg)
Gilmore-Gomory vs Bin Packing Heuristics
![Page 78: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/78.jpg)
Some Remaining Open Problems
![Page 79: Bin Packing: From Theory to Experiment and Back Again](https://reader036.fdocuments.us/reader036/viewer/2022081507/56815acf550346895dc8a364/html5/thumbnails/79.jpg)