• Nem Talált Eredményt

Here we complete the analysis and provide examples showing that the asymptotic approximation ratios cannot be smaller that the bounds proved in the previous section. For completeness we include a lower bound fork = 2as well. In the statement of the theorem the casesk = 4,10are included in two cases.

Theorem 6.2.1 The asymptotic approximation ratio of FF satisfies the following properties.

• It is at least2.5− 2k fork = 2,3,4.

• It is at least 8(k−1)3k = 833k8 for4≤k ≤10.

• It is at least2.7− 3k fork ≥10.

Proof. The cases2≤k≤4.

Let` ≥ 0be a large integer, and let0 < ε < 9k1. Consider an input consisting of2k(k −2)`

items of size ε each (smallest items), 2k` items of size 12 −kε > 13 each (medium size items), and2k`items of size 12 +εeach (largest items). The items are presented in this order. FF creates 2(k −2)` bins containing k smallest items each. Then, as further items are larger than 13, FF createsk`bins containing pairs of medium size items, and as the remaining items are larger than

1

2, the largest items are packed into2k`dedicated bins. For this inputL`, OP T(L`) = 2k`, since it is possible to pack a largest item, a medium size item, andk −2 smallest items into a bin as

1

2 +ε+ 12 −kε+ (k−2)ε <1, whileF F(L`) = 2(k−2)`+k`+ 2k` = 5k`−4`. This shows that the asymptotic approximation ratio of FF is at least2.5− k2, that is, at least 116 fork = 3and at least2fork = 4. The example is valid fork = 2too, giving the value1.5(in this case there are no smallest items).

The cases5≤k≤10.

Let`be a positive integer divisible byk, let0< ε < 1201 andδ < 3`+4ε be small positive values, and consider the following input. There are3`items of size 12 +δ,`items of size 12 −10δ,`items of size 14 + 20δ,`items of size 14 −30δ,(3k−8)`items of sizeδ, and for1≤p≤`there is a pair of items of sizes 14 + 3εp and 143εp −10δ. Sinceδ < ε < 1201 , all sizes are strictly positive. An optimal solution has three types of bins. There are`bins with an item of size 12+δ, an item of size

1

2−10δ, andk−2≤8items of sizeδeach. There are`bins with an item of size 12+δ, an item of size 14 + 20δ, an item of size 14 −30δandk−3≤7items of sizeδeach. Finally, there are`bins, where thepth bin has an item of size 12 +δ, the pair of items of sizes 14 +3εp and 143εp −10δ, and k−3≤ 7items of sizeδ each. Remove the items of sizes 14 + 3ε` and 14 −10δ− 3ε, and one item of size 14 −30δfrom the input. Obviously, an optimal solution still requires at most3`bins. For 1≤p≤`−1, the items of sizes 14 +3εp and 14 −10δ−3p+1ε are called a modified pair of indexp.

The items are presented toF F in the following order. First, all items of size δ are presented and packed into(3k−8)k` bins that cannot be used again. Next, for1≤ p≤ `−1, the modified pair of items of indexpis presented, followed by an item of size 14 −30δ. The total size of these three items is 14 + 3εp + 14 −10δ − 3p+1ε + 14 −30δ = 34 − 40δ + 3p+1 > 34340ε`+4 + 3p+1

3

4340εp+5 +3p+1 > 34 + 2·3εp, while further items have sizes of 12 +δ > 12 −10δ > 14 + 20δ > 14,

1 4+ ε

3p0 > 14, 14 −30δ > 14 −10δ−320ε`+414 −10δ−3`+1ε > 14 −10δ− ε

3p0+1, and14 −10δ− ε

3p0+1,

wherep0 ≥ p+ 1 (there are additional modified pairs arriving later only ifp < `−1). We have

3

4 + 2·3εp + 14ε

3p0+1 −10δ ≥ 1 + 2·3εp3p+2ε310εp+5 = 1 + ε(35/2−33p+53−10) > 1. This proves that after a bin of a modified pair and an item of size 14 −30δis created, no other items can be packed into that bin. When no modified pairs remain, pairs of items of sizes 12 −10δ and 14 + 20δ are presented (there are`such pairs). Each bin receives such a pair, whose total size is 34 + 10δ. Since all remaining items have sizes above 14, each created bin will not be used for other items. Finally, all remaining items (of sizes 12 +δ) are packed into dedicated bins. The total number of bins is (3k−8)k` +`−1 +`+ 3` = 8k−8k `−1. Since an optimal solution has at most3` bins, we find that the asymptotic approximation ratio is at least 8(k−1)3k .

The casesk ≥10.

After having got the tight lower bound construction for standard bin packing, given in Theorem 4.3.2 (in the chapter that deals with algorithm F F for standard bin packing), we can now apply this construction for the cardinality constrained model. In that place of the dissertation there is an input for any OP T = 10m, for which F F = 17m. (We changed the letter k tom in the claim, since in that chapterk is ”only” an integer, but in this chapterkhas a special meaning.)

We adapt this lower bound example ofF F by adding a large number of tiny items. The original construction is such that every bin of OP T has a big item whose size is 12 +ε, and it holds that every optimal bin contains exactly 3 items. We replace the big items with slightly smaller big items of sizes 12+ε/2. Then, any optimal bin receives alsok−3tiny items of sizes 2kε. Naturally, this modification is possible both with respect to size and to the number of packed items. The tiny items are presented toF F before other items, so they are packed into bins containingkitems each, that cannot be used for other items.

The items of sizes 12 +ε/2are presented last and must be packed into dedicated bins, as any previous bin either haskitems or total size above12. Thus, the modified construction gives a lower bound of1.7 + k−3k = 2.7−k3 on the asymptotic approximation ratio ofF F. 2

Chapter 7

Batched Bin Packing and Graph-Bin Packing

The results of this chapter are from [22], thus the contribution of this chapter is reached by the author of the dissertation. In this last chapter we revisit the Batched Bin Packing problem (abbre-viated asBBP). In this model items come inK consecutive batches, and the items of the earlier batches must be packed without any knowledge of later batches. The model is introduced in [48].

LetLbe the set of items whereL = B1 ∪...∪BK, whereBi∩Bj = ∅ ifi 6= j. Note that for anyi, Bi may be empty. We say thatBi is the i-thbatchof the input. It is assumed that for any 1≤i < j ≤K, thei-th batch is revealed before thej-th batch. As soon as a batch is revealed, the items in the batch must be irrevocably packed, this part of the packing procedure being called the i-th phase. IfK = 1, we get back to the offline packing problem. If every batch contains only one item, we get the online packing problem (with the only difference being that the number of items is known). Thus thebatched bin packingproblem is in some sense a common generalization of the offline and online bin packing problem. It seems that no other paper has considered this model so far, except [22], the work of the present author.

We give the first approximation algorithm for the case K = 2, with tight asymptotic approxi-mation ratio1.5833, while the known lower bound of the model is1.378.

Let us consider some possible applications: An office moves from one building to another one.

There are two rooms in the office, an inner and an outer room. It is possible to carry out the furniture from the inner room only through the outer room. It is very important that the documents of the staff of one room should not be mixed up with the documents of the other room, thus the staff make the decision that first all the furniture (and documents therein) from the outer room are carried out and packed into several trucks, and only after this can the remaining furniture from the inner room be handled in the same way. Here the furniture of the two rooms form the batches, and the trucks play the role of the bins.

Another situation that may occur is: A factory moves from one country to another country.

First the machines (i.e. items) are transported by train to a transfer point, then the machines are unpacked from the wagons, and they are packed into trucks, because the target point is among the hills and there is no railway to the destination. Since the factory is large, the items of the factory are transported by several trains, hence it is possible that a part of the input arrives at the transfer point on Monday, the next batch arrives on Tuesday, and so on. Then it is natural to start to pack

the first batch on Monday. Then on Tuesday, the next batch is packed. At any time when a truck is full, the items are transported.

Note that in the above-mentioned applications, two versions of the batched bin packing can be distinguished. In the first application (moving) the bins of the first batch cannotbe used to pack the items of the next batch, but in the next application (transporting items of a factory) they are allowedto be used. We call these two versions theaugmentingmodel (the bins that are used in the i-th phase can also be used in thej-th phase, for anyi < j, to pack other items if they fit), while in thedisjunctivemodel the bins that are used in some phase cannot be used in any later phase. (At this point the latter model does not seem to be very interesting or attractive, but we will need this model later on.) Thus in the augmenting model the algorithms can choose to combine items from different batches, while in the disjunctive model they cannot.

The algorithms which are applied in the two different models are called augmenting and dis-junctive algorithms, respectively. Note that a disdis-junctive algorithm simply packs the batches in-dependently. The asymptotic approximation ratio of an (augmenting or disjunctive) algorithm A is defined in an appropriate way. The number of the bins used by algorithmA is compared with the solution of an offline optimal algorithmOP T. Note thatOP T is allowed to pack together the items from different batches.

For theBBP problem, in [48] the authors just investigate the augmenting model in the special case when K = 2. The authors prove that Ras(A) ≥ r ≈ 1.3871 is a lower bound for the problem, where r is a solution of equation r/(r−1)−3 = lnr/(2r −2), thus the asymptotic approximation ratio of any algorithmA is at least this value. We approach the problem from the opposite side: We give the first algorithm for the same special case, when K = 2. The tight asymptotic approximation ratio of the algorithm is 19/12 ≈ 1.5833, thus it remains below the asymptotic approximation ratio of the best-knownBP algorithm (i.e. the algorithmSH of Seiden which has asymptotic approximation ratio of1.58889, see [69]). Comparing toSH, our algorithm is very simple. We define it for the disjunctive model, but it can be also applied for the augmenting model in a natural way.

Another model and connection: an improved result. Thebin packing with conflicts(BP C for short) is another generalization of theBP problem: several pairs of items are in conflict, which means that the two items are not allowed to be packed into the same bin; see e.g. [52] or [41].

A more general version called thegraph-bin packing problem (abbreviated by GBP) is defined in [11], and (the simplified version of this problem) is as follows. Given a graph, with lower and upper bounds on the edges and weights on the points, the weight of a point is called the size. The points of the graph, also called items, are to be packed into unit capacity bins. The total size of the items in any bin can be at most1, as usual. But some additional constraints must also be satisfied.

Namely, given any two points, sayaandb, if they are connected in the graph by an edge, and the lower and upper bounds of this edge arel and u, respectively, anda andb are packed into some binsBi andBj, respectively, then the indices of the bins must satisfyl ≤ |i−j| ≤ u. Note that for theBP Cproblem,u=∞andl ∈ {0,1}for any edge.

In the case of the GBP problem [11], among several results, an approximation algorithm is given with absolute approximation ratio3, for the special case where there are only lower bounds on the edges (i.e. u =∞for any edge), and the graph has chromatic number2, i.e. it is bipartite.

Surprisingly, with the application of our algorithm (which we defined for theBBP problem), we are able to get an improved algorithm for the graph-bin packing problem for this special case. We

improve the previous3upper bound to2.5833, not just in the asymptotic, but also in the absolute sense.

Notation Recall that a bin is called ak-bin if it contains exactlyk items. The level of a bin, denoted byl(B), is the sum of the sizes of the items in the bin. In this chapter the total size of all the items will be denoted byP.

7.1 An upper bound for Batched Bin Packing for K = 2

Now we will introduce an approximation algorithm for the batched bin packing problem, for the special case where K = 2. In fact, we apply algorithm F F D for the two batches separately;

i.e. we pack the items in batchB1 byF F D, and we also apply F F D for the second batchB2, independently of the first batch (thus we consider the disjunctive model; i.e. we do not use the bins of the first batch to pack the items of the second batch).

This natural adaptation of F F D will be denoted by F F D(B1, B2). The two independent packings will be denoted by F F D(B1) and F F D(B2), respectively. Then F F D(B1, B2) = F F D(B1) +F F D(B2). Let the optimum value of the relaxed offline problem (where the items of setB1 ∪B2 can be packed freely together) be denoted byOP T. We will call the solution of this relaxed problem the optimal solution. Then when we measure the quality of our packing, we will compareF F D(B1, B2)withOP T. Note thatOP T ≥P trivially holds. Next, we will show that

F F D(B1, B2)≤ 19

12OP T + 2, (7.1)

and the approximation ratio 19/12 is tight for the algorithm. We group the items into classes.

Now let a denote an arbitrary item. Then a is called tiny, small, medium or grand, ifa ≤ 1/4, 1/4< a ≤ 1/3,1/3 < a≤ 1/2, or 1/2 < a, respectively. The classes, and the items therein are denoted byT,S,M andN, respectively (letterGwill be used for another meaning, which is why we use the letterN for graNd items). If a medium item and a grand item share a bin (possibly with some further items), we call them apair.

The next lemma and the corollary provide some insight into the way theF F Dalgorithm works.

Both are folklore results, but we present them and their proofs for completeness.

Lemma 7.1.1 Consider an arbitrary list of itemsLin theBP problem, and letN andM denote the set of the grand and medium-sized items, respectively. Letp= p(L)be the maximum number of (n, m) pairs, where n ∈ N and m ∈ M and no item appears in more than one pair. Then algorithmF F Dcreates exactlyppairs.

Proof. Suppose that the statement is not true, and letLbe a minimal counterexample, i.e. a list when F F D makesr pairs, where r < p. It follows that L does not have any item smaller than a medium item, since after deleting these itemsF F D makes the same number of pairs, andp(L) does not change. Now consider all feasible packings ofL, where there are exactlyppairs. Let us suppose that there aretsuch feasible packings. For thek-th packing among these, denote the pairs by(n1k, m1k), ...,(npk, mpk), where the pairs are listed in lexicographically decreasing order, i.e.

if nik > njk for some 1 ≤ i, j ≤ p, then (nik, mik) precedes(njk, mjk), and also, if nik = njk

andmik > mjk. Note that there can be some other items in the list. There may be several grand items that are single items in their bins, and there may be also some other bins containing one or two medium-sized items. Now we choose all the packings among the t packings, for whichn1k has the largest possible size, say, and we havet1 ≤tsuch packings. Then among thet1 packings, we choose all the packings for which m1k has the largest possible size, and let us fix one such packing, and letk simply denote again the index of the chosen packing, and we will refer to this packing below as the chosen packing. We claim that there are non0 ∈ N andm0 ∈ M, a grand and a medium-sized item, respectively, such thatn0 > n1k, and n0 andm0 fit into a common bin.

Suppose for the sake of contradiction that such an(n0, m0)pair exists. It follows thatn0is a single item in its bin. Ifm0 is different from anymik, 1≤ i≤ p, this would contradict the fact thatpis the maximum number of pairs, as we foundp+ 1pairs. Otherwisem0 =mik, for some1≤i≤p.

Then, in the chosen packing we take off mik from its actual bin, and pack it into the bin ofn0 (thus replace the pair(nik, mik)by a new pair(n0, mik)), and leave unchanged the bin of any other item. This packing hasppairs but differs from any packings in the tpossible packings, which is a contradiction. Thus our claim is proved. Now let us see how F F D works. First F F D packs the grand items in order of decreasing size. Consider the first bin with a grand item of sizen1k

(k is the index of the chosen packing). Because of the above claim,F F D cannot pack a medium item into some earlier bin, but it will find that a medium item of sizem1kfits into this bin. (It also holds that no medium-sized item with size bigger thanm1k will fit into this bin.) ThusF F Dwill packn1kandm1ktogether. (More exactly,F F Dpacks a certain grand itemn, and a medium item m into a common bin, where the sizes of n andn1k, and the sizes ofm and m1k are equal. For the sake of simplicity we will assume that n = n1k and m = m1k; if this is not the case, we can swapnandn1k, and alsomandm1kin the packing.) We claim that by deletingn1kandm1kfrom the input, we get a smaller counterexample. Indeed, F F D will create the same packing for the remaining items in the sense that any non-deleted item will be packed together with the same item as before; or alone, if the item was alone in the previous packing. It follows that in the smaller list F F Dcreates exactlyr−1pairs. However, in the modified list at leastp−1pairs can be created.

Thus we conclude that our list was not minimal, which is a contradiction. 2 Corollary 7.1.1 For any list of itemsLin theBP problem, if the smallest item inLis still larger than1/3, then algorithmF F Dmakes an optimal packing.

Proof. Note that no bin can contain more than two items, no two grand items fit into a common bin, and any two medium items fit into a common bin. Now let us consider a listL, and all possible packings of L, wherep = p(L) means the maximum number of pairs in the packings. We can easily see that if we make an arbitrary packing with the only restrictions that the number of pairs is chosen to bep, and there are no two bins with some single medium items, then the packing is optimal. SinceF F Dcreatesppairs by Lemma 7.1.1, andF F Dnever creates two bins with single

medium items, it follows thatF F Dmakes an optimal packing. 2

Now we prove our main result.

Theorem 7.1.1 F F D(B1, B2)≤ 1912·OP T+2, and the asymptotic bound is tight for the algorithm.

Proof. First we note that the additive term is necessary here, as the statement is not valid without any additive term. Its smallest value may be smaller than 2, but if we use 2, this is just enough

to apply this theorem in the next section. In the calculation of the proof of Theorem 7.2.1, the 2 additive term will just disappear, and this makes it possible to get an absolute bound there.

Thus using a bigger additive term in the present theorem would not be sufficient later, but using a smaller additive term would make the proof harder. Suppose that the statement is not true; then let us choose a minimal counterexample (in the sense of the number of items inB1∪B2). It then follows that in the lastF F D(B1) bin there is only one item, denoted byX, and also in the last

Thus using a bigger additive term in the present theorem would not be sufficient later, but using a smaller additive term would make the proof harder. Suppose that the statement is not true; then let us choose a minimal counterexample (in the sense of the number of items inB1∪B2). It then follows that in the lastF F D(B1) bin there is only one item, denoted byX, and also in the last