Next-fit-decreasing bin packing explained

Next-fit-decreasing (NFD) is an algorithm for bin packing. Its input is a list of items of different sizes. Its output is a packing - a partition of the items into bins of fixed capacity, such that the sum of sizes of items in each bin is at most the capacity. Ideally, we would like to use as few bins as possible, but minimizing the number of bins is an NP-hard problem. The NFD algorithm uses the following heuristic:

In short: NFD orders the items by descending size, and then calls next-fit bin packing.

Performance upper bound

Baker and Coffman[1] proved that, for every integer r, when the size of all items is at most 1/r, the asymptotic approximation ratio of RFD satisfies

infty
R
NFD

(size\leq1/r)=hinfty(r)

,
where

hinfty(r)

is a sequence whose first elements are approximately 1.69103, 1.42312, 1.30238. In particular, taking r=1 implies that
infty
R
NFD

=hinfty(1)1.69103

.

Later, NFD has also been analyzed probabilistically.[2]

Variants

Next-Fit packs a list and its inverse into the same number of bins. Therefore, Next-Fit-Increasing has the same performance as Next-Fit-Decreasing.[3]

However, Next-Fit-Increasing performs better when there are general cost structures.[4]

References

  1. Baker. B. S.. Coffman. Jr., E. G.. 1981-06-01. A Tight Asymptotic Bound for Next-Fit-Decreasing Bin-Packing. SIAM Journal on Algebraic and Discrete Methods. 2. 2. 147–152. 10.1137/0602019. 0196-5212.
  2. 1986-11-01. A probabilistic analysis of the next fit decreasing bin packing heuristic. Operations Research Letters. en. 5. 5. 233–236. 10.1016/0167-6377(86)90013-1. 0167-6377. Csirik. J.. Galambos. G.. Frenk. J.B.G.. Frieze. A.M.. Rinnooy Kan. A.H.G.. 1765/11645. free.
  3. 1988-12-01. Next-fit packs a list and its reverse into the same number of bins. Operations Research Letters. en. 7. 6. 291–293. 10.1016/0167-6377(88)90060-0. 0167-6377. Fisher. David C..
  4. Anily. Shoshana. Bramel. Julien. Simchi-Levi. David. 1994-04-01. Worst-Case Analysis of Heuristics for the Bin Packing Problem with General Cost Structures. Operations Research. 42. 2. 287–298. 10.1287/opre.42.2.287. 0030-364X.