The Stochastic Bilevel Continuous Knapsack Problem with Uncertain Follower's Objective

We consider a bilevel continuous knapsack problem where the leader controls the capacity of the knapsack, while the follower chooses a feasible packing maximizing his own profit. The leader's aim is to optimize a linear objective function in the capacity and in the follower's solution, but with respect to different item values. We address a stochastic version of this problem where the follower's profits are uncertain from the leader's perspective, and only a probability distribution is known. Assuming that the leader aims at optimizing the expected value of her objective function, we first observe that the stochastic problem is tractable as long as the possible scenarios are given explicitly as part of the input, which also allows to deal with general distributions using a sample average approximation. For the case of independently and uniformly distributed item values, we show that the problem is #P-hard in general, and the same is true even for evaluating the leader's objective function. Nevertheless, we present pseudo-polynomial time algorithms for this case, running in time linear in the total size of the items. Based on this, we derive an additive approximation scheme for the general case of independently distributed item values, which runs in pseudo-polynomial time.


Introduction
In many real-world optimization problems, more than one decision-maker is involved. Often, decisions are taken in a hierarchical order: the first actor takes a decision that determines the feasible set and objective function of the second actor, whose decision in turn may influence the objective value of the first actor. Formally, such problems may be modeled as bilevel optimization problems, where the problem solved by the first actor is called the upper level problem and the one of the second actor the lower level problem. When such bilevel problems are considered from a game-theoretic perspective, the two decision-makers are often called leader and follower, a terminology we use throughout this paper. Typical applications of bilevel optimization arise when the general rules of a system (e.g., an energy market or a transport system) are determined by one actor (e.g., some regulatory commission or some large logistics company) while the other actors (e.g., energy producers or subcontractors) try to optimize their own objectives within the rules of the system. For general introductions to bilevel optimization, we refer to [5,7,8].
Bilevel optimization problems often turn out to be NP-hard. This is the case, in general, even when all constraints and objective functions are linear [11]. A notable exception is the bilevel continuous knapsack problem [8]: here, the leader controls the capacity of the knapsack, while the follower chooses a feasible packing maximizing his own profit. The leader's aim is to optimize an objective function that is linear in the chosen capacity and in the follower's chosen solution. However, the leader's item values may differ from the follower's item values. This problem can be solved efficiently by first sorting the items according to the follower's profits and then enumerating the capacities corresponding to the total size of each prefix in this ordering; see Section 2.1 for more details. Applications of the bilevel knapsack problem considered here arise in, e.g., revenue management [1].
In practice, however, it is very likely that the leader does not know the follower's subproblem exactly. It is thus natural to combine bilevel optimization with optimization under uncertainty. To the best of our knowledge, uncertain bilevel optimization problems were first considered in [15]. Recently, Burtscheidt and Claus [4] investigated stochastic bilevel linear optimization problems, dealing in particular with structural properties of such problems. A thorough review of literature on stochastic bilevel linear optimization can be found in [12].
Regarding the bilevel continuous knapsack problem under uncertainty, the robust optimization approach has been investigated in depth in [2]. It is assumed that the vector of follower's item values is unknown to the leader. This implies that the follower's order of preference for the items is now uncertain. However, according to the robust optimization paradigm, the leader knows a so-called uncertainty set containing all possible (or likely) realizations of this vector. The aim is to find a capacity leading to an optimal worst-case objective value over all these realizations. Among other things, it is shown that the resulting problem is still tractable under discrete or interval uncertainty -the latter case being nontrivial here -, while it turns out to be NP-hard for budgeted uncertainty (which is sometimes called Gamma uncertainty) and for ellipsoidal uncertainty, among others. Complexity questions for general robust bilevel optimization problems have been settled in [3].
In the following, we consider the stochastic bilevel continuous knapsack problem. The follower's item values are still unknown to the leader, but now given by probability distributions. Instead of the worst case, we are interested in optimizing the expected value. The problem can be written as where b denotes the capacity determined by the leader and x ∈ [0, 1] n are the optimization variables of the follower. As c is a random vector in the stochastic setting, the same is true for the follower's optimum solution x c and the leader's objective value d ⊤ x c − δb.
In the latter, the vector d contains the leader's item values and δ denotes the cost for each unit of capacity provided by the leader. The leader's aim is now to optimize the expected objective value of the latter. For the sake of simplicity, we do not distinguish between the optimistic and the pessimistic view (which are the two standard ways to handle ambiguous follower's optimal solutions) in this formulation. In Section 2.2 below, we argue why we may assume uniqueness of the follower's optimal solution almost surely in the stochastic setting. Therefore, the results presented in this paper hold in both the optimistic and the pessimistic setting.

Outline and Overview of Results
After discussing the deterministic problem version and introducing notation and basic results in Section 2, we start investigating the computational complexity of the stochastic optimization problem (SP), which of course depends strongly on the underlying probability distribution of c. Under the assumption that all possible realizations of the follower's objective vector are given explicitly as part of the input, together with their probabilities, we observe that the stochastic problem can be solved efficiently; see Section 3. Using standard methods, this result could be used to design a sample average approximation scheme for arbitrary distributions. Our main results apply to the case of independently distributed item values. In the most basic setting, each item value is distributed uniformly on either a finite set or an interval. In contrast to the setting of Section 3, in the discrete case, the input here contains the finite sets for all items, but not each of the (exponentially many) possible realizations explicitly. Even in this basic setting of independently and uniformly distributed item values, we show that the stochastic problem turns out to be #P-hard; see Section 4.1. It is thus unlikely that an efficient algorithm exists for solving the problem exactly. In fact, even the computation of the objective value resulting from a given capacity choice is #P-hard in these cases, and the same is true for finding a multiplicative approximation for any desired factor. However, all results only show weak #P-hardness. In fact, we also devise a pseudo-polynomial algorithm for the mentioned cases in Section 4.2, running in time linear in the total size of all items.
Finally, in Section 5, we consider general distributions with independent item values, given only by oracles for the cumulative distribution functions and the quantile functions. Assuming that these oracles can be queried in constant time, we devise an algorithm for solving (SP) with an arbitrarily small additive error ε > 0. The running time of this algorithm is pseudo-polynomial in the problem data and linear in 1 /ε. The idea of this approach is to approximate the given distribution by a componentwise discrete distribution and then to apply the main ideas used for the pseudo-polynomial algorithm of Section 4.2.
In Section 6, we summarize the main results and close the paper with a few remarks and a discussion of related questions.

Preliminaries
We start with basic observations concerning the stochastic bilevel continuous knapsack problem. We first have a closer look at the deterministic problem variant in Section 2.1. Subsequently, in Section 2.2, we introduce notation and list some basic observations concerning the stochastic problem (SP).

The Underlying Certain Problem
As mentioned in the introduction, the deterministic version of the bilevel continuous knapsack problem can be solved efficiently. This is explained in [8], but for the convenience of the reader and since our algorithms for the stochastic case build on this, we now describe the solution approach in more detail. The deterministic bilevel continuous knapsack problem can be formulated as follows, using the same notation as in the stochastic problem (SP): The leader's only variable is b ∈ R, which can be considered the knapsack's capacity. The follower's variables are x ∈ R n , i.e., the follower fills the knapsack with a subset of the objects, where also fractions are allowed. The item sizes a ∈ R n ≥0 , the follower's item values c ∈ R n , the capacity bounds b − , b + ∈ R ≥0 as well as the leader's item values d ∈ R n and a scalar δ ≥ 0 are given. The latter can be thought of as a price the leader has to pay for providing one unit of knapsack capacity. For the following, we define A := n i=1 a i and assume that a > 0 and 0 since we are mostly interested in complexity results, we assume throughout that a ∈ N n and d ∈ Z n . Finally, we will use the notation [k] := {1, . . . , k} for k ∈ N and [0] := ∅. As usual in bilevel optimization, we have to be careful in case the follower's optimal solution is not unique. In this case, the model (P) is not well-defined. The standard approach is to distinguish between the optimistic setting, in which the follower always chooses one of his optimal solutions that is best possible for the leader, and the pessimistic setting, where the follower chooses an optimal solution that is worst possible for the leader. The former case is equivalent to considering the follower's variables x being under the leader's control as well. However, regarding the results presented in this paper, there are no relevant discrepancies between the two cases. For the sake of simplicity and since we can also make this assumption almost surely in the stochastic setting later on (see Section 2.2), we assume in this section that the follower's profits c i a i , i ∈ [n], are pairwise distinct and nonzero, so that his optimal solution is unique for any capacity b.
Indeed, the follower in (P) solves a continuous knapsack problem with fixed capacity b. This can be done, for example, using Dantzig's algorithm [6]: by first sorting the items, we may assume for some n ′ ∈ {0, . . . , n}. The idea is then to pack all items with positive profit into the knapsack, in this order, until it is full. More formally, if A ′ := n ′ i=1 a i ≤ b, all items with positive profit can be taken, so an optimum solution is x i = 1 for i ∈ [n ′ ] and x i = 0 else. Otherwise, we consider the critical item and an optimum solution is given by We now turn to the leader's perspective. As only the critical item k, but not the ordering (1) depends on b, the leader can compute the described order of items once and then consider the behavior of the follower's optimum solution x when b changes. Every x i in (2) is a continuous piecewise linear function in b, of the form for b ∈ [0, A] and for i ∈ [n ′ ], and constantly zero for i > n ′ . The leader's objective function f is given by the corresponding values d ⊤ x(b) − δb and thus corresponds to a weighted sum of the functions x i (b) for i ∈ [n ′ ] and δb: Note that this piecewise linear function is well-defined and continuous with vertices in the points b = i j=1 a j , i ∈ [n ′ ], in which the critical item changes from i to i + 1. The leader has to maximize f over the range As f is piecewise linear, it suffices to evaluate it at the boundary points b − and b + and at all feasible vertices, i.e., at all points . By computing f (b) incrementally, Problem (P) can be solved in O(n log n) time, which is the time needed for sorting.

Basic Definitions and Observations
In the stochastic version of the problem, the vector c of follower's item values is seen as a random variable having a known distribution. The follower's optimum solution x c (b) and the leader's objective value f c (b) = d ⊤ x c (b) − δb depend on the realization of c and hence are also random variables. The leader optimizes the expected value E c (f c (b)).
If two different items have the same profit or an item has profit zero, the follower's optimal solution might be ambiguous. For simplicity, we assume throughout this paper that the profits of two different items almost surely disagree and that the profit of each item is almost surely nonzero, i.e., If c follows a continuous distribution, i.e., its cumulative distribution function is continuous, this assumption is always satisfied. In case of a discrete distribution with finite support, it can be obtained, if necessary, by a small perturbation of the entries in the support of c. Using an appropriate perturbation, both the optimistic and the pessimistic setting can be modeled. In particular, we do not need to distinguish between these two settings in the following because under Assumption (5), the follower's optimal solution is almost surely unique. For fixed c, we have seen in Section 2.1 that x c i for i ∈ [n] and f c are piecewise linear functions in b. These functions do not depend on c directly, but only on the implied order of the items when the latter are sorted according to the values c i /a i . Hence, the expected valuesx can be seen as expected values with respect to a probability distribution on all permutations of the items 1, . . . , n. As the number of permutations is finite, this implies that the functionsx i andf are finite convex combinations of functions x c i and f c , respectively, for appropriate values of c. In particular, they are piecewise linear functions again. Since we assume the item sizes a to be integral, the vertices of these functions all lie on integer points b ∈ {0, . . . , A} because this holds for the functions defined in (3) and (4).
This gives rise to a general algorithmic scheme for solving the stochastic problem (SP): enumerate all permutations π of [n] and compute the corresponding leader's objective functions f π as in (4), together with the probabilities p π that the values c i /a i are sorted decreasingly when permuted according to π. Finally, sum all piecewise linear functions p π f π to determine the leader's objectivef , and maximizef over We emphasize that, depending on the given probability distribution of c, it might be nontrivial to compute the probabilities p π in general. Moreover, due to the exponential number of permutations, this approach does not yield a polynomial time algorithm in general. In fact, we will show that such an efficient algorithm cannot exist for some probability distributions unless P = NP. However, for distributions with finite support, enumerating all values in the support yields an efficient algorithm, as we show in the next section. Although the above algorithm is not efficient for other distributions, it will be useful for our proofs to know the structure of the follower's optimum solutions and the leader's objective function as described above.
Besides the piecewise linear functions defined in (6) and (7), we will also make use of the values For some probability distributions, it will turn out that not only the optimization in (SP), but also the computation of the valuesx i (b) and ∆x i (b) is hard in general. However, we will devise pseudo-polynomial time algorithms in these cases that compute all values ∆x i (b), from which one can solve (SP) in pseudo-polynomial time as well; see Section 4.2.

Distributions with Finite Support
Assuming that c has a finite support U , i.e., that there exists a finite set U of possible follower's objectives c which occur with probabilities 0 < p c ≤ 1, respectively, the leader's objective is given as a finite sum of the piecewise linear functions p c f c , where f c is defined as in (4). Note that the definition in (4) depends on the order of the items given by the follower's preferences, which in turn depends on c.
Similarly to the algorithm described in Section 2.2, the following algorithm solves Problem (SP) for distributions with finite support: for every c ∈ U , use the algorithm described in Section 2.1 to compute the piecewise linear function f c in O(n log n) time, and multiply each function f c by the factor p c . Then maximize the resulting weighted sum, which is a piecewise linear function again. Note that the sum has O(|U |n) linear segments and that it can be computed by sorting the vertices of all functions and traversing them from left to right while keeping track of the sum of the active linear pieces. This is possible in a running time of O(|U |n log(|U |n)). Thus, we obtain Theorem 1. Assume that c is distributed on a finite set U and that the input consists of U together with the corresponding probabilities. Then Problem (SP) can be solved in O(|U |n log(|U |n)) time.
The result of Theorem 1 suggests to address the general problem (SP), with an arbitrary underlying distribution of c, by means of sample average approximation: for a given number N ∈ N, first compute N samples c (1) , . . . , c (N ) of the random variable c. Then apply the algorithm of Theorem 1 to the uniform distribution over the finite set {c (1) , . . . , c (N ) } and let ϑ N be the resulting optimal value (which is a random variable again). Using general results from [16], one can show that ϑ N almost surely converges to the optimal value of (SP) for N → ∞, and a similar statement holds for the set of optimal solutions; see [17]. The only assumption needed here is that sampling of c is possible.

Componentwise Uniform Distributions
In this section, we consider the version of (SP) where the distribution of c is uniform on a product of either finite sets or continuous intervals. Equivalently, each component of c is drawn independently and according to some (discrete or continuous) uniform distribution. For both the discrete and the continuous case, we will show that (SP) cannot be solved efficiently unless P = NP. However, we will devise pseudo-polynomial time algorithms with a running time linear in the total item size A. The algorithm for the discrete case solves the problem not only for uniform, but also for arbitrary componentwise distributions with finite support.
Note that the results presented in Section 3 are not applicable to the discrete independent case discussed here because the support U , which contains all possible combinations of item values, is exponential in the number of items and hence in the problem input.

Hardness Results
Our first aim is to show that (SP) is #P-hard in case of componentwise uniform distributions. The class #P contains all counting problems associated with decision problems belonging to NP, or, more formally, all problems that ask for computing the number of accepting paths in a polynomial time nondeterministic Turing machine. Using a natural concept of efficient reduction for counting problems, one can define a counting problem to be #P-hard if every problem in #P can be reduced to it. A polynomial time algorithm for a #P-hard counting problem can only exist if P = NP. In the following proofs, we will use the #P-hardness of the problem #Knapsack, which asks for the number of feasible solutions of a given binary knapsack instance [9].
In stochastic optimization with continuous distributions, problems often turn out to be #P-hard, and this is often even true for the evaluation of objective functions containing expected values. For an example, see [10], from where we also borrowed some ideas for the following proofs. Proof. We show the result by a reduction from #Knapsack. More precisely, for some given a * ∈ N m and b * ∈ {0, 1, . . . , m i=1 a * i }, we will prove that one can compute in polynomial time if the following instances of (SP) can be solved in polynomial time.
In case b * = m i=1 a * i , this is clear, so from now on, we assume that b * < m i=1 a * i . We define a family of instances of (SP), parameterized by τ ∈ [−1, 1]: each of the instances has n := m + 1 items, where   (a 1 , . . . , a m , a m+1  with ε := 1 2a m+1 > 0 . The proof consists of two main steps. First, we investigate the structure of the leader's objective functions for the described instances and show that by determining the slope of any of them at b = b * , up to a certain precision, we can compute In the second step, we show how to determine this slope up to the required precision by solving a polynomial number of these instances in a bisection algorithm.
As described in Section 2.2, the leader's objective function can be thought of as a weighted sum of piecewise linear functions corresponding to the permutations induced by different choices of c, with weights being the probabilities of the permutations, respectively. For fixed c, consider the set of items the follower would choose before item m+1. The corresponding piecewise linear function f c first has slope 1 + τ and then slope −1 + τ , since d i a i = 1 + τ for all i ∈ [m], and d m+1 a m+1 = −1 + τ . The order of the items in I c does not matter to the leader because they all result in the same slope in her objective. The slope changes from 1 + τ to −1 + τ at b = i∈Ic a i . The slope would change back to 1 + τ at b = i∈Ic a i + a m+1 ≥ b + , but this is outside of the range of the leader's objective.
The actual leader's objective is now a weighted sum of such functions. For obtaining the weights, we only need to know the probabilities for different sets I c , because all c resulting in the same I c also result in the same piecewise linear function f c . The probability distribution is chosen such that I c = [m] occurs with probability Thus, the leader's objective functionf τ is given asf where f M,τ is the function that has slope 1 + τ for b ∈ [0, i∈M a i ] and slope −1 + τ afterward. It follows that, for any This shows that by computingf ′ τ (b * + 1) for any fixed τ , we can determine the number #{x ∈ {0, 1} m : a * ⊤ x ≤ b * } = 2 m (1 + τ −f ′ τ (b * + 1)) . It is even enough to compute an interval of length less than 1 2 m containingf ′ τ (b * + 1) because the number of feasible knapsack solutions is an integer and this gives an interval of length less than 1 in which it must lie. This concludes the first step of our proof.

It remains to show how to determine whetherf
, in order to choose the new interval. To this end, we first maximize f τ for τ : . This can be done by solving (SP) for the corresponding instance, which by our assumption is possible in polynomial time. Suppose the maximum is attained at b k+1 . As a weighted sum of concave functions,f τ is concave, and hence,

Theorem 3. Problem (SP) with a continuous componentwise uniform distribution of c is #P-hard.
Proof. The result can be shown by a similar proof to the one of Theorem 2: instead of the discrete distribution used before, the continuous distribution is considered, while fixing c m+1 = 1. The sets I c are defined as before, and it can be shown that each set has probability 1 2 Both events have probability 1 /2. The rest of the proof is analogous, except for a small change in the computation in (10) due to the slightly different probabilities.
Note that c m+1 is fixed in the proof of Theorem 3. In order to avoid this, one can consider c m+1 ∼ U[1 − ε, 1 + ε] instead, for sufficiently small ε > 0.

Theorem 4. Evaluating the objective function of Problem (SP) with a discrete or continuous componentwise uniform distribution of c is #P-hard.
Proof. Using the same construction and notation as in the preceding proofs, we have shown that computingf ′ 0 (b * + 1) =f 0 (b * + 1) −f 0 (b * ) is #P-hard. It follows that also evaluatingf 0 is #P-hard.
Note that the proof of Theorem 4, together with (7) and (9), implies that already the computation of the valuesx i (b) and ∆x i (b) for some given i ∈ [n] and b ∈ [A] can be #Phard. Moreover, the constructions in the proofs of Theorem 2 and 3 show that all stated hardness results still hold when δ = 0. One can show that, since all follower's item values in these constructions are positive, the hardness result also holds when assuming d ≥ 0 and δ > 0; see [2].
Considering these results, it is a natural question whether (SP) can at least be approximated efficiently. Assuming b − = 0, this question is well-defined, since all optimal values are nonnegative then, due tof (0) = 0. However, it is easy to derive the following negative result, which excludes the existence of any polynomial time (multiplicative) approximation algorithm, unless P = NP.

Theorem 5. For Problem (SP) with a discrete or continuous componentwise uniform distribution of c and with b − = 0, it is #P-hard to decide whether the optimal value is zero.
Proof. For any given instance of (SP) and any K ∈ R ≥0 , we can efficiently construct a new instance of (SP) by adding an item n + 1 with leader's value d n+1 = −K + δ, size a n+1 = 1, and any distribution of c n+1 guaranteeing P(c n+1 > c i /a i ) = 1 for all i ∈ [n]. Letf andf K denote the objective functions of the original and the extended problem, respectively. By construction, the follower will always choose item n + 1 first in the extended instance.
In summary, we can polynomially reduce the decision of to the decision of max Since the computation of an optimal solution for the original instance of (SP) can be polynomially reduced to problems of type (11), using a bisection algorithm, the desired result now follows from Theorems 2 and 3.

Pseudo-Polynomial Time Algorithms
We now present pseudo-polynomial time algorithms for the stochastic bilevel continuous knapsack problem in the #P-hard cases addressed in the previous section. These algorithms are based on a dynamic programming approach. As discussed in Section 2.2, the leader's objective function is piecewise linear with vertices at integral positions b ∈ [A], since the item sizes a are assumed to be integral. Therefore, we could solve the problem by evaluatingf (b) for O(A) many values of b, and A has polynomial size in the numerical values of the sizes a. The quest for a pseudo-polynomial algorithm thus reduces to the computation off (b) for given b ∈ [A]. However, we have seen in the previous section that also the latter task is #P-hard in general. Actually, as mentioned, even the computation of ∆x i (b) for given i ∈ [n] and b ∈ [A] can be #P-hard. In the following, we will present algorithms for computing ∆x in pseudo-polynomial time for the distributions addressed above, i.e., for item values that are componentwise uniformly distributed on a finite set or on a closed interval. From ∆x one can computex using formula (8) and with that evaluatef for all integral capacities using formula (7), which takes pseudo-polynomial time O(nA).
In order to compute ∆x, we first define the auxiliary function for i ∈ [n], I ⊆ [n] \ {i}, and b ∈ Z, i.e., the probability that item i is profitable and that the total size of all items in I that the follower prefers over item i is exactly b. We then for all i ∈ [n] and b ∈ [A]. Indeed, for r ∈ [a i ], the value g i (b − r, [n] \ {i}) describes the probability that a percentage of exactly r/a i of item i is packed when the capacity is b, and hence (r − 1)/a i when the capacity is b − 1. The sum thus represents the probability that the percentage of item i being packed is increased by 1/a i when increasing the capacity from b−1 to b. Hence, the right hand side agrees withx Note that c j /a j > c i /a i and c i > 0 in the definition of g i (b, I) could be replaced equivalently by c j /a j ≥ c i /a i and c i ≥ 0 by Assumption (5), and the same is true in the following whenever comparing profits of different items.
Determining all probabilities g i (b, [n] \ {i}) would thus allow us to compute ∆x and hence to solve Problem (SP) in pseudo-polynomial time. To this end, for i ∈ [n], I ⊆ [n] \ {i}, b ∈ Z, and γ ∈ R, we next define i.e., the probability that the total size of all items in I with profit larger than γ a i is exactly b. For the following, let supp From now on we assume componentwise independent item values. Under this assumption, for item values with finite support, we then have while for absolutely continuously distributed item values, we have where p i (γ) denotes the probability density function of the random variable c i . For all i ∈ [n] and γ ∈ R, it is easy to verify that and, if j ∈ I and i ∈ I, This recursive formula enables an incremental computation of h i (b, [n] \ {i}, γ) for given i ∈ [n], γ ∈ R, and b ∈ {0, . . . , A}. We emphasize that only O(n) many subsets I of [n] need to be considered for this, as, for the recursion (16), it suffices to choose one element j to be removed from I. Using this, we can now develop pseudo-polynomial time algorithms for computing ∆x in case of independently and uniformly distributed item values, with supports being either finite sets or continuous intervals.

Componentwise uniform distributions with finite support
In this section, we assume that all item values are independently and discretely distributed with finite support. More specifically, for i ∈ Proof. Each such probability can be computed in time O(m) as and the claim follows. Proof. We apply the recursive formula (16) in order to compute the desired probabilities h i (b, [n] \ {i}, γ). More specifically, setting I := ∅ and b max := 0 at the beginning, we iterate over all j ∈ [n] \ {i} in an arbitrary order. For each such j, we first compute . . , A}, which follows from (12). From ∆x one can computex in time O(nA) using (8)

Componentwise continuous uniform distributions
In this section, we assume that the value c i of item i ∈ [n] is distributed uniformly on the continuous interval [c The key difference to the discrete case discussed in the previous section is that we compute the probabilities h i (b, I, γ) not for fixed γ, but as functions in γ. The involved probabilities P(c j /a j > γ/a i ) are piecewise linear in γ. As a result, h i (b, I, γ) is a piecewise polynomial function in γ and the expected values ∆x can be computed as integrals over piecewise polynomial functions.
with v 1 < · · · < v r be the ascending enumeration of all elements in V . For i, j ∈ [n], i = j, and γ ∈ R, we have In particular, P(c j /a j > γ/a i ), as a function in γ, is linear on each interval [a i v k , a i v k+1 ]. From the proofs of Lemma 9 and Theorem 10, it follows easily that a pseudo-polynomial algorithm exists for each class of continuous distributions such that the entries c i are independently distributed and such that each c i has a piecewise polynomial density function, assuming that the latter is given explicitly as part of the input. In particular, each entry c i may have a support consisting of a finite union of bounded closed intervals such that c i induces a uniform distribution on each of these intervals.
Moreover, the approach can deal with item values c i that are given as weighted sums of independently and uniformly distributed random variables on continuous intervals, as long as the number of summands is fixed. Indeed, if some given distributions have piecewise polynomial density functions, then the density function of their sum (assuming independence) is again piecewise polynomial, and the number of polynomial pieces is bounded by the product of the numbers of pieces of the original density functions. In particular, this applies to the case where each component independently follows an Irwin-Hall distribution.

Correlated Distributions
The fact that (SP) can be solved in pseudo-polynomial time for uniform independently distributed item values raises the question of how much the complexity increases when considering correlated item values. This question is only well-defined when we restrict ourselves to specific classes of distributions and when we specify how exactly the input is given. As an example, one may consider uniform distributions on general polytopes, instead of boxes as in Theorem 3 and Theorem 10. For this case, one can show that no pseudo-polynomial algorithm in the total item size A can exist unless P = NP, since the problem is already hard for unit sizes. However, the hardness derives from the complexity that can be modeled into the polytope, rather than from the stochastic optimization task itself, and the problem may turn tractable again if the numbers appearing in the description of the polytope are polynomially bounded; see [14] for details.

Additive Approximation Scheme for Componentwise Distributions
Building on the results of the previous section, we next devise a fully pseudo-polynomial time additive approximation scheme for Problem (SP) for arbitrary absolutelycontinuous distributions with independent components c i . This approach can be easily adapted to deal with discrete distributions (with finite or infinite support) as well. Recall that the case of finite support was settled by Theorem 8, but the running time of the corresponding algorithm depends on the size of the supports. It may thus be desirable to approximate a discrete distribution by another discrete distribution with a smaller support in order to obtain a faster running time, even if this comes with a small error. For each i ∈ [n], we assume that the distribution of c i is given by an oracle for its cumulative distribution function, defined as as well as an oracle for its quantile function Now let j 1 , . . . , j r be the elements of J i ∩ R >0 in ascending order, and set j 0 = 0 and j r+1 = ∞. Denoting the probability density function of c i by p i again, we set We claim that the computed solution is actually an ε-approximate solution for the original problem, in the additive sense. To show this, we first observe that the cumulative distribution functions of c i andc i have a pointwise difference of at most 1 2m . Then, using (16) for any j ∈ I, we obtain for all i ∈ [n] using (8). Finally, the additive error inf (b), for any b, is bounded by which implies the desired result.
It is easy to see that the proof of Lemma 12 also works when all or some components of c follow a discrete distribution. For this, it suffices to adapt the definition ofg i and the estimation of its error. Altogether, we thus obtain Theorem 13. Assume that the components of c are independently distributed and that the distribution of each component c i is given by oracles for its cumulative distribution function and its quantile function. Then there exists a fully pseudo-polynomial time additive approximation scheme for (SP).

Conclusion
We have settled the complexity status of the stochastic bilevel continuous knapsack problem with uncertain follower's item values for different types of distributions. In case of a distribution with finite and explicitly given support, the problem is tractable. If the item values are independently and uniformly distributed, the problem is #Phard in general, both for continuous and discrete distributions, but we devise pseudopolynomial algorithms for both cases. Finally, we present a fully pseudo-polynomial additive approximation scheme for the case of arbitrary distributions with independent item values.
For the (single-level) binary knapsack problem, it is a classical result that the wellknown pseudo-polynomial algorithm can be turned into an FPTAS by a natural rounding approach [13]. Unfortunately, such an approach fails for the pseudo-polynomial algorithm presented in Section 4.2. In fact, by Theorem 5, an FPTAS for the stochastic bilevel continuous knapsack problem under the distributions considered in Section 4 cannot exist, at least not in the multiplicative sense.
Finally, several interesting variants of the stochastic bilevel continuous knapsack problem arise when replacing the expected value in (SP) by some other risk measure, e.g., by a higher moment or a combination of different moments. This would allow to take also the variance into account, as is common in mean-risk optimization. Also other risk measures such as the conditional value at risk may be considered. For a collection of related results along the lines of Section 3 and Section 4.1, see [17].