Offline black and white bin packing

János Balogh, József Békési, György Dósa, Leah Epstein, Hans Kellerer, Asaf Levin, Zsolt Tuza

Research output: Contribution to journalArticle

1 Citation (Scopus)


We define and study a variant of bin packing called unrestricted black and white bin packing. Similarly to standard bin packing, a set of items of sizes in [0, 1] are to be partitioned into subsets of total size at most 1, called bins. Items are of two types, called black and white, and the item types must alternate in each bin, that is, two items of the same type cannot be assigned consecutively into a bin. Thus, a subset of items of total size at most 1 can form a valid bin if and only if the absolute value of the difference between the numbers of black items and white items in the subset is at most 1. We study this problem both with respect to the absolute and the asymptotic approximation ratios. We design a fast heuristic whose absolute approximation ratio is 2. We also design an APTAS and modify it into an AFPTAS. The APTAS can be used as an algorithm of absolute approximation ratio 32, which is the best possible absolute approximation ratio for the problem unless P. =. NP.

Original languageEnglish
Pages (from-to)92-101
Number of pages10
JournalTheoretical Computer Science
Publication statusPublished - Sep 6 2015



  • Approximation schemes
  • Bin packing
  • First Fit
  • Knapsack
  • Next Fit

ASJC Scopus subject areas

  • Theoretical Computer Science
  • Computer Science(all)

Cite this

Balogh, J., Békési, J., Dósa, G., Epstein, L., Kellerer, H., Levin, A., & Tuza, Z. (2015). Offline black and white bin packing. Theoretical Computer Science, 596, 92-101.