Manuscript Offprint
arXiv:2610.40290Leveraging Recourse and Size Bounds for OnlineKnapsack with Removable Items
Dimitris Fotakis [0000-0001-6864-8960], Laurent Gourvès [0000-0002-5076-1583], Aris Pagourtzis [0000-0002-6220-3722], and Panagiotis Patsilinakos [0009-0007-9540-2334]
National Technical University of Athens, Greece
Archimedes, Athena Research Center, Greece
Université Paris-Dauphine, Université PSL, CNRS, LAMSADE, Paris, France
fotakis@cs.ntua.gr, laurent.gourves@dauphine.fr,
pagour@cs.ntua.gr, panagiotis.patsilinakos@dauphine.psl.eu
Abstract. In the online unweighted knapsack problem, items arrive sequentially and must be accepted or rejected immediately for a bounded-capacity knapsack, aiming to maximize the total size of accepted items. When decisions are irrevocable, no algorithm achieves a non-trivial competitive ratio. An essential relaxation that circumvents this impossibility is to allow previously accepted items to be removed from the knapsack (a.k.a. removal). In this work, we investigate possible further improvements on the competitive ratio with removal by bringing together two other previously proposed model extensions: knowledge of an upper bound on the item sizes (a.k.a. bound awareness) and ability to reinsert previously rejected items (a.k.a. recourse). Our contributions are twofold. First, we establish close upper and lower bounds on the competitive ratio under bound awareness, removal and recourse. We show that significant improvements on the best known competitive ratio are possible when the upper bound on the item sizes is not too restrictive and only few uses of recourse are available. Second, we introduce the notion of adaptive online algorithms which do not require to know any upper bound on the item sizes but still achieve performance guarantees comparable to the ones obtained under the bound awareness model.
Keywords: Unweighted Knapsack · Adaptive Online Algorithms · Removable Items · Recourse
1 Introduction
We study the online unweighted knapsack problem in which some items, to be placed in a knapsack of capacity 1, are disclosed over time. Each item has a size . Starting from an initial empty set , item is revealed at round during which it must be decided to pack in or not. The value of , denoted by and defined as , should never exceed the capacity.
A preliminary version of this work appeared in IWOCA 2026 [11].
D. Fotakis et al.
The goal is to maximize when the instance stops, given that the number of items is not known in advance.
The competitive ratio (CR for short) of a deterministic online algorithm is the worst case ratio between the value of its solution and the value of an optimal solution . Every CR of this article is in [0, 1]. Unfortunately, no deterministic algorithm can exhibit a non-trivial CR (i.e., bounded away from zero by any constant) for the online unweighted knapsack problem [19]. This is mostly due to the fact that decisions are irrevocable. An essential relaxation that circumvents this impossibility is to allow items to be removed from after their insertion. Iwama and Taketomi showed that the online unweighted knapsack problem with removable items admits a -competitive algorithm with , and that no deterministic online algorithm can achieve a better CR [17].
Refined models have been proposed for improving upon the -competitive algorithm. One such model is recourse, in which a recourse operation allows one item that was previously rejected to be eventually packed. Concretely, an item may be discarded from the solution upon its arrival and temporarily stored in a buffer. Subsequently, this item may eventually be inserted into the solution, which requires a so-called recourse operation. Items removed after being packed can also be stored in the buffer and reinserted by a recourse operation.
In contrast to the unlimited number of removals, the number of recourse operations is typically small, as such operations can be costly in practice. Böckenhauer et al. have demonstrated (among other results) that the online unweighted knapsack problem with at most recourse operation(s) and removable items admits a deterministic -competitive algorithm, and that no algorithm can achieve better CR with recourse operation(s) [6, 7]. Consequently, a single recourse operation suffices to improve upon the ratio of .
The second model assumes that item sizes are upper-bounded by a value strictly smaller than the knapsack capacity. Moreover, when dealing repeatedly with such bounded instances, this bound can be known in advance and with precision.
Accordingly, bound awareness refers to the ability to know from the outset an upper bound such that holds for every item . As approaches 0, the instance becomes increasingly constrained; however, the potential errors of an algorithm have a diminishing impact on the CR. When items are removable and their sizes are upper bounded by , Gourvès and Pagourtzis [12] proposed an algorithm parameterized by whose CR improves upon whenever , given that is known to be the optimal CR (without recourse) when [17]. Figure 1 comprises an illustration of while its formal definition is given in Theorem 3.
Suppose a first item is released. If is not packed, then the instance stops. Otherwise, a second item of size 1 arrives and the instance stops. Clearly, cannot be packed because of . The CR of any deterministic algorithm for this instance is at most but can be arbitrarily close to 0.
Recourse operations are useless without the removability property [7].
In comparison with the -competitive algorithm of Böckenhauer et al., exceeds 2/3 for , exceeds 3/4 for , and exceeds 4/5 for .
The approaches of [7] and [12] are complementary yet incomparable: the former considers recourse without bound awareness, while the latter assumes bound awareness but allows no recourse.
To this end, we explore in Section 2 the possibility of combining recourse with bound awareness for the online unweighted knapsack problem with removable items. We establish both upper and lower bounds on the optimal CR, given an upper bound u on item sizes and a fixed limit on the number of recourse operations. Our bounds, established for many discrete values of u (typically for integers k), increase as decreases, as does the number of possible recourse operations (on the order of for the lower bound and of k for the upper bound). Our most significant results concern the most relevant cases in which u is large (so the instance is only weakly constrained) and the number of possible recourse operations is small.
Figure 1 provides an illustration where bullets (resp., triangles) correspond to lower (resp., upper) bounds on the optimal CR for a small number of recourse operations (this number is indicated in parentheses, to the right of the bullet/triangle). Concretely, having at coordinates means that for instances whose items have size at most , every algorithm using at most recourse operations has CR at most . Having at coordinates means that there exists a -competitive algorithm using at most recourse operations for instances whose items have size at most .
Our second approach, developed in Section 3, overcomes a drawback of bounded awareness. We continue to assume that item sizes are upper-bounded by a value u but u is not known in advance. Therefore, we propose an adaptive version of the parametric algorithm of [12]: its CR is approximately the same, but the parameter u is updated each time a (larger) new item is disclosed. Finally, an adaptive version of the algorithm that allows for one recourse operation is proposed, thereby improving the previously established competitive ratio.
Importantly, our adaptive algorithm yields a learning-augmented variant that can use an uncertain upper-bound prediction to match non-adaptive performance when correct, degrading by only a small factor in the worst case when incorrect.
All our bounds on CRs are for deterministic algorithms for the online unweighted knapsack problem with removable items, so we often omit this information.
1.2 Additional Related Work
We have already mentioned the most related to our work earlier results. Some additional related work is described below.
D. Fotakis et al.

Fig. 1. Bounds on the CR as a function of u. The solid curve depicts , the CR of the bound aware algorithm of [12]. Bullets and triangles correspond to lower and upper bounds on the optimal CR when recourse is allowed (only drawn for a small number of recourse operations). The maximum number of recourse operations is indicated in parentheses. On the left are the CRs from [17, 7], which are independent of u.
Regarding the possibility of item removal, an alternative model was proposed by Han et al. [13] where removal induces a cost either proportional to the item's size (by a value known as the buyback factor) or equal to 1. The objective is to maximize the worth of packed items minus the cost of removed items, counting only those that were removed after been packed. Under this model, Han et al. studied the unweighted online knapsack problem [13], obtaining ratios that tend to 1/2 when the buyback cost tends to 0. Babaioff et al. [2] considered, among others, the online weighted knapsack problem with a known upper bound on the size of any item. They gave a deterministic algorithm for the case whose competitive ratio is , which becomes when . This is below the ratio of [17] except for very small values of , and is also inferior to the ratios obtained in [12] for every value of the item size bound . However, the results of [2] hold for the weighted case as well; note that no deterministic algorithm can achieve any non-trivial CR for the online weighted knapsack, by removal only [18]. Another result of [2] is a randomized algorithm whose CR tends to 1/3 as goes to 0. Randomized algorithms for the online knapsack problem with (costless) removal can be found in [14, 10].
A variant to the idea of recourse was proposed by Böckenhauer et al. [3], where the possibility to reserve an item (i.e., postpone the decision about it) is studied. In that model items are non-removable and the decision on which to restore is taken at the end, assuming that the algorithm is informed once the instance ends and can take action afterwards. Assuming that reserving an item costs times its value, the authors characterize the best competitive ratio for all possible values of . The best ratio in [3] is 1/2, obtained for small values of ( ), and the performance deteriorates as increases. Note that in [7] they achieve a 2/3 CR with just one use of recourse and no information about the end of the instance; however, the two models are incomparable as in [3] there is no limit on the number of items that can be restored from the reserve, while in [7] there is no cost for reserving items in the recourse and bringing them into the solution. Another model supposes that the items can be placed in a buffer of size K > 1 before a selection of them is put in a knapsack of size 1 [15]; this model also assumes that the algorithm is informed when the input ends. Reservation with removability has been considered in [9].
Other proposed approaches for online knapsack include the possibility of augmentation of the knapsack size [18], the possibility of items being split and partially included in the knapsack [16], and the study of the advice complexity of the problem [8, 4]. The work of Zhou et al. on the weighted knapsack problem also makes (restrictive) assumptions about both the size of objects and their weight-to-size ratio [21].
For more information about the online knapsack problem, the interested reader may refer to a recent survey by Böckenhauer et al. [5].
2 Algorithms with Recourse
2.1 Lower Bounds on the Best Competitive Ratio
We propose (and analyze the CR of) Algorithm 1 where for some integer an upper bound on the item sizes of is assumed and at most recourse operations are allowed. Small and large items have size in and , respectively. It follows that any feasible solution contains at most large items. Upon the arrival of item , the high-level strategy of Algorithm 1 is to maintain a solution according to the following rules: (i) do not modify if ; (ii) when , attempt to exploit together with at most items from the buffer (via recourse operations) in order to construct a feasible solution of value at least ; (iii) if step (ii) fails, retain in the current solution the smallest large items, the largest large items, and all small items revealed so far.
Theorem 1. For an integer , Algorithm 1 is -competitive when . In addition, Algorithm 1 uses at most recourse operations.
Proof. The proof is by induction until it possibly happens that a feasible solution of value at least is built. As soon as the current solution has value at least (which occurs at line 4, or when the while loop at line 12 is executed, or at line 16), the algorithm is clearly -competitive because the optimal value is at most 1.
Consider the cases other than those of lines 4, 12, and 16. First, observe that if , then every small item disclosed so far belongs to S, and every
The while loop always creates a feasible solution of value at least .
D. Fotakis et al.
Algorithm 1 at most recourse operations, , for any integer
1: Small and large items have size in and , respectively
2: while a new item arrives do
3: if then
4: Put in the buffer
5: else
6: if then
7:
8: else
9: if then
10:
11: while do
12: Remove a small item from chosen arbitrarily
13: else
14: collection of all sets of at most elements of
15: which contain at most buffered items
16: if such that then
17:
18: else
19: Keep in the smallest large items seen so far, the largest large items seen so far, and every small item seen so far
item placed in the buffer is large. Indeed, an item is put into S if it fits (cf. line 7), which is always the case for small items because their size is at most .
Let (resp., ) be an optimal solution (resp., the solution produced by Algorithm 1) for the item set . Let and denote the restriction of to small and large items of , respectively. Let be a subset of large items taken in whose value is maximum under the constraint . We claim that Algorithm 1 maintains a feasible solution which guarantees
for until it possibly happens that . The base case () of the induction hypothesis (1) holds trivially: if is large then , otherwise , so . From now on, we assume that (1) holds for , right before is disclosed. Our proof also relies on the following observation whose proof is given in Appendix 4.1.
Observation 1 implies .
At line 7 of Algorithm 1, is put into the current solution because it fits. If is small, then , and , so . If is large, then , and , so . In both cases, the insertion of maintains the property of being -competitive.
The last case to be analyzed is line 18. In this context we have , and , implying that is a large item.
Suppose that at some point , contains for the first time a set of large items such that . This means that . Since Algorithm 1 maintains the smallest large items seen so far, it can exploit and the recourse operations to produce a set of large items such that . Since every large item has size at least , it holds that . Thus, the algorithm is able to produce a feasible solution of value at least as soon as a feasible set of large items exists.
It remains to consider the case where every set of large items such that satisfies . This is true, in particular, for . Moreover, cannot contain less than large items because the test of line 9 is false. Indeed, any set of large items has size at most 1 because every item has size at most . One cannot take a large item of the buffer, say , and have , because every set of large items such that satisfies . This means that . If , then when .
The final case is when . By the definition of , is non-decreasing with . Let us suppose that is the first moment that . This means that contains . Let denote the (large) items of where we assume w.l.o.g. that . We have .
Since keeps the largest items seen so far, we can assume that . In other words, at most recourse operations are needed to produce from because and are accessible without any recourse. Thus, at line 14 of Algorithm 1, meaning that the algorithm can produce a solution of value at least .
Finally, the following Observation 2, shows that Algorithm 1 is correct: it produces a feasible solution and uses at most recourse operations.
Observation 2 Algorithm 1 is correct.
Proof. Let us first consider how many times the recourse is used. By construction, recourse is made for possibly multiple items but during a single round, and for each recourse a solution whose value is between and 1 is produced.
At line 14, at most items are taken from the buffer. No recourse is necessary for building from and at line 18. Indeed, we have seen in the proof of Theorem 1 that contains exactly large items. More precisely, contains the smallest large items, say , and the largest large items, say , of , where . If , then . If , then . If , then .
It remains to prove that the algorithm maintains a solution whose value does not exceed 1. It is immediate at lines 7, 12 and 16. Let us show that
D. Fotakis et al.
holds at line 18. We have because . We also know that because , and . Thus, it holds that when .
Extending Theorem 1 to yields a CR of 3/4 using at most one recourse operation when . In fact, a modified version of Algorithm 1, Algorithm 4, using four classes of items (small, medium, large and extra-large) gives the following stronger result.
Theorem 2. There exists a deterministic -competitive algorithm using at most one recourse operation when .
Algorithm 4 at most 1 recourse operation and
1: , Small, medium, large and extra-large items have size in , , , and , respectively
2: while a new item arrives do
3: if then
4: Put in the buffer
5: else
6: if then
7:
8: else
9: Let
10: if then
11:
12: while do
13: Remove a small item from (chosen arbitrarily)
14: else
15: collection of all sets of at most 3 elements of which contain at most 1 item of the buffer
16: if such that then
17:
18: else
19: If contains two extra-large items, then place the largest one into the buffer, and keep the smallest one. Otherwise, if contains an extra large item and a large item, then place the large item into the buffer and keep the extra-large item. Otherwise, if contains 3 items (i.e., 3 medium items, or 2 medium items and 1 large item), then place the median one into the buffer, and keep the remaining 2 items (i.e., the smallest and the largest)
For the proof, we are going to analyze Algorithm 4 which tries to produce a solution whose value is between 3/4 and 1. Such a solution is called a target solution. We are particularly interested in non-small items, i.e., items whose size is strictly larger than . More specifically, we say that an item is small, medium, large, and extra-large when , , , and , respectively. Hence, non-small items are either medium, large or extra-large. At line 19, we use the notion of median item. Given three items , we say that is a median item if .
Proof. Algorithm 4 follows the same line as Algorithm 1. The same goes for their analyses. Indeed, using the same notations and arguments as in the proof of Theorem 1 it is not difficult to prove that Algorithm 4 is -competitive, except when line 19 is executed. This case happens when
and
hold, where designates right before is disclosed. By construction, contains all the small items disclosed so far. It follows from (2) that is non-small.
Since , and because non-small items have size strictly larger than , a combination of non-small items whose value lies in the interval must contain two or three elements. Table 1 provides the list of combinations of two or three non-small items, and the possibility that they satisfy the lower and upper bounds for being a target solution.
Table 1. Eight combinations of non-small items and comments on their total value. For example, “always ” means that the total value of the corresponding combination is always above 3/4, whereas “possibly > 1” indicates that the total value may exceed 1.
| #1 | 2 medium items | possibly < 3/4 | always ≤ 1 |
|---|---|---|---|
| #2 | 1 medium item + 1 large item | possibly < 3/4 | always ≤ 1 |
| #3 | 1 medium item + 1 extra large item | always ≥ 3/4 | always ≤ 1 |
| #4 | 2 large items | always ≥ 3/4 | always ≤ 1 |
| #5 | 3 medium items | always ≥ 3/4 | possibly > 1 |
| #6 | 1 large item + 1 extra large item | always ≥ 3/4 | possibly > 1 |
| #7 | 2 extra large items | always ≥ 3/4 | possibly > 1 |
| #8 | 2 medium items + 1 large item | always ≥ 3/4 | possibly > 1 |
For every other combination of non-small items it is guaranteed that its value is out of the interval . Combinations #3 and #4 are particularly interesting because they are guaranteed to be target solutions.
Note that because and would contradict (2) and (3), respectively.
D. Fotakis et al.
Having just a medium item in would contradict (2). Inequality (3) would be contradicted if contained one of the following combinations of two non-small items: 1 extra-large item plus another non-small item, or 2 large items. Thus, the only possibilities for the composition of are: 1 large item, 1 extra-large item, 2 medium items, and 1 medium plus 1 large items. All the possible cases are listed in Table 2.
Table 2. All the possible cases at line 19.
| composition of | is extra-large | is large | is medium |
|---|---|---|---|
| 1 extra-large item | case 1 | case 2 | case 3 |
| 1 large item | case 4 | case 5 | case 6 |
| 2 medium items | case 7 | case 8 | case 9 |
| 1 medium and 1 large items | case 10 | case 11 | case 12 |
For cases 3, 5, 7, 10 and 11, a target solution similar to combinations #3 or #4 can be created, so they are incompatible with the execution of line 19. Case 6 does not occur because it contradicts (2). Thus, line 19 covers all the remaining cases (1,2, 4, 8, 9, and 12), meaning that Algorithm 4 is correct.
Let be a set of non-small items of largest value within , without exceeding 1, for . As shown in the proof of Theorem 1, it suffices to prove to get that Algorithm 4 is -competitive at step . And as in the proof of Theorem 1, we make the induction hypothesis that .
Consider the cases 1, 2 and 4. By construction, the algorithm maintains one extra-large item in , so . If consists of a single non-small item, then . We deduce that . Suppose consists of two non-small items. If there is a medium item in , then it is possible to produce a combination #3 with a single recourse (use the extra-large item of ), and reach the value of at least 3/4: contradiction with the fact that no such combination exists in . Every pair of non-small items which does not include any medium item has value at least 3/4, so we again reach a contradiction. Finally, suppose that consists of three non-small items. Then, must include a medium item, implying that it is possible to produce a combination #3 with a single recourse: contradiction.
Consider the cases 8, 9 and 12. By construction, the algorithm maintains two non-small items in , the smallest and the largest, is either a pair of medium items or a medium and a large items, and . If consists of a single non-small item, then , and we deduce that .
Suppose consists of two non-small items. If there is an extra-large item in , then it is possible to produce a combination #3 with a single recourse (use a medium item of ), and reach the value of at least 3/4: contradiction with the fact that no such combination exists in .
Suppose consists of two medium items. Because , also contains two medium items. Since, by construction, the algorithm keeps the smallest and the largest items, we have where , and , so .
Suppose consists of a medium and a large items. Since, by construction, the algorithm keeps the smallest and the largest non-small items, also contains a medium and a large items. Moreover, the large item of is at least as large as the large item of . We have where , and , so .
Suppose consists of two large items, corresponding to combination #4 whose value is always in [3/4, 1]. Such a target solution belongs to because at most one recourse is needed to produce it: contradiction.
The remaining case is when consists of three items, say where . The set satisfies , and it must contain three medium items, or two medium items plus one large item, otherwise . We claim that a contradiction is reached because a single recourse is enough for constructing a solution such that with the use of and the non-small items of .
Indeed, by construction, the algorithm keeps the smallest non-small item, so we have where , , and . Suppose without loss of generality that (otherwise, swap and in our reasoning). One can use (if necessary) the recourse to get and produce the set such that . Moreover, because every member of is non-small.
Compared with [7], for identical competitive ratios, our results use fewer recourse operations, albeit under the assumption of bounded item sizes. Likewise, compared with [12], for identical bounds on item sizes, we achieve better competitive ratios thanks to the use of recourse.
2.2 Upper Bounds on the Best Competitive Ratio
It is known from [7, Thm. 1] that deterministic algorithms that use at most recourse operations have a CR of at most . This bound is established via instances in which the largest item has size . Consequently, both the size of the largest item and the upper bound on the CR increase with . However, it is also known that the optimal CR increases as decreases [12]. This motivates the need for novel upper bounds on the CR that reflect this dependence on .
Lemma 1. For every integer , there exists an upper bound of on the competitive ratio of deterministic algorithms with at most recourse operations when .
Proof. Take any online algorithm and suppose that an adversary reveals the following instance: large items of size followed by 2k small items of
D. Fotakis et al.
size , where . The instance can be interrupted at any moment if the algorithm's solution is (asymptotically) -approximate, or worse.
The first items fit into the knapsack. If the algorithm discards any of them, then the CR is at most as . Indeed, the optimal solution has value whereas the algorithm's solution has value at most . Henceforth, we assume that the first items belong to the solution.
When the -th item is revealed, it does not fit into the current solution, while the optimal value remains . The optimal value increases to 1 only upon the arrival of the final item, when the optimum consists of 2k small items. At this point, the algorithm may replace 1 large item with 1 small item, or buffer a small item, or replace 1 large item with 2 small items.
Action (i) decreases the value of the current solution by , yielding a CR of ; hence, the adversary can terminate the instance. Actions (ii) and (iii) do not significantly affect the solution value, but action (iii) can be performed at most times, as each use requires a recourse operation.
Since the instance contains large items, the algorithm must either perform action , or reach the end of the instance, where the optimal value is 1 while the algorithm's solution has value at most . In any case, the CR is at most as .
In the same spirit as Lemma 1, the following upper bounds can be derived.
Lemma 2. For every integer , there exists an upper bound of on the CR of deterministic algorithms with at most recourse operations when .
Proof. Take any online algorithm and suppose that an adversary discloses the following instance: large items of size followed by small items of size . We suppose that . The size of the largest item is . The instance can be interrupted at any moment by the adversary when the solution maintained by the algorithm is (asymptotically) -approximate, or worse.
The first items (which are identical) fit into the knapsack. If one of these items is not kept by the algorithm, then the competitive ratio is at most when tends to 0. From now on we suppose that the first items of the instance belong to the solution.
When the -th item of the instance is disclosed, it does not fit into the solution. However, the value of an optimal solution does not change. The optimal value changes only if the very last item is disclosed (i.e., it becomes 1 with small items).
In between, the algorithm can (1) replace one large item with one small item, or (2) buffer a small item, or (3) replace one large item with two small items.
Note that the first action decreases the value of the current solution by , giving a competitive ratio of when tends to zero. Therefore, the adversary can stop the instance if the first action is done. The second and third actions do not significantly change the value of the current solution (no decrease or a decrease by ). However, the third action can be performed at most times because each of them requires a recourse.
Since the instance comprises large items, the algorithm is forced, either to do the first action, or to reach the very end of the instance where the value of the optimum becomes 1 and the algorithm's solution has value at most . In any case, the competitive ratio is at best when goes to zero.
We now present a complementary upper bound on the CR for the case of a single recourse operation.
Lemma 3. The competitive ratio of any algorithm with at most one recourse operation is upper-bounded by when .
Proof. Let . The first items and have size and , respectively. If does not replace , then the competitive ratio is when goes to 0. From now on, suppose that is the current solution and is in the buffer. The third item has size . If the solution remains , then we get a ratio of which tends to when goes to 0. Otherwise, one can use the recourse to produce the solution . Then, a fourth item of size is disclosed. The optimum has size one, and the size of the current solution is at most , so the competitive ratio tends to when goes to 0. Given that and , we get an upper bound of when .
Let us summarize the bounds on the CR when a single recourse operation is possible (see Figure 1). There exist lower bounds of 4/5 when (Theorem 1), 3/4 when (Theorem 2), and 2/3 when ([7, Thm. 2]). There exist upper bounds of 5/6 when (Lemma 1, ), 4/5 when (Lemma 2, ), when (Lemma 3), and 2/3 when ([7, Thm. 1]).
In this section, we have proposed upper and lower bounds on the CR for certain combinations of upper bounds on object sizes, along with a limit on the number of allowable recourse operations. It would be interesting either to provide results for all possible combinations or to show that, for some combinations, recourse does not yield any significant improvement in the optimal CR. For example, what would be the best CR for all u with at most one recourse? Our results provide answers for , and we believe that a single recourse can only marginally improve the situation when u is very close to zero. Resolving this conjecture would be of great interest.
We suppose that and hold.
D. Fotakis et al.
3 Adaptive Algorithms
3.1 An Adaptive Algorithm with Removal Only
Algorithms that are aware of an upper bound on item sizes and whose CR is lower bounded by , but can exceed for most size upper bounds, exist [12]. Importantly, the smaller the size bound, the stronger the CR guarantees they provide (almost tight per upper bound). This raises the question:
Can we design algorithms whose competitive ratio (inversely) depends on the maximum item size, without any prior information?
Crucially, we want our adaptive algorithms’ CR to still be lower bounded by , in the worst case.
We begin by stating some useful definitions and theorems for the case of removable items without recourse. Consider an upper bound on the size of every item. In this section, we explicitly consider to be the maximum item size in the instance (unknown to the algorithm). Then, in [12] the following is shown:
Theorem 3 ([12]). For all integers , there exists a -competitive algorithm for a known , where is a constant defined as . In addition, for all integers , the same algorithm is -competitive when .
For all positive integers , increases with , and . We will refer to this algorithm of [12] as “NONADAPTIVE” here.
NONADAPTIVE can be adapted to get improved guarantees (compared to [17]) without knowing the item size upper bound u in advance, at the cost of a small penalty in the CR. Our adaptive version, Algorithm 2 (a.k.a. ADAPTIVE), follows NONADAPTIVE with the addition of lines 3, 4 and 5. These lines are used to dynamically update the value of k whereas NONADAPTIVE directly uses a fixed value, optimal for the given item size upper bound u.
The adaptive version updates an over-estimation of the upper bound (setting in line 5) whenever a larger item arrives and continues running with the corresponding threshold. We show that it preserves the guarantee of NONADAPTIVE tuned from the start to the final over-estimation. Since the true bound is smaller, the corresponding approximation guarantee is preserved.
Informally, NONADAPTIVE defines a threshold and classifies items as small or non-small. When a new item does not fit into the knapsack and the guarantee is not met, items are removed based on the total sum of non-small item sizes. Specifically, when the sum of non-small item sizes is infeasible, it removes the largest item, otherwise it removes small items until it gets a feasible solution.
Definition 1 (k-small items). An item o is said to be k-small if .
The challenge is to identify the case where ADAPTIVE might remove an important item that NONADAPTIVE would not. In this case ADAPTIVE would delete its current largest item: For a current estimation of k, say , the -non-small items seen-so-far do not fit in the knapsack, but for a later estimation, say , some of these items could be considered -small by NONADAPTIVE - allowing the rest to fit in the knapsack, not triggering the large item deletion. However, the over-estimation of the upper bound raises the non-small size threshold. Moreover, we target a lower CR which is easier to satisfy. Thus, as non-small items accumulate, the desired CR is achieved before they exceed the knapsack capacity.
The proofs of Observation 3 and Claim 1 are included in Appendix 4.3.
Observation 3 Consider that the item upper bound is u. Then the optimal parameter k for NONADAPTIVE to guarantee the best possible approximation is:
Theorem 4. For all positive integers , Algorithm 2, a.k.a. ADAPTIVE, is -competitive when where . In particular, ADAPTIVE is -competitive where .
Algorithm 2 : ADAPTIVE
1: , MaxItem 0,
2: while a new item arrives do
3: MaxItem
4:
▷ Optimal k considering MaxItem as the upper bound
5:
6: if then
7: Reject
▷ S is not changed afterwards
8: else
9:
10: if then
11: Let
▷ Reset B
12: if B contains a subset such that then
13:
▷ S is not changed afterwards
14: else if then
15: Remove the largest item of S
16: else
17: while do
18: Remove from S one element of
▷ chosen arbitrarily
Proof. It suffices to consider , since is increasing. By Theorem 3 we have that NONADAPTIVE is guaranteed to achieve approximation whenever
D. Fotakis et al.
. That is since for any , (from properties in [12] and ). Finally for , and NONADAPTIVE gives CR for any .
As ADAPTIVE runs, it computes the optimal parameter for NONADAPTIVE based on the largest item seen so far, using Observation 3, and sets (i.e., when the largest item size revealed is , we have ). The algorithm then updates the set of non-small items according to and follows the same thresholds and removal rules as NONADAPTIVE with parameter .
We use the following claim.
Claim 1 If the largest item size seen so far satisfies MaxItem (i.e., ), then ADAPTIVE has never removed any item in set B.
While , Claim 1 shows that no non-small item is removed before the desired CR is reached. If the algorithm removes small items to restore feasibility, then just before the last removal the value is greater than 1, and the removed item has size at most . The remaining value is therefore greater than . Since can only decrease, this solution satisfies every subsequent threshold and is not changed afterwards. The same holds if line 13 produces a solution of value at least .
Consequently, either the desired CR has already been reached, or no item has been removed while . If the input ends in the latter case, the solution contains all the items and is optimal. If becomes 1, the solution still contains all the previously seen items, unless the desired CR has already been reached. If its value is at least , the algorithm does not change it. Otherwise, NONADAPTIVE run with parameter 1 from the beginning would have kept the same items, and Algorithm 2 subsequently follows its rules, with the possible earlier selection of a subset of of value at least . Theorem 3 therefore gives CR in this case. In every case, the CR is at least .
Learning-Augmented Variant The adaptive algorithm also allows to create a learning-augmented via predictions version (cf. [1, 20]).
The goal is to design algorithms that leverage predictive input, motivated by modern ML systems' ability to provide such insight. We are interested in two performance measures: (a) Consistency, the worst-case CR when predictions are perfect, and (b) Robustness, the worst-case CR when predictions are arbitrarily incorrect. In our setting, the prediction concerns the true item-size upper bound.
For our version, we identify the following key property:
Lemma 4. Items of size up to are , for .
This implies that the deletion order of previously seen items is irrelevant when targeting a approximation. This allows us to follow the non-adaptive strategy of [12] and, if the prediction is invalidated, switch to ADAPTIVE's strategy.
Specifically, the algorithm needs to follow the following basic steps:
-
For the prediction of the item-size upper bound , let be the optimal value of , according to Observation 3.
-
If , then run ADAPTIVE until completion, else continue.
-
Start by running algorithm ADAPTIVE.
-
If at any step it holds that , then keep the current knapsack state as is and start running NONADAPTIVE with parameter from there on.
-
If at any step an item arrives such that , then recalculate the new (as in line 4 of ADAPTIVE), keep the current knapsack state as is, and start running ADAPTIVE setting
Use this assignment in every subsequent iteration and do not use the prediction again.
The tests in steps 4 and 5 are performed after updating MaxItem and , but before processing the arriving item. Step 5 takes precedence over step 4.
Theorem 5. There exists an algorithm that, given a prediction of the item-size upper bound, achieves Consistency at least the guarantee of NONADAPTIVE from [12] with parameter and Robustness of for all . For , it guarantees both Consistency and Robustness of , where .
3.2 Adaptive Algorithm with Removal and Recourse
In this section, we extend the previous result by turning our attention to adaptive algorithms (with unknown item size upper bound) that can also use a recourse.
The goal is to incorporate the recourse into a new version of the adaptive algorithm so that we can create an equivalent of Theorem 4, that guarantees a CR even closer to the best possible that the non adaptive algorithm can achieve. Specifically, we aim for a CR of at least when . The main logic is as follows:
Maintain the same strategy as ADAPTIVE and keep considering items of size larger than to be non-small, where , but only terminate if the sum of collected items gives CR (at least) , where . That is, run the algorithm as if we were trying to get CR , but only accept the solution if a CR of is satisfied instead. While doing so, also keep track of the items of size larger than , i.e., “non-very-small items”. I.e., the items we should have considered as “non-small” if we were aiming for CR of , by the logic of NONADAPTIVE.
Unlike non-small items in the proof of Theorem 4, which always additively guarantee the desired CR before becoming infeasible, non-very-small items lack
D. Fotakis et al.
Algorithm 3 ADAPTIVE WITH RECOURSE
1: 2: MaxItem 0 3: 4: while a new item arrives do 5: MaxItem max{MaxItem, } 6: max Optimal k considering MaxItem as the upper bound. 7: max 8: max 9: if then 10: Reject S is not changed afterwards 11: else 12: 13: if then 14: Let Reset B 15: if S contains a subset such that then 16: S is not changed afterwards 17: break 18: if or then 19: Remove the largest item of S (send to the buffer) 20: else if contains a subset such that then 21: Use the recourse to bring item back and set: 22: S is not changed afterwards 23: break 24: else 25: while do 26: Remove from S the smallest element of (send to the buffer)
this property. As a result, the adaptive algorithm may remove items that it could later combine with new arrivals to achieve the target ratio. With careful analysis, we identify the unique case where this occurs and show that the algorithm can detect it and use a single recourse when needed.
When B is empty, the algorithm removes the largest item, as NONADAPTIVE would do. Otherwise, it deletes small items in increasing order. If the two algorithms delete different items before reaching the target, Algorithm 3 retains at least as much value as NONADAPTIVE. Upon the next non-very-small item, either a target solution is available among the current items, or it can be obtained by a single recourse. The technical analysis is given in Appendix 4.4.
Theorem 6. For all positive integers , Algorithm 3 is -competitive when , where , using at most one recourse.
In Figure 2, we show the performance of, ADAPTIVE and ADAPTIVE WITH RECOURSE, compared to the upper-bound aware algorithm of [12].

Fig. 2. The black continuous lines represent the CR of NONADAPTIVE, the red dashed the CR of ADAPTIVE and the blue dotted the CR of ADAPTIVE WITH RECOURSE.
Acknowledgments. This work has been partially supported by project MIS 5154714 of the National Recovery and Resilience Plan Greece 2.0 funded by the European Union under the NextGenerationEU Program. Panagiotis Patsilinakos has received support under the program “Investissements d’Avenir” launched by the French Government, project PSL JRC 2024 - N 2024- 488. This work received the support of “Partenariat Hubert Curien France/Grèce – ARISTOTE”.
References
-
Babaioff, M., Hartline, J.D., Kleinberg, R.D.: Selling ad campaigns: online algorithms with cancellations. In: EC. pp. 61–70. ACM (2009)
-
Böckenhauer, H., Burjons, E., Hromkovic, J., Lotze, H., Rossmanith, P.: Online simple knapsack with reservation costs. In: STACS. pp. 16:1–16:18. LIPIcs, Schloss Dagstuhl - Leibniz-Zentrum für Informatik (2021)
-
Böckenhauer, H., Frei, F., Rossmanith, P.: Removable online knapsack and advice. In: STACS. pp. 18:1–18:17. LIPIcs, Schloss Dagstuhl - Leibniz-Zentrum für Informatik (2024)
-
Böckenhauer, H., Hromkovic, J., Komm, D., Rossmanith, P., Stocker, M.: A survey of online knapsack problems. Discret. Appl. Math. 378, 492–507 (2026)
-
Böckenhauer, H., Klasing, R., Mömke, T., Rossmanith, P., Stocker, M., Wehner, D.: Online knapsack with removal and recourse. In: IWOCA. LNCS, vol. 13889, pp. 123–135. Springer (2023)
-
Böckenhauer, H., Klasing, R., Mömke, T., Rossmanith, P., Stocker, M., Wehner, D.: Online knapsack with removal and recourse. J. Comput. Syst. Sci. 155, 103697 (2026)
-
Böckenhauer, H., Komm, D., Královic, R., Rossmanith, P.: The online knapsack problem: Advice and randomization. Theor. Comput. Sci. 527, 61–72 (2014)
-
Burjons, E., Gehnen, M., Lotze, H., Mock, D., Rossmanith, P.: The online simple knapsack problem with reservation and removability. In: MFCS. pp. 29:1–29:12. LIPIcs, Schloss Dagstuhl - Leibniz-Zentrum für Informatik (2023)
D. Fotakis et al.
-
Cygan, M., Jez, L., Sgall, J.: Online knapsack revisited. Theory of Computing Systems 58(1), 153–190 (2016)
-
Fotakis, D., Gourvès, L., Pagourtzis, A., Patsilinakos, P.: Removable online knapsack: Exploiting recourse and bounded item sizes. In: Combinatorial Algorithms: 37th International Workshop, IWOCA 2026, Clermont-Ferrand, France, June 8–11, 2026, Proceedings. pp. 296–310. Springer-Verlag, Berlin, Heidelberg (2026). https://doi.org/10.1007/978-3-032-27732-9_21, https://doi.org/10.1007/978-3-032-27732-9_21
-
Gourvès, L., Pagourtzis, A.: Removable online knapsack with bounded size items. In: SOFSEM. LNCS, vol. 14519, pp. 283–296. Springer (2024)
-
Han, X., Kawase, Y., Makino, K.: Online unweighted knapsack problem with removal cost. Algorithmica 70(1), 76–91 (2014)
-
Han, X., Kawase, Y., Makino, K.: Randomized algorithms for online knapsack problems. Theor. Comput. Sci. 562, 395–405 (2015)
-
Han, X., Kawase, Y., Makino, K., Yokomaku, H.: Online knapsack problems with a resource buffer. In: ISAAC. LIPIcs, vol. 149, pp. 28:1–28:14. Schloss Dagstuhl - Leibniz-Zentrum für Informatik (2019)
-
Han, X., Makino, K.: Online removable knapsack with limited cuts. Theor. Comput. Sci. 411(44-46), 3956–3964 (2010)
-
Iwama, K., Taketomi, S.: Removable online knapsack problems. In: ICALP 2002, Malaga, Spain, July 8-13, 2002, Proceedings. pp. 293–305 (2002)
-
Iwama, K., Zhang, G.: Online knapsack with resource augmentation. Information Processing Letters 110(22), 1016–1020 (2010)
-
Marchetti-Spaccamela, A., Vercellis, C.: Stochastic on-line knapsack problems. Math. Program. 68, 73–104 (1995)
-
Mitzenmacher, M., Vassilvitskii, S.: Algorithms with Predictions, p. 646–662. Cambridge University Press (2021)
-
Zhou, Y., Chakrabarty, D., Lukose, R.M.: Budget constrained bidding in keyword auctions and online knapsack problems. In: WINE. LNCS, vol. 5385, pp. 566–576. Springer (2008)
4 Appendix
4.1 Proof of Observation 1
Observation 1 implies .
Proof. Let and be the restrictions of to small and large items, respectively. We have
for . By the definition of , we know that
holds for . As previously mentioned, the algorithm puts every small item in the current solution until we possibly have , meaning that
holds for . Combining (1), (4), (5), and (6) gives .
4.2 Useful Details from [12]
In this section we list further useful details from [12]. The competitive ratios are achieved by NONADAPTIVE introduced in the same work.
Algorithm 5
1:
2: while a new item arrives do
3: if then
4: Reject
5: else
6:
7: if then
8: Let
9: if then
10: if contains a subset such that then
11:
12: else
13: Remove the largest item of
14: else
15: while do
16: Remove from one element of
17: ▷ chosen arbitrarily
The competitive ratios given in [12] (and the equivalent upper bounds), of deterministic online algorithms for the unweighted knapsack problem with
D. Fotakis et al.
removable items are depicted in Figure 3. The lower (solid) and upper (dotted) bounds on are non-increasing functions of u. One can observe that the competitive ratio is always above t, where , and the performance guarantee increases (and tends to 1) as the size of the items reduces.
Along with Theorem 3 mentioned in Section 3, the following theorem complements the result and corresponds to the “sloped” segments of the CR figure, providing an (almost tight) approximation guarantee for all possible values of u.
Theorem 7. For all integers , Algorithm 5 is -competitive when .

Fig. 3. Lower (solid) and upper (dotted) bounds on the competitive ratio as a function of u.
The rationale of originates from the following equality:
Other useful technical properties of (valid for all positive integers , except for (11), which requires ) are:
4.3 Proofs from the Adaptive Algorithm with Removal Analysis
Observation 3. Consider that the item upper bound is u. Then the optimal parameter for NONADAPTIVE to guarantee the best possible approximation is:
Proof. The observation easily follows from Theorems 3 and 7. Specifically, as mentioned in [12], is the solution of the equation for . I.e., where the approximation guarantee given by Theorem 7 for is equal to the approximation guarantee given by Theorem 3 for , making a better parameter for any larger .
Furthermore, for and any Theorem 3 guarantees a better or equal approximation ratio using parameter , i.e., . That is since is the solution to by substitution.
Finally, notice that for , the ratio becomes 1 (i.e., larger or equal to any ).
Claim 1: As long as the largest item size, MaxItem, seen so far by the algorithm satisfies MaxItem (i.e., ), Algorithm 2 has never removed an item from set B, i.e., a non-small item.
Proof. We prove the claim by showing that because we are checking for a set satisfying an approximation ratio of , instead of , the sum of items in will always become larger than before becoming infeasible (i.e., larger than 1). We show this by using Lemmas 5 and 6.
Specifically, by definition, at any point, the algorithm has seen items of size up to
By step 11 of the algorithm, resetting B at an overflow, all items in B at that point must be of size strictly greater than .
By Lemma 5 we have that
This means that whenever there are items in , there is a set that satisfies .
That is, no item is deleted while being a member of B i.e., considered non-small at the current phase. An item that has been a member of B but is in a later phase re-classified as small (i.e., member of S but not member of B) can get deleted.
Where the optimal k for the items bounded by the highest value seen so far.
D. Fotakis et al.
Finally, by Lemma 6, we have:
The right part of the product on the left side of the inequality is an upper bound on the largest possible item size seen so far. Thus, whenever there are items in B, they can fit in the knapsack and would be returned as the algorithm's solution.
Lemma 5. For ,
Proof. It suffices to prove the first inequality, the second stands by definition of as an increasing function in [12].
We prove this by using the stronger Lemma 7, described and proven in Appendix 4.4: For all integers and ,
Specifically, all we need to note is that , since . Thus, applying the lemma for we get:
Which is the desired inequality.
Lemma 6. For ,
Proof. For k = 1, the left hand side is 0 so the inequality holds.
For , we first notice that the denominator, on the left side, , is positive. Thus the inequality is equivalent to:
Which stands for all .
□
4.4 Formal Definition and Analysis of Algorithm ADAPTIVE WITH RECOURSE
We begin by providing the formal description of algorithm ADAPTIVE WITH RECOURSE:
Similarly to the previous case of Algorithm 2, our strategy is to show that our adaptive algorithm will behave almost exactly, in this case, as the non adaptive algorithm would have if it was running for from the beginning. Then, should an approximation-wise noticeable difference have emerged, we can identify it and use the recourse to “reverse” it to the required degree such that a solution with the targeted approximation is provided. Critically, we can always do this before the input ends.
We begin the analysis of the algorithm by stating some key observations and lemmata.
For the analysis, apart from the previous definition of the set of non-small items, (and its instance at step ), we also need to define an equivalent set of “non-very-small-items”. That is, items of size (i.e., -non-small items in the general case). We equivalently use the terms and for this set. By definition, at any . Even though Algorithm 3 still defines the set of non-small items to generally be -non-small items, in this case we want to compare its behavior to the non-adaptive algorithm, Algorithm 5, run with parameter (since we are trying to guarantee approximation in this case). Here within the phase under consideration, and and refer to the corresponding subsets of the currently held items.
Observation 4 By Lemma 5, we have that the main condition used in the analysis of Algorithm 2, i.e., that no item in the current set of non-small items will be deleted, also stands for Algorithm 3 before reaching the target, when , where we are trying to reach approximation.
The proof is identical to Claim 1. All we have to notice is that in that specific proof we didn’t use Lemma 5 tightly: We only needed that when it is also . The additional largest-item deletion in line 18 is performed only when , so it does not remove a non-small item.
The following lemma is key to understanding the structure of non-small items. To maintain the narrative, we state the Lemma here and provide its proof after the proof of the main theorem, towards the end of the section:
Lemma 7. For all integers and ,
Corollary 1. Lemma 7 in combination with Lemma 6 show that whenever there are non-very-small-items such that at least two of them are non-small, then their sum is a feasible solution of at least approximation ratio.
Observation 5 If Algorithm 3 deletes an item while and has not reached its target, its solution after that iteration has value greater than . If subsequently decreases, the new target is already satisfied.
D. Fotakis et al.
Proof. By Observation 4, all deleted items have size at most . Immediately before the last deletion that restores feasibility, the solution has value greater than 1. Therefore, afterwards its value is greater than . Further iterations with the same parameter preserve this bound. If the parameter decreases to , the new target is , so line 9 applies before processing the new item.
The following lemma completes the picture of the possible structures of non-small-items that could provide the approximation ratio:
Lemma 8. For any ,
That is, if k non-very-small items fit in the knapsack, then their sum gives the required approximation.
The proof of the main theorem distinguishes the case where B is empty from the case where there is exactly one non-small item. In the former case, Algorithm 3 removes the largest item, as Algorithm 5 would do. In the latter case, we compare the values of the two solutions and show that the next non-very-small item either gives a target solution directly or allows the use of one recourse. By Observation 5, a change in before termination can occur only before any deletion.
We are now ready to conclude with the formal proof of Theorem 6:
Theorem 6. For all positive integers , Algorithm 3 is -competitive when , where , using at most one recourse.
Proof. Since increases with , it suffices to prove the guarantee for of Observation 3. We first consider a phase during which . Write
Thus , and . Algorithm 5 run with parameter guarantees approximation for the item-size upper bound of this phase, by Theorem 3 and the same argument used in the proof of Theorem 4.
Suppose that an item causes , but the test in line 15 finds no subset with value in . Then . Otherwise, deleting items outside , each of size at most , until feasibility is restored would leave a subset of value greater than , a contradiction. Just before the new item arrived, the solution contained at most items in : a feasible set of such items would already reach the target by Lemma 8. By Lemma 6, any items fit. Hence the current set has exactly items. By Corollary 1, at most one of them belongs to , since otherwise a subset of items would reach the target.
If , Algorithm 3 removes the largest item. This is exactly the choice of Algorithm 5 when . It restores feasibility, since the removed item is at least as large as the arriving item. Until the first deletion with , the two algorithms therefore have the same solution, unless Algorithm 3 has already reached its target.
Consider that first deletion with , and let be the size of its unique non-small item. Let be the size of the smallest other item in , let be the total size of the remaining items in , and let be the total size of the items outside . Algorithm 3 deletes all items outside and then the item of size , leaving value ; Algorithm 5 removes the item of size , leaving value . The former solution is feasible by Lemma 6. The latter is feasible because is the largest item and the solution was feasible before the arrival. Neither has value at least , since both are subsets tested in line 15.
In fact, the failed test also implies . If this were false, starting with the feasible set of value and adding items outside C until reaching would produce a subset of value at most . Since is the smallest of the items in , we have . By Lemma 7,
Consequently,
Thus : Algorithm 3 retains at least as much value as Algorithm 5. If the input ends now, its competitive ratio is at least . Until another item in C arrives, items of size at most c fit in both solutions while their values are below , and preserve this comparison.
Consider the next item of size greater than c. If a target subset exists, Algorithm 3 finds it. Otherwise the preceding argument again gives exactly k items in C, with the same unique non-small item of size z. A second non-small item would yield a target subset by Corollary 1. Let be the smallest size among the other items in C, and let be the sum of the remaining sizes. The set of value is feasible and has value less than , so
The previous deletion similarly gives . By restoring the item of size and removing the non-small item, we obtain items in with total size
To verify the last inequality, Lemma 7 gives . For , using , we obtain
Since , the inequality follows. For , it follows directly from
D. Fotakis et al.
By Lemma 8, the feasible set in (16) has value greater than . It is available in the test of line 20 by using the previously deleted item of size . The algorithm therefore uses one recourse and reaches its target. No further recourse is used.
It remains to consider changes in . By Observation 5, a decrease after any deletion immediately satisfies the new target. Every change before that has retained all items seen so far, so the preceding comparison with Algorithm 5 begins from the same solution. If , then . After a failed target subset test, necessarily holds, by the same small-item deletion argument. The algorithm then behaves as Algorithm 5 with parameter 1 and guarantees .
Finally, a solution that reaches its current target also meets every later target, since can only decrease. If the input ends before this happens, the comparison with Algorithm 5 in the final phase gives the claimed ratio. This completes the proof.
Next, we provide the proof of Lemma 7 (restated below):
Lemma 7. For all integers and ,
Proof. It suffices to notice that:
That is, since , the inequality becomes stronger as decreases. Furthermore, the upper bound of 1 follows from , since the expression contains terms, each at most .
We first rewrite the left-hand side:
From the definition of , we obtain
Therefore,
Multiplying by , we see that (18) is equivalent to
(22) where
For any x > 0, we use the inequality
Applying (24) with and (valid for ), we obtain
Substituting these bounds into gives
(27)
A direct simplification yields:
For , we have , and
Thus, for all integers ,
and therefore, by (28),
It remains to check the cases and .
For , inequality (18) becomes
We compute and get:
D. Fotakis et al.
which is true.
For k = 4, inequality (18) becomes
or equivalently,
We compute and get:
which is also true.
Therefore, inequality (18) holds for and for all integers . Hence, it is valid for all integers .
We continue with the proof of Lemma 8
Lemma 8 For any ,
Proof. Since and set . Then , and the inequality
is equivalent to
Recall that
We first prove that .
The inequality
is equivalent, since , to
Dividing by , we obtain
Both sides are positive, so we may square:
Which reduces to n > 0, which proves this direction as .
We now prove that . By (40) and the definition of this is equivalent to:
Since the above becomes:
Dividing by , we find
Using the inequality
valid for . Thus, for , we get:
verifying (54).
For the remaining case (that is, ), we evaluate both sides directly and get:
Which holds and completes the proof.
□
D. Fotakis et al.
4.5 Learning-Augmented Version
We begin by describing the strategy of the augmented algorithm. Since we have already presented algorithms ADAPTIVE and Algorithm 5 of [12] and their similarities, we make a more informal presentation, that focuses on presenting the key aspect of how we capitalize on their behavior.
Next, we produce the arguments that prove Theorem 5:
Proof. Whenever , we only run ADAPTIVE and ignore the prediction. Thus, we guarantee approximation of , where , by Theorem 4 which bounds both the robustness and the consistency of the algorithm.
We now focus on the more interesting case where . If is the optimal for the real upper bound according to Observation 3, we break the analysis into the following cases:
Case . In this case the prediction is not accurate and thus we need to show the robustness bound. We identify two sub-cases:
: Then, the algorithm will terminate during the run of ADAPTIVE in step 3 guaranteeing approximation (Theorem 4).
: Then the algorithm reaches step 4, unless the required guarantee has already been achieved. Notice that our algorithm will immediately switch to Algorithm 5 as soon as . This switch is performed before processing the arriving item. Before this arrival, , unless this is the first item. That is, at the point of the switch, all items preceding the arriving item would be considered small, w.r.t to , by Lemma 4. Thus, using the same logic as in the proof of Theorem 4, all earlier items would have been considered as by Algorithm 5 and their deletion order doesn't matter. More precisely, by the proof of Theorem 4, any earlier deletion or rejection leaves value at least , since until the switch . Otherwise, all earlier items remain. Thus, unless the value already reaches , the current state is the same as for Algorithm 5 with parameter from the beginning. The arriving item is then processed by Algorithm 5. Since (hence ), Algorithm 5 will still provide approximation , by Theorem 3 [12]. But we have which is better than the desired robustness.
Case . First suppose that the prediction is never invalidated. This case follows the same switching argument as the sub case of the previous case. All we have to notice is that since now , Algorithm 5 will guarantee its best possible competitive ratio as stated by Theorem 3 (mentioned in Section 3) of [12]. This proves consistency when , and robustness otherwise, since this guarantee is at least . If the prediction is invalidated, the argument in the following case applies as well.
Case . I.e., the prediction is not accurate and thus we need to show the robustness bound. An item invalidating the prediction must arrive. The following argument also applies when and the prediction is invalidated. When the first item invalidating the prediction arrives (i.e., an item of size , we immediately return to running ADAPTIVE with at every subsequent iteration. By Lemma 4, this means that all items preceding this arrival are -small, so their deletion order doesn't matter when we are targeting an approximation ratio of at most . More precisely, if an earlier deletion has occurred, the last deletion restoring feasibility leaves value greater than . Selection of a feasible subset or rejection at a termination condition also leaves at least this value. This already suffices, since . Otherwise, all earlier items remain. The proof of Theorem 4 applies to the subsequent run because never increases and, whenever , satisfies : by Lemmas 5 and 6, non-small items fit and already reach , so no non-small item is removed before reaching the target; deleting small items to restore feasibility reaches the target. The case is handled as in that proof. The final guarantee is therefore , which is at least when , and at least otherwise. Thus the desired guarantee directly follows from the analysis of ADAPTIVE (i.e., proof of Theorem 4).
This concludes the proof.
We finalize with the formal proof of the key lemma:
Lemma 4: Items of size up to are , for .
Proof. It suffices to show that
That is, since is increasing in , we have whenever . Thus , when and , feasible, i.e., .
Notice that we only care about showing the lemma for , since we only need to use it for cases where is “feasible”, in the sense that (as it is for in general).
By expanding equation (58) we get that it must be:
Notice that the denominator of the fraction in equation 59 is always positive for feasible k, i.e., for .
D. Fotakis et al.
Thus it suffices to show that for
Set , so that . Define:
Using the conjugate, we obtain:
which implies:
Substituting (63) into (61), we get:
Since , we have:
and therefore , which proves the inequality.
AI Disclosure. After writing the full version of the paper, chatGPT was used to assist with mathematical proofreading, minor corrections and streamlining the writing.