Next-fit-decreasing Bin Packing
   HOME

TheInfoList



OR:

Next-fit-decreasing (NFD) is an algorithm for
bin packing The bin packing problem is an optimization problem, in which items of different sizes must be packed into a finite number of bins or containers, each of a fixed given capacity, in a way that minimizes the number of bins used. The problem has ma ...
. 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 A heuristic (; ), or heuristic technique, is any approach to problem solving or self-discovery that employs a practical method that is not guaranteed to be optimal, perfect, or rational, but is nevertheless sufficient for reaching an immediate, ...
: * Order the items from largest to smallest. * Initialize an empty bin and call it the "open bin". * For each item in order, check if it can fit into the open bin: ** If it fits, then place the new item into it. ** Otherwise, close the current bin, open a new bin, and put the current item inside it. In short: NFD orders the items by descending size, and then calls
next-fit bin packing Next-fit is an online 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 cap ...
.


Performance upper bound

Baker and Coffman 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^_(\text\leq 1/r) = h_(r),
where h_(r) is a sequence whose first elements are approximately 1.69103, 1.42312, 1.30238. In particular, taking ''r''=1 implies that
R^_ = h_(1) \approx 1.69103.
Later, NFD has also been analyzed probabilistically.


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. However, Next-Fit-Increasing performs better when there are general cost structures.{{Cite journal, last=Anily, first=Shoshana, last2=Bramel, first2=Julien, last3=Simchi-Levi, first3=David, date=1994-04-01, title=Worst-Case Analysis of Heuristics for the Bin Packing Problem with General Cost Structures, url=https://pubsonline.informs.org/doi/abs/10.1287/opre.42.2.287, journal=Operations Research, volume=42, issue=2, pages=287–298, doi=10.1287/opre.42.2.287, issn=0030-364X


References

Bin packing