This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Packing a Knapsack of Unknown Capacity

Yann Disser Supported by the Alexander von Humboldt Foundation. Department of Mathematics, Technische Universität Berlin, Germany.
{disser,klimm,nmegow,stiller}@math.tu-berlin.de.
Max Klimm Department of Mathematics, Technische Universität Berlin, Germany.
{disser,klimm,nmegow,stiller}@math.tu-berlin.de.
Nicole Megow Supported by the German Science Foundation (DFG) under contract ME 3825/1. Department of Mathematics, Technische Universität Berlin, Germany.
{disser,klimm,nmegow,stiller}@math.tu-berlin.de.
Sebastian Stiller Department of Mathematics, Technische Universität Berlin, Germany.
{disser,klimm,nmegow,stiller}@math.tu-berlin.de.
Abstract

We study the problem of packing a knapsack without knowing its capacity. Whenever we attempt to pack an item that does not fit, the item is discarded; if the item fits, we have to include it in the packing. We show that there is always a policy that packs a value within factor 2 of the optimum packing, irrespective of the actual capacity. If all items have unit density, we achieve a factor equal to the golden ratio φ1.618\varphi\approx 1.618. Both factors are shown to be best possible.

In fact, we obtain the above factors using packing policies that are universal in the sense that they fix a particular order of the items and try to pack the items in this order, independent of the observations made while packing. We give efficient algorithms computing these policies. On the other hand, we show that, for any α>1\alpha>1, the problem of deciding whether a given universal policy achieves a factor of α\alpha is 𝖼𝗈𝖭𝖯\mathsf{coNP}-complete. If α\alpha is part of the input, the same problem is shown to be 𝖼𝗈𝖭𝖯\mathsf{coNP}-complete for items with unit densities. Finally, we show that it is 𝖼𝗈𝖭𝖯\mathsf{coNP}-hard to decide, for given α\alpha, whether a set of items admits a universal policy with factor α\alpha, even if all items have unit densities.

1 Introduction

In the standard knapsack problem we are given a set of items, each associated with a size and a value, and a capacity of the knapsack. The goal is to find a subset of the items with maximum value who’s size does not exceed the capacity. In this paper, we study the oblivious knapsack problem where the capacity of the knapsack is not given. Whenever we try to pack an item, we observe whether or not it fits the knapsack. If it does, the item is packed into the knapsack and cannot be removed later. If it does not fit, we discard it and continue packing with the remaining items. The central question of this paper is how much we loose by not knowing the capacity, in the worst case. The oblivious variant of the knapsack problem naturally arises whenever items are prioritized by a different entity or at a different time than the actual packing of the knapsack.

A solution to the oblivious knapsack problem is a policy that governs the order in which we attempt to pack the items, depending only on the observation which of the previously attempted items did fit into the knapsack and which did not. In other words, a policy is a binary decision tree with the item that is tried first at its root. The two children of the root are the items that are tried next, which of the two depends on whether or not the first item fits the knapsack, and so on. We aim for a solution that is good for every possible capacity, compared to the best solution of the standard knapsack problem for this capacity. Formally, a policy has robustness factor α\alpha if, for any capacity, packing according to the policy results in a value that is at least a 1/α1/\alpha-fraction of the optimum value for this capacity.

We show that the oblivious knapsack problem always admits a robustness factor of 2. In fact, this robustness factor can be achieved with a policy that packs the items according to a fixed order, irrespective of the observations made while packing. Such a policy is called universal. We provide an algorithm that computes a 2-robust, universal policy in time Θ(nlogn)\Theta(n\log n) for a given set of nn items. We complement this result by showing that no robustness factor better than 2 can be achieved in general, even by policies that are not universal. In other words, the cost of not knowing the capacity is exactly 2.

We give a different efficient algorithm for the case that all items have unit density, i.e., size and value of each item coincide. This algorithm produces a universal policy with a robustness factor of at most the golden ratio φ1.618\varphi\approx 1.618. Again, we show that no better robustness factor can be achieved in general, even by policies that are not universal.

While good universal policies can be found efficiently, it is intractable to compute the robustness factor of a given universal policy and it is intractable to compute the best robustness factor an instance admits. Specifically, we show that, for any fixed α(1,)\alpha\in(1,\infty), it is 𝖼𝗈𝖭𝖯\mathsf{coNP}-complete to decide whether a given universal policy is α\alpha-robust. For unit densities we establish a slightly weaker hardness result by showing that it is 𝖼𝗈𝖭𝖯\mathsf{coNP}-complete to decide whether a given universal policy achieves a given robustness factor α\alpha. Finally, we show that, for given α\alpha, it is 𝖼𝗈𝖭𝖯\mathsf{coNP}-hard to decide whether an instance of the oblivious knapsack problem admits a universal policy with robustness factor α\alpha, even when all items have unit density.

Related work

The knapsack problem has been studied for different models of imperfect information. In the stochastic knapsack problem, sizes and values of the items are random variables. It is known that a policy maximizing the expected value is 𝖯𝖲𝖯𝖠𝖢𝖤\mathsf{PSPACE}-hard to compute, see Dean et al. [7]. The authors assume that the packing stops when the first item does not fit the knapsack, and give a universal policy that approximates the value obtained by an optimal, not necessarily universal, policy by a factor of 22. They also provide a non-universal policy within a factor of 3+ε3+\varepsilon of the optimal policy. Bhalgat et al. [3] give an algorithm with an improved approximation guarantee of 8/3+ε8/3+\varepsilon. They also give a PTAS for the case that it is allowed to violate the capacity of the knapsack by a factor of 1+ε1+\varepsilon.

In robust knapsack problems, a set of possible scenarios for the sizes and values of the items is given. Yu [24], Bertsimas and Sim [2], Goetzmann et al. [12], and Monaci and Pferschy [19] study the problem of maximizing the worst-case value of a knapsack under various models. Büsing et al. [5] and Bouman et al. [4] study the problem from a computational point of view. Both allow for an adjustment of the solution after the realization of the scenario. Similar to our model, Bouman et al. consider uncertainty in the capacity.

The notion of a robustness factor that we adopt in this work is due to Hassin and Rubinstein [13] and is defined as the worst-case ratio of solution and optimum, over all realizations. Kakimura et al. [15] analyze the complexity of deciding whether an α\alpha-robust solution exists for a knapsack instance with an unknown bound on the number of items that can be packed. Megow and Mestre [17] study a variant of the knapsack problem with unknown capacity closely related to ours. In contrast to our model, they assume that the packing stops once the first item does not fit the remaining capacity. In this model, a universal policy with a constant robustness factor may fail to exist, and, thus, Megow and Mestre resort to instance-sensitive performance guarantees. They provide a PTAS that constructs a universal policy with robustness factor arbitrarily close to the best possible robustness factor for every particular instance.

The concept of obliviousness is used in various other contexts (explicitly or implicitly), such as hashing (Carter and Wegman [6]), caching (Frigo et al. [10], Bender et al. [1]) routing (Valiant and Brebner [23], Räcke [21]), TSP (Papadimitriou [20], Deineko et al. [8], Jia et al, [14]), Steiner tree and set cover (Jia et al, [14]), and scheduling (Epstein et al. [9], Megow and Mestre [17]). In all of these works, the general idea is that specific parameters of a problem instance are unknown, e.g., the cache size or the set of vertices to visit in a TSP tour, and the goal is to find a universal solution that performs well for all realizations of the hidden parameters.

Universal policies for the oblivious knapsack problem play a role in the design of public key cryptosystems. One of the first such systems – the Merkle–Hellman knapsack cryptosystem [18] – is based on particular instances that allow for a 11-robust universal policy for the oblivious knapsack problem. The basic version of this cryptosystem can be attacked efficiently, e.g., by the famous attack of Shamir [22]. This attack uses the fact that the underlying knapsack instance has exponentially increasing item sizes. A better understanding of universal policies may help to develop knapsack-based cryptosystems that avoid the weaknesses of Merkle and Hellman’s.

2 Preliminaries

An instance of the oblivious knapsack problem is given by a set of nn items \mathcal{I}, where each item ii\in\mathcal{I} has a non-negative value v(i)0v(i)\in\mathbb{Q}_{\geq 0} and a strictly positive size l(i)>0l(i)\in\mathbb{Q}_{>0}. For a subset SS\subseteq\mathcal{I} of items, we write v(S)=iSv(i)v(S)=\sum_{i\in S}v(i) and l(S)=iSl(i)l(S)=\sum_{i\in S}l(i) to denote its total value and total size, respectively, of the items in SS. A solution for instance \mathcal{I} is a policy 𝒫\mathscr{P} that governs the order in which the items are considered for packing into the knapsack. The policy must be independent of the capacity of the knapsack, but the choice which item to try next may depend on the observations which items did and which items did not fit the knapsack so far. Formally, a solution policy is a binary decision tree that contains every item exactly once along each path from the root to a leaf. The packing 𝒫(C)\mathscr{P}(C)\subseteq\mathcal{I} of 𝒫\mathscr{P} for a fixed capacity CC is obtained as follows: We start with 𝒫(C)=\mathscr{P}(C)=\emptyset and check whether the item rr at the root of 𝒫\mathscr{P} fits the knapsack, i.e., whether l(r)+l(𝒫(C))Cl(r)+l(\mathscr{P}(C))\leq C. If the item fits, we add rr to 𝒫(C)\mathscr{P}(C) and continue packing recursively with the left subtree of rr. Otherwise, we discard rr and continue packing recursively with the right subtree of rr.

A universal policy Π\Pi for instance \mathcal{I} is a policy that does not depend on observations made while packing, i.e., the decision tree for a universal policy has a fixed permutation of the items along every path from the root to a leaf. We identify a universal policy with this fixed permutation and write Π=(Π1,Π2,,Πn)\Pi=(\Pi_{1},\Pi_{2},\dots,\Pi_{n}). Analogously to general policies, the packing Π(C)\Pi(C)\subseteq\mathcal{I} of a universal policy Π\Pi for capacity Cl()C\leq l(\mathcal{I}) is obtained by considering the items in the order given by the permutation Π\Pi and adding every item if it does not exceed the remaining capacity.

We measure the quality of a policy for the oblivious knapsack problem by comparing its packing with the optimal packing for each capacity. More precisely, a policy 𝒫\mathscr{P} for instance \mathcal{I} is called α\alpha-robust for capacity CC, α1\alpha\geq 1, if it holds that v(Opt(,C))αv(𝒫(C))v(\textsc{Opt}(\mathcal{I},C))\leq\alpha\cdot v(\mathscr{P}(C)), where Opt(,C)\textsc{Opt}(\mathcal{I},C) denotes an optimal packing for capacity CC. We say 𝒫\mathscr{P} is α\alpha-robust if it is α\alpha-robust for all capacities. In this case, we call α\alpha the robustness factor of policy 𝒫\mathscr{P}.

3 Solving the Oblivious Knapsack Problem

In this section, we describe an efficient algorithm that constructs a universal policy for a given instance of the oblivious knapsack problem. The solution produced by our algorithm is guaranteed to pack at least half the value of the optimal solution for any capacity CC. We show that this is the best possible robustness factor.

The analysis of our algorithm relies on the classical modified greedy algorithm (cf. [16]). We compare the packing of our policy, for each capacity, to the packing obtained by the modified greedy algorithm instead of the actual optimum. As the modified greedy is a 2-approximation, to show that our policy is 2-robust it is sufficient to show that its packing is never worse the one obtained by the modified greedy algorithm. We briefly review the modified greedy algorithm.

Input: set of items \mathcal{I}, capacity CC
Output: subset SS\subseteq\mathcal{I} such that l(S)Cl(S)\leq C and v(S)v(Opt(,C))/2v(S)\geq v(\textsc{Opt}(\mathcal{I},C))/2
Ditems in {il(i)C} sorted decreasingly by densityD\leftarrow\left<\text{items in }\{i\in\mathcal{I}\mid l(i)\leq C\}\text{ sorted decreasingly by density}\right>
kmax{jl({D1,,Dj})C}k\;\leftarrow\max\{j\mid l(\{D_{1},\dots,D_{j}\})\leq C\}
P(D1,,Dk)P\leftarrow(D_{1},\dots,D_{k}), sDk+1s\leftarrow D_{k+1}
if v(P)v(s)v(P)\geq v(s) then
 return PP
 
else
 return {s}\{s\}
 
Algorithm 1 MGreedy(\mathcal{I}, CC)

Let d(i)=v(i)/l(i)d(i)=v(i)/l(i) denote the density of item ii. The modified greedy algorithm (MGreedy) for a set of items \mathcal{I} and known knapsack capacity CC first discards all items that are larger than CC from \mathcal{I}. The remaining items are sorted in non-increasing order of their densities, breaking ties arbitrarily. The algorithm then either takes the longest prefix PP of the resulting sequence that still fits into capacity CC, or the first item ss that does not fit anymore, depending on which of the two has a greater value. In the latter case, we say that ss is a swap item (for capacity CC) that and CC is a swap capacity. In both cases, we refer to PP as the greedy set for capacity CC. See Algorithm 1 for a formal description.

For our analysis, it is helpful to fix the tie-breaking rule of the greedy algorithm. To this end, we assume that there is a bijection t:{1,2,,n}t:\mathcal{I}\to\{1,2,\dots,n\}, that maps every item ii\in\mathcal{I} to a tie-breaking index t(i)t(i), and that the modified greedy algorithm initially sorts the items decreasingly with respect to the tuple d~()=(d(),t())\tilde{d}(\cdot)=(d(\cdot),t(\cdot)), i.e., the items are sorted non-increasingly by density and whenever two items have the same density, they are sorted by decreasing tie-breaking index. In the following, for two items i,ji,j, we write d~(i)d~(j)\tilde{d}(i)\succ\tilde{d}(j) if and only if d(i)>d(j)d(i)>d(j), or d(i)=d(j)d(i)=d(j) and t(i)>t(j)t(i)>t(j), and say that ii has higher density than jj.

We evaluate the quality of our universal policy by comparing it for every capacity with the solution of MGreedy. This analysis suffices because of the following well-known property of the modified greedy algorithm.

Theorem 1 (cf. [16]).

For every instance (,C)(\mathcal{I},C) of the standard knapsack problem with known capacity, v(Opt(,C))2v(MGreedy(,C))v(\textsc{Opt}(\mathcal{I},C))\leq 2\cdot v(\textsc{MGreedy}(\mathcal{I},C)).

We are now ready to describe our algorithm Universal (Algorithm 2) that produces a universal policy tailored to imitate the behavior of MGreedy without knowing the capacity.

First, Universal determines which items are swap items. It then starts with an empty permutation, and considers the items in order of non-decreasing sizes, inserting each item into the permutation. Swap items are always placed in front of all items already in the permutation, and all other items are inserted in front of the first item in the permutation that has a lower density.

We prove the following result.

Input: set of items \mathcal{I}
Output: sequence of items Π\Pi
Litems in  sorted by non-decreasing sizeL\leftarrow\left<\text{items in }\mathcal{I}\text{ sorted by non-decreasing size}\right>
Π(0)\Pi^{(0)}\leftarrow\emptyset
for r1,,nr\leftarrow 1,\dots,n do
  if LrL_{r} is a swap item then
    Π(r)(Lr,Π(r1))\Pi^{(r)}\leftarrow(L_{r},\Pi^{(r-1)})
  else
     j1j\leftarrow 1
     while j|Π|j\leq|\Pi| and d~(Πj)d~(Lr)\tilde{d}(\Pi_{j})\succ\tilde{d}(L_{r}) do
        jj+1j\leftarrow j+1
       
    Π(r)(Π1(r1),,Πj1(r1),Lr,Πj(r1),)\Pi^{(r)}\leftarrow(\Pi^{(r-1)}_{1},\dots,\Pi^{(r-1)}_{j-1},L_{r},\Pi^{(r-1)}_{j},\dots)
    
 
return Π(n)\Pi^{(n)}
Algorithm 2 Universal(\mathcal{I})
Theorem 2.

The algorithm Universal constructs a universal policy of robustness factor 22.

Before we prove this theorem, we first analyze the structure of the permutation output by Universal in terms of density, size, and value. First, we prove that every item following a non-swap item has lower density.

Lemma 3.

For a sequence Π\Pi returned by Universal, we have d~(Πk)d~(Πk+1)\tilde{d}(\Pi_{k})\succ\tilde{d}(\Pi_{k+1}) for every non-swap item Πk\Pi_{k}, 1k<n1\leq k<n.

Proof.

For j{k,k+1}j\in\{k,k+1\}, let r(j){1,,n}r(j)\in\{1,\dots,n\} be the index of the iteration in which Universal inserts Πj\Pi_{j} into Π\Pi. We distinguish two cases.

If r(k)<r(k+1)r(k)<r(k+1), then the item Πk+1\Pi_{k+1} cannot be a swap item, since it would appear in front of the item Πk\Pi_{k} if it was. As each non-swap item is inserted into Π\Pi such that all items left of it are larger with respect to d~\tilde{d}, the claim follows.

If r(k)>r(k+1)r(k)>r(k+1), since it is not a swap item, Πk\Pi_{k} is put in front of Πk+1\Pi_{k+1} because it has a higher density. ∎

We prove that no item preceding a swap item has smaller size.

Lemma 4.

For a permutation Π\Pi returned by Universal, we have l(Πj)l(Πk)l(\Pi_{j})\geq l(\Pi_{k}) for every swap item Πk,1<kn\Pi_{k},1<k\leq n, and every other item Πj,1j<k\Pi_{j},1\leq j<k.

Proof.

Since Πk\Pi_{k} is a swap item, it stands in front of all items inserted earlier into Π\Pi. Hence, all items that appear in front of Πk\Pi_{k} in Π\Pi have been inserted in a later iteration of Universal. Since Universal processes items in order of non-decreasing sizes, we have l(Πj)l(Πk)l(\Pi_{j})\geq l(\Pi_{k}). ∎

We prove that no item preceding a swap item has smaller value.

Lemma 5.

For a permutation Π\Pi returned by Universal, we have v(Πj)v(Πk)v(\Pi_{j})\geq v(\Pi_{k}) for every swap item Πk,1<kn\Pi_{k},1<k\leq n, and every other item Πj,1j<k\Pi_{j},1\leq j<k.

Proof.

We distinguish three cases.

First case: Πj\Pi_{j} is a swap item and d(Πj)d(Πk)d(\Pi_{j})\geq d(\Pi_{k}). By Lemma 4, we have l(Πj)l(Πk)l(\Pi_{j})\geq l(\Pi_{k}), and the claim trivially holds.

Second case: Πj\Pi_{j} is a swap item and d(Πj)<d(Πk)d(\Pi_{j})<d(\Pi_{k}). Since Πj\Pi_{j} is a swap item, there is a capacity Cl(Πj)C\geq l(\Pi_{j}) such that

v(Πj)>v({il(i)C and d~(i)d~(Πj)}).v(\Pi_{j})>v(\{i\in\mathcal{I}\mid l(i)\leq C\text{ and }\tilde{d}(i)\succ\tilde{d}(\Pi_{j})\}).

In particular, for C=l(Πj)C=l(\Pi_{j}) we obtain

v(Πj)>v({il(i)l(Πj) and d~(i)d~(Πj)}).v(\Pi_{j})>v(\{i\in\mathcal{I}\mid l(i)\leq l(\Pi_{j})\text{ and }\tilde{d}(i)\succ\tilde{d}(\Pi_{j})\}). (1)

Since, by Lemma 4, l(Πj)l(Πk)l(\Pi_{j})\geq l(\Pi_{k}), the item Πk\Pi_{k} is included in the set on the right hand side of (1). We conclude that v(Πj)>v(Πk)v(\Pi_{j})>v(\Pi_{k}).

Third case: Πj\Pi_{j} is not a swap item. Let Πj\Pi_{j^{\prime}} be the first swap item after Πj\Pi_{j} in Π\Pi, i.e.,

j=min{i{j+1,,k}Πi is a swap item }.\displaystyle j^{\prime}=\min\{i\in\{j+1,\dots,k\}\mid\Pi_{i}\text{ is a swap item }\}.

Note that the minimum is attained as Πk\Pi_{k} is a swap item. The analysis of the first two cases implies that v(Πj)v(Πk)v(\Pi_{j^{\prime}})\geq v(\Pi_{k}). By Lemma 3 we have d(Πj)d(Πj+1)d(Πj)d(\Pi_{j})\geq d(\Pi_{j+1})\geq\dots\geq d(\Pi_{j^{\prime}}), and by Lemma 4 we have l(Πj)l(Πj)l(\Pi_{j})\geq l(\Pi_{j^{\prime}}). Hence, v(Πj)v(Πj)v(Πk)v(\Pi_{j})\geq v(\Pi_{j^{\prime}})\geq v(\Pi_{k}). ∎

Finally, the next lemma gives a legitimation for the violation of the density order in the output permutation. Essentially, whenever an item precedes denser items, we guarantee that it is worth at least as much as all of them combined.

Lemma 6.

For a permutation Π\Pi returned by Universal, we have

v(Πk)v({Πjj>k and d~(Πj)d~(Πk)})v(\Pi_{k})\geq v\bigl{(}\bigl{\{}\Pi_{j}\mid j>k\text{ and }\tilde{d}(\Pi_{j})\succ\tilde{d}(\Pi_{k})\bigr{\}}\bigr{)}

for every item Πk,1k<n\Pi_{k},1\leq k<n.

Proof.

We distinguish whether Πk\Pi_{k} is a swap item, or not.

If Πk\Pi_{k} is a swap item, by definition, Πk\Pi_{k} is worth more than the greedy set for some capacity Cl(Πk)C\geq l(\Pi_{k}). Thus,

v(Πk)>v({Πjl(Πj)C and d~(Πj)d~(Πk)})v({Πjl(Πj)l(Πk) and d~(Πj)d~(Πk)}).v(\Pi_{k})>v\bigl{(}\bigl{\{}\Pi_{j}\mid l(\Pi_{j})\leq C\text{ and }\tilde{d}(\Pi_{j})\succ\tilde{d}(\Pi_{k})\bigr{\}}\bigr{)}\geq v\bigl{(}\bigl{\{}\Pi_{j}\mid l(\Pi_{j})\leq l(\Pi_{k})\text{ and }\tilde{d}(\Pi_{j})\succ\tilde{d}(\Pi_{k})\bigr{\}}\bigr{)}.

Since items whose size is strictly larger than l(Πk)l(\Pi_{k}) are inserted into Π\Pi at a later iteration of Universal, they can only end up behind Πk\Pi_{k} if they are smaller with respect to d~\tilde{d}. Hence,

{Πj|j>k and d~(Πj)d~(Πk)}{Πjl(Πj)l(Πk) and d~(Πj)d~(Πk)},\displaystyle\{\Pi_{j}\,|\,j>k\text{ and }\tilde{d}(\Pi_{j})\succ\tilde{d}(\Pi_{k})\}\subseteq\{\Pi_{j}\mid l(\Pi_{j})\leq l(\Pi_{k})\text{ and }\tilde{d}(\Pi_{j})\succ\tilde{d}(\Pi_{k})\},

and thus v(Πk)>v({Πj|j>k and d~(Πj)d~(Πk)})v(\Pi_{k})>v(\{\Pi_{j}\,|\,j>k\text{ and }\tilde{d}(\Pi_{j})\succ\tilde{d}(\Pi_{k})\}), as claimed.

If, on the other hand, Πk\Pi_{k} is not a swap item, let Πk\Pi_{k^{\prime}} be the first swap item after it in Π\Pi. If no such item exists, the claim holds by Lemma 3, since

{Πjj>k and d~(Πj)d~(Πk)}=.\displaystyle\bigl{\{}\Pi_{j}\mid j>k\text{ and }\tilde{d}(\Pi_{j})\succ\tilde{d}(\Pi_{k})\bigr{\}}=\emptyset.

Otherwise, by Lemma 3, we obtain d~(Πk)d~(Πk+1)d~(Πk)\tilde{d}(\Pi_{k})\succ\tilde{d}(\Pi_{k+1})\succ\dots\succ\tilde{d}(\Pi_{k^{\prime}}) and hence

{Πjj>k and d~(Πj)d~(Πk)}\displaystyle\{\Pi_{j}\mid j>k\text{ and }\tilde{d}(\Pi_{j})\succ\tilde{d}(\Pi_{k})\} ={Πjj>k and d~(Πj)d~(Πk)}\displaystyle=\{\Pi_{j}\mid j>k^{\prime}\text{ and }\tilde{d}(\Pi_{j})\succ\tilde{d}(\Pi_{k})\}
{Πjj>k and d~(Πj)d~(Πk)}.\displaystyle\subseteq\{\Pi_{j}\mid j>k^{\prime}\text{ and }\tilde{d}(\Pi_{j})\succ\tilde{d}(\Pi_{k^{\prime}})\}.

Consequently, and by the argument above for swap items,

v(Πk)\displaystyle v(\Pi_{k^{\prime}}) >v({Πjj>k and d~(Πj)d~(Πk)})\displaystyle>v(\{\Pi_{j}\mid j>k^{\prime}\text{ and }\tilde{d}(\Pi_{j})\succ\tilde{d}(\Pi_{k^{\prime}})\})
v({Πjj>k and d~(Πj)>d~(Πk)})).\displaystyle\geq v(\{\Pi_{j}\mid j>k\text{ and }\tilde{d}(\Pi_{j})>\tilde{d}(\Pi_{k})\})).

Finally, by Lemma 5, we have v(Πk)v(Πk)v({Πj|j>k and d~(Πj)d~(Πk)})v(\Pi_{k})\geq v(\Pi_{k^{\prime}})\geq v(\{\Pi_{j}\,|\,j>k\text{ and }\tilde{d}(\Pi_{j})\succ\tilde{d}(\Pi_{k})\}). ∎

We now prove Theorem 2.

of Theorem 2.

We show that for every set of items \mathcal{I}, the permutation Π=Universal()\Pi=\textsc{Universal}(\mathcal{I}) satisfies v(Opt(,C))2v(Π(C))v(\textsc{Opt}(\mathcal{I},C))\leq 2v(\Pi(C)) for every capacity Cl()C\leq l(\mathcal{I}). By Theorem 1, it suffices to show v(Π(C))v(MGreedy(,C))v(\Pi(C))\geq v(\textsc{MGreedy}(\mathcal{I},C)) for all capacities. We distinguish between swap capacities and capacities where MGreedy outputs a greedy set.

First, assume that CC is a swap capacity, and let {Πk}=MGreedy(,C)\{\Pi_{k}\}=\textsc{MGreedy}(\mathcal{I},C) be the swap item returned by the modified greedy algorithm. Then, Π(C)\Pi(C) contains at least one item Πj\Pi_{j} with jkj\leq k. By Lemma 5 we have

v(Π(C))v(Πj)v(Πk)=v(MGreedy(,C)).\displaystyle v(\Pi(C))\geq v(\Pi_{j})\geq v(\Pi_{k})=v(\textsc{MGreedy}(\mathcal{I},C)).

Now assume that CC is not a swap capacity. Let G+=MGreedy(,C)Π(C)G^{+}=\textsc{MGreedy}(\mathcal{I},C)\setminus\Pi(C) be the set of items in the greedy set for capacity CC that are not packed by the permutation Π\Pi. Similarly, let U+=Π(C)MGreedy(,C)U^{+}=\Pi(C)\setminus\textsc{MGreedy}(\mathcal{I},C). If G+=G^{+}=\emptyset, then v(Π(C))v(MGreedy(,C))v(\Pi(C))\geq v(\textsc{MGreedy}(\mathcal{I},C)) and we are done. Suppose now that G+G^{+}\neq\emptyset. Then, also U+U^{+}\neq\emptyset. For all items iU+i\in U^{+}, we have l(i)Cl(i)\leq C and iMGreedy(,C)i\notin\textsc{MGreedy}(\mathcal{I},C). Since CC is not a swap capacity, MGreedy(,C)\textsc{MGreedy}(\mathcal{I},C) is the greedy set for capacity CC, and thus d~(i)d~(i)\tilde{d}(i)\prec\tilde{d}(i^{\prime}) for all iU+i\in U^{+} and iG+i^{\prime}\in G^{+}. By definition of Π(C)\Pi(C) and since U+U^{+}\neq\emptyset, we also have k=min{jΠjU+}<min{kΠkG+}k=\min\{j\mid\Pi_{j}\in U^{+}\}<\min\{k^{\prime}\mid\Pi_{k^{\prime}}\in G^{+}\}, i.e., the first item ΠkU+\Pi_{k}\in U^{+} in Π\Pi is encountered before every item from G+G^{+}. It follows that

G+{Πjj>k and d~(Πj)d~(Πk))}.\displaystyle G^{+}\subseteq\bigl{\{}\Pi_{j}\mid j>k\text{ and }\tilde{d}(\Pi_{j})\succ\tilde{d}(\Pi_{k})\bigr{)}\bigr{\}}.

Using v(U+)v(Πk)v(U^{+})\geq v(\Pi_{k}) and v(Πk)v(G+)v(\Pi_{k})\geq v(G^{+}) (Lemma 6) we get

v(Π(C))\displaystyle v(\Pi(C)) =v(Π(C)MGreedy(,C))+v(U+)\displaystyle=v\bigl{(}\Pi(C)\cap\textsc{MGreedy}(\mathcal{I},C)\bigr{)}+v(U^{+})
v(Π(C)MGreedy(,C))+v(G+)=v(MGreedy(,C)).\displaystyle\geq v\bigl{(}\Pi(C)\cap\textsc{MGreedy}(\mathcal{I},C)\bigr{)}+v(G^{+})=v(\textsc{MGreedy}(\mathcal{I},C)).

While it is obvious that Universal runs in polynomial time, we show that it can be modified to run in time Θ(nlogn)\Theta(n\log n).

Theorem 7.

The algorithm Universal can be implemented to run in time Θ(nlogn)\Theta(n\log n).

Proof.

We first argue how all swap items can be determined in time Θ(nlogn)\Theta(n\log n). We use that an item is a swap item if and only if it is worth more than all smaller items of higher density combined. This is true, because every item ii that is worth more than all smaller items of higher density is a swap item for capacity l(i)l(i). Conversely, a swap item ii for capacity Cl(i)C\geq l(i) is worth more than all items of higher density that are smaller than CC.

We maintain a balanced search tree for items that is ordered by size and stores the total value of the items of both subtrees in the corresponding root. Inserting an item into this tree as well as determining whether an item is worth more than all smaller items in the tree both takes time Θ(logn)\Theta(\log n). To determine the set of swap items, we iterate over all items in order of decreasing densities and insert items one by one into the search tree. After each insertion, we query whether the newly inserted item is worth more than all smaller items in the tree. This is true if and only if the item is worth more than all smaller items of higher density, i.e., if and only if the item is a swap item. Including the initial sorting by density, we can determine all swap items in time Θ(nlogn)\Theta(n\log n).

We construct the output permutation Π\Pi by iterating over the items in order of increasing size, as in Algorithm 2. We maintain a list LL of balanced search trees, each ordered by density. Except for the last tree in LL, every tree contains exactly one swap item, which is the item of smallest density in the tree. The density of a tree is the density of this swap item (or 0 if the tree has no swap item). Each tree stores the items in Π\Pi to the left of the corresponding swap item (if it exists) and to the right of the swap item of the preceding tree in LL (if it exists). We start with a list containing a single tree with no corresponding swap item, which eventually holds all non-swap items that end up behind the last swap item in Π\Pi. Whenever we encounter a new swap item, we add a new tree consisting of only this swap item to the front of LL. For each non-swap item, we have to find the correct tree to insert it into. Once we know the tree, we can determine the position at which to insert the item into the tree, and thus in Π\Pi, in time Θ(logn)\Theta(\log n) simply by searching the tree.

To complete the proof, we need an efficient way to find the correct tree in LL for a non-swap item. For this purpose, we maintain a sublist LL^{\prime} of LL that contains only those trees that are needed for the remainder of the algorithm. Whenever a new swap item ss adds a tree to the front of LL, we also add the tree to the front of LL^{\prime}. Observe that from this point on no items are inserted into trees of a higher density than ss. Hence, before inserting the tree of ss to LL^{\prime}, we may remove trees of higher density from the front of LL^{\prime}. This guarantees that LL^{\prime} remains sorted by density. We can thus implement LL^{\prime} as a balanced search tree order by density. This way, we can find the correct tree for each non-swap item in time Θ(logn)\Theta(\log n). Since every tree is removed at most once from LL^{\prime}, the amortized cost for maintaining the sublist is constant for each swap item.

Since Universal requires nn iterations, the total running time is Θ(nlogn)\Theta(n\log n). ∎

We now give a general lower bound on the robustness factor of any policy for the oblivious knapsack problem. This shows that Universal is best possible.

Theorem 8.

For every δ>0\delta>0, there are instances of the oblivious knapsack problem where no policy achieves a robustness factor of 2δ2-\delta.

Proof.

We give a family of instances, one for each size n3n\geq 3. We ensure that for every item ii of the instance of size nn, there is a capacity CC, such that packing item ii first can only lead to a solution that is worse than Opt(,C)\textsc{Opt}(\mathcal{I},C) by a factor of at least (24/n)(2-4/n). This completes the proof, as the factor approaches 22 for increasing values of nn.

The instance of size nn is given by ={1,2,,n}\mathcal{I}=\{1,2,\dots,n\} with

l(i)\displaystyle l(i) =Fn+Fi1,\displaystyle=F_{n}+F_{i}-1, v(i)\displaystyle v(i) =1+in,\displaystyle=1+\frac{i}{n},

where FiF_{i} denotes the ii-th Fibonacci number (F1=1,F2=1,F3=2,F_{1}=1,F_{2}=1,F_{3}=2,\dots).

We need to show that, no matter which item is tried first (i.e., no matter which item is the root of the policy), there is a capacity for which this choice ruins the solution. Observe that both values and sizes of the items are strictly increasing. Assume that item i3i\geq 3 is packed first. Since the smallest item has size l(1)=Fnl(1)=F_{n}, for capacity Ci=2Fn+Fi2<2Fn+Fi1=l(1)+l(i)C_{i}=2F_{n}+F_{i}-2<2F_{n}+F_{i}-1=l(1)+l(i), no additional item fits the knapsack. However, the unique optimum solution in this case is Opt(,Ci)={i1,i2}\textsc{Opt}(\mathcal{I},C_{i})=\{i-1,i-2\}. These two items fit the knapsack, as l(i1)+l(i2)=2Fn+Fi1+Fi22=2Fn+Fi2=Cil(i-1)+l(i-2)=2F_{n}+F_{i-1}+F_{i-2}-2=2F_{n}+F_{i}-2=C_{i}. By definition,

v(i1)+v(i2)vi=2n+2i3n+i=23n+i23n.\displaystyle\frac{v(i-1)+v(i-2)}{v_{i}}=\frac{2n+2i-3}{n+i}=2-\frac{3}{n+i}\geq 2-\frac{3}{n}\,.

Hence, policies that first pack item i3i\geq 3 do not achieve a robustness factor α<23/n\alpha<2-3/n.

Now, assume that one of the two smallest items is packed first. For capacity C1,2=l(n)=2Fn1<2Fn=l(1)+l(2)C_{1,2}=l(n)=2F_{n}-1<2F_{n}=l(1)+l(2), no additional item fits the knapsack. The unique optimum solution, however, is to pack item nn. It remains to compute the ratios

v(n)v(1)>v(n)v(2)=2nn+2=24n+2>24n.\frac{v(n)}{v(1)}>\frac{v(n)}{v(2)}=\frac{2n}{n+2}=2-\frac{4}{n+2}>2-\frac{4}{n}\,.

Hence, policies that first pack item 1 or item 2 do not achieve a robustness factor α<24/n\alpha<2-4/n. ∎

4 Unit Densities

In this section we restrict ourselves to instances of the oblivious knapsack problem, where all items have unit density, i.e., v(i)=l(i)v(i)=l(i) for all items ii\in\mathcal{I}. For two items i,ji,j\in\mathcal{I} we say that ii is smaller than jj and write iji\prec j if v(i)<v(j)v(i)<v(j), or v(i)=v(j)v(i)=v(j) and t(i)<t(j)t(i)<t(j), where tt is the tiebreaking index introduced in Section 3. We give an algorithm UniversalUD (cf. Algorithm 3) that produces a universal policy tailored to achieve the best possible robustness factor equal to the golden ratio φ1.618\varphi\approx 1.618. The algorithm considers the items from smallest to largest, and inserts each item into the output sequence as far to the end as possible, such that the item is not preceded by other items that are more than a factor φ\varphi smaller. Intuitively, the algorithm tries as much as possible to keep the resulting order sorted increasingly by size; only when an item dominates another item by a factor of at least φ\varphi the algorithm ensures that it precedes this item in the final sequence. Note that, even though φ\varphi is irrational, for rationals a,ba,b the condition a<φba<\varphi b can be tested efficiently by testing the equivalent condition a/b<1+b/aa/b<1+b/a.

Input: set of items \mathcal{I}
Output: sequence of items Π\Pi
Litems in  sorted such that L1LnL\leftarrow\left<\textrm{items in }\mathcal{I}\textrm{ sorted such that }L_{1}\prec\dots\prec L_{n}\right>
Π(0)\Pi^{(0)}\leftarrow\emptyset
for r1,,nr\leftarrow 1,\dots,n do
  j1j\leftarrow 1
  while j|Π|j\leq|\Pi| and v(Lr)<φv(Πj(r1))v(L_{r})<\varphi v(\Pi^{(r-1)}_{j}) do
     jj+1j\leftarrow j+1
    
 Π(r)(Π1(r1),,Πj1(r1),Lr,Πj(r1),)\Pi^{(r)}\leftarrow(\Pi^{(r-1)}_{1},\dots,\Pi^{(r-1)}_{j-1},L_{r},\Pi^{(r-1)}_{j},\dots)
 
return Π(n)\Pi^{(n)}
Algorithm 3 UniversalUD(\mathcal{I})
Theorem 9.

The algorithm UniversalUD constructs a universal policy of robustness factor φ\varphi when all items have unit density.

Proof.

Given an instance \mathcal{I} of the oblivious knapsack problem with unit densities and any capacity Cv()C\leq v(\mathcal{I}), we compare the packing Π(C)\Pi(C) that results from the solution Π=UniversalUD(\Pi=\textsc{UniversalUD}(\mathcal{I}) with an optimal packing Opt(,C)\textsc{Opt}(\mathcal{I},C). We define the set MM of items in Π(C)\Pi(C) for which at least one smaller item is not in Π(C)\Pi(C), i.e., more precisely, let M={iΠ(C)j\Π(C):ji}M=\{i\in\Pi(C)\mid\exists j\in\mathcal{I}\backslash\Pi(C):j\prec i\}.

We first consider the case that MM\neq\emptyset and set i=minMi=\min_{\prec}M to be the smallest item in MM with respect to ‘\prec’. Consider the iteration rr of UniversalUD in which ii is inserted into Π\Pi, i.e., i=Lri=L_{r}. By definition of MM, there is an item jij\prec i with jΠ(C).j\notin\Pi(C). Let jj be the first such item in Π\Pi. Since jij\prec i, we have jΠ(r)j\in\Pi^{(r)}. From iΠ(C)i\in\Pi(C) and jΠ(C)j\notin\Pi(C), it follows that ii precedes jj in Π\Pi (and thus in Π(r)\Pi^{(r)}). Let ii^{\prime} be the item directly preceding jj in Π(r)\Pi^{(r)}. If i=ii^{\prime}=i, ii was compared with jj when it was inserted into Π(r)\Pi^{(r)}, with the result that v(i)φv(j)v(i)\geq\varphi v(j) and thus v(Π(C))φv(j)v(\Pi(C))\geq\varphi v(j). If iii^{\prime}\neq i, by definition of jj, we still have iΠ(C)i^{\prime}\in\Pi(C). Also, either iji^{\prime}\succ j and thus v(i)v(j)v(i^{\prime})\geq v(j), or jj was compared with ii^{\prime} when it was inserted into Π\Pi in an earlier iteration of UniversalUD, with the result that v(i)>1φv(j)v(i^{\prime})>\frac{1}{\varphi}v(j). Again, v(Π(C))v(i)+v(i)>v(j)+1φv(j)=φv(j)v(\Pi(C))\geq v(i)+v(i^{\prime})>v(j)+\frac{1}{\varphi}v(j)=\varphi v(j).

In both cases it follows from jΠ(C)j\notin\Pi(C) that v(Opt(,C))C<v(Π(C))+v(j)v(\textsc{Opt}(\mathcal{I},C))\leq C<v(\Pi(C))+v(j), and using v(j)1φv(Π(C))v(j)\leq\frac{1}{\varphi}v(\Pi(C)) we get

v(Opt(,C))v(Π(C))<v(Π(C))+v(j)v(Π(C))<1+1φ=φ.\frac{v(\textsc{Opt}(\mathcal{I},C))}{v(\Pi(C))}<\frac{v(\Pi(C))+v(j)}{v(\Pi(C))}<1+\frac{1}{\varphi}=\varphi.

Now, assume that M=M=\emptyset. Intuitively, this means that Π(C)\Pi(C) consists of a prefix of LL (the smallest items). Let i1iki_{1}\succ\dots\succ i_{k} be the items in Π(C)Opt(,C)\Pi(C)\setminus\textsc{Opt}(\mathcal{I},C), and let j1jlj_{1}\succ\dots\succ j_{l} be the items in Opt(,C)Π(C)\textsc{Opt}(\mathcal{I},C)\setminus\Pi(C). As Π(C)\Pi(C) consists of a prefix of LL, we have |Π(C)||Opt(,C)||\Pi(C)|\geq|\textsc{Opt}(\mathcal{I},C)| and thus klk\geq l. If k=0k=0, the claim trivially holds. Otherwise, since MM is empty, we have jli1j_{l}\succ i_{1}. Is suffices to show v(jh)φv(ih)v(j_{h})\leq\varphi v(i_{h}) for all hlh\leq l. To this end, we consider any fixed hlh\leq l. From v({i1,,ih1})v({j1,,jh1})v(\{i_{1},\dots,i_{h-1}\})\leq v(\{j_{1},\dots,j_{h-1}\}) it follows that

v(jh)v(Opt(,C))v({j1,,jh1})Cv({i1,,ih1}).v(j_{h})\leq v(\textsc{Opt}(\mathcal{I},C))-v(\{j_{1},\dots,j_{h-1}\})\leq C-v(\{i_{1},\dots,i_{h-1}\}).

This implies that jhj_{h} cannot precede all items of {ih,,ik}\{i_{h},\dots,i_{k}\} in Π\Pi, as jhΠ(C)j_{h}\notin\Pi(C). Hence, there is an item i{ih,,ik}i\in\{i_{h},\dots,i_{k}\} that precedes jhj_{h} in Π\Pi. Since jhij_{h}\succ i, in the iteration when UniversalUD inserted jhj_{h} into Π\Pi, ii was already present. From the fact that ii ended up preceding jhj_{h} it follows that jkj_{k} was compared with ii and thus v(jh)<φv(i)φv(ih)v(j_{h})<\varphi v(i)\leq\varphi v(i_{h}). We obtain

v(Opt(,C))v(Π(C))v(Opt(,C)Π(C))v(Π(C)Opt(,C))=h=1lv(jh)h=1kv(ih)h=1lφv(ih)h=1lv(ih)=φ,\frac{v(\textsc{Opt}(\mathcal{I},C))}{v(\Pi(C))}\leq\frac{v(\textsc{Opt}(\mathcal{I},C)\setminus\Pi(C))}{v(\Pi(C)\setminus\textsc{Opt}(\mathcal{I},C))}=\frac{\sum_{h=1}^{l}v(j_{h})}{\sum_{h=1}^{k}v(i_{h})}\leq\frac{\sum_{h=1}^{l}\varphi v(i_{h})}{\sum_{h=1}^{l}v(i_{h})}=\varphi,

which implies the result. ∎

A naïve implementation of UniversalUD runs in time Θ(n2)\Theta(n^{2}). We improve this running time to Θ(nlogn)\Theta(n\log n).

Theorem 10.

The algorithm UniversalUD can be implemented to run in time Θ(nlogn)\Theta(n\log n).

Proof.

To improve the running time from the naïve Θ(n2)\Theta(n^{2}), we maintain a balanced search tree TT that stores a subset of the items in Π\Pi sorted decreasingly by their sizes. Whenever an item gets inserted to the front of Π\Pi, and only then, we also insert it into TT. This way, the items in TT remain sorted by their positions in Π\Pi throughout the execution of the algorithm. We need an efficient way of finding, in each iteration rr of UniversalUD (Algorithm 3), the first item ii in Π(r)\Pi^{(r)} for which v(Lr)φv(i)v(L_{r})\geq\varphi v(i), or detecting that no such item exists. We claim that, if such an item exists, it is stored in TT and can thus be found in time Θ(logn)\Theta(\log n).

It suffices to show that for every item iTi\in T and its predecessor jj in TT we have that none of the items that precede ii in Π\Pi are smaller than jj. To see this, we argue that none of the items between jj and ii in Π\Pi are smaller than jj. We can then repeat the argument for jj and its predecessor jj^{\prime}, etc. For the sake of contradiction, let ii^{\prime} be the first item between jj and ii with v(i)<v(j)v(i^{\prime})<v(j). None of the items between jj and ii^{\prime} are smaller than jj, hence both jj and ii^{\prime} are inserted into Π\Pi earlier than all of them. Let rr be the iteration in which jj is inserted into Π\Pi. Since ii^{\prime} is inserted earlier into Π\Pi, and since jj is inserted to the front of Π(r)\Pi^{(r)}, ii^{\prime} is at the front of Π(r1)\Pi^{(r-1)}. This is a contradiction to ii^{\prime} not being in TT. ∎

We now establish that UniversalUD is best possible, even if we permit non-universal policies.

Theorem 11.

There are instances of the oblivious knapsack problem where no policy achieves a robustness factor of φδ\varphi-\delta, for any δ>0\delta>0, even when all items have unit density.

Proof.

Consider an instance of the oblivious knapsack problem with five items of unit density and values equal to v1=1+ε,v2=1+ε,v3=2/φ,v4=1+1/φ2,v5=φv_{1}=1+\varepsilon,v_{2}=1+\varepsilon,v_{3}=2/\varphi,v_{4}=1+1/\varphi^{2},v_{5}=\varphi, for sufficiently small ε>0\varepsilon>0. We show that no algorithm achieves a robustness factor of φδ\varphi-\delta for this instance. To this end we consider an arbitrary algorithm 𝒜\mathscr{A} and distinguish different cases depending on which item the algorithm tries to pack first.

  1. (a)

    If 𝒜\mathscr{A} tries item 1 or item 2 first, it cannot fit any additional item for a capacity equal to v5=φv_{5}=\varphi, as even v1+v2>φv_{1}+v_{2}>\varphi. For this capacity 𝒜\mathscr{A} is worse by a factor of φ/(1+ε)>φδ\varphi/(1+\varepsilon)>\varphi-\delta than the optimum solution, which packs item 5.

  2. (b)

    If 𝒜\mathscr{A} tries item 3 first, it cannot fit any additional item for a capacity equal to v1+v2=2+2εv_{1}+v_{2}=2+2\varepsilon, as even v3+v1>2+2εv_{3}+v_{1}>2+2\varepsilon. For this capacity 𝒜\mathscr{A} is worse by a factor of (1+ε)φ>φδ(1+\varepsilon)\varphi>\varphi-\delta than the optimum solution which packs items 1 and 2.

  3. (c)

    If 𝒜\mathscr{A} tries item 4 first, it cannot fit any additional item for a capacity equal to v2+v3=1+2/φ+εv_{2}+v_{3}=1+2/\varphi+\varepsilon, as even v4+v1=2+1/φ2+ε>1+2/φ+εv_{4}+v_{1}=2+1/\varphi^{2}+\varepsilon>1+2/\varphi+\varepsilon. For this capacity 𝒜\mathscr{A} is worse by a factor of 1+2/φ+ε1+1/φ2>φ+1/φ1+1/φ2=φ>φδ\frac{1+2/\varphi+\varepsilon}{1+1/\varphi^{2}}>\frac{\varphi+1/\varphi}{1+1/\varphi^{2}}=\varphi>\varphi-\delta than the optimum solution which packs items 2 and 3.

  4. (d)

    If 𝒜\mathscr{A} tries item 5 first, it cannot fit any additional item for a capacity equal to v3+v4=φ+1v_{3}+v_{4}=\varphi+1, as even v5+v1=φ+1+ε>φ+1v_{5}+v_{1}=\varphi+1+\varepsilon>\varphi+1. For this capacity 𝒜\mathscr{A} is worse by a factor of φ+1φ=φ>φδ\frac{\varphi+1}{\varphi}=\varphi>\varphi-\delta than the optimum solution which packs items 3 and 4.

5 Hardness

Although we can always find a 22-robust universal policy in polynomial time, we show in this section that, for any fixed α(1,)\alpha\in(1,\infty), it is intractable to decide whether a given policy is α\alpha-robust, even if it is universal. This hardness result also holds for instances with unit densities when α\alpha is part of the input. As the final – and arguably the most interesting – result of this section, we establish 𝖼𝗈𝖭𝖯\mathsf{coNP}-hardness of the the problem to decide for a given instance and given α>1\alpha>1, whether the instance admits a universal policy with robustness factor α\alpha. All proofs rely on the hardness of the following version of SubsetSum.

Lemma 12.

Let W={w1,w2,,wn}W=\{w_{1},w_{2},\dots,w_{n}\} be a set of positive integer weights and Tk=1nwkT\leq\sum_{k=1}^{n}w_{k} be a target sum. The problem of deciding whether there is a subset UWU\subseteq W with wUw=T\sum_{w\in U}w=T is 𝖭𝖯\mathsf{NP}-complete, even when

  1. 1.

    T=2kT=2^{k} for some integer k3k\geq 3,

    1. (a)

      all weights are in the interval [2,T/2)[2,T/2),

    2. (b)

      all weights have a difference of at least 2 to the closest power of 2.

Proof.

Without Properties 1 to 1b, the SubsetSum problem is well known to be 𝖭𝖯\mathsf{NP}-complete (e.g., Garey and Johnson [11]). Given an instance (W,T)(W,T) of this classical problem, we construct an equivalent instance with Properties 1 to 1b. We first multiply all weights in WW as well as the target sum TT with 66 to obtain an equivalent instance (W,T)(W^{\prime},T^{\prime}). In the new instance, all weights are even but not a power of 2, hence they have distance at least 2 to the closest power of 2. We set T′′=2σT^{\prime\prime}=2^{\sigma}, with σ=log2(T+wWw)+2\sigma=\left\lceil\log_{2}(T^{\prime}+\sum_{w^{\prime}\in W^{\prime}}w^{\prime})\right\rceil+2 and define two new weights

u=T′′T2,w=T′′T2.u=\left\lfloor\frac{T^{\prime\prime}-T^{\prime}}{2}\right\rfloor,\quad w=\left\lceil\frac{T^{\prime\prime}-T^{\prime}}{2}\right\rceil.

We set W′′=W{u,w}W^{\prime\prime}=W^{\prime}\cup\{u,w\} to obtain the final instance (W′′,T′′)(W^{\prime\prime},T^{\prime\prime}). Properties 1 and 1a are satisfied by construction. Also, any solution to the instance (W′′,T′′)(W^{\prime\prime},T^{\prime\prime}) has to include both uu and ww, since T′′>4wWwT^{\prime\prime}>4\cdot\sum_{w^{\prime}\in W^{\prime}}w^{\prime}. Hence, the instance remains equivalent to the original instance (W,T)(W,T). Since T′′T>3T′′/4T^{\prime\prime}-T^{\prime}>3T^{\prime\prime}/4, and since T′′T^{\prime\prime} is a power of two, the new items uu and ww are far enough from the closest power of 2 (which either is T′′/2T^{\prime\prime}/2 or T′′/4T^{\prime\prime}/4). ∎

We first show that it is intractable to determine the robustness factor of a given universal policy.

Theorem 13.

For any fixed and polynomially representable α>1\alpha>1 it is 𝖼𝗈𝖭𝖯\mathsf{coNP}-complete to decide whether a given universal policy for the oblivious knapsack problem is α\alpha-robust.

Proof.

Regarding the membership in 𝖼𝗈𝖭𝖯\mathsf{coNP}, note that if a universal policy Π\Pi is not α\alpha-robust, then there is a capacity CC such that v(Π(C))<v(Opt(,C))/αv(\Pi(C))<v(\textsc{Opt}(\mathcal{I},C))/\alpha. Thus, CC together with Opt(,C)\textsc{Opt}(\mathcal{I},C) is a certificate for Π\Pi not being an α\alpha-robust solution.

For the proof of 𝖼𝗈𝖭𝖯\mathsf{coNP}-hardness, we reduce from the variant of SubsetSum specified in Lemma 12. An instance of this problem is given by a set W={w1,w2,,wn}W=\{w_{1},w_{2},\dots,w_{n}\} of positive integer weights in the range [2,T/2)[2,T/2) and a target sum T=2kT=2^{k} for some integer k3k\geq 3. Let α>1\alpha>1 be polynomially representable. We may assume without loss of generality that α>TT1\alpha>\frac{T}{T-1} as we can ensure this property by multiplying TT and all items in WW by a sufficiently large power of 2.

We construct an instance \mathcal{I} and a sequence Π\Pi such that Π\Pi is an α\alpha-robust universal policy for \mathcal{I} if and only if the instance of SubsetSum given by WW and TT has no solution. To this end, we introduce for each weight wWw\in W an item with value and size equal to ww. In this way, the optimal knapsack solution for capacity TT is at least TT if the instance of SubsetSum has a solution. Furthermore, we introduce a set of additional items that make sure that the robustness factor for all capacities except TT is at most α\alpha while maintaining the property that the optimal knapsack solution for capacity TT is strictly less than TT if the instance of SubsetSum has no solution.

We now explain the construction of \mathcal{I} and Π\Pi is detail. Let ε=α(T1)Tα(T1)1\smash{\varepsilon=\frac{\alpha(T-1)-T}{\alpha(T-1)-1}}, i.e., α=Tε(T1)(1ε)\smash{\alpha=\frac{T-\varepsilon}{(T-1)(1-\varepsilon)}}. Note that ε(0,1)\varepsilon\in(0,1) by our assumptions on TT and α\alpha. For each weight wWw\in W, we introduce an item iwi_{w} with l(iw)=v(iw)=wl(i_{w})=v(i_{w})=w. The set of these items is called regular and is denoted by reg\mathcal{I}_{\text{{reg}}}. Furthermore, we introduce a set of auxiliary items. Let m=log2T1m=\log_{2}T-1. Then, for each k{0,1,,m}k\in\{0,1,\dots,m\}, we introduce an auxiliary item jkj_{k} with size l(jk)=2kl(j_{k})=2^{k} and value v(jk)=2k(1ε)v(j_{k})=2^{k}\,(1-\varepsilon). Denoting the set of auxiliary items by aux\mathcal{I}_{\text{{aux}}}, we have l(aux)=k=0m2k=T1l(\mathcal{I}_{\text{{aux}}})=\sum_{k=0}^{m}2^{k}=T-1. Finally, we introduce a dummy item dd with l(d)=T+1l(d)=T+1 and

v(d)=1εε(v(aux)+v(reg))=1εε((T1)(1ε)+wWw).v(d)=\frac{1-\varepsilon}{\varepsilon}\left(v(\mathcal{I}_{\mathrm{aux}})+v(\mathcal{I}_{\mathrm{reg}})\right)=\frac{1-\varepsilon}{\varepsilon}\Biggl{(}(T-1)(1-\varepsilon)+\sum_{w\in W}w\Biggr{)}.

The universal policy Π\Pi is defined as Π=(d,jm,jm1,,j0,iwn,iwn1,,iw1)\Pi=(d,j_{m},j_{m-1},\dots,j_{0},i_{w_{n}},i_{w_{n-1}},\dots,i_{w_{1}}). The hardness proof relies on the claim that Π\Pi is a 11ε\frac{1}{1-\varepsilon}-robust universal policy for all capacities except TT, i.e.,

v(Opt(,C))11εv(Π(C))for all CT.v(\textsc{Opt}(\mathcal{I},C))\leq\frac{1}{1-\varepsilon}v(\Pi(C))\,\textrm{for all }C\neq T. (2)

As all item sizes are integer, it suffices to consider integer capacities. To prove (2), let us first consider capacities CT1C\leq T-1. Since the density of each item with size not larger than T1T-1 is bounded from above by 11, it is sufficient to show that v(Π(C))=C(1ε)v(\Pi(C))=C(1-\varepsilon). To this end, we show that every capacity C{1,,2m+11=T1}C\in\{1,\dots,2^{m+1}-1=T-1\} is packed without a gap by the exponentially decreasing sequence of items jm,jm1,,j0j_{m},j_{m-1},\dots,j_{0}. We prove this statement by induction over mm. For m=0m=0, the statement is true, since there is only a single item with length 11, which packs the capacity C=1C=1 optimally. Now assume that the statement is true for all m<mm^{\prime}<m and consider the sequence jm,jm1,,j0j_{m},j_{m-1},\dots,j_{0}. We distinguish two cases. For capacities C{2m,,2m+11}C\in\{2^{m},\dots,2^{m+1}-1\}, item jmj_{m} is packed and, using the induction hypothesis, the residual capacity C~=C2m2m+112m2m1\tilde{C}=C-2^{m}\leq 2^{m+1}-1-2^{m}\leq 2^{m}-1 can be packed without a gap by the remaining sequence jm1,jm2,,j0j_{m-1},j_{m-2},\dots,j_{0}. For capacities C<2mC<2^{m}, item jmj_{m} is not packed, and, again using the induction hypothesis, we derive that CC can be packed by jm1,,j0j_{m-1},\dots,j_{0}. This completes the proof of our claim for CT1C\leq T-1.

Let us now consider our claim for capacities CT+1C\geq T+1. In this case, dΠ(C)d\in\Pi(C) and we can trivially bound the robustness factor of Π\Pi by observing that

v(Opt(,C))v(Π(C))v()v(d)=1+(T1)(1ε)+wWwv(d)=1+ε1ε=11ε.\frac{v(\textsc{Opt}(\mathcal{I},C))}{v(\Pi(C))}\leq\frac{v(\mathcal{I})}{v(d)}=1+\frac{(T-1)(1-\varepsilon)+\sum_{w\in W}w}{v(d)}=1+\frac{\varepsilon}{1-\varepsilon}=\frac{1}{1-\varepsilon}.

We proceed to show that Π\Pi is an α\alpha-robust universal policy if and only if the instance of SubsetSum given by WW and TT has no solution. Let us first assume that the instance of SubsetSum has no solution. We prove that Π\Pi is α\alpha-robust. For all capacities except TT this is clear from claim  (2). For capacity TT, we argue as follows: As there is no packing of TT with items of density 1, we bound v(Opt(,T))v(\textsc{Opt}(\mathcal{I},T)) from above by (T1)+(1ε)(T-1)+(1-\varepsilon), whereas Π\Pi packs all auxiliary items. We get

v(Opt(,T))v(Π(T))(T1)+(1ε)(T1)(1ε)=α.\frac{v(\textsc{Opt}(\mathcal{I},T))}{v(\Pi(T))}\leq\frac{(T-1)+(1-\varepsilon)}{(T-1)(1-\varepsilon)}=\alpha.

Now, assume that the instance of SubsetSum has a solution. Then, v(Opt(T))=Tv(\textsc{Opt}(T))=T and thus

v(Opt(,T))v(Π(T))=T(T1)(1ε)>α,\displaystyle\frac{v(\textsc{Opt}(\mathcal{I},T))}{v(\Pi(T))}=\frac{T}{(T-1)(1-\varepsilon)}>\alpha,

and we conclude that Π\Pi is not α\alpha-robust. ∎

We give a result similar to Theorem 13 for instances in which each item has unit density. Note that this time we require α\alpha to be part of the input.

Theorem 14.

It is 𝖼𝗈𝖭𝖯\mathsf{coNP}-complete to decide whether, for given α>1\alpha>1, a given universal policy for the oblivious knapsack problem is α\alpha-robust, even when all items have unit density.

Proof.

Membership in 𝖼𝗈𝖭𝖯\mathsf{coNP} follows from Theorem 13. To prove hardness, we again reduce from SubsetSum (Lemma 12) using a similar construction as in the proof of Theorem 13. Let the set W={w1,,wn}W=\{w_{1},\dots,w_{n}\} of weights and the target sum T8T\geq 8 of an instance of SubsetSum be given, with w1w2wnw_{1}\leq w_{2}\leq\dots\leq w_{n}. We proceed to explain the construction of a universal policy Π\Pi for which the decision whether Π\Pi is α\alpha-robust is 𝖼𝗈𝖭𝖯\mathsf{coNP}-hard, for some α>1\alpha>1.

For each weight wWw\in W, we introduce an item iwi_{w} with value v(iw)=wv(i_{w})=w. The set of these items is called regular and is denoted by reg\mathcal{I}_{\text{{reg}}}. Let m=log2T1m=\log_{2}T-1 and ε=1/T2\varepsilon=1/T^{2}. For each k{0,,m}k\in\{0,\dots,m\}, we introduce an auxiliary item jkj_{k} with value v(jk)=2k(1ε)v(j_{k})=2^{k}(1-\varepsilon). Denoting the set of auxiliary items by aux\mathcal{I}_{\text{{aux}}}, we have v(aux)=(1ε)k=0m2k=(1ε)(T1)v(\mathcal{I}_{\text{{aux}}})=(1-\varepsilon)\sum_{k=0}^{m}2^{k}=(1-\varepsilon)(T-1). We further introduce a set of dummy items dum={d0,,dm}\mathcal{I}_{\text{{dum}}}=\{d_{0},\dots,d_{m^{\prime}}\}, where m=log2wnm^{\prime}=\lceil\log_{2}w_{n}\rceil. We set v(dk)=T2kv(d_{k})=T\cdot 2^{k} for each k{1,,m}k\in\{1,\dots,m^{\prime}\}, and v(d0)=T+εv(d_{0})=T+\varepsilon. The values of the dummy items sum up to v(dum)=(T+ε)+Tk=1m2k=T(2m+11)+εv(\mathcal{I}_{\text{{dum}}})=(T+\varepsilon)+T\sum_{k=1}^{m^{\prime}}2^{k}=T(2^{m^{\prime}+1}-1)+\varepsilon. In total, the sum of the values of all dummy and auxiliary items is

S=v(aux)+v(dum)=(1ε)(T1)+T(2m+11)+ε.\displaystyle S=v(\mathcal{I}_{\text{{aux}}})+v(\mathcal{I}_{\text{{dum}}})=(1-\varepsilon)(T-1)+T(2^{m^{\prime}+1}-1)+\varepsilon. (3)

Finally, we define the sequence Π\Pi as

Π=(dm,dm1,,d0,jm,jm1,,j0,iwn,iwn1,,iw1),\displaystyle\Pi=(d_{m^{\prime}},d_{m^{\prime}-1},\dots,d_{0},j_{m},j_{m-1},\dots,j_{0},i_{w_{n}},i_{w_{n-1}},\dots,i_{w_{1}}),

i.e., Π\Pi first tries to pack the dummy items in decreasing order, then the auxiliary items in decreasing order, and finally the regular items in non-increasing order. Let α=Tε(1ε)(T1)\alpha=\frac{T-\varepsilon}{(1-\varepsilon)(T-1)}. We proceed to prove the statement of the theorem by showing that Π\Pi is an α\alpha-robust universal policy if and only if the instance (W,T)(W,T) of SubsetSum has no solution. To this end, we first prove that Π\Pi is always an α\alpha-robust universal policy for all capacities except the critical capacities in the interval [TεT,T+ε)\big{[}T-\varepsilon T,T+\varepsilon\big{)}. Then, we argue that Π\Pi is α\alpha-robust for the critical capacities if and only if the instance (W,T)(W,T) of SubsetSum has no solution.

We start by proving that v(Π(C))v(\Pi(C)) is within an α\alpha-fraction of v(Opt(C))v(\textsc{Opt}(C)) for all capacities C[0,TεT)C\in[0,T-\varepsilon T). Since the regular items are of integer values and the values of the auxiliary items each are an (1ε)(1-\varepsilon)-fraction of an integer, only capacities CC for which the ratio C/CC/\lceil C\rceil is not smaller than 1ε1-\varepsilon can be packed without a gap. Otherwise, the value of an optimal solution is bounded from above by C\lfloor C\rfloor. For capacities C[0,TεT)C\in[0,T-\varepsilon T), we obtain

v(Opt(,C)){C, if C/C1εC, otherwise.v(\textsc{Opt}(\mathcal{I},C))\leq\begin{cases}C,&\text{ if }C/\lceil C\rceil\geq 1-\varepsilon\\ \lfloor C\rfloor,&\text{ otherwise.}\end{cases} (4)

The value packed by Π\Pi is given by

v(Π(C))={(1ε)C, if C/C1ε(1ε)C, otherwise.v(\Pi(C))=\begin{cases}(1-\varepsilon)\lceil C\rceil,&\text{ if }C/\lceil C\rceil\geq 1-\varepsilon\\ (1-\varepsilon)\lfloor C\rfloor,&\text{ otherwise.}\end{cases} (5)

From (4) and (5) it follows that

v(Opt(,C))11εv(Π(C))<αv(Π(C))\displaystyle v(\textsc{Opt}(\mathcal{I},C))\leq\frac{1}{1-\varepsilon}v(\Pi(C))<\alpha\,v(\Pi(C)) (6)

for all C[0,TεT)C\in[0,T-\varepsilon T).

We proceed to prove that Π\Pi is within an α\alpha-fraction of an optimal solution for all capacities C[T+ε,S]C\in[T+\varepsilon,S]. We distinguish two cases for each such capacity CC.

First case: auxΠ(C)\mathcal{I}_{\text{{aux}}}\subset\Pi(C), i.e., all auxiliary items are packed by Π\Pi. Since, in Π\Pi, the dummy item d0d_{0} with value T+εT+\varepsilon precedes all auxiliary items, and since CT+εC\geq T+\varepsilon, this case can only occur for capacities

Cv(d0)+v(aux)=T+ε+(1ε)(T1)=2(T+ε)(1+εT).C\geq v(d_{0})+v(\mathcal{I}_{\text{\text{{aux}}}})=T+\varepsilon+(1-\varepsilon)(T-1)=2(T+\varepsilon)-(1+\varepsilon T). (7)

On the other hand, the gap Cv(Π(C))C-v(\Pi(C)) is at most the gap left after trying all dummy items and packing all auxiliary items, i.e., Cv(Π(C))<v(d0)v(aux)=T+ε(1ε)(T1)=1+εTC-v(\Pi(C))<v(d_{0})-v(\mathcal{I}_{\text{{aux}}})=T+\varepsilon-(1-\varepsilon)(T-1)=1+\varepsilon T. Thus,

v(Opt(,C))v(Π(C))<CC(1+εT)(7)2(T+ε)(1+εT)2(T+ε)2(1+εT)=(T+ε)(1+εT)/2(T+ε)(1+εT)<T8Tε(1ε)(T1)=α.\frac{v(\textsc{Opt}(\mathcal{I},C))}{v(\Pi(C))}<\frac{C}{C-(1+\varepsilon T)}\overset{\eqref{eq:min_C-1}}{\leq}\frac{2(T+\varepsilon)-(1+\varepsilon T)}{2(T+\varepsilon)-2(1+\varepsilon T)}\\ =\frac{(T+\varepsilon)-(1+\varepsilon T)/2}{(T+\varepsilon)-(1+\varepsilon T)}\overset{T\geq 8}{<}\frac{T-\varepsilon}{(1-\varepsilon)(T-1)}=\alpha.

Second case: auxΠ(C)\mathcal{I}_{\text{{aux}}}\setminus\Pi(C)\neq\emptyset, i.e., not all auxiliary items are packed. This implies that the gap Cv(Π(C))C-v(\Pi(C)) is at most 1ε1-\varepsilon. We calculate

v(Opt(,C))v(Π(C))<CC(1ε)CT+εT+εT+2ε1<ε=1/T2Tε(1ε)(T1)=α.\frac{v(\textsc{Opt}(\mathcal{I},C))}{v(\Pi(C))}<\frac{C}{C-(1-\varepsilon)}\overset{C\geq T+\varepsilon}{\leq}\frac{T+\varepsilon}{T+2\varepsilon-1}\overset{\varepsilon=1/T^{2}}{<}\frac{T-\varepsilon}{(1-\varepsilon)(T-1)}=\alpha.

Next, we consider capacities C(S,v(auxdumreg)]C\in(S,v(\mathcal{I}_{\text{{aux}}}\cup\mathcal{I}_{\text{{dum}}}\cup\mathcal{I}_{\text{{reg}}})]. For these capacities, all dummy items and all auxiliary items are packed by Π\Pi. Using that the gap CΠ(C)C-\Pi(C) is at most wnw_{n}, we obtain

v(Opt(,C))v(Π(C))CCwn<C>SSSwn<S>T2mT2mT2mwnTwnTwnwn=TT1=T(1ε)(1ε)(T1)<Tε(1ε)(T1)=α.\frac{v(\textsc{Opt}(\mathcal{I},C))}{v(\Pi(C))}\leq\frac{C}{C-w_{n}}\overset{C>S}{<}\frac{S}{S-w_{n}}\overset{S>T2^{m^{\prime}}}{<}\frac{T2^{m^{\prime}}}{T2^{m^{\prime}}-w_{n}}\\ \leq\frac{Tw_{n}}{Tw_{n}-w_{n}}=\frac{T}{T-1}=\frac{T(1-\varepsilon)}{(1-\varepsilon)(T-1)}<\frac{T-\varepsilon}{(1-\varepsilon)(T-1)}=\alpha.

To finish the proof, let us finally consider the critical capacities C[TTε,T+ε)C\in\big{[}T-T\varepsilon,T+\varepsilon\big{)}. We proceed to show that v(Π(C))v(\Pi(C)) is within an α\alpha-fraction of v(Opt(C))v(\textsc{Opt}(C)) for all C[TTε,T+ε)C\in\big{[}T-T\varepsilon,T+\varepsilon\big{)} if and only if (W,T)(W,T) does not have a solution. Let us first assume that (W,T)(W,T) does not have a solution. Then, v(Opt(C))Tεv(\textsc{Opt}(C))\leq T-\varepsilon and we obtain

v(Opt(,C))v(Π(C))Tε(T1)(1ε)=α,\frac{v(\textsc{Opt}(\mathcal{I},C))}{v(\Pi(C))}\leq\frac{T-\varepsilon}{(T-1)(1-\varepsilon)}=\alpha,

for all C[TTε,T+ε)C\in\big{[}T-T\varepsilon,T+\varepsilon\big{)}. If, on the other hand, (W,T)(W,T) has a solution, then v(Opt(T))=Tv(\textsc{Opt}(T))=T, implying that

v(Opt(,T))v(Π(T))=T(T1)(1ε)>α,\frac{v(\textsc{Opt}(\mathcal{I},T))}{v(\Pi(T))}=\frac{T}{(T-1)(1-\varepsilon)}>\alpha,

i.e., Π\Pi is not an α\alpha-robust universal policy. ∎

Finally, we prove that it is hard to decide whether a given instance admits an α\alpha-robust universal policy when α\alpha is part of the input.

Theorem 15.

It is 𝖼𝗈𝖭𝖯\mathsf{coNP}-hard to decide whether, for given α>1\alpha>1, an instance of the oblivious knapsack problem admits an α\alpha-robust universal policy, even when all items have unit density.

Proof.

We again reduce from SubsetSum. To this end, let (W,T)(W,T) be an instance of SubsetSum (Lemma 12), let \mathcal{I} be the set of items constructed from (W,T)(W,T) in the proof of Theorem 14, and let α=Tε(1ε)(T1)\alpha=\frac{T-\varepsilon}{(1-\varepsilon)(T-1)}. We proceed to show that \mathcal{I} admits an α\alpha-robust universal policy if and only if the instance (W,T)(W,T) of SubsetSum has no solution.

For the case that (W,T)(W,T) has no solution, an α\alpha-robust universal policy is constructed in the proof of Theorem 14. Thus, it suffices to show that if (W,T)(W,T) has a solution, \mathcal{I} does not admit an α\alpha-robust universal policy.

First, we claim that any α\alpha-robust universal policy Π\Pi contains the auxiliary items in decreasing order. Otherwise, for the sake of contradiction, let jj be the first auxiliary item in Π\Pi that is preceded by a smaller auxiliary item ii. Consider the capacity C=v(j)C=v(j). As all dummy items are larger than T>CT>C, only auxiliary and regular items can be in Π(C)\Pi(C). Since ii precedes jj, we have jΠ(C)j\notin\Pi(C).

If Π(C)\Pi(C) contains only auxiliary items, since the sum of the values of the auxiliary items smaller than v(j)v(j) is v(j)(1ε)v(j)-(1-\varepsilon), we can use that jΠ(C)j\notin\Pi(C) to obtain v(Π(C))v(j)(1ε)<v(j)v(\Pi(C))\leq v(j)-(1-\varepsilon)<\left\lfloor v(j)\right\rfloor. If Π(C)\Pi(C) contains a regular item ii^{\prime}, then Cv(i)Cv(i)<1ε\frac{C-v(i^{\prime})}{\left\lceil C-v(i^{\prime})\right\rceil}<1-\varepsilon, and hence the gap Cv(i)C-v(i^{\prime}) cannot be packed with a value more than Cv(i)\left\lfloor C-v(i^{\prime})\right\rfloor. It follows that v(Π(C))v(j)v(\Pi(C))\leq\lfloor v(j)\rfloor. In either case we have

v(Opt(,C))v(Π(C))v(j)v(j)v(j)(1ε)T/2(1ε)T/2(1ε)T/2=(1ε)T/2T/21>ε=1/T2Tε(T1)(1ε)=α.\frac{v(\textsc{Opt}(\mathcal{I},C))}{v(\Pi(C))}\geq\frac{v(j)}{\lfloor v(j)\rfloor}\overset{v(j)\leq(1-\varepsilon)T/2}{\geq}\frac{(1-\varepsilon)T/2}{\lfloor(1-\varepsilon)T/2\rfloor}=\frac{(1-\varepsilon)T/2}{T/2-1}\overset{\varepsilon=1/T^{2}}{>}\frac{T-\varepsilon}{(T-1)(1-\varepsilon)}=\alpha.

This is a contradiction to the assumption that Π\Pi is α\alpha-robust. We conclude that the auxiliary items appear in Π\Pi in decreasing order.

Second, we claim that if Π(T)\Pi(T) contains a regular item, then Π\Pi is not α\alpha-robust. By the argument above, we may assume that the auxiliary items in Π\Pi are ordered decreasingly. Let ii be the regular item contained in Π(T)\Pi(T) that appears first in Π\Pi. Consider the capacity C=(v(i)+1)(1ε).C=(v(i)+1)(1-\varepsilon). The auxiliary items that appear before ii in Π\Pi (if any) are ordered decreasingly. All of them must be larger than v(i)v(i), otherwise, the gap left after packing them for capacity TT would be too small to fit ii. By Lemma 12, we have that neither v(i)v(i) nor v(i)+1v(i)+1 are a power of 2, thus Π(C)\Pi(C) does not contain any of the auxiliary items preceding ii. All regular items that appear before ii in Π\Pi are larger than v(i)v(i), since they are not in Π(T)\Pi(T). Hence, Π(C)\Pi(C) does not contain any regular items except ii. We conclude that Π(C)={i}\Pi(C)=\{i\}. On the other hand, CC is an integer multiple of 1ε1-\varepsilon and can be packed without a gap by auxiliary items only. We obtain

v(Opt(C))v(Π(C))=Cv(i)=(v(i)+1)(1ε)v(i)v(i)T/2(T/2+1)(1ε)T/2>ε=1/T2α.\frac{v(\textsc{Opt}(C))}{v(\Pi(C))}=\frac{C}{v(i)}=\frac{(v(i)+1)(1-\varepsilon)}{v(i)}\overset{v(i)\leq T/2}{\geq}\frac{(T/2+1)(1-\varepsilon)}{T/2}\overset{\varepsilon=1/T^{2}}{>}\alpha.

We conclude that if an α\alpha-robust universal policy Π\Pi exists, then Π(T)\Pi(T) does not contain regular items. It follows that Π(T)=aux\Pi(T)=\mathcal{I}_{\text{{aux}}} and, thus, v(Π(T))=(T1)(1ε).v(\Pi(T))=(T-1)(1-\varepsilon). Using that the SubsetSum instance (W,T)(W,T) has a solution, we obtain

v(Opt(,T))v(Π(T))T(T1)(1ε)>α,\frac{v(\textsc{Opt}(\mathcal{I},T))}{v(\Pi(T))}\geq\frac{T}{(T-1)(1-\varepsilon)}>\alpha,

which implies that no α\alpha-robust universal policy exists. ∎

References

  • [1] M. A. Bender, R. Cole, and E. D. Demaine. Scanning and traversing: maintaining data for traversals in a memory hierarchy. In Proceedings of the 10th European Symposium on Algorithms (ESA), pages 139–151, 2002.
  • [2] D. Bertsimas and M. Sim. Robust discrete optimization and network flows. Mathematical Programming, 98:49–71, 2003.
  • [3] A. Bhalgat, A. Goel, and S. Khanna. Improved approximation results for stochastic knapsack problems. In Proceedings of the 22nd Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 1647–1665, 2011.
  • [4] P. C. Bouman, J. M. van den Akker, and J. A. Hoogeveen. Recoverable robustness by column generation. In Proceedings of the 19th European Symposium on Algorithms (ESA), pages 215–226, 2011.
  • [5] C. Büsing, A. M. Koster, and M. Kutschka. Recoverable robust knapsacks: the discrete scenario case. Optimization Letters, 5(3):379–392, 2011.
  • [6] J. L. Carter and M. N. Wegman. Universal classes of hash functions. Journal of Computer and System Sciences, 18:143–154, 1979.
  • [7] B. C. Dean, M. X. Goemans, and J. Vondrák. Approximating the stochastic knapsack problem: The benefit of adaptivity. In Proceddings of the 45th IEEE Symposium on Foundations of Computer Science (FOCS), pages 208–217, 2004.
  • [8] V. G. Deineko, R. Rudolf, and G. J. Woeginger. Sometimes travelling is easy: The master tour problem. In Proceedings of the 3rd European Symposium on Algorithms (ESA), pages 128–141. 1995.
  • [9] L. Epstein, A. Levin, A. Marchetti-Spaccamela, N. Megow, J. Mestre, M. Skutella, and L. Stougie. Universal sequencing on an unreliable machine. SIAM Journal on Computing, 41(3):565–586, 2012.
  • [10] M. Frigo, C. Leiserson, H. Prokop, and S. Ramachandran. Cache-oblivious algorithms. In Proceedings of the 40th Symposium on Foundations of Computer Science (FOCS), pages 285–297, 1999.
  • [11] M. R. Garey and D. S. Johnson. Computers and Intractability, A Guide to the Theory of NP-Completeness. W.H. Freeman and Company, 1979.
  • [12] K.-S. Goetzmann, S. Stiller, and C. Telha. Optimization over integers with robustness in cost and few constraints. In Proceedings of the 9th Workshop on Approximation and Online Algorithms (WAOA), pages 89–101, 2011.
  • [13] R. Hassin and S. Rubinstein. Robust matchings. SIAM Journal on Discrete Mathematics, 15(4):530–537, 2002.
  • [14] L. Jia, G. Lin, G. Noubir, R. Rajaraman, and R. Sundaram. Universal approximations for TSP, Steiner tree, and set cover. In Proceedings of the 37th Annual ACM Symposium on Theory of Computing (STOC), pages 386–395, 2005.
  • [15] N. Kakimura, K. Makino, and K. Seimi. Computing knapsack solutions with cardinality robustness. In Proceedings of the 22nd International Conference on Algorithms and Computation (ISAAC), pages 693–702, 2011.
  • [16] B. Korte and J. Vygen. Combinatorial Optimization. Theory and Algorithms. Springer, 2nd edition, 2002.
  • [17] N. Megow and J. Mestre. Instance-sensitive robustness guarantees for sequencing with unknown packing and covering constraints. In Proceedings of the 4th Conference on Innovations in Theoretical Computer Science (ITCS), pages 495–504, 2013.
  • [18] R. Merkle and M. E. Hellman. Hiding information and signatures in trapdoor knapsacks. IEEE Transactions on Information Theory, 24(5):525–530, 1978.
  • [19] M. Monaci and U. Pferschy. On the robust knapsack problem. In Proceedings of the 10th Cologne-Twente Workshop on Graphs and Combinatorial Optimization (CTW), pages 207–210, 2011.
  • [20] C. H. Papadimitriou. Computational Complexity. Addison-Wesley, 1994.
  • [21] H. Räcke. Survey on oblivious routing strategies. In Proceedings of the 5th Conference on Computability in Europe: Mathematical Theory and Computational Practice (CiE), pages 419–429, 2009.
  • [22] A. Shamir. A polynomial time algorithm for breaking the basic Merkle-Hellman cryptosystem. In Proceedings of the 23rd Symposium on Foundations of Computer Science (FOCS), pages 145–152, 1982.
  • [23] L. G. Valiant and G. J. Brebner. Universal schemes for parallel communication. In Proceedings of the 13th Annual ACM Symposium on Theory of Computing (STOC), pages 263–277, 1981.
  • [24] G. Yu. On the max-min 0-1 knapsack problem with robust optimization applications. Operations Research, 44(2):407–415, 1996.