Fundamental algorithms
- Ordering
- Original arrival order
- Rules
- Next open bin, first feasible bin, or tightest feasible bin
- Algorithms
- Next-Fit, First-Fit, Best-Fit
Compare fundamental, offline, and beyond-worst-case heuristics on the same one-dimensional bin packing instance. Explore placement decisions, exact small-instance optima, random-order experiments, theoretical guarantees, and exportable final packings.
Sorting and bin selection are separate design choices. The cards below isolate their effects.
Choose an algorithm and predict its next bin.
Next-Fit, First-Fit, and Best-Fit process the original input order.
Next-Fit-Decreasing, First-Fit-Decreasing, and Best-Fit-Decreasing sort before packing.
Worst-Fit, Best-Fit under random arrival, and an educational MFFD visualization.
Run Best-Fit over many independent random permutations of the same multiset and inspect the empirical distribution.
The experiment reports the minimum, mean, maximum, and standard deviation of bins used. It is empirical and does not replace a random-order ratio proof.
Load an instance to see lower bounds and exact-OPT status.
Classical worst-case results for unit-capacity one-dimensional bin packing. Runtime entries assume comparison-model implementations with standard search data structures.
| Algorithm | Model | Best-known guarantee shown here | Standard runtime | Primary source |
|---|---|---|---|---|
| Next-Fit | Online | Absolute/asymptotic ratio 2; in particular NF(I) ≤ 2OPT(I) − 1. | O(n) | Johnson et al. (1974) |
| First-Fit | Online | Tight absolute ratio 17/10: FF(I) ≤ ⌊1.7 OPT(I)⌋. | O(n log n); naive O(n²) | Dósa–Sgall (2013) |
| Best-Fit | Online | Tight absolute ratio 17/10: BF(I) ≤ ⌊1.7 OPT(I)⌋. | O(n log n); naive O(n²) | Dósa–Sgall |
| Next-Fit-Decreasing | Offline | Tight asymptotic ratio ≈ 1.69103. | O(n log n) | Baker–Coffman (1981) |
| First-Fit-Decreasing | Offline | Tight bound FFD(I) ≤ 11/9 OPT(I) + 6/9. | O(n log n) | Dósa et al. (2013) |
| Best-Fit-Decreasing | Offline | Tight asymptotic ratio 11/9; absolute ratio 3/2. | O(n log n) | Johnson et al. (1974) |
| Worst-Fit | Online | Absolute/asymptotic ratio 2. | O(n log n); naive O(n²) | Johnson et al. (1974) |
| Best-Fit, random order | Random-order | General asymptotic random-order ratio is strictly below 3/2; current lower bound ≥ 1.15582656. | O(n log n) per permutation | Hebbar–Khan–Sreenivas (2024) · Epstein–Levin (2025) |
| Modified FFD | Offline | Classical MFFD(I) ≤ 71/60 OPT(I) + 1. | O(n log n) | Johnson–Garey (1985) · Yue–Zhang (1995) |
Encode the current instance in the URL, export summary data, save final packings, or print the page.