Lower bounds on the performance of online algorithms for relaxed packing problems
Lower bounds on the performance of online algorithms
for relaxed packing problems
Abstract
We prove new lower bounds for suitable competitive ratio measures of two relaxed online packing problems: online removable multiple knapsack, and a recently introduced online minimum peak appointment scheduling problem. The high level objective in both problems is to pack arriving items of sizes at most into bins of capacity as efficiently as possible, but the exact formalizations differ. In the appointment scheduling problem, every item has to be assigned to a position, which can be seen as a time interval during a workday of length . That is, items are not assigned to bins, but only once all the items are processed, the optimal number of bins subject to chosen positions is determined, and this is the cost of the online algorithm. On the other hand, in the removable knapsack problem there is a fixed number of bins, and the goal of packing items, which consists in choosing a particular bin for every packed item (and nothing else), is to pack as valuable a subset as possible. In this last problem it is possible to reject items, that is, deliberately not pack them, as well as to remove packed items at any later point in time, which adds flexibility to the problem.
keywords: Bin packing, online algorithms, competitive ratio
1 Introduction
We study two online problems, for which the offline version is a classic problem, with well-known efficient near-optimal solutions [15, 12, 18]. Our online problems are not the most natural variants that one can define, but they are more relaxed. This models reality in the sense that often there is some flexibility even in online environments. Flexibility obviously allows the design of better online algorithms, though such algorithms typically cannot find optimal solutions. Here, we focus on the limitations of online algorithms for relaxed models.
We use the competitive ratio and asymptotic competitive ratio measures for analysis of online algorithms. The competitive ratio for minimization problems is the worst-case ratio between the cost of an online algorithm and the cost of an optimal offline algorithm for the same input. For maximization problems, the roles of the algorithm and an optimal offline solution are reversed. The asymptotic competitive ratio is the supreme limit of the competitive ratio for inputs with optimal costs or profits growing to infinity.
In offline bin packing [17, 12, 18], there are items of indices , where item has a rational size . The goal is to partition the items into the minimum number of sets called bins, where the total size for every bin does not exceed . One can see this as a scheduling problem where items are assigned to machines that are available during the time interval , but it is not necessary to assign the specific time slots in advance, since this can always be done. The length of the time slot for item is required to be of length , where the interval has the form for and . Alternatively, one can assign the time slots, and not the bins, where the assignment to bins can be done by a simple process of coloring an interval graph. In the standard online bin packing problem [6, 2, 5] items are to be assigned to bins sequentially, and it is assumed that items just receive consecutive time slots in the bin, starting from time zero. An alternative online model was defined recently by Escribe, Hu, and Levi [11], where the online feature is the assignment to time slots rather than the bins. The problem is called minimum peak appointment scheduling (MPAS). In both models, items are presented one by one, such that each item is assigned irrevocably before the next item arrives.
In the work by Escribe, Hu, and Levi [11], a randomized algorithm with asymptotic competitive ratio at most was designed, which was recently improved to by Smedira and Shmoys [20]. A lower bound of on the competitive ratio of deterministic algorithms was proved [11], while Smedira and Shmoys [20] proved a lower bound of for the asymptotic competitive ratio of all randomized (and deterministic) algorithms. These results contrast with those known for the standard online bin packing. While the best known lower bound of 1.54278 [5] holds only for deterministic algorithms, earlier results hold for randomized algorithms, where the best such result is 1.5403 [6]. The current best upper bound for standard online bin packing [2] is 1.57829. A simple way to see the difference between the problems is the following. Consider a large even number of items of size , possibly followed by the same number of items of size . A bin packing algorithm has to decide how many pairs of items of size to create in order to have a good performance in both cases. However, in the case of MPAS, one can assign half of the items of size to the time interval and the other half to . This is optimal if there are no further items, but if there are such items, half of them is assigned to and the other half to , also obtaining an optimal solution. The problem is not meaningful as a separate offline problem, though generalizations were recently studied as offline problems [19, 14, 10].
A related problem is the so called dual bin packing [8, 1], which may also be seen as a variant of the knapsack problem with multiple knapsacks available [9, 16]: The processing of arriving items is similar, except here the number of available bins (or knapsacks) is fixed in advance, and the goal is rather to maximize the profit associated with those items that are successfully packed. In the multiple knapsack as studied originally, the profit associated with a set of packed items was the maximum over all the bins of the total value of all items packed in the bin [16], but later studies [9, 7] extended this to the sum of values of all the items packed, which is in line with dual bin packing. We are interested in this objective, so we will not specify the results concerned solely with the single bin of maximum value. The packing consists in assigning an item to a particular bin, which is in contrast to MPAS, where instead a “position” or “interval” (on a horizontal axis) within a bin (which is yet to be determined) is specified. An item may also be rejected by an algorithm, i.e., not packed at all. Moreover, in the so called removable online variant of the knapsack problem it is allowed to remove a previously packed item (e.g., to accommodate the one arriving ), which from then on counts as rejected. As is the case in vast amount of literature, we will consider two restricted settings, in which there is a particular natural relation between the profit associated with an item and its size (or processing time); note that as we focus on lower bounds, considering these makes our results stronger. The two cases, which we call as in [9], are proportional, in which the value of an item equals its size, and unit, in which every item is worth regardless of its size.
The dual bin packing problem corresponds to the unit case with no removals, for which no algorithm can attain constant competitive ratio [8]. Thus the studies of this problem focused on “accommodating” instances, in which all items can be packed by the offline solution, for which constant-competitive algorithms were designed. Moreover, it is known that whether an algorithm is allowed to reject an item that it could pack in some bin (thus being “unfair”) affects what ratio can be attained [1]. In the later studies of the multiple knapsack problem, it was noted that proportional instances, even non-accommodating, allow constant-competitive ratio, which was eventually determined to be exactly [9, 7]. Moreover, with removals allowed, a deterministic algorithm of asymptotic competitive ratio at most is known even for general instances, and the proportional and unit instances admit algorithms with much better competitive ratios of and respectively [9]. The corresponding lower bounds for these two settings, applicable even to randomized algorithms are only [9] and [1] respectively. No better lower bounds are known for general instances. For special cases with a small number of bins and the proportional case, lower bounds of and are known for the competitive ratio of deterministic algorithms with two and three bins, respectively [9], and in some special cases the lower bound on the competitive ratio as a function of the number of bins is slightly inferior to the bounds of and [9, 1]. This problem is also not of interest as a separate offline problem, though the knapsack problem and its variants are being studied continuously, and a near-optimal solution is known for almost fifty years [15].
1.1 Our results
In this work, we prove the following lower bounds on the performance of online algorithms:
- •
-
•
A lower bound of on the competitive ratio for randomized algorithms for the proportional case of the removable knapsack problem, also improving upon the previous bound of [9],
-
•
A lower bound of on the asymptotic competitive ratio for randomized algorithms for the minimum peak appointment scheduling problem, improving upon the previous bound of [20].
We also consider some special cases for the online removable knapsack problem. For example, our results improve the known lower bound for three bins and deterministic algorithms.
1.2 Adaptive item sizing in designing hard instances for online algorithms
Those of our lower bounds that are designed specifically for deterministic algorithms employ the “adaptive item sizing” technique [5], which we now describe. This approach and more advanced approaches (in particular, one where there is a multiplicative gap between sizes) were used for other online bin packing problems [13, 4, 3].
This is a procedure in which a sequence of items arrives, all with sizes in a predetermined interval , where and are parameters. This allows the items from to be partitioned into a set of smallish items with sizes in the interval and largish items with sizes in the interval . The threshold satisfies , and the classification of each item as either smallish or largish occurs immediately after its packing by the deterministic algorithm, but the value of is determined later.
Such classification and partitioning can be ensured by a procedure resembling the binary search. Let and be variables such that . All items thus far classified as smallish have sizes in , and all items thus far classified as largish have sizes in . Initially, we let and . Then, the next item to arrive can have any size in , e.g., . Once it is dealt with (packed or rejected) by the algorithm, and hence classified as either smallish or largish, the value of or respectively is set to this item’s size. Once all items in are processed, can take any value that could be the size of a next item in the sequence and thus separates the sizes of smallish and largish items, e.g., for the final values of the variables and .
2 Online removable knapsack
In our lower bound proofs, we assume without loss of generality that the online algorithm is lazy in that it defers removing (or rejecting) items as long as the packing is valid. Namely, we assume that upon the arrival of an item , the algorithm decides to either reject it outright without packing it or chooses any bin to which is packed. If the bin then overflows, the algorithm chooses a subset of items from , excluding , for removal; this subset has to be minimal such that its removal makes the total size of the items remaining in bin at most . Additionally, the algorithm is only allowed to reject the item outright if there is no bin where it fits without removals; note that this does not mean no removals take place when such bin exists, as the algorithm can choose to pack in another bin.
2.1 Deterministic online algorithms for the proportional and unit cases
We start with a deterministic lower bound.
Theorem 2.1
Any deterministic online algorithm that works for any number of bins , has competitive ratio of at least .
Proof. We focus on the proportional case, and remark that the proof also applies to the unit case because all items in the strategy have sizes that deviate from only by negligible amounts.
The input consists of two phases. The first phase employs the adaptive sizing framework for items, with for arbitrarily small . As there are bins, the algorithm is lazy, and item sizes are slightly below , every item will be packed upon arrival (though possibly causing removal of another item), every non-empty bin at all times will contain either one or two items, and the number of items in any bin cannot decrease over item. The items are classified as follows upon packing: The first item to be placed in a bin is largish, the second one to be placed in a bin is smallish, and an item that replaces another inherits the replaced item’s class.
As a result, at the end of the first phase, each bin has at most two items, if is it non-empty, then it contains one largish item, and if it contains another one, then that item is smallish. Let denote the number of bins with two items, where , since items were presented. If , there are no smallish items, but the threshold is still well defined.
In the second phase, there are two possible continuations of the input, and the adversary’s choice depends on . The first one, applied when is suitably large, is to issue items of size each. Since all previous items have sizes at most , the optimal offline solution packs these items in pairs, and its profit is at least . Now consider the algorithm’s packing. As each item in the second phase has size strictly larger than , any bin that was empty at the beginning of this phase, may contain at most one item at its end. The number of bins for the algorithm with exactly one item before the arrival of the new items is at most , and therefore the profit of the algorithm is below
For , the competitive ratio in this case tends to .
The other strategy for the second phase, applied when is suitably small, is to issue items of size . Each such item has size slightly above , and can be packed together with a smallish item but not with a largish item. Clearly, no bin can have more than one such item. Note that the number of smallish items in the input is at least , and thus the number of largish items is at most , because exactly items were issued in the first phase. It is possible that the number of smallish items is larger than if the algorithm removed a smallish item to pack another, which is then smallish as well. Offline, it is possible to pack bins by placing one smallish item together with one of size in each bin, bins with the remaining items of size , one per bin, and packing all the now remaining items, i.e., largish and yet unpacked smallish ones in pairs into bins; note that if is odd, one of those last bins will contain only a single item. Again assuming that , in the limit the total size of items packed this way is
For the online algorithm, an item of size cannot be added to a bin with only a single item, since such item is largish by the adaptive item sizing used by the adversary. So the algorithm has only bins with total size approximately , and its profit is approximately (up to negligible terms). Routine inspection of the cases of odd and even yields that the competitive ratio is at least
If , we have , and otherwise, . Since for large , the fraction tends to zero, the lower bound follows.
In the cases we get:
by testing all values of , the bounds of the first case and the suitable bound for the second case.
Again, we note that as all items have sizes almost equal to , the proofs works also for unit profits (where these profits are approximately twice as large as the proportional profits).
2.2 Randomized online algorithms for the proportional case
In this section we provide an alternative easier construction, which in general provides weaker bounds, though with the exception of two values of , for which it improves the result of Theorem 2.1 (which was for deterministic online algorithms). Unlike that theorem, this one applies to randomized algorithms as well. Another difference is that here the input sequence is not “accommodating”, i.e., the optimal offline solution does not always pack all the items. The advantages of this construction are that it is fairly simple, and that it provides a lower bound for the case of randomized online algorithms.
Theorem 2.2
Any randomized online algorithm for bins has competitive ratio of at least .
Proof. Let be a very small constant. The input starts with items of each of the two sizes: , . Since items are removable, and since there are sufficiently many items, we can assume that every bin will either have one item of size or two items of sizes .
Let be the expected number of bins with one item of size . The input continues in one of two ways. The first one is items of sizes , and the second one is items of sizes . The optimal offline solution has full bins in either case. Consider the online algorithm. In the first case, its best approach is to add one item to each bin with an item of size . These bins are full, so there is no better packing for them. For each bin of the other kind, even if some replacements are made, the total size of the items it holds is at most . By linearity of expectation, the expected profit of the algorithm is (letting tend to zero and neglecting those terms).
In the other case, there is no reason for the algorithm to replace items of size approximately . (Besides, such replacements change only the negligible terms.) Every bin without such an item can become full when the algorithm replaces one item of size with the item of size ). The expected profit of the algorithm is .
The threshold for is . The first input is used if , and the second one is used otherwise, if . The competitive ratio is at least .
For odd values of , in the deterministic case we can use the integrality of . The first input is used if , and the second one is used otherwise, i.e., for . The ratio is at least
For we get lower bounds of , , , and , which improves slightly upon the lower bound from Theorem 2.1 for and .
3 The online minimum peak appointment scheduling problem
In this section we study the problem MPAS. On high level, the aim in this problem is the same as in the multiple knapsack problem, i.e., to pack the items efficiently, which possibly explains why our results are similar in spirit and techniques. However, the setup is rather different, and it is a minimization problem rather than maximization. Here, every item has to be packed, and the goal is to minimize the number of the bins. The algorithm is not required to specify the bin for packing, but it has to specify the item’s position in any bin it will eventually be packed in, i.e., for an arriving item of size (where ), the algorithm has to specify an interval of the form such that .
3.1 Warm-up: deterministic online algorithms for MPAS
We start with a simple construction for deterministic algorithms that uses the adaptive item sizing technique. Afterwards, we improve it into a lower bound for randomized algorithms.
Theorem 3.1
The asymptotic competitive ratio for deterministic online algorithms for MPAS is at least .
Proof. The input consists of one or two phases, depending on the algorithm. In the first phase, for sufficiently large , items arrive with sizes chosen adaptively using and for an arbitrarily small value . We define the partition into smallish and largish items now. Those items whose intervals after packing contain the point are classified as smallish, and the remaining items (whose intervals do not contain the point ) are classified as largish. Recall that the adaptive sizing guarantees that there exists a threshold such that smallish items have sizes in and largish items have sizes in . Let denote the number of smallish items.
We further classify the largish items as either “low” or ”high”, depending on whether their intervals lie completely to the left or to the right of the point , if the positions are defined on the horizontal axis. Note that all high items contain the point in their intervals and similarly all low items contain the point . If or , then a solution that distributes the items evenly, i.e., places items in each of the intervals
and thus has cost of , proves that the algorithm’s competitive ratio is at least : For , there are smallish items, all containing the point , whereas for , there are must be at least low or at least high items (by the pigeonhole principle), which then all contain the point or respectively. Otherwise, when , there is a second phase, which depends on ’s relation to .
If , items of size each are issued. An optimal offline solution places the first phase items in the interval , and it places the second phase items in the interval , yielding optimal cost of . For the algorithm, all second phase items must have the point as an internal point of their intervals, as do the smallish items, so the cost of the algorithm is at least . Thus the asymptotic competitive ratio is at least in this case.
Finally, if , items of size are issued, where is divisible by and . Note that all low items have the point as an internal point of their intervals, and similarly, all high items have the point as an internal point. We find that the second phase items have a common point with every interval of the low and high items from the first phase. By the pigeonhole principle, there are at least low items or at least this many high items. Thus, for at least one of the points and , there are at least items whose intervals contain it, for a cost of at least for the algorithm. An optimal offline solution has intervals of for smallish items, intervals of for items of size , and for the remaining items (where this number is divisible by ) there are intervals of every form out of , , . Note that all smallish items have sizes not exceeding , and the intervals assigned to such items by an optimal offline solution are sometimes slightly too long (because they have lengths of ).
The cost of an optimal offline solution is therefore at most . For large value of , we can neglect the additive term and find a lower bound on the ratio
for . This ratio is indeed at least for since
is a monotonically decreasing function of , and for it is minimized for , in which case
As in each of the four cases analyzed in the proof, the competitive ratio is at least , possibly in the limit as grows to infinity, is a lower bound on asymptotic competitive ratio.
3.2 A lower bound for randomized algorithms for MPAS
Now, instead of using an adaptive classification of items, we show how to use very small items instead. This construction, which yields a superior bound, also applies to randomized algorithms.
Theorem 3.2
The deterministic and randomized asymptotic competitive ratios for the peak problem are at least .
Proof. Let be large integers, such that is even, and is divisible by .
To prove the lower bound for randomized algorithms, we use Yao’s approach, where one considers the best deterministic online algorithm for a known probability distribution over inputs.
Each input starts with a fixed prefix of items of size each. For every point such that , define to be the number of items whose assigned intervals contain the point as an interior point or the left endpoint of the interval. Since the length of every interval is , its contribution to the definite integral is , and therefore
The integration is possible since the number of discontinuity points of is at most , i.e., a constant for every fixed pair . In fact, is constant between every two consecutive discontinuity points, including the boundary points and among those. This implies that we can find the total length of intervals where has the integer value for , which we denote by . Clearly, . Imagine sorting the intervals with fixed values of , so that, going from right to left along the interval, we have, in this order, a sequence of intervals, the -th of which, where , has length and associated value . This is captured by a non-increasing step function defined as follows: For every point where , let the unique such that
the function is well-defined, since naturally . Moreover, it holds that
(1) |
We further note that it follows from the definition of that any (left-closed) interval of length at least contains a point such that , i.e., a point which is contained in at least intervals assigned by the algorithm to the items from the input prefix.
Next, the input may continue in one of many ways. Specifically, consider an eventually fixed such that . Then, for every , there is an input which continues after the prefix with items of length . Since , we have
An optimal offline solution assigns all these items the interval , and it partitions the items of size from the prefix into subsets of , to be assigned the intervals for , i.e., all items from a -th subset are assigned the -th interval. Clearly, the cost of such solution is , i.e.,
(2) |
As for the algorithm, no matter what intervals it assigned to the items of size , they must all contain the interval , whose length is . Thus, by aforementioned properties of the function , there is a point such that , which implies that
(3) |
In addition, we consider the prefix of items by itself, i.e., with no further items released, and denote such instance . The optimal offline solution partitions items into subsets and uses all intervals for , so
(4) |
while by definition and properties of the function , for the online algorithm we have
(5) |
Suppose that the algorithm is asymptotically -competitive. Then, for some additive constant , the following inequality holds for any probability distribution over the instances :
(6) |
Plugging in the upper bounds on OPT, i.e., (2) and (4), as well as the lower bounds on ALG, i.e., (3) and (5), we get
which after moving the terms without to the right hand side becomes
Letting and for , the left hand side becomes an upper bound on the integral of over , so by (1),
Dividing by , the term tends to for , so letting , this inequality becomes
With growing to infinity, the sum tends to . Rearranging, we have
where finally letting yields the desired lower bound on .
We note that the even though we did not specify the probability distribution over instances upfront, it is fixed, and in particular it does not depend on the deterministic online algorithm, which thus may know the distribution a priori, as stipulated by Yao’s principle.
References
- [1] Y. Azar, J. Boyar, L. M. Favrholdt, K. S. Larsen, M. N. Nielsen, and L. Epstein. Fair versus unrestricted bin packing. Algorithmica, 34(2):181–196, 2002.
- [2] J. Balogh, J. Békési, G. Dósa, L. Epstein, and A. Levin. A new and improved algorithm for online bin packing. In Proc. of the 26th European Symposium on Algorithms (ESA2018), pages 5:1–5:14, 2018.
- [3] J. Balogh, J. Békési, G. Dósa, L. Epstein, and A. Levin. Lower bounds for several online variants of bin packing. Theory of Computing Systems, 63(8):1757–1780, 2019.
- [4] J. Balogh, J. Békési, G. Dósa, L. Epstein, and A. Levin. Online bin packing with cardinality constraints resolved. Journal of Computer and System Sciences, 112:34–49, 2020.
- [5] J. Balogh, J. Békési, G. Dósa, L. Epstein, and A. Levin. A new lower bound for classic online bin packing. Algorithmica, 83(7):2047–2062, 2021.
- [6] J. Balogh, J. Békési, and G. Galambos. New lower bounds for certain classes of bin packing algorithms. Theoretical Computer Science, 440:1–13, 2012.
- [7] M. Bienkowski, M. Pacut, and K. Piecuch. An optimal algorithm for online multiple knapsack. In Proc. of the 47th International Colloquium on Automata, Languages, and Programming (ICALP2020), LIPIcs, pages 13:1–13:17, 2020.
- [8] J. Boyar, L. M. Favrholdt, K. S. Larsen, and M. N. Nielsen. The competitive ratio for on-line dual bin packing with restricted input sequences. Nordic Journal of Computing, 8(4):463–472, 2001.
- [9] M. Cygan, L. Jez, and J. Sgall. Online knapsack revisited. Theory of Computing Systems, 58(1):153–190, 2016.
- [10] M. A. Deppert, K. Jansen, A. Khan, M. Rau, and M. Tutas. Peak demand minimization via sliced strip packing. In Proc. of the 24th International Conference on Approximation Algorithms for Combinatorial Optimization Problems (APPROX2021), pages 21:1–21:24, 2021.
- [11] C. Escribe, M. Hu, and R. Levi. Competitive algorithms for the online minimum peak appointment scheduling. Available at SSRN, 3787306, 2021. 31 pages.
- [12] W. Fernandez de la Vega and G. S. Lueker. Bin packing can be solved within in linear time. Combinatorica, 1(4):349–355, 1981.
- [13] H. Fujiwara and K. M. Kobayashi. Improved lower bounds for the online bin packing problem with cardinality constraints. Journal of Combinatorial Optimization, 29(1):67–87, 2015.
- [14] W. Gálvez, F. Grandoni, A. J. Ameli, and K. Khodamoradi. Approximation algorithms for demand strip packing. In Proc. of the 24th International Conference on Approximation Algorithms for Combinatorial Optimization Problems (APPROX2021), pages 20:1–20:24, 2021.
- [15] O. H. Ibarra and C. E. Kim. Fast approximation algorithms for the knapsack and sum of subset problems. Journal of the ACM, 22(4):463–468, 1975.
- [16] K. Iwama and S. Taketomi. Removable online knapsack problems. In Proc. of the 29th International Colloquium on Automata, Languages, and Programming (ICALP2002), pages 293–305, 2002.
- [17] 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 Journal on Computing, 3:256–278, 1974.
- [18] N. Karmarkar and R. M. Karp. An efficient approximation scheme for the one-dimensional bin-packing problem. In Proceedings of the 23rd Annual Symposium on Foundations of Computer Science (FOCS1982), pages 312–320, 1982.
- [19] A. Ranjan, P. P. Khargonekar, and S. Sahni. Offline first-fit decreasing height scheduling of power loads. Journal of Scheduling, 20(5):527–542, 2017.
- [20] D. Smedira and D. B. Shmoys. Scheduling appointments online: The power of deferred decision-making. CoRR, abs/2111.13986, 2021.