English

Online Colored Bin Packing

Data Structures and Algorithms 2014-12-05 v2

Abstract

In the Colored Bin Packing problem a sequence of items of sizes up to 11 arrives to be packed into bins of unit capacity. Each item has one of c2c\geq 2 colors and an additional constraint is that we cannot pack two items of the same color next to each other in the same bin. The objective is to minimize the number of bins. In the important special case when all items have size zero, we characterize the optimal value to be equal to color discrepancy. As our main result, we give an (asymptotically) 1.5-competitive algorithm which is optimal. In fact, the algorithm always uses at most 1.5OPT\lceil1.5\cdot OPT\rceil bins and we show a matching lower bound of 1.5OPT\lceil1.5\cdot OPT\rceil for any value of OPT2OPT\geq 2. In particular, the absolute ratio of our algorithm is 5/35/3 and this is optimal. For items of unrestricted sizes we give an asymptotically 3.53.5-competitive algorithm. When the items have sizes at most 1/d1/d for a real d2d \geq 2 the asymptotic competitive ratio is 1.5+d/(d1)1.5+d/(d-1). We also show that classical algorithms First Fit, Best Fit and Worst Fit are not constant competitive, which holds already for three colors and small items. In the case of two colors---the Black and White Bin Packing problem---we prove that all Any Fit algorithms have absolute competitive ratio 33. When the items have sizes at most 1/d1/d for a real d2d \geq 2 we show that the Worst Fit algorithm is absolutely (1+d/(d1))(1+d/(d-1))-competitive.

Keywords

Cite

@article{arxiv.1404.5548,
  title  = {Online Colored Bin Packing},
  author = {Martin Böhm and Jiří Sgall and Pavel Veselý},
  journal= {arXiv preprint arXiv:1404.5548},
  year   = {2014}
}

Comments

Added lower bound of 2.5 for at least three colors, expanded some proofs

R2 v1 2026-06-22T03:55:55.528Z