Lower bounds for several online variants of bin packing

08/10/2017 ∙ by János Balogh, et al. ∙ Technion University of Szeged University of Haifa 0

We consider several previously studied online variants of bin packing and prove new and improved lower bounds on the asymptotic competitive ratios for them. For that, we use a method of fully adaptive constructions. In particular, we improve the lower bound for the asymptotic competitive ratio of online square packing significantly, raising it from roughly 1.68 to above 1.75.

READ FULL TEXT VIEW PDF
POST COMMENT

Comments

There are no comments yet.

Authors

page 1

page 2

page 3

page 4

This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

1 Introduction

In bin packing problems, there is an input consisting of a set of items, and the goal is to partition it into a minimum number of subsets called bins, under certain conditions and constraints. In the classic variant [28, 19, 20, 31, 24], items have one-dimensional rational numbers in , called sizes, associated with them, and the total size of items of one bin cannot exceed . In online variants items are presented as a sequence and the partition is created throughout this process in the sense that any new item should be assigned to a bin before any information regarding the next item is provided. The conditions on the partition or packing remain as in the offline problem where the items are all given at once as a set. Using an algorithm to partition the items into subsets, which is also seen as a process of packing items into bins, the number of partitions or bins used for the packing is defined to be the cost of .

Algorithms for bin packing problems are normally studied using the asymptotic approximation ratio, also called asymptotic competitive ratio for the case of online algorithms (and we will use this last term). For an algorithm and an input , let denote the number of bins used by for , that is, the cost of for . Let denote the number of bins that an optimal solution uses for , that is, the cost of an optimal (offline) algorithm for . Consider the set of inputs of all inputs for which the number of bins used by is . For the problems studied here (and non-empty inputs for them), will be a positive integer. Let (where for reasonable algorithms this value is finite), and let . The absolute competitive ratio of is defined by , that is, this is the supremum ratio between the cost of and the optimal cost, over all inputs, and the asymptotic competitive ratio is the superior limit of the absolute competitive ratios for fixed values of when grows to infinity. Since the standard measures for online bin packing problems (and offline bin packing problems, respectively), are the asymptotic competitive ratio (and the asymptotic approximation ratio), we also use the terms competitive ratio (and approximation ratio) for them, and always use the word absolute when we discuss the absolute measures. To prove lower bounds on the (asymptotic) competitive ratio one can use inputs where the optimal cost is arbitrarily large, and we use this method. The study of lower bounds on the competitive ratio for a given problem characterizes the extent to which the performance of the system deteriorates due to lack of information regarding the future input items.

Here, we study three versions of the online bin packing problem, providing new lower bounds on the competitive ratio for them. Previous constructions used for proving such lower bounds were often inputs where items arrive in batches, such that the items of one batch all have the exact same size (and the input may stop after a certain batch or it can continue to another one). In the known lower bounds for classic bin packing, it is even known what the next batches will be, if they are indeed presented [23, 29, 6]. While it may be obvious that adaptive inputs where the properties of the next item are based on the packing of previous items are harder for an algorithm to deal with, it was not known until recently how to use this idea for designing lower bounds, except for special cases [9, 2, 17]. In cardinality constrained bin packing [22, 21, 12, 2, 8], items are one-dimensional, a fixed integer is given, and the two requirements for a packed bin are that its total size of items is at most , and that it contains at most items. The special case analyzed in the past [9, 2, 17] is , which can also be seen as a matching problem, as every bin can contain at most two items. In [4] we showed that the overall competitive ratio (supremum over all values of ) is (an upper bound was known prior to that work [2, 8]), and provided improved lower bounds for relatively small values of . For standard bin packing, the best known lower bound on the competitive ratio is [29, 6] and the best upper bound is [5].

Another lower bound presented in [4]

is for the competitive ratio of vector packing in at least two dimensions. For an integer dimension

, the items have -dimensional vectors associated with them, whose components are rational numbers in (none of which are all-zero vectors), and bins are all-one vectors of dimension . A subset of items can be packed into a bin if taking no component exceeds in their vector sum. This generalizes cardinality constrained bin packing, and we showed a lower bound of on the competitive ratio of the online variant for any (prior to that work, no lower bound strictly above for a constant dimension was known).

Our main goal here is to exhibit how to exploit adaptive constructions with some connection to those used in [4] in order to obtain lower bounds for other variants. We focus on the following three variants. In all three variants of online bin packing which we study, the input consists of rational numbers in , however there is additional information received with the input in some of the cases and the input is interpreted in different ways. Two of the problems are one-dimensional and the input numbers are sizes of items. The third variant is two-dimensional, and the numbers are side lengths of squares. In our first variant called bin packing with known optimal cost, the cost of an optimal (offline) solution is given in advance, that is, it is known how many bins are required for packing the input. This problem is also called K-O (known-OPT). It is currently hard to find an appropriate way to use this additional piece of information for algorithm design, but in all lower bounds known for standard online bin packing [29, 6] the property that the optimal cost is different for different inputs is crucial for achieving the result. For K-O, a lower bound of 1.30556 on the competitive ratio was presented [14] and later improved to 1.32312 [3]. We show a new lower bound of on the competitive ratio, improving the previous result significantly. This problem is related to the field of semi-online algorithms and to the so-called model of online algorithms with advice [10, 1], where the online algorithm is provided with some (preferably very small) pieces of information regarding the input.

In the square packing (SP) problem, the goal is to assign an input set of squares whose sides are rational numbers in into bins that are unit squares in a non-overlapping and axis-parallel way, so as to minimize the number of non-empty bins. We use the standard definition of this packing problem, where two squares do not overlap if their interiors do not overlap (but they may have common points on the boundaries of the squares). The offline variant is well-studied [7, 15]. The history of lower bounds on the competitive ratio of online algorithms for this problem is as follows. Several such lower bounds were proved for the online version of SP, starting with a simple construction yielding a lower bound of on the competitive ratio by Coppersmith and Raghavan [11], and then there were several improvements [25, 16, 18], all showing bounds above . In 2016 a copy of the thesis of Blitz [9] from 1996 was found by the authors of [18]. This thesis contains a number of lower bounds for bin packing problems, including a lower bound of 1.680783 on the competitive ratio of online algorithms for SP. The result of Blitz [9] is now the previous best lower bound on the competitive ratio for the problem (prior to our work), and it is higher than the lower bounds of [25, 16, 18]. Here, we show a much higher lower bound, larger than , on the competitive ratio of this problem.

Finally, we consider class constrained bin packing (CLCBP) [27, 26, 30, 13]. In this one-dimensional variant every item has a size and a color, and for a given parameter , any bin can receive items of at most different colors (of total size at most ), while the number of items of each color can be arbitrary. This problem generalizes standard bin packing, as for any input of standard bin packing, defining a common color to all items results in an instance of CLCBP for any . It also generalizes bin packing with cardinality constraints, though here to obtain an instance of CLCBP one should assign distinct colors to all items. We provide improved lower bounds for . For , the previous known lower bound was [13]. For , the previous lower bound was [26]. This last result was proved even for the special case with equal size items. Interestingly, it has elements of adaptivity, but with respect to colors (as all items have identical sizes), and the input moves to presenting items of a new color once the algorithm performs a certain action. We show that the competitive ratio of any online algorithm for CLCBP with is at least , and that the competitive ratio of any online algorithm for CLCBP with is at least .

The drawback of previous results for all those problems is that while the exact input was not known in advance, the set of sizes used for it was determined prior to the action of the algorithm. We show here that our methods for proving lower bounds can be combined with a number of other approaches to result in improved lower bounds for a variety of bin packing problems. We use the following theorem proved in [4] (see the construction in Section 3.1 and Corollary 3).

Theorem 1

(i) Let and be large positive integers. Assume that we are given an arbitrary deterministic online algorithm for a variant of bin packing and a condition on the possible behavior of an online algorithm for one item (on the way that the item is packed). An adversary is able to construct a sequence of values () such that for any , , and in particular . For any item satisfying and any item not satisfying , it holds that . Specifically, there are values and such that for any item satisfying , and any item not satisfying , it holds that and .

(ii) If another condition is given for stopping the input (it can be a condition on the packing or on the constructed input), it is possible to construct a sequence consisting of items such that never holds, or a sequence of items, such that holds after items were introduced (but not earlier), and where the sequence satisfies the requirements above.

Examples for the condition can be the following: “the item is packed as a second item of its bin”, “the item is packed into a non-empty bin”, “the item is packed into a bin an item of size above ”, etc. An example for the condition can be “the algorithm has at least a given number of non-empty bins”.

The construction of such inputs is based on presenting items one by one, where there is an active (open) interval of sizes out of which future values are selected. When a new item is presented, and the algorithm packs it such that it does not satisfy , all future items will be smaller. If the algorithm packs a new item such that it satisfies , all future items will be larger. This reduces the length of the active interval. Thus, even though the active interval becomes shorter in every step where a new item arrives, it always has a positive length. One can see this as a kind of binary search on the value , which will always be contained in the remaining interval (as it remains non-empty). For example, Fujiwara and Kobayashi [17] used a similar approach and in their work the middle point of the active interval is the size of the next item, and the active interval has length that it smaller by a factor of after every step. To obtain the stronger property that items whose sizes is at least the right endpoint of the active interval are larger by a factor of than items no larger than the left endpoint of the active interval, the selection of the next size is performed by a process similar to geometrical binary search.

Note that an important feature is that the value is defined before it is known whether holds for the th item (the item corresponding to , that is, the item whose size is a function of ). We will use this theorem throughout the paper. We study the problems in the order they were defined.

2 Online bin packing with known optimal cost (K-O)

Here, we consider the problem K-O, and prove a new lower bound on the competitive ratio for it. We prove the following theorem.

Theorem 2

The competitive ratio of any online algorithm for K-O is at least .

Let be a large integer that is divisible by ( will be the value of the known optimal cost). We will create several alternative inputs, such that the optimal cost will be equal to for each one of them.

We use the following construction. For and , define an input built using Theorem 1 as follows applied twice on different parts of the input as explained below. The outline of our lower bound construction is as follows. The first part of the input will consist of items of sizes slightly above (such that some of them, those packed first into bins, are larger than the others). Then, there are items of sizes slightly above (where items packed into new bins are larger than others, while those combined with items of sizes roughly or with another item of size roughly , or both, are slightly smaller). Finally, the algorithm will be presented with a list of identical items of one of the three sizes (exactly), or slightly above , or slightly below , such that every larger item of size slightly above cannot be packed together with such an item (of size slightly below ). Additionally, after the first items arrive, it is possible that instead of the input explained here there are items of sizes slightly below , either such that every such item can be packed with any item out of the first items, or such that it can only be combined with the smaller items out of the first items (due to the property that the size of an item will be just below , in both cases it can be combined with at most one item of size just above ).

Next, we formally define our input sequences. Throughout this section, let the condition be that the item is not packed as a first item into a bin. The first items are defined as follows. Using Theorem 1, we create items such that the size of item is . These items are called -items. The sizes of such items are in , and there is a value such that any item whose packing satisfies condition has size below and any item whose packing does not satisfy has size above . The first kind of items are called small -items, and the second kind of items are called large -items.

Let denote the current number of bins used by the algorithm (after all -items have arrived), and this is also the number of large -items. Two possible continuations at this point are items of sizes equal to (the first option), and items of sizes equal to (the second option).

Lemma 3

In both options, an optimal solution has cost .

Proof. In the first option, an optimal solution has one item of size and one item of size no larger than in every bin. It is optimal as every item of size above requires a separate bin (where it can be possibly packed with smaller items).

In the second option, an optimal solution uses bins to pack the large -items: Every bin can contain at most six such items, as their sizes are in , each remaining bin has one item of size , and of them also have one item (each) of size below . This is an optimal solution as the two larger kinds of items (those of sizes above and the large -items) cannot be combined into the same bins, and the packing for each of these two kinds of items is optimal.   

In the first case, the algorithm can use bins containing exactly one item to pack (also) an item of size , but it cannot use any other bin again. In the second case, as every bin has exactly one item of size above , the algorithm uses an empty bin for every item of size .

We explain the continuation of the input in the case where none of the two continuations already defined is used. The next items are defined using Theorem 1, and we create items such that the size of the th item of the current subsequence of items is (the values are constructed here again, and they are different from the values constructed earlier). We call these items -items. The sizes of -items are in , and there is a value such that any item whose packing satisfies condition (defined in this section) has size below and for any item whose packing does not satisfy , it has size above . The first kind of items are called small -items, and the second type items are called large -items.

Here, there are three possible continuations. The first one is items, all of size . The second one is items, each of size . Let denote the number of new bins created for the -items, which is also the number of large -items (so after the -items are packed the algorithm uses bins). If , the third continuation is with items, each of size (where ). Otherwise (), the third continuation is with items, each of size . Thus, in the third continuation, the sizes of items are the same (i.e., ) in both cases, and the number of items is .

Lemma 4

The optimal cost in all cases (i.e., after the packing of the items of each possible continuation has been completed) is exactly .

Note that it is sufficient to show that the optimal cost is at most , as in the case where it is strictly smaller than , it is possible to present items of size until the optimal cost is exactly , while the cost of the algorithm does not decrease. We prove that the value is exactly to stress the property that one cannot prove a better lower bound using the same kind of input.

Proof. For the first continuation, an optimal solution packs bins, each with two -items and two -items, and another bins, each with one item of size . This solution is optimal as every item of size has to be packed alone into a bin, and no bin can contain more than two items of sizes above .

For the second continuation, an optimal solution packs bins, each with one item of size , one -item and one -item. This solution is optimal as no bin can contain more than one item of size above .

For the third continuation, the two options for optimal solutions are as follows. In the case , there are bins, each with two -items and two -items. All large -items will be packed into these bins (which is possible as there are -items packed into those bins). There are also small -items packed into these bins. Each of the remaining bins contains one item of size , where of those bins also contain two -items (which is possible as the total size will be below ), and each of the remaining bins has one small -item (this is possible as the size of each small -item is below ).

In the case , there are bins with two -items and two large -items (at most one bin may contain a smaller number of large -items). All large -items are packed into these bins, and no small -items are packed into these bins. The remaining bins all contain one item (each) of size , where of those bins also contain two -items, and of those bins (not containing -items) also contain one small -item (this is possible as ).

The solution for the second case (i.e., for the case ) is optimal as separate bins are needed for items of size and large -items, and the solution obtained for each kind is optimal.

Thus, it remains to prove that in the first case (i.e., in the case ), the optimal cost is . Observe that we showed a feasible solution of cost , so we need to show that the optimal cost is at least . In this case every bin with an item of size can receive either two -items or one small -item. Consider an optimal solution and let be the number of items of size packed with a -item. The remaining -items are packed at most two in each bin, so if , we are done as there are at least bins. Otherwise, , at most -items are packed with items of size , and -items remain to be packed with -items. Even replacing each -item with two items of size in (virtually, for the sake of proof), we have to pack items where a bin can contain at most six items, so at least bins are needed, for a total of bins.   

This completes the description of the input where we showed that in each case the optimal cost is exactly . Next, we consider the behavior of the algorithm. Consider the kinds of bins the algorithm may have after all -items have arrived. The -items do not necessarily arrive, but we will deduce the numbers of different kinds of bins the algorithm has after the -items have arrived from the numbers of bins assuming that the -items have arrived. This is an approach similar to that used in [29], where numbers of bins packed according to certain patterns (subsets of items that can be packed into one bin) at the end of the input are considered, and based on them, the number of bins already opened at each step of the input are counted. More precisely, if the input consists of batches of identical (or similar) items, given the contents of a bin it is clear when it is opened and at what times (after arrival of sub-inputs) it should be counted towards the cost of the algorithm.

A bin with no -items can receive an item of size if it has at most three -items and it can receive an item of size if it has at most two -items. The only case where a bin with at least one -item and at least one -item can receive another item (out of a continuation of the input) is the case that a bin has one of each of these types of items, and it will receive an item of size .

Let denote the number of bins with four or five or six -items and no -items. Such a bin cannot receive any further items in addition to its -items. Let denote the number of bins with three -items and no -items. Such a bin can receive an item of size (but not a larger item). Let and denote the number of bins with two -items and one -item, respectively, and no -items. Out of possible input items, such a bin can receive an item of size or an item of size . We distinguish these two kinds of bins due to the possible other continuations after -items have arrived. Let denote the number of bins with two or three or four -items and one -item. Such bins cannot receive any further items out of our inputs. Let denote the number of bins with one -item and one -item. Let and denote the numbers of bins with two -items and one and two -items, respectively. Obviously, there can be bins without -items containing one or two -items, and we denote their numbers by (one -item) and (two -items).

We have five scenarios based on the different options and continuations described above, and we use to denote the cost of a given algorithm for each one of them, in the order they were presented. Let be the (asymptotic) competitive ratio. Let , which is a lower bound on the competitive ratio since the optimal cost is always (by Lemmas 3 and 4), so for we have the constraint . The (for

) will not appear explicitly as variables in the forthcoming linear program. Instead, we will compute each

based on the other variables in the program and substitute the resulting expression in the constraint . We use and for those values of and such that and are defined. For all thirteen variables there is a non-negativity constraint. In addition, the number of items should satisfy and (the second constraint is not an equality as in some cases counts bins with at most -items). Using the definitions of and we have and .

We get the following four constraints:

(1)
(2)
(3)
(4)

The costs of the algorithm are as follows. We have , , , and .

If , we have , and if , we have .

The four first costs of the algorithm (for the first four scenarios) gives the constraints

(5)
(6)
(7)
(8)

The two final constraints form two cases (according to the value of ), and therefore our list of constraints results in two linear programs (with all previous constraints and two additional ones). The inputs for the two cases are different, and therefore they are considered separately (due to the different inputs, there is one other different constraint except for the constraint on the value of ). For each one of the linear programs, the objective is to minimize the value of .

One pair of constraints is and , and the alternative pair is and (observe that the constraint is a relaxation of the valid constraint , and thus the weaker constraint is valid in this case).

Multiplying the first five constraints by the values , , , , , respectively, and taking the sum gives:

(9)

For the first case, we take the sum of the sixth, eighth, and tenth constraints multiplied by the values , , , respectively, and get:

Summing this with ten times (9) we get , and by we get .

For the second case, we take the sum of the seventh, eighth, and tenth constraints multiplied by the values , , , respectively, and get:

Summing this with twice (9) we get , and as , we have . Thus, we have proved .

3 Online Square packing (Sp)

We continue with the online square packing (SP) problem. We prove the following theorem.

Theorem 5

The competitive ratio of any online algorithm for SP is at least .

Here, in the description of the input, when we refer to the size of an item, this means the length of the side of the square (and not its area). Consider the following input. For a large positive even integer and , we define an input based on using Theorem 1 twice. The construction is similar to that of the previous section, though here we are not committed to a specific optimal cost, and we take into account the multidimensionality. Moreover, for one of the item types the number of such items is also determined by the action of the algorithm (which was difficult to implement in the previous section when the cost of an optimal packing is fixed in advance, and we did not use such an approach there as extensively as in the current section). Here, we only compute upper bounds on the optimal cost for each case.

The outline of the construction is as follows. The first part of the input will consist of items of sizes slightly above (such that some of them, those packed first into bins, are larger than the others), then, there are items of sizes slightly above (where such items that are packed into bins containing relatively few items, where the exact condition is defined below, will be larger than other items of this last kind). Finally, there will be items of one of the sizes: , and slightly below (all of them will have exactly the same size), such that every larger item of size slightly above cannot be packed together with such an item of size slightly smaller than . Additionally, after the first items arrive, it is possible that instead of the input explained here there are items of sizes slightly below , such that it can be only be combined with the smaller items out of the first items (any bin with an item of size slightly below may have at most five smaller items out of the first items in a common bin).

Next, we formally define the construction. Let the condition be that the item is not packed as a first item into a bin. This is the condition we will use for items of sizes slightly above . For items of sizes slightly above , let the condition be that the item is either packed in a bin already containing an item of size above , or that it contains at least five items whose sizes are in .

The first items are defined as follows. Using Theorem 1, we create items such that the size of item is . These items are called -items. The sizes of items are in , and there is a value such that any item whose packing satisfies condition has size below and for any item whose packing does not satisfy , it has size above . The first kind of items are called small -items, and the second type items are called large -items. No matter how the input continues, as any packing of the first items requires at least bins, the cost of an optimal solution is .

Let denote the current number of bins used by the algorithm, and this is also the number of large -items. A possible continuation at this point is items of (identical) sizes equal to . Note that such an item cannot be packed into a bin with an item of size above , as it cannot be packed next to it or below (or above) it, and the remaining space (not next to it or below it or above it) is too small (the sum of the diagonals of these two items is too large to be packed into a unit square bin).

Lemma 6

There exists a packing of the items of the presented sequence (in this case) of cost at most .

Proof. A possible packing of the items of sizes together with the -items is to use bins for the new items and combine five small -items into these bins (one such bin may have a smaller number of -items). This packing is feasible as the large item can be packed in one corner of a unit square bin, leaving an shaped area of width , the opposite corner will contain an -item, and there are two additional such items next to it on each side of the shaped area. The remaining large -items are packed into bins containing nine items each (possibly except for one bin), such that the number of such bins is . The total number of bins in this packing is at most .   

The algorithm has one large -item in each of the first bins and therefore it uses a new bin for every item of size . Thus, the total number of bins in the packing of the algorithm (in this case) is exactly .

We explain the continuation of the input in the case where the continuation defined above is not used. Here, for the construction, we state an upper bound on the number of items as the exact number of items is not known in advance and it will be determined during the presentation of the input. There will be at most items of sizes slightly above . We will use the variables and to denote the numbers of items for which condition was satisfied and was not satisfied, respectively, in the current construction. Initialize , and increase the value of the suitable variable by when a new item is presented. The th item of the current construction has size , and the sizes of items are in . These items are called -items. There is a value such that any item whose packing satisfies condition has size below and any item whose packing does not satisfy has size above . The first kind of items are called smaller -items and the second type items are called larger -items. Present items until holds (this does not hold initially, so at least one item is presented, and this is defined to be condition ). We show that indeed at most items are presented. If items were already presented, , and therefore the construction is stopped. In what follows, let and denote the final values of these variables. Before the last item of this part of the input was presented, it either was the case that or (as exactly one of and was increased by when the last item was presented), so , or alternatively, . Moreover, as . Let (and we have ).

Here, there are two possible continuations. The first one is identical items, each of size exactly , and the second one is identical items, each of size .

Lemma 7

The optimal cost in the first continuation is at most .

Proof. A possible packing for this case consists of bins with one item of size , three -items, and two -items (placing the item of size in a corner leaves an shaped area of width , so we place one -item in each of the other corners and in the remaining space between each pair of adjacent -items we pack an -item). As , there are unpacked -items, and they are packed into exactly bins, where each bin has nine items (the last bin may have less items). In addition, there are at most two unpacked -items, and they are packed into a bin together. The total number of bins is at most .   

Lemma 8

The optimal cost in the second continuation is at most .

Proof. A possible packing for this case consists of bins with one item of size , three small -items, and two -items (placing the item of size in a corner of a unit square bin leaves an shaped area of width where the remaining items are packed). There are at least -items that were packed and at least -items are packed. There are also bins, each with at most four -items and at most five -items (there is a square with four larger items in a corner and the smaller items are packed around them, in the -shaped area of the bin). This allows to pack the remaining -items as there is space for at least such items, and to pack all -items as there is a place for at least such items, where the last inequality holds by the condition . The total number of bins is at most .   

Let denote the number of new bins created for the -items (where these bins were empty prior to the arrival of -items). Here, there may be previously existing bins containing larger -items (with at most four -items), and . Consider the kinds of bins the algorithm may have after all -items have arrived. Once again, -items do not necessarily arrive, but we will deduce the numbers of different kinds of bins the algorithm has after all -items have arrived based on number of bins existing after the arrival of -items. After all -items have arrived, a non-empty bin can receive an item of size if it has at most five items, out of which at most three are -items. The construction is such that any non-empty bin except for bins with at most five -items has either at least six items in total (each of size above ) or it has an item of size above (or both options may occur simultaneously), and therefore it cannot receive an item of size above .

Consider a given online algorithm for SP after the -items were presented. Let denote the number of bins with six, seven, eight, or nine -items and no -items. Such a bin cannot receive any further items in addition to its -items in any of our continuations. Let denote the number of bins with at least one and at most five -items and no -items. Such a bin can receive any item of size larger than that may arrive (but not an item of size ). Let denote the number of bins with five, six, seven, or eight -items and one (small) -item. Let denote the number of bins with at least one and at most four -items and one (large) -item. Let denote the number of bins with five, six, or seven -items and two (small) -items. Let denote the number of bins with four -items and two -items (out of which one is small and one is large). Let be the number of bins with at least one and at most three -items and two -items (out of which one is small and one is large). Let denote the number of bins with five or six -items and three -items (all of which are small). Let denote the number of bins with three or four -items and three -items (out of which two are small and one is large). Let denote the number of bins with one or two -items and three -items (out of which two are small and one is large). Let denote the number of bins with five -items and four -items (all of which are small). Let denote the number of bins with two or three or four -items and four -items (out of which three are small and one is large). Let denote the number of bins with one -item and four -items (out of which three are small and one is large).

Let be the number of bins with no -items and at least one and at most three -items, one of which is a large -item, while the others (at most two) are small. Let be the number of bins with no items and four -items, one of which is large, while three are small.

We have three scenarios, and we use to denote the cost of the algorithm for each one of them, in the order they were presented. Let . The optimal cost is always in , and we let denote our upper bounds on the optimal cost of the th scenario, , and the ratio is lower bound on the competitive ratio . We use the notation and for those values of and such that and are defined. Let and , so , and for growing to infinity, .

Let be the (asymptotic) competitive ratio. For all twenty variables there is a non-negativity constraint. In addition, the number of items should satisfy and (once again, the first constraint is inequality and not equality as counts also bins with less than three -items, and the second constraint is not an equality as in some cases counts bins with fewer than -items). Using the definitions of and we have and .

We also have while , so

Additionally, while , and while , so

and .

We get the following set of constraints:

(10)
(11)
(12)
(13)
(14)
(15)
(16)
(17)
(18)

The optimal objective function value of the mathematical program of minimizing subject to all these constraints is approximately (and it is not smaller than this number). Thus, we have proved .

4 Online class constrained bin packing (CLCBP)

In this section we exhibit our approach to proving lower bounds for the last variant of the bin packing problem which we study here, by improving the known lower bounds for the cases and of CLCBP. We will prove the following theorem.

Theorem 9

The competitive ratios of online algorithms for CLCBP with and are at least and at least , respectively.

The constructions for and have clear differences, but the general idea is similar. The outline of the constructions is as follows. Start with a large number of tiny items, all of distinct colors, so every bin of any algorithm will contain at most tiny items. Here, the construction is such that the items packed first into their bins are much larger than other items (large tiny items will be larger by at least a constant multiplicative factor than small tiny items, but they are still very small). One option at this point is to continue with huge items of sizes close to , all of distinct colors out of the colors of small tiny items, such that every item of size almost can be packed into a bin with small tiny items in an offline solution, one of which has the same color as the huge item packed with it. Note that no large tiny item can be combined with a huge item, so those items will be packed separately, items per bin. The number of huge items is chosen in a way such that the optimal cost is not increased. Another option to continue the construction (instead of introducing the huge items) is with items of sizes slightly above , where an item packed into a bin already containing an item of size above is smaller than an item packed into a bin with no such item (but it could possibly be packed with tiny items). It is ensured that bins of the algorithm already containing (tiny) items will not be used again by the algorithm by never introducing items of their colors again. The sizes will be plus small values, where these small values are much larger than sizes of tiny items (including sizes of large tiny items). An interesting feature is that there will be exactly two items of sizes slightly above with each color which is used for such items, where the idea is to reuse (as much as possible) colors of tiny items packed by the algorithm into bins with at most tiny items (where those tiny items can be large or small), and never reuse colors of tiny items packed in bins of items. In some cases (if there are too few such colors which can be reused), new colors are used as well for items of sizes slightly above (but there are still two items of sizes just above for each color). After these last items are presented, the final list of items will be items of sizes above whose colors will match exactly those of items of sizes in with the goal of packing such pairs of one color together into bins of offline solutions. There are two options for the final items. There are either such items not much larger than , or there are items of sizes close to , such that such an item having a color of an item of size slightly above can be combined into a bin with that item and with at most tiny items coming from bins of the algorithm with at most items (no matter whether they are small or large, but one of them has to be of the same color). However, in the case of items of sizes almost , only small items of sizes just above will be combined with them in good offline solutions while others are packed in pairs (of the same color whenever possible, and of different colors otherwise, combining tiny items where possible).

First, we present the parts of the constructions that are identical for and . The condition will be that the current item is not the first item of its type packed into its bin, where a type consists of all items of similar size (the two relevant types are tiny items and items of sizes slightly above ). Let be a large integer divisible by . The construction starts with the first type of items, where these items are called -items or tiny items, consisting of items constructed using Theorem 1. Let the value of be , and the resulting values are smaller than . The number of tiny items presented is always exactly (so the stopping condition is that there are items), and the size of the th item is simply . Every -item has its own color that may be reused in future parts of the construction but not for -items. Let and be such that the size of any -item satisfying (which we call a small -item) is below and the size of any -item not satisfying (which we call a large -item) is above (but smaller than ). Let (for ) be the number of bins of the algorithm with -items. Let denote the total number of bins of -items, i.e., .

If huge items arrive now, their number is and their colors are distinct colors out of colors of small -items. The size of every huge item is . If , there are no other continuations. In all other cases, there are two possible continuations except for the one with huge items, which was just discussed.

In all other continuations, items of a second type are presented such that their number is at most , and they will be called -items. They are constructed using Theorem 1 with , so their values of are in . We have (by ) . The size of the th -item is , and here condition means that the -item is packed by the algorithm as the second -item of its bin. Let and be such that a -item satisfying (which we call a small -item) has size smaller than and a -item not satisfying (which we call a large -item) has size larger than . The number of -items is even, and their colors are such that there are two -items for each color. These colors are colors of -items that are not packed in bins of -items by the algorithm. As the number of such -items is