Online Bin Packing with Predictions

Spyros Angelopoulos, Shahin Kamali, Kimia Shadkami · DOI

Abstract

Online bin packing is a classic optimization problem with extensive applications in cloud resource management and logistics. Traditional online algorithms focus on minimizing the worst-case competitive ratio, often ignoring the predictable patterns present in real-world data. This paper introduces a novel framework for online bin packing that leverages machine-learned predictions of item size frequencies. We propose PROFILEPACKING, an algorithm that achieves near-optimal performance when predictions are accurate, and HYBRID(\lambda), a robust variant that maintains theoretical safety guarantees even when predictions fail. Our experimental results across synthetic and real-world datasets demonstrate that these predictive algorithms significantly outperform standard heuristics like First Fit and Best Fit.

1. Introduction

The bin packing problem involves assigning a set of items of various sizes into the minimum number of fixed-capacity bins. In the online setting, items arrive one by one and must be placed immediately without knowledge of future arrivals. While the best-known online algorithms achieve a competitive ratio of approximately 1.578, they are designed for adversarial worst-case scenarios. In practice, many systems—such as cloud platforms managing Virtual Machine (VM) placement—exhibit stable item size distributions over time. This paper explores how to utilize these distributions as predictions to improve online packing efficiency while ensuring robustness against prediction errors.

2. Methodology: Profile-Based Packing

The authors introduce a two-tiered algorithmic approach centered on the concept of a "profile set."

2.1 PROFILEPACKING

PROFILEPACKING is an optimistic algorithm that takes a predicted frequency distribution of item sizes and constructs a representative multiset of items. It then pre-computes an optimal offline packing for this profile.

Example of a predicted frequency distribution $f'_x$ for item sizes $x \in \{1, \dots, 10\}$.

As items arrive, the algorithm attempts to slot them into the pre-allocated "placeholders" defined by the optimal profile packing. If an item arrives that was not accounted for in the prediction (a "special item"), it is handled using a fallback heuristic such as First Fit.

2.2 HYBRID($\lambda$) and Robustness

To mitigate the risks of incorrect predictions, the HYBRID(\lambda) algorithm combines PROFILEPACKING with a standard robust algorithm. The parameter $\lambda$ serves as a confidence dial: a higher $\lambda$ prioritizes the prediction's potential gains (consistency), while a lower $\lambda$ ensures the algorithm does not perform significantly worse than standard online methods (robustness).

3. Theoretical Analysis

The performance of these algorithms is analyzed relative to the prediction error $\eta$, defined as the $L_1$ distance between the predicted and actual frequency distributions.

  • Consistency: Under perfect predictions ($\eta = 0$), PROFILEPACKING achieves a competitive ratio of $1 + \epsilon$.
  • Graceful Degradation: The competitive ratio degrades linearly with $\eta$, specifically $1 + O(\eta k)$, where $k$ is the bin capacity.
  • The Price of Optimism: A key theoretical result is the lower bound proving that any algorithm with perfect consistency must have a robustness that scales linearly with $k$, establishing a fundamental trade-off in learning-augmented bin packing.

4. Experimental Results

The proposed algorithms were evaluated using a variety of benchmarks, including Weibull distributions (modeling data center workloads) and the BPPLIB suite (GI, Schwerin, and Wascher datasets).

Key findings include:

  • Empirical Dominance: HYBRID algorithms consistently used fewer bins than First Fit and Best Fit across all tested distributions.
  • Resilience to Error: Even with a 20% prediction error, the learning-augmented approach maintained superior performance.
  • Adaptivity: A heuristic variant, ADAPTIVE(w), successfully handled "concept drift" in sequences where the underlying distribution changed over time.

5. Conclusion

This work provides the first comprehensive framework for online bin packing with predictions. By shifting the focus from individual items to collective frequency profiles, the authors demonstrate that historical data can be effectively harnessed to surpass traditional worst-case bounds. The practical learnability of these profiles makes this approach highly suitable for real-world resource management systems. Future work includes extending this profile-based methodology to higher-dimensional packing problems and formalizing the analysis of distribution shifts.

Summary updated

BibTeX
@article{angelopoulos2022online,
  author = {Spyros Angelopoulos and Shahin Kamali and Kimia Shadkami},
  title = {{Online Bin Packing with Predictions}},
  journal = {J. Artif. Intell. Res.},
  year = {2022},
  doi = {10.1613/jair.1.14820},
}
Figure