In the bin packing problem, a list L of n items is to be packed into a sequence Ž . of unit capacity bins with the goal of minimizing the number of bins used. First Fit FF is one of the most natural on-line algorithms for this problem, based on the simple rule that each successive item is packed into the first bin of the sequence that currently has room for it. We present an average-case analysis of FF in the discrete uniform model: The item sizes Ž . 4 are drawn independently and uniformly at random from the set 1rk, . . . , ky1 rk , for FFŽ . some k)1. Let W L denote the wasted space in the FF packing of L, i.e., the total FF ' w Ž .x Ž . space still available in the occupied bins. We prove that E W L sO nk , i.e., there FF ' w Ž .x exists a constant c)0 such that E W L Fc nk for all n, k sufficiently large. By a complementary lower bound argument, we prove that this result is sharp, unless k is allowed 1r3 w FFŽ .x Ž 2r3. to grow with n at a rate faster than n , in which case E W L sQ n . Finally, we show that this last result carries over to the continuous uniform model, where item sizes are w x Ž 2r3. chosen uniformly from 0, 1 . The O n upper bound for the continuous model is new and solves a problem posed a decade ago. The proofs of many of these results require extensions to the theory of stochastic planar matching. Q 1997 John Wiley & Sons, Inc. Random Struct. Alg., Ž . 10, 69]101 1997
[1]
Edward G. Coffman,et al.
Markov chains, computer proofs, and average-case analysis of best fit bin packing
,
1993,
STOC '93.
[2]
Peter W. Shor,et al.
How to pack better than best fit: tight bounds for average-case online bin packing
,
1991,
[1991] Proceedings 32nd Annual Symposium of Foundations of Computer Science.
[3]
P.W. Shor,et al.
The average-case analysis of some on-line algorithms for bin packing
,
1984,
Comb..
[4]
Frank E. Grubbs,et al.
An Introduction to Probability Theory and Its Applications
,
1951
.
[5]
Yuval Rabani,et al.
Biased random walks, Lyapunov functions, and stochastic analysis of best fit bin packing
,
1996,
SODA '96.
[6]
Mihalis Yannakakis,et al.
Fundamental discrepancies between average-case analyses under discrete and continuous distributions: a bin packing case study
,
1991,
STOC '91.