• Nem Talált Eredményt

4.3 Tight lower bound

5.1.3 The tight upper bound

Now we determine the tight upper bound. Recall thatOP T ≥ 4, as the smaller cases are already treated.

Case 1, OP T = k ·d + 1. If k = 0, then OP T = 1, a contradiction. Thus k ≥ 1. We claimF Fd ≤ OP T +k = k(d+ 1) + 1. Suppose for the sake of contradiction, that there exists a list L, for which F Fd ≥ k(d+ 1) + 2. We apply Corollary 5.0.1 and Claim 5.0.2 for the first k(d+ 1)≥d+ 1bins. The total level of these bins is bigger thank(d+ 1)·d+1d =kd. Moreover the total level of the last two bins is bigger than1, by Claim 5.0.3. Thus the total size of the items P > kd+ 1 =OP T, a contradiction.

Case 2,OP T =k·d+r, where2≤r≤d, andk ≥1. We claim thatF Fd≤OP T+k+ 1 = (k·d+r) +k+ 1 =k(d+ 1) +r+ 1. Suppose for contradiction, that there exists a list for which F Fd≥k(d+ 1) +r+ 2. We apply Corollary 5.0.1 for the firstk(d+ 1) +r≥d+ 1bins, all these bins ared+-bins by Claim 5.0.2. Thus their total level is bigger than(k(d+1)+r)·d+1d =kd+d+1dr . Moreover the total level of the last two bins is bigger than1, by Claim 5.0.3. Thus the total size of the items is

P > kd+ dr

d+ 1 + 1 =kd+dr+d+ 1

d+ 1 > kd+ dr+r

d+ 1 =kd+r=OP T, a contradiction.

Case 3,OP T =k·d+r, where2≤ r≤ d, andk = 0. In other words,2 ≤r =OP T ≤d.

We claim thatF Fd ≤r+ 1 =OP T + 1. Suppose to the contrary, that there exists a list for which F Fd ≥ OP T + 2. We complete the input withd·(d−OP T + 1)items with equally1/dsizes, and these items will be put to the end of the list L. The new list is denoted byL0. We denote the new values of the optimum and theF F packing by OP T0 andF Fd0, respectively. Naturally, OP T0 =OP T + (d−OP T + 1) =d+ 1.

Now let us consider the F Fd0 packing. Let the last bin in theF Fd packing be denoted byB. Since there is an item inB (with size at most1/d), it follows that the level of any previous bin is bigger than1−1/d. Now, when the new items come, none of them fits into any previously opened bin, exceptB. Since the new items completely fill(d−OP T + 1)bins, andBis not empty, they do not fit intoB, and at most(d−OP T)newly opened bins.

Thus exactly(d−OP T+1)new bins will be opened, and thusF Fd0 =F Fd+(d−OP T+1)≥ OP T + 2 + (d−OP T + 1) =d+ 3. This contradicts to what we have proved in Case 1.

Chapter 6

The tight asymptotic bound of First Fit with cardinality constraints

The results of this chapter are from [26]. All results of [26] are contained (together with further results) in [27]. The contribution of the author of this dissertation regarding the results of this chapter is approximately 75%.

In bin packing with cardinality constraints (BPCC), there is a global parameter k ≥ 2, which is an upper bound (called the cardinality constraint) on the number of items that can be packed into each bin, additionally to the standard constraint on the total size of items packed into a bin.

In this chapter the items are denoted by 1,2, . . . , n, where item i has a size si > 0 associated with it. In many applications of bin packing, the assumption that a bin can contain any number of items is not realistic, and bounding the number of items as well as their total size provides a more accurate modeling of the problem. BPCC was studied both in the offline and online environments [58, 59, 57, 13, 1, 38, 40, 42].

Here we study the algorithm First Fit (F F). This algorithm processes the input items one by one. Each item is packed into the a bin of the smallest index where it can be packed. An itemican be packed into binB if the packing is possible both with respect to the total size of items already packed into that bin and with respect to the number of packed items, i.e., the bin contains items of total size at most1−si and it contains at mostk−1items. We present a complete analysis of its asymptotic approximation ratio for all values ofk ≥ 3. Prior to this work, only the tight bound fork = 2was known. After almost forty years after the problem BPCC and the natural algorithm First Fit for it were introduced, its tight asymptotic competitive ratio is for all values ofkis finally found.

Approximation algorithms were designed for the offline version of BPCC (which is strongly NP-hard fork≥3) [58, 57, 13, 40], and the problem has an asymptotic fully polynomial approxi-mation scheme (AFPTAS) [13, 40]. Using elementary bounds, it was shown by Krause, Shen, and Schwetman [58] thatF F has an asymptotic approximation ratio of at most2.7−2.4k . Fork → ∞, it can be deduced that the asymptotic approximation ratio is2.7also since this is a special case of vector bin packing (with two dimensions) [44]. The case k = 2is solvable using matching tech-niques in the offline scenario, but it is not completely resolved in the online scenario, and the best possible asymptotic approximation ratio is in[1.42764,1.44721][61, 1, 42]. For largerk, there is an approximation algorithm of approximation ratio at most 2[1], and improved algorithms (that

have smaller asymptotic approximation ratios thanmin{2,2.7− 2.4k }) are known fork = 3,4,5,6 [38].

For comparison we note that tight asymptotic approximation ratio of the cardinality constrained variant of the Harmonic algorithm [60] (that partitions items intok classes and packs each class independently, such that the classes areI` = (`+11 ,1`]for1 ≤ ` ≤ k−1andIk = (0,1k], and for any1≤`≤k, each bin ofI`, possibly except for the last such bin, receives exactly`items) is the same as forF F for2≤k≤4, and slightly smaller for anyk≥5, see [38]. Known lower bounds on the competitive ratio do not exceed those known for standard bin packing [86, 77, 2, 42]. A related problem is calledclass constrained bin packing[39, 71, 72, 84]. In that problem each item has a color, and a bin cannot contain items of more thankcolors (for a fixed parameterk). BPCC is the special case of that problem where all items have distinct colors.

Value of k FF prev. UB for FF best known UB 2 1.5 [58] 1.5 [58] 1.44721 [1]

3 1.8333 1.9 [58] 1.75 [38]

4 2 2.1 [58] 1.86842 [38]

5 2.1333 2.22 [58] 1.93719 [38]

6 2.2222 2.3 [58] 1.99306 [38]

7 2.2857 2.35714 [58] 2 [1]

8 2.3333 2.4 [58] 2 [1]

9 2.3704 2.43333 [58] 2 [1]

10 2.4 2.46 [58] 2 [1]

11 2.4273 2.481818 [58] 2 [1]

12 2.45 2.5 [58] 2 [1]

Table 6.1: Bounds for2 ≤k ≤12. The second column contains the tight asymptotic approxima-tion ratio of FF, the third column contains the previous upper bound on FF’s asymptotic approxi-mation ratio, and the last column contains the asymptotic approxiapproxi-mation ratio of the current best algorithm. Entries without a citation are those proved here.

Below we provide a complete analysis of the famous and natural algorithm F F with respect to the asymptotic approximation ratio. We find that the asymptotic approximation ratio ofF F is 2.5−k2 fork = 3,4, 8(k−1)3k = 833k8 for4≤k ≤10, and2.7−k3 fork ≥10(recall that the values k = 4andk = 10are included in two cases each). Interestingly, introducing cardinality constraints (with sufficiently large values of k) results in an increase of many approximation ratios by 1[58, 55, 60, 38]. In particular, the asymptotic approximation ratio of the cardinality constrainedF F has an approximation ratio that is larger by1than its approximation ratios for standard bin packing.

(Harmonic has a slightly smaller approximation ratio of2.69103.) Moreover, it can be verified that the worst-case examples of Harmonic are valid (but not tight) forF F.

WhileF F is a frequently studied natural algorithm, its exact asymptotic approximation ratio as a function of k was unknown. While it is not difficult to show an upper bound of2.7for all values ofk[58, 44], providing such a tight analysis as a function ofkturns out to be quite difficult.

Intuitively, it initially seems that the asymptotic approximation ratio should simply increase by k−3k

compared to the approximation ratio ofF F for standard bin packing. The reason for this is that in the well-known worst-case example of [55], it is possible to define an optimal packing that packs three items into each bin, leaving space fork−3very small items that can still be packed into each bin of the optimal solution, while these items can arrive first, in which case F F will pack them into their own bins (such thatk items will be packed into each bin). As it turns out, this input can be used fork ≥10, but fork ≤9there are worse inputs. Our first attempt was to adapt the weight function that was used to prove an upper bound on the asymptotic approximation ratio of FF for standard bin packing [55]. Such an adaptation is quite tricky for the cases where 10 ≤ k ≤ 19, and in particular, items of sizes in [0.2,0.3)require a special treatment. Additionally, bins of an optimal solution that contain two items that FF does not pack into bins containing k items also require a special treatment, which is very different from the known analysis. While the cases wherek ∈ {2,3,4,5} are sufficiently straightforward to deal with, in the casesk ∈ {6,7,8,9}, a completely new weight function was needed. Intuitively, some of the difficulty is caused by the fact that in these cases the worst-case examples contain two very different types of bins packed by optimal solutions. In particular, in the case k = 9, it turned out that items whose sizes are approximately0.2 or 0.3 are most difficult to treat, and therefore one of the weight functions is partitioned into seven cases. Similar cases are also used here in a weight function defined for the cases10 ≤ k ≤ 19. In summary, while the approach seems similar to that of other work, it is in fact quite different and challenging.

Notation. Below we see a bin as a set of items, and for a binB, we lets(B) =P

i∈Bsi be its level.

6.1 Upper bounds

In this section we prove upper bounds on the the asymptotic approximation ratio. In the analysis, a bin ofF F that has j items for j ≤ k is called aj-bin, and a bin whose number of items is in [j, k−1]for some1≤ j < kis called aj+-bin. For a bin packed byF F, a later bin is a bin that was opened after the current bin was opened (it appears later in the ordering ofF F) and an earlier bin is a bin that was opened before the current one (it appears earlier in the ordering ofF F). When we discuss an item packed into some bin and the “further items” of a bin, we mean all the other items packed into the same the bin, where the list of items of a bin is not ordered according to the times that they were considered byF F.

Given a functionf defined on items or on item sizes and a subset of itemsX,f(X)is defined as the sum of images of the items in X underf. We start with several lemmas that will assist in the upper bounds proofs.

Lemma 6.1.1 Let1≤j ≤k−1. Everyj+-binB except for at most one bin has level above j+1j . Proof. Assume that there exists a j+-bin B whose level is at most j+1j . All later j+-bins only have items of sizes above j+11 (as they could not be packed intoB), and each such bin has at least

j items, so their levels are above j+1j . 2

In what follows, we often use the following partition of item sizes into classes. Items of sizes at most 16 are calledtiny. Items of sizes in(16,14]are calledsmall, items of sizes in(14,13]are called

medium, items of sizes in(13,12]are calledbig, and other items (of sizes above 12) are calledhuge.

We will use weights for the analysis of FF, and huge items will always have weight1, and in most cases this will not be stated in the definitions of weights (i.e., we will define weights only for items that are not huge).

Lemma 6.1.2 Letk ≥3. Except for at most one bin, any1-bin has a huge item. Consider2-bins that do not have huge items. Except for at most two bins, any such2-bin has a big item, and its other item is big or medium.

Proof. By Lemma 6.1.1, any bin except for at most one bin has a level above12, and all such1-bins have huge items. Moreover, by the same lemma, all2-bins except for at most one bin have levels above 23. Consider2-bins with levels above 23 and no huge items. Any such bin must have an item of size above 13. Moreover, since it has no huge item, it must have a big item. Assume that there is such a bin whose smaller item is no larger than 14 and consider the first such binB. Its level does not exceed 34, and thus any later bin cannot have an item of size at most 14, as such an item could be packed intoB. Thus, later2-bins without huge items only have medium and big items. We find that all 2-bins without huge items, except possibly for a bin with load no larger than 23, and one

additional bin, have the described contents. 2

Lemma 6.1.3 Letk ≥4. Except for at most one bin, any3+-bin that has a level of at most 56 has no tiny items.

Proof. If all3+-bins have levels above 56, we are done. Otherwise, consider the first 3+-bin B of level at most 56. Any later bin cannot have an item of size at most 16, as such an item could be

packed intoB. 2

Lemma 6.1.4 Letk ≥4. Except for at most one bin, any3-bin has at least one item of size above

1

4. Except for at most two bins, any3-bin without a huge item has one of the following structures.

• The bin has no tiny items, and at least one of its items is medium or big.

• The bin has level above 56, it has exactly one tiny item, and at least one big item.

Proof. By Lemma 6.1.1, all3-bins except for at most one bin have levels above 34, so at least one item has size above 14. By Lemma 6.1.3, for all3-bins except for at most one bin, if the bin has at least one tiny item, its level is above 56. Thus it can contain at most one tiny item, and if it has a tiny item, then it must contain at least one big item, given its level. 2 Lemma 6.1.5 Letk ≥5. Except for at most one bin, any4-bin without huge items has one of the following structures.

• The bin has no tiny items.

• The bin has level above 56, and it has at least one big item.

• The bin has level above 56, and it has exactly one tiny item.

• The bin has level above 56, and it has two tiny items, a medium item, and another item that is small or medium.

Proof. By Lemma 6.1.3, it is sufficient to consider a bin of level above 56. If the bin has no big items, it can have at most two tiny items, and if it has exactly two tiny items, the remaining items

cannot be both small. 2