Download presentation
Presentation is loading. Please wait.
Published byErvin Kovács Modified over 5 years ago
1
Bin Packing (1-D) These slides on 1-D bin packing
are adapted from slides from Professor C. L. Liu former President ( ) Tsing Hua University, Hsinchu, Taiwan).
2
Bin Packing (1-D) Bin Packing Problem Items to be packed
The bins; (capacity 1) Bin Packing Problem 1 …… .5 .7 .5 .2 .4 .2 .5 .1 .6 Items to be packed
3
Bin Packing (1-D) Bin Packing Problem Optimal Packing
…… Optimal Packing .5 .1 .2 .5 .6 N0 = 4 .7 .5 .4 .2
4
Next Fit Packing Algorithm
Bin Packing Problem .5 .1 .2 .5 .6 N0 = 4 .7 .5 .4 .2 Next Fit Packing Algorithm .7 .2 .2 .1 .6 .5 .5 .5 .4 N = 6
5
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!!!
6
Next Fit Packing Algorithm
… a1 ai-1 . ai aj-1 ak-1 aj ak am-1 al am a1+……..+ ai > 1 ai+……..+ aj > 1 aj+……..+ ak > 1 al+……..+ am > 1 Let a1+ a2 + …….. = 2 N – 1 N0 .
7
Next Fit Packing Algorithm (simpler proof)
… a1 ai-1 . ai aj-1 ak-1 aj ak am-1 al am s(B1)+s(B2) > 1 s(B2)+s(B3) > 1 … … … … … s(BN-1)+s(BN) > 1 Let a1+ a2 + … = 2 > N – 1 2N0 2 N – 1 . 2( s(B1)+s(B2)+…+ s(BN) ) > N – 1
8
First Fit Packing Algorithm
Next Fit Packing Algorithm .7 .2 .2 .1 .6 .5 .5 .5 .4 First Fit Packing Algorithm .5 .1 .2 .7 .2 .6 .5 .5 .4 N = 5 (Proof omitted)
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.