Bin Packing 1 D These slides on 1
Bin Packing (1 -D) These slides on 1 -D bin packing are adapted from slides from Professor C. L. Liu former President (1998 -2002) Tsing Hua University, Hsinchu, Taiwan).
Bin Packing (1 -D) The bins; (capacity 1) Bin Packing Problem 1 . 5. 5 …… . 7. 7 . 5. 5 . 2 . 4 . 2 Items to be packed . 5. 5 . 1 . 6 . 1. 6
Bin Packing (1 -D) Bin Packing Problem 1 …… . 5 . 7 . 5 . 2 . 4 . 2 . 5 . 1 . 6 Optimal Packing. 5 . 2 . 5 . 7 . 1. 5. 4 . 6. 2 N 0 = 4
Next Fit Packing Algorithm Bin Packing Problem. 5 . 7. 5. 5 . 2. 2. 7 . 4 . 2 . 5 . 1 . 6 . 1. 5. 4 . 6 N 0 = 4 . 2 Next Fit Packing Algorithm. 2. 5 . 7 . 5 . 2 . 1 . 4 . 5 . 6 N=6
Bin Packing (1 -D) Approximation Algorithms: Not optimal solution, but with some performance guarantee (eg, no worst than twice the optimal) Even though we don’t know what the optimal solution is!!!
Next Fit Packing Algorithm ai-1 aj-1 ak-1 a 1 ai aj . . . a 1+……. . + ai > 1 . . . … ak am-1 . . . Let a 1+ a 2 + ……. . = 2 N– 1 aj+……. . + ak > 1 N 0 al+……. . + am > 1 am al ai+……. . + aj > 1. . . .
Next Fit Packing Algorithm (simpler proof) ai-1 aj-1 ak-1 a 1 ai aj . . . … ak am-1 . . . al . . . am s(B 1)+s(B 2) > 1 s(B 2)+s(B 3) > 1 Let a 1+ a 2 +. . … = 2 > N– . . 1. 2 N 0 2 N – 1 … … … s(BN-1)+s(BN) > 1 2( s(B 1)+s(B 2)+…+ s(BN) ) > N – 1
First Fit Packing Algorithm. 5 . 7 . 5 . 2 . 4 . 2 . 5 . 1 . 6 Next Fit Packing Algorithm. 2. 5 . 7 . 5 . 2 . 1 . 4 . 5 . 6 First Fit Packing Algorithm. 5. 5 . 1. 2. 7 . 2. 4 N=5 (Proof omitted)
- Slides: 8