# A Self Organizing Bin Packing Heuristic

## Abstract

This paper reports on experiments with a new on-line heuristic for one-dimensional bin packing whose average-case behavior is surprisingly robust. We restrict attention to the class of “discrete” distributions, i.e., ones in which the set of possible item sizes is finite (as is commonly the case in practical applications), and in which all sizes and probabilities are rational. It is known from [7] that for any such distribution the optimal expected waste grows either as *θ*(*n*), *θ*(\(
\sqrt n
\)), or *O*(1), Our new *Sum of Squares* algorithm (*SS*) appears to have roughly the same expected behavior in all three cases. This claim is experimentally evaluated using a newly-discovered, linear-programming-based algorithm that determines the optimal expected waste rate for any given discrete distribution in pseudopolynomial time (the best one can hope for given that the basic problem is NP-hard). Although *SS* appears to be essentially optimal when the expected optimal waste rate is sublinear, it is less impressive when the expected optimal waste rate is linear. The expected ratio of the number of bins used by *SS* to the optimal number appears to go to 1 asymptotically in the first case, whereas there are distributions for which it can be as high as 1.5 in the second. However, by modifying the algorithm slightly, using a single parameter that is tunable to the distribution in question (either by advanced knowledge or by on-line learning), we appear to be able to make the ratio go to 1 in all cases.

## Keywords

Discrete Distribution Optimal Packing Interval Distribution Item Size Waste Rate## Preview

Unable to display preview. Download preview PDF.

## References

- 1.J. L. Bentley, D. S. Johnson, F. T. Leighton, and C. C. McGeoch. An experimental study of bin packing. In
*Proceedings of the 21st Annual Allerton Conference on Communication, Control, and Computing*, pages 51–60, Urbana, 1983. University of Illinois.Google Scholar - 2.E. G. Coffman, Jr., C. Courcoubetis, M. R. Garey, D. S. Johnson, P.W. Shor, R. R. Weber, and M. Yannakakis. Bin packing with discrete item sizes, part I: Perfect packing theorems and the average case behavior of optimal packings.
*SIAM J. Disc. Math.*Submitted 1997.Google Scholar - 3.E. G. Coffman, Jr., C. A. Courcoubetis, M. R. Garey, D. S. Johnson, L. A. Mc-Geogh, P. W. Shor, R. R. Weber, and M. Yannakakis. Fundamental discrepancies between average-case analyses under discrete and continuous distributions: A bin packing case study. In
*Proceedings of the 23rd Annual ACM Symposium on Theory of Computing*, pages 230–240. ACM Press, 1991.Google Scholar - 4.E. G. Coffman, Jr., D. S. Johnson, P.W. Shor, and R. R.Weber. Bin packing with discrete item sizes, part IV: Average-case behavior of best fit. In preparation.Google Scholar
- 5.E. G. Coffman, Jr., D. S. Johnson, P. W. Shor, and R. R. Weber. Markov chains, computer proofs, and best fit bin packing. In
*Proceedings of the 25th ACM Symposium on the Theory of Computing*, pages 412–421, New York, 1993. ACM Press.Google Scholar - 6.E. G. Coffman, Jr. and G. S. Lueker.
*Probabilistic Analysis of Packing and Partitioning Algorithms*. Wiley, New York, 1991.Google Scholar - 7.C. Courcoubetis and R. R. Weber. Stability of on-line bin packing with random arrivals and long-run average constraints.
*Prob. Eng. Inf. Sci.*, 4:447–460, 1990.MATHCrossRefGoogle Scholar - 8.C. Kenyon, Y. Rabani, and A. Sinclair. Biased random walks, Lyapunov functions, and stochastic analysis of best fit bin packing.
*J. Algorithms*, 27:218–235, 1998.MATHCrossRefMathSciNetGoogle Scholar - 9.D. E. Knuth.
*The Art of Computer Programming, Volume 2: Seminumerical Algorithms*. 2nd Edition, Addison-Wesley, Reading, MA, 1981.Google Scholar - 10.T. Leighton and P. Shor. Tight bounds for minimax grid matching with applications to the average case analysis of algorithms.
*Combinatorica*, 9:161–187, 1989.MATHCrossRefMathSciNetGoogle Scholar - 11.W. T. Rhee and M. Talagrand. On line bin packing with items of random size.
*Math. Oper. Res.*, 18:438–445, 1993.MATHMathSciNetCrossRefGoogle Scholar - 12.W. T. Rhee and M. Talagrand. On line bin packing with items of random sizes — II.
*SIAM J. Comput.*, 22:1251–1256, 1993.MATHCrossRefMathSciNetGoogle Scholar - 13.P. W. Shor. The average-case analysis of some on-line algorithms for bin packing.
*Combinatorica*, 6(2):179–200, 1986.MATHCrossRefMathSciNetGoogle Scholar