Escolar Documentos
Profissional Documentos
Cultura Documentos
Professor C. L. Liu
former President (1998-2002)
Tsing Hua University,
Hsinchu, Taiwan).
Bin Packing (1-D)
1 ……
.5 .7 .5 .2 .4 .2 .5 .1 .6
.2 .4 .2 .1
.5 .5 .5 .6
.7
Items to be packed
Bin Packing (1-D)
1 ……
.5 .7 .5 .2 .4 .2 .5 .1 .6
Optimal Packing
.1
.5 .2
.5
.6 N0 = 4
.5 .7
.4
.2
Next Fit Packing
Algorithm
Bin Packing Problem
.5 .7 .5 .2 .4 .2 .5 .1 .6
.1
.5 .2
.5
.6 N0 = 4
.5 .7
.4
.2
N N=6
2
N0
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
s(B1)+s(B2) > 1
s(B2)+s(B3) > 1
… … … … …
Let a1+ a2 +. … =
.. s(BN-1)+s(BN) > 1
2 > N– 1..
2N0 2 N – 1 2( s(B1)+s(B2)+…+ s(BN) ) > N – 1
First Fit Packing
Algorithm
.5 .7 .5 .2 .4 .2 .5 .1 .6
Next Fit Packing Algorithm
.2 .1
.2
.7 .6
.5 .5 .4 .5
.2
.7 .6
.5 .4 .5
N=5
N
1.7 (Proof omitted)
N0