In the offline version of bin packing, the algorithm can see all the items before starting to place them into bins. This allows to attain improved approximation ratios.
Multiplicative approximation The simplest technique used by offline approximation schemes is the following: • Ordering the input list by descending size; • Run an online algorithm on the ordered list. Johnson •
Next-fit-decreasing (NFD) orders the items by descending size, then calls
Next-Fit. Its approximate ratio is slightly less than 1.7 in the worst case. It has also been analyzed probabilistically. 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. •
Modified first-fit-decreasing (MFFD), improves on FFD for items larger than half a bin by classifying items by size into four size classes large, medium, small, and tiny, corresponding to items with size > 1/2 bin, > 1/3 bin, > 1/6 bin, and smaller items respectively. Its approximation guarantee is MFFD(I) \leq \frac {71}{60}\mathrm{OPT}(I) + 1. Fernandez de la Vega and Lueker presented a
PTAS for bin packing. For every \varepsilon>0, their algorithm finds a solution with size at most (1+\varepsilon)\mathrm{OPT} + 1 and runs in time \mathcal{O}(n\log(1/\varepsilon)) + \mathcal{O}_{\varepsilon}(1), where \mathcal{O}_{\varepsilon}(1) denotes a function only dependent on 1/\varepsilon. For this algorithm, they invented the method of
adaptive input rounding: the input numbers are grouped and rounded up to the value of the maximum in each group. This yields an instance with a small number of different sizes, which can be solved exactly using the
configuration linear program.
Additive approximation The
Karmarkar-Karp bin packing algorithm finds a solution with size at most \mathrm{OPT} + \mathcal{O}(\log^2(\mathrm{OPT})), and runs in time polynomial in (the polynomial has a high degree, at least 8). Rothvoss presented an algorithm that generates a solution with at most \mathrm{OPT} + \mathcal{O}(\log(\mathrm{OPT})\cdot \log\log(\mathrm{OPT})) bins. Hoberg and Rothvoss improved this algorithm to generate a solution with at most \mathrm{OPT} + \mathcal{O}(\log(\mathrm{OPT})) bins. The algorithm is randomized, and its running-time is polynomial in .
Comparison table Exact algorithms Martello and Toth developed an
exact algorithm for the 1-dimensional bin-packing problem, called MTP. A faster alternative is the Bin Completion algorithm proposed by
Richard E. Korf in 2002 and later improved. A further improvement was presented by Schreiber and Korf in 2013. The new Improved Bin Completion algorithm is shown to be up to five orders of magnitude faster than Bin Completion on non-trivial problems with 100 items, and outperforms the BCP (branch-and-cut-and-price) algorithm by Belov and Scheithauer on problems that have fewer than 20 bins as the optimal solution. Which algorithm performs best depends on problem properties like the number of items, the optimal number of bins, unused space in the optimal solution and value precision.
Small number of different sizes A special case of bin packing is when there is a small number
d of different item sizes. There can be many different items of each size. This case is also called
high-multiplicity bin packing, and It admits more efficient algorithms than the general problem. == Bin-packing with fragmentation ==