Colored Bin Packing: Online Algorithms and Lower Bounds

Abstract

In the Colored Bin Packing problem a sequence of items of sizes up to 1 arrives to be packed into bins of unit capacity. Each item has one of at least two 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 \(\lceil 1.5\cdot OPT \rceil \) bins and we can force any deterministic online algorithm to use at least \(\lceil 1.5\cdot OPT \rceil \) bins while the offline optimum is \( OPT \) for any value of \( OPT \ge 2\). In particular, the absolute competitive ratio of our algorithm is 5 / 3 and this is optimal. For items of arbitrary size we give a lower bound of 2.5 on the asymptotic competitive ratio of any online algorithm and an absolutely 3.5-competitive algorithm. When the items have sizes of at most 1 / d for a real \(d \ge 2\) the asymptotic competitive ratio of our algorithm is \(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 give a lower bound of 2 on the asymptotic competitive ratio of any online algorithm when items have arbitrary size. We also prove that all Any Fit algorithms have the absolute competitive ratio 3. When the items have sizes of at most 1 / d for a real \(d \ge 2\) we show that the Worst Fit algorithm is absolutely \((1+d/(d-1))\)-competitive.

This is a preview of subscription content, access via your institution.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10

References

  1. 1.

    Babel, L., Chen, B., Kellerer, H., Kotov, V.: Algorithms for on-line bin-packing problems with cardinality constraints. Discrete Appl. Math. 143, 238–251 (2004)

    MathSciNet  Article  MATH  Google Scholar 

  2. 2.

    Balogh, J., Békési, J., Dósa, G., Epstein, L., Kellerer, H., Tuza, Z.: Online results for black and white bin packing. Theory Comput. Syst. 56(1), 137–155 (2015)

    MathSciNet  Article  MATH  Google Scholar 

  3. 3.

    Balogh, J., Békési, J., Dósa, G., Kellerer, H., Tuza, Z.: Black and white bin packing. In: Approximation and Online Algorithms. LNCS, vol. 7846, pp. 131–144. Springer, Berlin (2013)

  4. 4.

    Balogh, J., Békési, J., Galambos, G.: New lower bounds for certain classes of bin packing algorithms. Theor. Comput. Sci. 440–441, 1–13 (2012)

    MathSciNet  Article  MATH  Google Scholar 

  5. 5.

    Balogh, J., Békési, J., Dósa, G., Sgall, J., van Stee, R.: The optimal absolute ratio for online bin packing. In: Proceedings of the 26th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pp 1425–1438. ACM-SIAM (2015)

  6. 6.

    Böhm, M., Sgall, J., Veselý, P.: Online colored bin packing. In: Approximation and Online Algorithms. LNCS, vol. 8952, pp. 35–46. Springer, Berlin (2015)

  7. 7.

    Chrobak, M., Sgall, J., Woeginger, G.J.: Two-bounded-space bin packing revisited. In: European Symposium on Algorithms (ESA). LNCS, vol. 6942, pp. 263–274. Springer, Berlin (2011)

  8. 8.

    Coffman Jr, E., Csirik, J., Galambos, G., Martello, S., Vigo, D.: Bin packing approximation algorithms: survey and classification. In: Pardalos, P.M., Du, D.-Z., Graham, R.L. (eds.) Handbook of Combinatorial Optimization, pp. 455–531. Springer, Berlin (2013)

    Chapter  Google Scholar 

  9. 9.

    Csirik, J., Johnson, D.S.: Bounded space on-line bin packing: best is better than first. Algorithmica 31(2), 115–138 (2001)

    MathSciNet  Article  MATH  Google Scholar 

  10. 10.

    Dósa, G., Epstein, L.: Colorful bin packing. In: Algorithm Theory SWAT. LNCS, vol. 8503, pp. 170–181. Springer, Berlin (2014)

  11. 11.

    Dósa, G., Epstein, L.: Online bin packing with cardinality constraints revisited. arXiv:1404.1056

  12. 12.

    Dósa, G., Sgall, J.: First Fit bin packing: A tight analysis. 30th International Symposium on Theoretical Aspects of Computer Science (STACS), Volume 20 of Leibniz International Proceedings in Informatics (LIPIcs), pp. 538–549. Dagstuhl, Germany (2013)

  13. 13.

    Dósa, G., Sgall, J.: Optimal analysis of Best Fit bin packing. In: Automata, Languages, and Programming (ICALP). LNCS, vol. 8572, pp. 429–441. Springer, Berlin (2014)

  14. 14.

    Dósa, G., Tuza, Z., Ye, D.: Bin packing with “largest in bottom” constraint: tighter bounds and generalizations. J. Comb. Optim. 26(3), 416–436 (2013)

    MathSciNet  Article  MATH  Google Scholar 

  15. 15.

    Epstein, L.: Online bin packing with cardinality constraints. SIAM J. Discrete Math. 20, 1015–1030 (2006)

    MathSciNet  Article  MATH  Google Scholar 

  16. 16.

    Epstein, L.: On online bin packing with LIB constraints. Naval Res. Logist. 56(8), 780–786 (2009)

    MathSciNet  Article  MATH  Google Scholar 

  17. 17.

    Finlay, L., Manyem, P.: Online LIB problems: heuristics for bin covering and lower bounds for bin packing. RAIRO Oper. Res. 39(3), 163–183 (2005)

    MathSciNet  Article  MATH  Google Scholar 

  18. 18.

    Fujiwara, H., Kobayashi, K.: Improved lower bounds for the online bin packing problem with cardinality constraints. In: Computing and Combinatorics, LNCS, vol. 7936, pp. 518–530. Springer, Berlin (2013)

  19. 19.

    Johnson, D.: Near-Optimal Bin Packing Algorithms. Massachusetts Institute of Technology, Project MAC. Massachusetts Institute of Technology (1973)

  20. 20.

    Krause, K.L., Shen, V.Y., Schwetman, H.D.: Analysis of several task-scheduling algorithms for a model of multiprogramming computer systems. J. ACM 22, 522–550 (1975)

    MathSciNet  Article  MATH  Google Scholar 

  21. 21.

    Lee, C.C., Lee, D.T.: A simple on-line bin-packing algorithm. J. ACM 32, 562–572 (1985)

    MathSciNet  Article  MATH  Google Scholar 

  22. 22.

    Manyem, P.: Bin packing and covering with longest items at the bottom: online version. ANZIAM J. 43(E), E186–E232 (2002)

    MathSciNet  Article  MATH  Google Scholar 

  23. 23.

    Manyem, P., Salt, R.L., Visser, M.S.: Approximation lower bounds in online LIB bin packing and covering. J. Automata Lang. Comb. 8(4), 663–674 (2003)

    MathSciNet  MATH  Google Scholar 

  24. 24.

    Seiden, S.S.: On the online bin packing problem. J. ACM 49, 640–671 (2002)

    MathSciNet  Article  MATH  Google Scholar 

  25. 25.

    Ullman, J.: The Performance of a Memory Allocation Algorithm. Technical Report 100 (1971)

Download references

Acknowledgements

We would like to thank anonymous reviewers for careful reading and many useful suggestions.

Author information

Affiliations

Authors

Corresponding author

Correspondence to Pavel Veselý.

Additional information

This work was supported by the Project 14-10003S of GA ČR and by the GAUK Project 548214. The conference versions of this paper appeared in SWAT 2014 [10] and WAOA 2014 [6].

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Böhm, M., Dósa, G., Epstein, L. et al. Colored Bin Packing: Online Algorithms and Lower Bounds. Algorithmica 80, 155–184 (2018). https://doi.org/10.1007/s00453-016-0248-2

Download citation

Keywords

  • Online algorithms
  • Bin packing
  • Worst-case analysis
  • Colored bin packing
  • Black and white bin packing