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.
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
R N F D ∞ ( size ≤ 1 / r ) = h ∞ ( r ) {\displaystyle R_{NFD}^{\infty }({\text{size}}\leq 1/r)=h_{\infty }(r)} ,
where h ∞ ( r ) {\displaystyle h_{\infty }(r)} is a sequence whose first elements are approximately 1.69103, 1.42312, 1.30238. In particular, taking r=1 implies that
R N F D ∞ = h ∞ ( 1 ) ≈ 1.69103 {\displaystyle R_{NFD}^{\infty }=h_{\infty }(1)\approx 1.69103} .
Later, NFD has also been analyzed probabilistically.[2]
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]
{{cite journal}}