0% found this document useful (0 votes)
13 views15 pages

FFabs

Bin packing

Uploaded by

prof.danilobr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views15 pages

FFabs

Bin packing

Uploaded by

prof.danilobr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

First Fit bin packing: A tight analysis

György Dósa1 and Jiří Sgall2

1 Department of Mathematics, University of Pannonia


Veszprém, Hungary
[email protected]
2 Computer Science Institute of Charles University
Faculty of Mathematics and Physics
Malostranské nám. 25, CZ-11800 Praha 1, Czech Republic
[email protected]

Abstract
In the bin packing problem we are given an instance consisting of a sequence of items with sizes
between 0 and 1. The objective is to pack these items into the smallest possible number of bins
of unit size. FirstFit algorithm packs each item into the first bin where it fits, possibly opening
a new bin if the item cannot fit into any currently open bin. In early seventies it was shown that
the asymptotic approximation ratio of FirstFit bin packing is equal to 1.7.
We prove that also the absolute approximation ratio for FirstFit bin packing is exactly 1.7.
This means that if the optimum needs Opt bins, FirstFit always uses at most b1.7 · OPTc
bins.
Furthermore we show matching lower bounds for a majority of values of Opt, i.e., we give
instances on which FirstFit uses exactly b1.7 · OPTc bins.
Such matching upper and lower bounds were previously known only for finitely many small
values of OPT. The previous published bound on the absolute approximation ratio of FirstFit
was 12/7 ≈ 1.7143. Recently a bound of 101/59 ≈ 1.7119 was claimed.

1998 ACM Subject Classification F.2.2 Nonnumerical Algorithms and Problems

Keywords and phrases Approximation algorithms, online algorithms, bin packing, First Fit

Digital Object Identifier 10.4230/LIPIcs.xxx.yyy.p

1 Introduction
Bin packing is a classical combinatorial optimization problem in which we are given an
instance consisting of a sequence of items with rational sizes between 0 and 1, and the goal
is to pack these items into the smallest possible number of bins of unit size. FirstFit
algorithm packs each item into the first bin where it fits, possibly opening a new bin if the
item does not fit into any currently open bin.
Johnson’s thesis [8] on bin packing together with Graham’s work on scheduling [6, 7]
belong to the early influential works that started and formed the whole area of approximation
algorithms. The proof that the asymptotic approximation ratio of FirstFit bin packing
is 1.7 given by Ullman [13] and subsequent works by Garey et al. and Johnson et al. [5, 9]
were among these first results on approximation algorithms.
In this paper, we prove that also the absolute approximation ratio for FirstFit bin
packing is exactly 1.7. This means that if the optimum needs Opt bins, FirstFit always
uses at most b1.7 · Optc bins. Thus we settle this open problem after almost 40 years.
Furthermore we show matching lower bounds for a majority of values of Opt, i.e., we
give instances on which FirstFit uses exactly b1.7 · Optc bins. More precisely, we give
© Gy. Dósa and J. Sgall
Conference title on which this volume is based on.
Editors: Billy Editor, Bill Editors; pp. 1–15
Leibniz International Proceedings in Informatics
Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl Publishing, Germany
2 First Fit bin packing: A tight analysis

these lower bounds for all values of Opt, except when Opt mod 10 equals to 0 or 3; for
these two remaining cases we show a lower bound of b1.7 · Optc − 1.
Such matching upper and lower bounds were previously known only for finitely many
small values of Opt. Thus our results not only give the exact worst case for most values of
Opt (8 out of 10 residue classes), but actually even give the first infinite sequence of values
of Opt for which the exact worst-case performance of FirstFit is known.

1.1 History and related work


The upper bound on FirstFit was first shown by Ullman in 1971 [13]; he proved that for
any instance, FF ≤ 1.7 · Opt + 3, where FF and Opt denote the number of bins used by
FirstFit and the optimum, respectively. Still in seventies, the additive term was improved
first in [5] to 2 and then in [4] to FF ≤ d1.7 · Opte; due to integrality of FF and Opt this
is equivalent to FF ≤ 1.7 · Opt + 0.9. Recently the additive term of the asymptotic bound
was improved to FF ≤ 1.7 · Opt + 0.7 in [15].
The absolute approximation ratio of FirstFit got some attention recently. A significant
step towards settling the question of the absolute approximation ratio was the upper bound
of 1.75 by Simchi-Levy [12]. This was improved independently by Xia and Tan [15] and
Boyar et al. [1] to 12/7 ≈ 1.7143 and recently Németh claimed an upper bound of 101/59 ≈
1.7119 [10].
For the lower bound, the early works give examples both for the asymptotic and absolute
ratios. The example for the asymptotic bound gives FF = 1.7·Opt whenever Opt = 10k+1,
thus it shows that the asymptotic upper bound of 1.7 is tight, see [13, 5, 9]. For the absolute
ratio, an example is given with FF = 17 and Opt = 10, which shows that the absolute
approximation ratio cannot be better than 1.7 [5, 9]. (Also an example with FF = 34 and
Opt = 20 is claimed, but it seems that this example has never been published.)
Johnson [8, 9] has also analyzed the First Fit Decreasing algorithm, which behaves like
FirstFit but receives the items on the input sorted from the largest one to the smallest,
and proved that the asymptotic approximation ratio is equal to 11/9. Johnson’s bound had
an additive constant of 4; this was improved several times and finally it was shown that
the additive constant is exactly 2/3 [3]. That is, 11 2
9 Opt + 3 bins are sufficient for First
Fit Decreasing, but this number of bins is actually also necessary for some instances for
infinitely many values of Opt. Thus for First Fit Decreasing, the asymptotic and absolute
approximation ratios are not equal. In fact, the results of [3] give the exact value of the
worst case for every value of Opt and show that the worst case absolute ratio is equal to 4/3,
attained for Opt = 6 when 8 bins may be needed for First Fit Decreasing. In light of this
result, it is rather surprising that for FirstFit the asymptotic and absolute approximation
ratios are equal and no additive term is needed.
We have mentioned only directly relevant previous work. Of course, there is much more
work on bin packing, in particular there exist approximation schemes for this problem, as
well as many other algorithms. We refer to the survey [2] or to the recent excellent book [14].

1.2 Main ideas of our results


Once the asymptotic bound with a small additive constant is shown, a natural approach to
improve absolute upper bounds is to study fixed small values of Opt and to exclude the
possibility of a higher absolute ratio for them. Indeed, solving a few such cases necessarily
improves upper bounds on the absolute ratio—but cannot give a tight result. Of course, this
is still far from trivial: Even for a fixed Opt, each such problem seems to lead to a new and
Gy. Dósa and J. Sgall 3

more extensive case analysis. Instead of joining this race of incremental results, we choose
a different approach to attack arbitrarily large values of Opt directly.
The first important step is a combination of amortization and weight function analysis.
To illustrate our technique, we now present a new short proof of the asymptotic ratio 1.7 for
FirstFit. It uses the same weight function as the traditional analysis of FirstFit. To use
amortization, we split the weight of each item into two parts. Identifying an item a with its
size, the weight of a is its scaled size 56 a plus the bonus v(a) defined as


 0 if a ≤ 61 ,

 3 (a − 1 ) if a ∈ 1 , 1  ,

v(a) = 5 6
 16 13 


 0.1 if a ∈ 3, 2 ,
 1
0.4 if a > 2 .

P
Note that there is a discontinuity only at a = 1/2. For a set of items B, v(B) = a∈B v(a)
P
denotes the total bonus and s(B) = a∈B a the total size.
It is easy to observe that the weight of any bin B, i.e., of any set with s(B) ≤ 1, is at
most 1.7: The scaled size of B is at most 1.2, so we only need to check that v(B) ≤ 0.5.
If B contains no item larger than 1/2, there are at most 5 items with non-zero v(a) and
v(a) ≤ 0.1 for each of them. Otherwise the large item has bonus 0.4; there are at most two
other items with non-zero bonus and it is easy to check that their total bonus is at most 0.1.
Consider an instance I. The previous bound implies that the weight of the whole instance
6
5 s(I) + v(I) is at most 1.7 · Opt.
The key part is to show that, on average, the weight of each FirstFit bin is at least 1.
Lemma 1.1 implies that for almost all bins with two or more items, the first part of its
weight plus the second part of the weight of the following such bin is at least 1.
I Lemma 1.1. Let B, C be two bins in the FirstFit packing such that s(B) ≥ 2/3, C con-
tains at least two items, and B is opened before C. Then 56 s(B) + v(C) ≥ 1.
Proof. Since C is after B in the FirstFit packing, C contains two items c and c0 that do
not fit in B, i.e., c, c0 > 1 − s(B). If s(B) ≥ 5/6 then the lemma follows trivially without
considering v(C). In the remaining case, let x ∈ (0, 61 ] be such that s(C) = 56 − x. Thus
c, c0 > 61 + x and v(c), v(c0 ) > 35 x. We get 65 s(B) + v(c) + v(c0 ) > 65 ( 56 − x) + 35 x + 35 x = 1. J

Consider any FF-bin B with a single item. If s(B) > 1/2, then b(B) = 0.4 and 65 s(B) +
v(B) > 1. Furthermore, at most one FF-bin has s(B) ≤ 1/2, by the definition of FirstFit.
Now consider FF-bins with two or more items. Similarly, at most one of them has size
less than 2/3: If we have one such bin, any item in any later bin is larger than 1/3 and thus
any later bin with two items is larger than 2/3. Now we use Lemma 1.1 for every FirstFit
bin B with two or more items and s(B) ≥ 2/3 (except for the last such bin); the bin C is
chosen as the next bin with the same properties.
Summing the bounds for bins with a single item plus the bounds from Lemma 1.1 for
bins with two or more items (note that each bin is used at most once as B and at most once
as C), we obtain that 56 s(I) + v(I) ≥ FF − 3. The additive constant 3 comes from the fact
that we did not bound the weight of at most three FF-bins: (i) one bin with a single item
and s(B) ≤ 1/2, (ii) one bin with two or more items and s(B) < 2/3, and (iii) the last bin
with two or more items. Combining this with the previous bound on the total weight, we
obtain F F − 3 ≤ 65 s(I) + v(I) ≤ 1.7 · Opt and the asymptotic bound follows.
By itself, this simplified analysis can decrease the additive constant to 0.6 (after exam-
ining the remaining three bins in the FF packing) but cannot remove it completely. To
4 First Fit bin packing: A tight analysis

obtain the tight bound, we need to analyze different types of bins in the FF packing quite
carefully. In the typical worst case, FF packing starts by bins with five or more items of
size around 1/6 or smaller, followed by Opt/2 bins with two items slightly larger than 1/3,
and ends by Opt bins with a single item slightly larger than 1/2. We analyze these three
types of bins separately. To handle various possible situations we slightly modify the weight
function (see Definition 3.5) and the amortization lemma (see Lemma 3.8).
The most delicate part of the proof analyzes the FirstFit bins containing three or four
items—or rather shows that they cannot play an important role in the worst case; here
it is important that the amortization uses the bonus of only two items and thus the bins
with three or four items are “wasteful”. In the final steps of the proof, the parity of the
items of size around 1/3 comes into play: Typically they come in pairs, as described above,
but for odd values of Opt one of them is missing (or is in a FirstFit bin of 3 or more
items), and this allows us to remove the last 0.1 of the additive term. Our analysis sketched
above still leaves a few values of Opt that need to be analyzed separately. However, with
our framework of the general proof, even this is relatively simple compared to the previous
proofs in this area. The upper bound proof is presented in Section 3.
Similar amortization was used in [11] to analyze the Best Fit bin packing algorithm.
There the situation is more complicated, as the notion of the “following bin” is not clear,
in fact a careful choice is needed. Currently we are not able to fully extend our bounds to
Best Fit. The bottleneck seems to be the analysis of the bins with three and four items.
For the lower bounds we modify the instance from [5, 9]. The original construction
is quite intricate. Fortunately—and perhaps also surprisingly—it is sufficient to carefully
analyze the high-level structure of the instance, add to it a few new jobs, and carefully
position them in the input instance. See Section 4 for the details.

2 Notations

Let us fix an instance I with items a1 , . . . an and denote the number of bins in the FirstFit
and optimal solutions by FF and Opt, respectively. We will often identify an item and its
P
size. For a set of items A, let s(A) = a∈A a, i.e., the total size of items in A and also for
P
a set of bins A, let s(A) = A∈A s(A). Furthermore, let S = s(I) be the total size of all
items of I. Obviously S ≤ Opt.
The bins in the FF packing are ordered by the time they are opened (i.e., the first item
is packed into them). We refer to this order when we say that one bin is before or after
another one, or when we speak about the first or last bin.
A bin is called a k-bin or k + -bin, if it contains exactly k items or at least k items,
respectively, for an integer k. An item is called k-item if FF packs it into a k-bin.
We classify the the FF bins into three groups. If a 2+ -bin B satisfies s(B) ≥ 5/6, it is
a big bin; B denotes the set of all big bins and β their number. Any other 2+ -bin C is a
common bin; C denotes the set of all common bins and γ their number. Finally, any 1-bin
D is a dedicated bin; D denotes the set of all dedicated bins and δ their number. The items
in big, common, and dedicated bins are called B-items, C-items, and D-items, respectively.
Finally, let C2-items be the items in common 2-bins. The common and dedicated bins are
typically denoted by C and D, and C-items and D-items by c and d (with indices and other
decorations). We use B for generic bins (typically big or common) and b for items that
may be in big or common bins. If there exists a D-item with size at most 1/2, denote it d0 ;
otherwise d0 is undefined. We shall see in Lemma 3.2(i) that there is at most one such item.
Gy. Dósa and J. Sgall 5

3 The upper bound


3.1 Preliminaries
We state a few basic properties of FF packings. Assumption 3.1 as well as all parts of
Lemma 3.2 are known and easy facts used explicitly or implicitly in previous works on
FirstFit including [12, 15, 1].
I Assumption 3.1. We assume, without loss of generality, that no two items ai and aj are
packed into the same bin both in FF and Opt solutions.
This is w.l.o.g., since any such items may be replaced by a single item of size ai + aj that
arrives at the time of arrival of the first of the original items. It is easy to see that both FF
and Opt solutions are unchanged (except for this replacement).

I Lemma 3.2. In the FF packing the following holds:


(i) The sum of sizes of any two FF-bins is greater than 1. The total size of any k ≥ 2
FF-bins is greater than k/2.
(ii) The D-items are packed into different optimal bins. Thus δ ≤ Opt.
(iii) There is at most one common bin C0 with s(C0 ) ≤ 2/3. Furthermore, if s(C0 ) =
2/3 − 2x for x ≥ 0 then for any other 2+ -bin (i.e., any other common or big bin) B
we have s(B) > 2/3 + x; in addition, if B is opened after C0 , then s(B) > 2/3 + 4x.
(iv) If k ≥ 3, then the total size of k arbitrary 2+ -bins is greater than 32 k.
(v) Suppose that k ≥ 1, we have k + 1 FF-bins B1 , B2 , . . . , Bk , B, in this order, and such
that B is a k + -bin. Then the sum of the sizes of these k + 1 bins is greater than k.

Proof. (i): The first item in any FF-bin does not fit in any previous bin, thus the sum of
their sizes is greater than 1 already at the time when the second bin is opened. For k bins,
order the bins cyclically and sum the inequalities s(Bi ) + s(Bj ) > 1 for pairs of adjacent
bins.
(ii): Follows from (i), as the size of each D-item equals the size of its dedicated FF-bin.
(iii): If B is after C0 , then it contains only items of size larger than 1−s(C0 ) = 1/3+2x;
since it contains two items, s(B) > 2/3 + 4x follows. If B is before C0 , then notice that C0
contains an item of size at most s(C0 )/2 = 1/3 − x; This item was not packed into B, thus
it follows that s(B) > 2/3 + x.
(iv): Follows immediately from (iii).
(v): Let x be the minimum of s(Bi ), i = 1, . . . , k. Then by the FF-rule, any item in bin
Pk
B is larger than 1−x. Since there are at least k items in bin B, we have s(B)+ i=1 s(Bi ) >
k(1 − x) + kx = k. J

Now we assume that the instance violates the absolute ratio 1.7 and derive some easy
consequences that exclude some degenerate cases. The first claim, Opt ≥ 7, follows from [1,
15]; we include its proof for completeness. Note that the values of 1.7 · Opt are multiples of
0.1 and FF is an integer, thus FF > 1.7 · Opt implies FF ≥ 1.7 · Opt + 0.1. Typically we
derive a contradiction with the fact S ≤ Opt stated above.

I Lemma 3.3. If FF > 1.7 · Opt then the following holds:


(i) Opt ≥ 7.
(ii) No common bin C has size s(C) ≤ 1/2.
(iii) The number of dedicated bins is bounded by δ ≥ 3.
(iv) The number of common bins is bounded by γ ≥ Opt/2+1 > 4. If FF ≥ 1.7·Opt+τ /10
for some integer τ ≥ 1 then γ > (Opt + τ )/2.
6 First Fit bin packing: A tight analysis

Proof. (i): If Opt ∈ {3, 4, 5, 6} and FF > 1.7 · Opt then we can verify that both FF ≥
2 · Opt − 1 and FF ≥ Opt + 3. Using Lemma 3.2(ii), the number of 2+ -bins is β + γ =
FF − δ ≥ FF − Opt ≥ 3. Thus we can use Lemma 3.2(v) and obtain a contradiction:
2 1 1 1 1 1
S> (β + γ) + δ = (β + γ) + FF ≥ · 3 + (2 · Opt − 1) = Opt .
3 2 6 2 6 2
If Opt = 2 and FF > 1.7·Opt then FF ≥ 4, and by Lemma 3.2(i) we have S > 4· 21 = Opt,
a contradiction. For Opt = 1, FirstFit is trivially optimal.
(ii): Suppose that s(C0 ) ≤ 1/2 for a contradiction. Lemma 3.2(iii) implies that any big
or common bin C before C0 has s(C) ≥ 3/4. Furthermore, any bin after C0 is a D-bin (as
it can contain only items larger than 1/2) and by Lemma 3.2(i), the total size of C0 and all
D-bins is at least (δ + 1)/2. Thus we can obtain a contradiction by using Opt ≥ 7 from (i)
and δ ≤ Opt from Lemma 3.2(ii) as follows:
3 1 3 1
S > (β + γ − 1) + (δ + 1) = FF − (δ + 1)
4 2 4 4
3 17 1 1 41 7
≥ Opt + − (Opt + 1) = Opt − ≥ Opt .
4 10 10 4 40 40
(iii): Suppose for a contradiction that δ ≤ 2. Then each FF-bin contains at least two
items, except for at most two dedicated FF-bins. Since Opt ≥ 7 from (i), we can apply
Lemma 3.2(iv) for the FF − 2 ≥ 3 of 2+ -bins and Lemma 3.2(i) for the remaining two bins,
and thus we obtain a contradiction as follows:
 
2 2 17 1 17 4
S > (FF − 2) + 1 ≥ Opt + −2 +1= Opt − > Opt .
3 3 10 10 15 15

(iv): To obtain the first bound from the second one, use τ = 1 and the integrality
of Opt. Now suppose for a contradiction that γ ≤ (Opt + τ )/2. If γ ≥ 3, then we use
Lemma 3.2(v) for C, Lemma 3.2(i) for D, and the fact that the remaining bins are big, and
we obtain
5 2 1 5 1 1
S > (FF − γ − δ) + γ + δ = FF − γ − δ
6 3 2 6 6 3
5 17 τ Opt + τ 1
≥ Opt + − − Opt = Opt ,
6 10 10 12 3
a contradiction. If γ ≤ 2 then
5 1 5 1
S > (FF − δ − 2) + (δ + 2) = FF − (δ + 2)
6 2 6 3
5 17 τ 1 2 Opt + 1 2
≥ Opt + − Opt − ≥ Opt + − ≥ Opt ,
6 10 10 3 3 12 3
using (i) in the last step, and we obtain a contradiction as well. J

3.2 The weight function and the main lemma


Now we introduce the main ingredients of our analysis: the modified weight function and
the main lemma that is used for the amortized analysis of the weight of FF bins. As in
the simple proof in the introduction and previous bin packing literature, our ultimate goal
is to prove that each Opt-bin has weight at most 1.7 and each FF-bin has an amortized
(average) weight at least 1.
It is convenient to describe the weight of each item a in two parts. The first part, w(a),
is called the regular (part of the) weight, and it is proportional to the size of a; it is the
Gy. Dósa and J. Sgall 7

same as in the simple proof. The other part, w(a) is called the bonus and it is modified so
that it depends both on the size of a and the type of FF-bin where a is packed. B-items
have no bonus. C-items have bonus equal to 0 for items of size at most 1/6, equal to 0.1
for items of size at least 1/3, and linearly interpolated between these values. D-items have
bonus 0.4 if they have size at least 1/2 and slightly smaller if they have smaller size (this
concerns only the single item d0 ).
Compared to the simple proof and the previous literature, we make several modifications
to the weight function. The first two are mostly a matter of convenience and simplification
of the case analysis in the proof. First, we move the bonus from the items larger than 1/2
to the D-items. Mostly these are actually the same items, except for d0 . As we shall see
later, in the tight cases, each Opt-bin contains a D-item and this change allows a more
uniform analysis. Second, we decrease some of the weights that we do not use in the proof,
namely we do not put any bonus on B-items and decrease the bonus on d0 (this is necessary
to guarantee that its Opt-bin has weight at most 1.7; however, in tight cases d0 is very
close to 1/2). The third change is essential in our last step of the proof where we remove
the remaining additive constant of 0.1. We define a set of at most two exceptional C-items
whose bonus is decreased to 0. Since they are in 3+ -bins in the FF packing, this does not
change the analysis of the FF packing significantly. On the other hand, the exceptional
items are chosen so that, if they exist, then one Opt-bin is guaranteed to have weight at
most 1.6, which is exactly the necessary improvement.
Formally we define the exceptional items as follows:
I Definition 3.4. If Opt ≡ 7 (mod 10) and there exists an Opt-bin E that contains no
C2-item, then fix any such bin E for the rest of the proof. Otherwise E is undefined. If E
contains at most two C-items with size larger than 1/6, denote the set of these items E 0 .
Otherwise (if there are three or more C-items in E or no E exists) put E 0 = ∅.
Let us call E the exceptional bin and the items in E 0 the exceptional items.
Note that there is at most one exceptional item in each FF-bin by Assumption 3.1. Later
we shall show that in a potential counterexample with FF = 1.7 · Opt + 0.1 the bin E exists.
I Definition 3.5. The weight function is defined as follows:
For a B-item b we define w(b) = 0.

0
 if c ≤ 1
or c ∈ E 0 ,
61
and c 6∈ E 0 ,
3 1

For a C-item c we define w(c) = 5
(c − 6
) if c ∈ ,1
6 3
c 6∈ E 0 .
 1
if c ≥
0.1 and
3
(
1
0.4 if d ≥ 2
,
For a D-item d we define w(d) = 3 1 1
0.4 − (
5 2
− d) if d < 2
.

For every item a we define w(a) = 56 a and w(a) = w(a) + w(a).

For a set of items A and a set of bins A, let w(A) and w(A) denote the total weight of all
items in A or A; similarly for w and w. Furthermore, let W = w(I) be the total weight of
all items of the instance I.
In the previous definition, the function w̄ is continuous on the case boundaries. Further-
1 1
more, if we have a set A of k C-items not from E with size  in [ 6 , 3 ], then the definition
3 k
implies that the bonus of A is exactly w(A) = 5 s(A) − 6 . More generally, if A contains
at least k items, each
 of size at least 1/6, and no D-item, then we get an upper bound
w(A) ≤ 53 s(A) − k6 .
8 First Fit bin packing: A tight analysis

First we analyze the weight of the Opt-bins.


I Lemma 3.6. For every optimal bin A its weight w(A) can be bounded as follows:
(i) w(A) ≤ 1.7.
(ii) If E is the exceptional Opt-bin then w(E) ≤ 1.6.
(iii) If A contains no D-item, then w(A) ≤ 1.5.
Proof. In all cases w(A) ≤ 1.2, thus it remains to bound w(A). We distinguish three cases:
Case 1: A contains no D-item. Either it contains at least 4 items with non-zero bonus,
in which case their total bonus is at most w(A) ≤ 35 (s(A) − 64 ) ≤ 35 · 26 = 0.2. Or else it
contains at most 3 items with non-zero bonus and w(A) ≤ 0.3. In both subcases (iii) follows
and thus (ii) also holds if E = A.
Case 2: A contains a D-item larger than 1/2. The bonus of the D-item is 0.4. If E = A
then A has no other item with non-zero bonus and both (i) and (ii) hold. Otherwise, in
addition to the D-item, A contains at most 2 items larger than 1/6 and no other items have
non-zero bonus. If there is at most one such item, its bonus is at most 0.1 and (i) follows.
If there are two such items, let their total size be y; note that y < 1/2. The bonus of A is
at most w(A) ≤ 0.4 + 53 (y − 26 ) < 0.4 + 35 · 16 = 0.5.
Case 3: A contains d0 . Let the size of d0 be 12 − x for x ≥ 0. We have w(d0 ) = 0.4 − 53 x.
We distinguish two subcases.
Case 3.1: A contains at most two items other than d0 and larger than 1/6. Then their
total size is at most 12 + x. If E = A then they have no bonus and both (i) and (ii) hold.
Otherwise their bonus is at most 0.1 + 35 x and (i) holds.
Case 3.2: If A contains at least three items other than d0 and larger than 1/6. Then
their total bonus is at most 53 x, thus w(A) ≤ 0.4 and both (i) and (ii) hold. (This subcase
may also happen if E = A, but there is no need to distinguish this in the proof.) J

Next we analyze the weight of FF-bins. The case of big and dedicated bins is easy:
I Lemma 3.7. (i) The total weight of the big bins is w(B) ≥ β.
(ii) The total weight of the dedicated bins is w(D) > δ.
Proof. (i): For every big bin B, w(B) = w(B) = 65 s(B) ≥ 56 · 65 = 1.
(ii): If d0 is undefined then for every dedicated bin D, w(D) = 56 s(D)+0.4 > 65 · 12 +0.4 =
1 and the claim follows. If d0 exists and has size 12 − x for x ≥ 0, then every other D-item
has size strictly larger than 12 + x. We also have δ ≥ 3 by Lemma 3.3(iii). Thus
       
6 1 6 1 3 6 6 3
w(D) > (δ−1) + x + 0.4 + − x +0.4− x = δ+ (δ − 1) − − x ≥ δ.
5 2 5 2 5 5 5 5
J

Now we focus on the common FF-bins. The next lemma gives the key insight for the
amortized analysis. It shows that for most common bins, the regular weight of the bin plus
the bonus of the next common bin is at least 1. A similar method was used for the analysis
of BestFit in [11]. For the rest of the upper bound section, number the common bins as
C1 , . . . , Cγ , in the order of their opening. The bins C2 , . . . , Cγ−1 are called inner common
bins. Note that there are some inner common bins, as γ ≥ 5 by Lemma 3.3(iv).
I Lemma 3.8. Let i = 2, . . . , γ be such that s(Ci−1 ) ≥ 2/3. Then there exist two items
c, c0 ∈ Ci \ E 0 and for any such items
w(Ci−1 ) + w(c) + w(c0 ) ≥ 1 .
Thus we have w(Ci−1 ) + w(Ci ) ≥ 1.
Gy. Dósa and J. Sgall 9

Proof. If Ci is a 2-bin, then it contains no exceptional item. If Ci is a 3+ -bin, then it


contains at most one exceptional item by Assumption 3.1. In both cases c and c0 exist.
Since Ci−1 is common, the size of this bin is smaller than 5/6 and it is at least 2/3 by the
assumption of the lemma. Let x ∈ (0, 16 ] be such that s(Ci−1 ) = 65 − x. Thus c, c0 > 16 + x
and w(c), w(c0 ) > 35 x. We get w(Ci−1 ) + w(c) + w(c0 ) > 65 ( 65 − x) + 35 x + 35 x = 1. J

3.3 The last common bin is large


The outline of the rest of the proof is this: We prove that the common FF-bins have
total weight at least γ − 0.2. This part of analysis is considerably harder in case when
the last common bin is smaller than 2/3, and we omit that part in this conference version.
Then, since the total weight of the dedicated bins is strictly greater than δ, this implies
W > FF − 0.2. Together with W ≤ 1.7 · Opt now FF ≤ 1.7 · Opt + 0.1 follows. However,
FF = 1.7·Opt+0.1 can hold only if Opt ≡ 7 (mod 10). Then we show that the exceptional
bin is defined, thus W ≤ 1.7 · Opt − 0.1 and we save the last 0.1.
I Lemma 3.9. If s(Cγ ) ≥ 2/3, then the total weight of the common bins is w(C) ≥ γ − 0.2.
Proof. First consider the case when every common bin has size at least 2/3. We apply
Lemma 3.8 for every i = 2, . . . , γ. The regular weight of the last bin is at least w(Cγ ) ≥
6 2
5 · 3 = 0.8. Summing all of these inequalities we obtain
γ
X γ
X
w(C) = w(Ci ) ≥ w(Cγ ) + (w(Ci−1 ) + w(Ci )) ≥ 0.8 + (γ − 1) = γ − 0.2.
i=1 i=2

Now suppose that s(Ck ) = 2/3 − x for x > 0 and k < γ. Using Lemma 3.2(iii), each
Cj , j > k, contains (exactly) two items larger than 1/3 + x. Thus w(Cj ) = 0.2 and also
Pγ 2
s(Cj ) > 2/3 + 2x which implies
Pγ i=k s(Ci ) > (γ + 1 − k) 3 . Combining these we have
w(Ck ) + j=k+1 w(Cj ) ≥ (γ + 1 − k) − 0.2. Adding the last inequality and the inequalities
w(Ci−1 ) + w(Ci ) ≥ 1 from Lemma 3.8 for i = 2, . . . , k, the lemma follows. J

I Lemma 3.10. Suppose w(C) ≥ γ − 0.2. Then


(i) FF ≤ 1.7 · Opt + 0.1, and
(ii) if the exceptional bin E is defined, then FF ≤ 1.7 · Opt.
Proof. By Lemma 3.7 and the assumption we have W > β + (γ − 0.2) + δ = FF − 0.2.
By Lemma 3.6(i) we have W ≤ 1.7 · Opt. Thus FF − 0.2 < W ≤ 1.7 · Opt. Since FF
and Opt are integers, (i) follows. If E is defined then by Lemma 3.6(i) and (ii) we have
W ≤ 1.7 · Opt − 0.1. Thus FF − 0.2 < W ≤ 1.7 · Opt − 0.1 and (ii) follows. J

To decrease the bound by the last one tenth, we only need to show that the exceptional
Opt-bin is defined. First yet another auxiliary lemma:
I Lemma 3.11. Suppose that every Opt-bin contains a D-item. Then no Opt bin contains
two 2-items c1 and c2 .
Proof. For contradiction, assume we have such c1 and c2 and number them so that the
FF-bin of c1 is before the FF-bin of c2 . (Note that by Assumption 3.1, c1 and c2 are not in
the same FF-bin.) Let c3 be the other item in the FF-bin of c1 . Since c2 was not packed
into this bin, which contains only c1 and c3 , we have c1 + c2 + c3 > 1. This implies that c3
cannot be in the Opt-bin of c1 and c2 . Every Opt-bin contains a D-item by the assumption;
let d1 be the D-item in the Opt-bin of c1 and c2 and d3 the D-item in the Opt-bin of c3 .
By Lemma 3.2(i), d1 + d3 > 1 and thus c1 + c2 + c3 + d1 + d3 > 2. As all these items are in
two Opt-bins, this is a contradiction. J
10 First Fit bin packing: A tight analysis

I Proposition 3.12. Suppose that s(C) ≥ γ − 0.2. Then FF ≤ 1.7 · Opt.

Proof. By Lemma 3.10(i) we have FF ≤ 1.7 · Opt + 0.1. If Opt 6≡ 7 (mod 10) then by
checking all the other residue classes we can verify that 1.7 · Opt + 0.1 is non-integral. Thus
FF ≤ 1.7 · Opt + 0.1 implies FF ≤ 1.7 · Opt and we are done.
It remains to handle the case when Opt ≡ 7 (mod 10) and FF = 1.7 · Opt + 0.1.
First we claim that every Opt-bin contains a D-item and thus δ = Opt. If some
Opt-bin does not contain a D-item, its weight is at most 1.5 by Lemma 3.6(iii). Thus
W ≤ 1.7 · Opt − 0.2. Since FF > W − 0.2, we obtain FF ≤ 1.7 · Opt, a contradiction.
Lemma 3.11 now implies that no Opt-bin contains two C2-items. Note that Opt is odd,
as Opt ≡ 7 (mod 10). On the other hand, the number of C2-items is even (in any FF-bin
there are either zero or two C2-items). Thus some Opt-bin contains no C2-item. This bin
satisfies all the conditions of Definition 3.4 of the exceptional bin. Thus E is defined and by
Lemma 3.10(ii) the proposition follows. J

Together with the omitted case of s(C) < γ − 0.2, we obtain our main result.
I Theorem 3.13. For any instance of bin packing, FF ≤ 1.7 · Opt.

4 Lower bounds
To prove the lower bounds, we use the classical lower bound construction from [5, 9]. We
have an input instance L with three regions of items. In the first region there are items of
size close to 1/6, in the second region come items close to 1/3, and in the third region there
are items with the equal size 1/2 + δ, for a small δ > 0. We will not modify the items in
this list, only add some new items before or after L, and also in between the three regions of
L. Thus we need to review the properties of L with the focus on the resulting FF packing
in each region; the details within each region are somewhat delicate but fortunately we can
use that part as a black box. We formulate the properties of L in the next lemma, before
giving our lower bound in Theorem 4.2.
I Lemma 4.1 ([5, 9]). For every k and a sufficiently small δ > 0 there exists an instance
L of 30k items such that Opt = 10k + 1 and FF = 17k for L. Furthermore the following
holds for ε = 46 · 18k−1 δ = O(δ):
(i) The first 10k items of L have size at least 1/6 −  and are packed into the first 2k
FF-bins; no further item is packed later into these bins. Each of these 2k FF-bins is
a big 5-bin, and has size at least 5/6 + δ;
(ii) The next 10k items of L have size at least 1/3 −  and are packed into the next 5k
FF-bins; no further item is packed later into these bins. Each of these FF-bins is a
common 2-bin and has size at least 2/3 + 2δ.
(iii) The last 10k items of L have size exactly 1/2 + δ are packed into the next 10k FF-bins.
Each of these FF-bins is a dedicated bin and has size exactly 1/2 + δ.
(iv) Moreover, all items of L, except three items, fit into 10k − 1 bins, each of size 1 − O(δ).
The three remaining items have sizes 1/3 + ε, 1/6 − 3δ, and 1/2 + δ.
I Theorem 4.2. For all integers k ≥ 1 and 0 ≤ i ≤ 9, there exists an instance I such that
Opt = 10k + i and the lower bound in the top row of the next table holds. The bottom row
of the table gives the upper bounds from Theorem 3.13 for a comparison.
i= 0 1 2 3 4 5 6 7 8 9
FF ≥ 17k + −1 1 3 4 6 8 10 11 13 15
FF ≤ b17k + 1.7ic = 17k + 0 1 3 5 6 8 10 11 13 15
Gy. Dósa and J. Sgall 11

Furthermore, for i = 1, . . . , 9 there exist instances with Opt = i and FF = b1.7 · ic.

Proof. We show how the instance L from Lemma 4.1 can be modified to prove the theorem.
We only show in each case that Opt ≤ 10k + i. However, equality follows as the lower
bound on FF is always larger than the upper bound on FF for Opt − 1 (see the table in
the theorem).
For i = 0, we create I by deleting one item of size 1/2 + δ from L. Then FF = 17k − 1.
Optimum uses 10k −1 bins as in Lemma 4.1(iv). Only two items of sizes 1/3+ε and 1/6−3δ
remain and they are packed into the last bin, thus obtaining Opt ≤ 10k. For k = 1, 2, better
examples with FF = 17k and Opt = 10k exist [5, 9], no such examples are known for k > 2.
For i ≥ 1 and k ≥ 1, we modify L by inserting new items. First we describe an optimal
packing with 10k +i optimal bins together with the new items. The first 10k −1 bins contain
the same items as in Lemma 4.1(iv). The (10k)th bin contains two of the remaining items
from L, namely 1/2 + δ and 1/6 − 3δ and a new item c0 = 1/3 + 2δ. The (10k + 1)st bin
contains the last remaining item from L, namely 1/3 + ε, and two new items d0 = 1/2 + δ/4
and b0 = 1/6 − δ/4 − ε. If i > 1, then the (10k + j)th bin of the optimal packing, j = 2, . . . , i,
contains three new items dj = 1/2 + δ/4, cj = 1/3 + δ/4 and bj = 1/6 − δ/2.
The items bj , cj and dj are called B-items, C-items and D-items, respectively; they are
typically packed into big, common and dedicated bins of the optimum. We have exactly i
new items of each type.
Now we describe the new instance I, together with the FF packing. The instance I
consists of L and some of the new items. In some cases we do not need all new items. Then
we remove the remaining new items; this can obviously only decrease the optimum, thus
Opt ≤ 10k + i.
All the new D-items are put at the end of L. Lemma 4.1 implies that they do not fit into
any previous FF bin and thus FF puts each of them into a new dedicated bin. Furthermore,
2bi/2c smallest new C-items are inserted in between the C-items and D-items in L. Since
there is an even number of these new C-items and they do not fit into any of the previous
bins, in FF packing they are put into bi/2c C-bins. Note that no D-item, old or new, does
not fit into these new bins.
At this point we have created b3i/2c new bins in the FF packing. Comparing this value
with the table in the theorem, we have sufficiently many FF-bins for i = 1, 2, 3, 4, while for
i = 5, 6, 7, 8 we need one additional FF-bin and for i = 9 two additional FF-bins. To create
these bins, we have available all i new B-items and for odd i also one C-item, namely c0 ,
which is the largest one. We distinguish a few cases.
Case i = 1, 2, 3, 4: We discard all the remaining new items.
Case i = 5: We put one new C-item and four new B-items in front of L. They fit into a
bin, thus FF packs them into the first bin and no other item fits in it. More precisely, the
size of this bin is 1 − O(δ), thus for a sufficiently small δ, no other item fits into it, as all
the items have size at least 1/6 − O(δ). The remaining B-item is discarded.
Case i = 6, 7, 8: We put 6 new B-items at the beginning of the list. They are packed in
the first FF-bin and no other item will fit into it. The remaining items are discarded for
i = 7, 8.
Case i = 9: We put 6 new B-items including b0 at the beginning of the list. Again, they
are packed in the first FF-bin and no other item will fit into it. We also insert c0 = 1/3 + 2δ,
and the three remaining new B-items of size 1/6 − δ/2 between the B-items and C-items
of L. None of these items fits in the previous bins, as those have size at least 5/6 + δ
by Lemma 4.1(i). Thus they are packed into one FF-bin of size about 5/6. Since all the
following items have size at least 1/3 − O(δ), for a sufficiently small δ no further item fits
12 First Fit bin packing: A tight analysis

into this bin. Thus this will be the second additional bin.
This completes the proof for Opt ≥ 10. For Opt ≤ 9, let 1 ≤ i ≤ 9. Then I contains
i items of each of the three sizes 1/6 − 2δ, 1/3 + δ, and 1/2 + δ. The items are ordered by
non-decreasing size. It is easy to verify that for all i = 1, . . . , 9, we have FF = b1.7 · ic and
also Opt = i, as we can pack into each bin three items of different sizes. J

Acknowledgements We are grateful to anonymous referees for numerous helpful com-


ments, in particular for correcting some historical references. G. Dósa was financially sup-
ported by the Hungarian State and the European Union under the TAMOP-4.2.2.A-11/1/
KONV-2012-0072. J. Sgall was partially supported by the Center of Excellence – Inst. for
Theor. Comp. Sci., Prague (project P202/12/G061 of GA ČR) and grant IAA100190902 of
GA AV ČR; he is also grateful to Miloš Vyleťal and YMCA Setkání for the environment at
Dům Setkání.

References
1 J. Boyar, G. Dósa, and L. Epstein. On the absolute approximation ratio for First Fit and
related results. Discrete Appl. Math., 160:1914–1923, 2012.
2 E. G. Coffman, M. R. Garey, and D. S. Johnson. Approximation algorithms for bin packing:
A survey. In D. Hochbaum, editor, Approximation algorithms. PWS Publishing Company,
1997.
3 G. Dósa. The tight bound of First Fit Decreasing bin-packing algorithm is F F D(I) ≤
11/9 OP T (I) + 6/9. In Proc. 1st International Symp. on Combinatorics, Algorithms,
Probabilistic and Experimental Methodologies (ESCAPE), volume 4614 of Lecture Notes
in Comput. Sci., pages 1–11. Springer, 2007.
4 M. R. Garey, R. L. Graham, D. S. Johnson, and A. C.-C. Yao. Resource constrained
scheduling as generalized bin packing. J. Combin. Theory Ser. A, 21:257–298, 1976.
5 M. R. Garey, R. L. Graham, and J. D. Ullman. Worst-case analysis of memory allocation
algorithms. In Proc. 4th Symp. Theory of Computing (STOC), pages 143–150. ACM, 1973.
6 R. L. Graham. Bounds for certain multiprocessing anomalies. Bell System Technical J.,
45:1563–1581, 1966.
7 R. L. Graham. Bounds on multiprocessing timing anomalies. SIAM J. Appl. Math., 17:263–
269, 1969.
8 D. S. Johnson. Near-optimal bin packing algorithms. PhD thesis, MIT, Cambridge, MA,
1973.
9 D. S. Johnson, A. Demers, J. D. Ullman, M. R. Garey, and R. L. Graham. Worst-case
performance bounds for simple one-dimensional packing algorithms. SIAM J. Comput.,
3:256–278, 1974.
10 Z. Németh. A first fit algoritmus abszolút hibájáról (in Hungarian). Eötvös Loránd Univ.,
Budapest, Hungary, 2011.
11 J. Sgall. A new analysis of Best Fit bin packing. In Proc. of 6th Int. Conference FUN with
Algorithms, volume 7288 of Lecture Notes in Comput. Sci., pages 315–321. Springer, 2012.
12 D. Simchi-Levi. New worst case results for the bin-packing problem. Naval Res. Logist.,
41:579–585, 1994.
13 J. D. Ullman. The performance of a memory allocation algorithm. Technical Report 100,
Princeton Univ., Princeton, NJ, 1971.
14 D. P. Williamson and D. B. Shmoys. The Design of Approximation Algorithms. Cambridge
University Press, 2011.
15 B. Xia and Z. Tan. Tighter bounds of the First Fit algorithm for the bin-packing problem.
Discrete Appl. Math., 158:1668–1675, 2010.
Gy. Dósa and J. Sgall 13

A The last common bin is small


Suppose that the size of the last common bin is smaller than 2/3. For the rest of the upper
bound proof, fix x > 0 so that s(Cγ ) = 23 − 2x. Lemma 3.3(ii) implies s(Cγ ) > 1/2 and thus
x < 1/12.
Since now the regular weight of the last bin is smaller than 0.8, we need to compensate
for this. This is indeed possible due to the fact that now Lemma 3.2(iii) implies that the
inner common bins are larger than 2/3 + x and this allows us to improve the bounds of
Lemma 3.8 by an amount proportional to x.
Note that Ci , i > 1, cannot be a 5+ -bin: Since s(C1 ) < 5/6, all items in Ci have
size larger than 1/6 and five of them would add up to more than 5/6, contradicting the
assumption that Ci is a common bin.

I Lemma 1.1. For i = 2, . . . , γ − 1 we have the following bounds:


If Ci is a 2-bin or a 3-bin, then w(Ci−1 ) + w(Ci ) ≥ 1 + 53 x.
3
If Ci is a 4-bin, then w(Ci−1 ) + w(Ci ) ≥ 1 + 10 x.

Proof. Let y be such that s(Ci−1 ) = 65 − y. Since Ci−1 is a common bin, y > 0. On the
other hand, by Lemma 3.2(iii) the size of Ci−1 is greater than 23 + x and thus also y < 61 − x.
Note that w(Ci−1 ) = 56 ( 56 − y) = 1 − 65 y and that every item c ∈ Ci satisfies c > 61 + y.
Case 1: Ci is a 2-bin. Then Ci contains at least one item c of size larger than 1/3 as
otherwise s(Ci−1 ) ≤ 2/3 contradicting Lemma 3.2(iii) together with the assumption that
S(Cγ ) < 2/3. The other item c0 in Ci satisfies c0 > 61 + y. Thus
 
6 3 3 3 1 3
w(Ci−1 ) + w(Ci ) ≥ 1 − y + y + 0.1 = 1.1 − y ≥ 1.1 − − x = 1 + x.
5 5 5 5 6 5

Case 2: Ci is a 3-bin. Suppose that Ci contains an item c > 1/3. Then the remaining
two items in Ci have size at least 16 + y and we obtain

6 3 3
w(Ci−1 ) + w(Ci ) ≥ 1 − y + (y + y) + 0.1 = 1.1 ≥ 1 + x
5 5 5
since x < 1/12. Otherwise all three items in Ci have size at most 1/3. We claim that one
of them has size at least 61 + x, as otherwise, using x < 1/12, we have s(Ci ) < 3( 61 + x) =
1 2
2 + 3x < 3 + x, contradicting Lemma 3.2(iii). Now we get

6 3 3
w(Ci−1 ) + w(Ci ) ≥ 1 − y + (y + y + x) = 1 + x .
5 5 5
Case 3: Suppose Ci is a 4-bin. All items in Ci are small, as otherwise s(Ci ) ≥ 13 +
3 · 61 = 56 , contradicting the assumption that Ci is a common bin. As s(Ci ) > 32 + x by
Lemma 3.2(iii), there must be two items with total size at least 13 + x2 and their total bonus
is at least 35 · x2 . Thus

6 3 x 3
w(Ci−1 ) + w(Ci ) ≥ 1 − y + y+y+ = 1 + x.
5 5 2 10
J

Let γk denote the number of k-bins that do not contain an exceptional item among the
inner common bins, i.e., among C2 , . . . , Cγ−1 . Let α = 2(γ2 + γ3 ) + γ4 .

I Lemma 1.2. Suppose that s(Cγ ) < 2/3. The following holds:
14 First Fit bin packing: A tight analysis

(i) If α ≥ 8 then the total weight of the common bins is at least w(C) ≥ γ − 0.2.
(ii) If α ≥ 4 then the total weight of the common bins is at least w(C) ≥ γ − 0.3.

Proof. We apply Lemma 1.1 for any i = 1, . . . , γ − 2 such that Ci+1 does not contain
an exceptional item. Otherwise, i.e., if Ci+1 contains an exceptional item and also for
i = γ − 1 we apply Lemma 3.8. Summing all the resulting bounds on w(Ci ) + w(Ci+1 ) and
w(Cγ ) = 0.8 − 12
5 x we obtain that the total weight of the common bins is

3 3 12 (3α − 24)x
s(C) ≥ γ − 1 + (γ2 + γ3 ) x + γ4 x + 0.8 − x = γ − 0.2 + .
5 10 5 10
For α ≥ 8 we have 3α ≥ 24 and (i) follows.
For α ≥ 4 we use x < 1/12, which gives (3α − 24)x ≥ −12x ≥ −1 and (ii) follows. J

I Theorem 1.3 (Theorem 3.13). For any instance of bin packing, FF ≤ 1.7 · Opt.

Proof. If s(Cγ ) ≥ 2/3 then the theorem follows by Proposition 3.12. Thus assume s(Cγ ) < 32
and FF ≥ 1.7 · Opt + 0.1. We distinguish several cases and in each we derive a contradiction
or prove the theorem statement FF ≤ 1.7 · Opt, leading to an indirect proof as well.
Case 1: Opt ≥ 21. By Lemma 3.3(iv) we have γ ≥ 12. Thus there are at least 10 inner
common bins and at most 2 of them have an exceptional item. Thus α ≥ γ2 + γ3 + γ4 ≥ 8
and w(C) ≥ γ − 0.2 by Lemma 1.2(i). Now Lemma 1.2(i) and Proposition 3.12 imply the
theorem.
Case 2: Opt ≥ 8, Opt 6≡ 4 (mod 10), and Opt 6≡ 7 (mod 10). Then FF ≥ 1.7 ·
Opt + 0.3, thus we can use Lemma 3.3(iv) with τ = 3 and we obtain γ ≥ 6. There are
no exceptional items, since Opt 6≡ 7 (mod 10), and thus α ≥ 4. Lemma 1.2(ii) implies
W > β + (γ − 0.3) + δ = FF − 0.3 ≥ 1.7 · Opt, a contradiction.
Case 3: Opt = 14. Then FF = 24. Lemma 3.3(iv) with τ = 2 implies γ ≥ 9. There
are no exceptional items, thus γ2 + γ3 + γ4 ≥ 7. If γ2 + γ3 ≥ 1 then α ≥ 8 and the theorem
follows by Lemma 1.2(i). In the remaining case γ4 ≥ 7, thus there are seven 4-bins among
the common bins. Using Lemma 3.2(v) for five of these common 4-bins, Lemma 3.2(iv) for
some four of the remaining γ − 5 ≥ 4 common bins and Lemma 3.2(i) for the remaining
24 − 9 = 15 bins we get
2 1
S >4+4· + 15 · > 14 = Opt ,
3 2
a contradiction.
Case 4: Opt = 17. Then FF = 29. Lemma 3.3(iv) gives γ ≥ 10. Thus γ2 + γ3 + γ4 ≥ 6.
If γ4 ≤ 4 then α ≥ 2(6 − γ4 ) + γ4 ≥ 8 and the theorem follows by Lemma 1.2(i). Otherwise
there are five 4-bins among the common bins. Using Lemma 3.2(v) for these five 4-bins,
Lemma 3.2(iv) for some five of the remaining γ − 5 ≥ 5 common bins and Lemma 3.2(i) for
the remaining 29 − 10 = 19 bins we get
2 1
S >4+5· + 19 · > 17 = Opt ,
3 2
a contradiction.
Case 5: Opt = 7. Then FF = 12.
First we claim that δ = 7. Otherwise S > 6 · 23 + 6 · 21 = 7, a contradiction.
It follows that there are at most three 2-bins in the FF packing, since by Lemma 3.11
no Opt-bin can contain two 2-items.
Gy. Dósa and J. Sgall 15

Next we claim that no two FF-bins have total size greater than or equal to 3/2. Otherwise
there remain at least three 2+ -bins in the FF packing and S > 32 + 3 · 32 + 7 · 21 = 7, a
contradiction.
Since there are five 2+ -bins and at most three 2-bins, there have to be at least two 3+ -
bins. Let C be the last 3+ -bin and B some bin before it. Then C contains three items of
size larger than 1 − s(B) and s(B) + s(C) ≥ s(B) + 3(1 − s(B)) = 3 − 2 · s(B). Since no two
bins have total size 3/2 or more, this implies s(B) ≥ 3/4. Furthermore, this implies that
there is a single bin before C, as otherwise there would again be two bins with total size at
least 3/2. I.e., B is the first bin, C is the second bin and there are exactly three 2-bins.
C has at least three items and they are packed into different Opt-bins by Assumption 3.1.
We claim that one of these three bins contains both a 2-item c and a D-item d with size
d > 1/2: Each Opt-bin contains a D-item and there is at most one D item of size at most
1/2; furthermore, there is at most one Opt-bin not containing a 2-item, as there are six
2-items in the three 2-bins. Thus the condition excludes at most two Opt-bins. Fix c0 to
be an item from C packed with such a c and d in the same Opt-bin. Note that c and d are
in later FF-bins than C, as B and C are the first bins and they are 3+ -bins.
We have c0 + c < 1/2 as they are packed with d > 1/2 in an Opt-bin. On the other hand
we claim that s(C) − c0 < 1/2: otherwise we note that c0 > 1 − s(B), as c0 was not packed
in B and thus s(B) + s(C) > s(B) + c0 + 1/2 > s(B) + (1 − s(B)) + 1/2 = 3/2, contradicting
the first claim in the proof. Thus s(C) + c = (s(C) − c0 ) + (c0 + c) < 1/2 + 1/2 = 1 and FF
should have packed c into C, which is the final contradiction. J

We note that the last case of Opt = 7 is also covered in the manuscript [10], we have
included it for completeness.

You might also like