Improved Approximation results for Stochastic Knapsack Problems.

Improved Approximation results for Stochastic Knapsack Problems.
Improved Approximation Results for Stochastic Knapsack Problems
Anand Bhalgat
∗
Ashish Goel
Abstract
In the stochastic knapsack problem, we are given a set of
items each associated with a probability distribution on sizes
and a profit, and a knapsack of unit capacity. The size
of an item is revealed as soon as it is inserted into the
knapsack, and the goal is to design a policy that maximizes
the expected profit of items that are successfully inserted
into the knapsack. The stochastic knapsack problem is a
natural generalization of the classical knapsack problem, and
arises in many applications, including bandwidth allocation,
budgeted learning, and scheduling.
An adaptive policy for stochastic knapsack specifies the
next item to be inserted based on observed sizes of the
items inserted thus far. The adaptive policy can have an
exponentially large explicit description and is known to be
PSPACE-hard to compute. The best known approximation for this problem is a (3 + )-approximation for any
> 0. Our first main result is a relaxed PTAS (Polynomial Time Approximation Scheme) for the adaptive policy,
that is, for any > 0, we present a poly-time computable
(1 + )-approximate adaptive policy when knapsack capacity
is relaxed to 1+. At a high-level, the proof is based on transforming an arbitrary collection of item size distributions to
canonical item size distributions that admit a compact description. We then establish a coupling that shows a (1 + )approximation can be achieved for the original problem by
a canonical policy that makes decisions at each step by observing events drawn from the sample space of canonical size
distributions. Finally, we give a mechanism for approximating the optimal canonical policy.
Our second main result is an (8/3 + )-approximate
adaptive policy for any > 0 without relaxing the knapsack
capacity, improving the earlier (3 + )-approximation result.
Interestingly, we obtain this result by using the PTAS
described above. We establish an existential result that the
optimal policy for the knapsack with capacity 1 can be folded
to get a policy with expected profit 3OPT/8 for a knapsack
with capacity (1 − ), with capacity relaxed to 1 only for the
first item inserted. We then use our PTAS result to compute
the (1 + )-approximation to such policy.
Our techniques also yield a relaxed PTAS for nonadaptive policies. Finally, we also show that our ideas can
be extended to yield improved approximation guarantees for
∗ Department
of Computer and Information Science,
University of Pennsylvania,
Philadelphia PA. Email:
bhalgat@cis.upenn.edu.
Supported by NSF Award CCF0635084.
† Departments of Management Science and Engineering and
(by courtesy) Computer Science, Stanford University. Email:
ashishg@stanford.edu. Research supported by NSF Award IIS0904325.
‡ Department
of Computer and Information Science,
University of Pennsylvania,
Philadelphia PA. Email:
sanjeev@cis.upenn.edu. Supported in part by NSF Awards
CCF-0635084 and IIS-0904314.
†
Sanjeev Khanna
‡
multi-dimensional and fixed set variants of the stochastic
knapsack problem.
1
Introduction
The knapsack problem is a fundamental and widely
studied optimization problem [GJ79, KK82]. We are
given a set of items each associated with a size and a
profit, and the objective is to find a maximum profit
set of items with total size at most 1. When the
item sizes are not fixed and are instead given by a
probability distribution, the problem is broadly referred
to as the stochastic knapsack problem. The size of
an item is revealed as soon as it is inserted into the
knapsack. If the knapsack capacity is not violated
by the inserted item, the insertion is referred to as
a successful insertion. No item insertions are allowed
after an unsuccessful insertion, and the goal is to
maximize the expected profit of successfully inserted
items. The stochastic knapsack problem and its variants
naturally arise in many scenarios, including bandwidth
allocation, budgeted learning, and scheduling. For
instance, a prototypical example is deadline-scheduling
of a maximum value subset of jobs on a single machine.
Even though the underlying distribution of processing
times for each job is known, the actual processing time
is revealed only when the job finishes execution.
Unlike the deterministic knapsack problem, the
order in which the items are chosen for insertion plays a
crucial role in determining the expected profit. Thus a
solution to the stochastic knapsack problem corresponds
to a policy that specifies the next item to be inserted.
A non-adaptive policy specifies a fixed permutation of
items for insertion into knapsack. An adaptive policy
chooses the next item to be inserted based on realized
sizes of the items inserted thus far. It is easy to see that
the stochastic knapsack problem is NP-hard in both
adaptive and non-adaptive settings since either setting
generalizes the classical knapsack problem. We note
that in the adaptive version of the problem, just the
description of an optimal policy can be exponentially
large. Indeed, Dean, Goemans, and Vondrák [DGV08]
show that several variants of the adaptive stochastic
knapsack problem are PSPACE-hard.
Much work on this problem has thus focused on
polynomial-time approximation algorithms. The current best known approximation ratios for stochastic
knapsack are due to Dean et al [DGV08]; they give
a (3 + )-approximation to the optimal adaptive and
non-adaptive policies for any > 0. When the knapsack capacity is relaxed to (1 + ) for some 0 < <
1, the techniques of [DGV08] imply a (3 − O())approximation. There are no better approximation results known for even for commonly studied distributions
such as Bernoulli or exponential, even when the knapsack capacity is relaxed to 1 + . More generally, we
are not aware of any approximation schemes for adaptive policies for scheduling and packing problems when
an unbounded number of adaptive decision points are
allowed, as in the stochastic knapsack problem.
1.1
Our Results and Techniques
Stochastic Knapsack with (1 + ) Space: Our
first main result is an approximation scheme for the
stochastic knapsack problem, in both adaptive and
non-adaptive settings for arbitrary size distributions of
items, provided the knapsack is allowed an arbitrarily
small extra space.
Theorem 1.1. For any > 0, there is a poly-time
computable (1 + )-approximate adaptive policy for the
adaptive stochastic knapsack problem when knapsack
capacity is relaxed to 1 + . A similar result holds for
non-adaptive policies.
The starting point for this result is a reduction of
the given arbitrary collection of size distributions to a
small number of distributions. Since an optimal policy
realization may potentially insert all n items, a (1 + )approximate solution would seem to require (1 + /n)approximate representation of probabilities. This yields
Ω(n/) groups just for one size and thus nΩ(log n/)
different size distributions overall; too large for our
purposes. Our first technical contribution is a sequence
of transformations that discretize the given distributions
into 2poly(1/) log n different canonical distributions; the
size realized by an item under a canonical distribution is
referred to as its canonical size. Observe that an optimal
adaptive policy on canonical distributions may behave
completely differently from an optimal adaptive policy
on real size distributions. We establish a coupling that
relates events drawn from canonical size distributions
to actual size realizations. Note that any discretization
errors need to be analyzed over all execution paths.
Towards this end, we frequently utilize the following
paradigm: for each source of discretization error, we
identify a good event (an event that fills the knapsack
without error) that occurs at a much higher rate than
the discretization error. Thus any profit lost due to
discretization error can be charged to the good event.
We also derive and use a tail bound for an adaptive
sequence of random variables when both the sum of
expectations of random variables in any realization and
the maximum realized value of a random variable are
bounded.
We next focus on computation of a near-optimal
adaptive policy using canonical size distributions. It is
worth noting that even for canonical size distributions,
there are instances where just the description of the optimal adaptive policy is super-polynomial. We overcome
this difficulty by introducing the notion of block-adaptive
policies, that allow us to reduce the number of adaptive
decision points. Broadly speaking, a block-adaptive policy makes adaptive decisions only after playing a subset of items whose profit is Ω(poly()OPT). Our second technical contribution is to show that there exists a
(1 + O())-approximate block adaptive policy when we
are allowed O() extra space. We then show that we
can enumerate over all block adaptive policies in polynomial time to find a (1 + O())-approximate policy. In
implementing this step, we use a technique of Chekuri
and Khanna [CK00] to reduce quasi-polynomially many
possibilities to polynomially many possibilities by exploiting their inter-dependence.
We note here that it is known [DGV08] that there
exists an absolute constant 0 > 0 such that no nonadaptive policy can approximate an adaptive policy to
better than a factor of (1 + 0 ) even when the knapsack
is allowed (1 + 0 ) space. Thus even with (1 + ) space,
design of an approximation scheme inherently requires
us to explicitly consider adaptive policies.
Stochastic Knapsack without Extra Space: Our
second main result is an improvement of the (3 + )approximation result of Dean et al [DGV08] when
knapsack capacity is not relaxed.
Theorem 1.2. For any > 0, there is a poly-time
computable ( 83 + )-approximate adaptive policy for the
adaptive stochastic knapsack problem.
Somewhat surprisingly, we obtain this result by
using Theorem 1.1. We consider the set of adaptive
policies for a knapsack of capacity 1 − with the
following special property: if the first item inserted by
the policy realizes to a size between (1 − ) and 1, then
the policy does not treat it as an overflow, but it can not
insert any more items. We show that the optimal policy
under this setting achieves an 8/3 approximation to an
optimal policy for the original knapsack capacity of 1.
Given this existential result, we can use Theorem 1.1
to compute a (1 + )-approximation to such a policy.
The total space used by such a policy will be at most
1 − + = 1. The only modification we need to make
to the dynamic program is to increase the profit of the
first item placed in the knapsack to also include profit
from the event where this item realizes to a size between
(1 − ) and 1.
The existential proof is based on a conceptual
experiment where we simulate the optimal policy σ for a
knapsack of capacity 1 using two knapsacks of capacity
1 − by charging each item placed by the optimal
policy to one of the knapsacks. We transition between
knapsacks to determine which knapsack the item gets
charged. The transition events between the knapsacks
are dynamically determined based on the realized sizes
of the inserted items. We refer to this simulation as
the two knapsack experiment, and the output of this
experiment is a pair of adaptive policies, one for each
knapsack. By using suitable choice of parameters and
transition points, we show that better of the two policies
captures a ( 38 )-fraction of the optimal profit.
Multi-Dimensional Stochastic Knapsack Problem:
In the multidimensional stochastic knapsack
problem with d dimensions, each item is associated with
a size distribution in each of d dimensions. The objective is to maximize the expected profit of items successfully inserted subject to the capacity constraint in each
dimension. Dean et al [DGV05] note that this problem
is a stochastic variant of the Packing Integer Program,
namely, the problem of finding maximum value 0/1 vector satisfying Ax ≤ b with A and b non-negative.
The best known approximation guarantee for ddimensional stochastic knapsack problem is a (6d + 1)approximation [DGV05]. Even in the deterministic setting, this problem is known to be hard to approximate
within a factor of O(d1− )[DGV05]. Our techniques can
be extended to obtain a relaxed PTAS for the multidimensional generalization of stochastic knapsack problem.
Theorem 1.3. For any fixed d, there is a PTAS for
the adaptive d-dimensional stochastic knapsack problem
when capacity is relaxed to 1 + in each dimension.
With no relaxation in capacity, there is a poly-time
computable (2d + 1 + )-approximate adaptive policy. A
similar result holds in the non-adaptive setting.
Fixed Set Models of Stochastic Knapsack Problem: In the fixed set models of the stochastic knapsack
problem, the goal is to output a suitable set of items as
opposed to a policy. We consider two such models.
In the bounded overflow probability model, the objective is to find a maximum
profit subset of items such
P
that Pr
1≤i≤|S| Xi > 1 ≤ γ, where X1 , X2 , ..., X|S|
are random variables corresponding to the sizes of items
in S, and γ is an input parameter, referred to as
the overflow probability. This variant is motivated by
the problem of allocating bandwidth to bursty connections [KRT97]. Kleinberg et al [KRT97] gave a log(1/γ)factor approximation algorithms when items sizes have
Bernoulli size distribution. Later, Goel et al [GI99] gave
PTAS and QPTAS results for restricted classes of distributions, namely Bernoulli, Exponential and Poisson
distribution. These results require the knapsack capacity and the overflow probability to be relaxed by a (1+)
factor, and the algorithm requires γ to be a constant
for Bernoulli distributions. There are no results known
for this problem with arbitrary size distributions, even
when the knapsack capacity and the overflow probability are relaxed. We give a PTAS for arbitrary size
distributions in this model.
Theorem 1.4. There is a PTAS for the bounded overflow probability model when the knapsack capacity and
the overflow probability are relaxed by a (1 + ) factor.
In the All-or-None model [DGV08], we get profit
for all items in the output subset S when all items in
S fit in the knapsack, and otherwise we get zero profit.
Dean et al [DGV08] gave a factor 9.5 approximation for
this model. Our techniques can be used to get a PTAS
for this model when knapsack capacity is relaxed.
Theorem 1.5. There is a PTAS for for the All-orNone model when knapsack capacity is increased to 1+.
1.2 Other Related Work We briefly highlight some
other related work on variations of the stochastic knapsack problem and adaptivity in stochastic optimization. The stochastic knapsack problem with deterministic sizes and random profits has been studied in
[CSW93], [Hen90], [Sne80], [SP79]; the objective is to
find a set which maximizes the probability of achieving
some threshold profit value. These works primarily focus on heuristic approaches for this problem. Derman et
al. [DLR78] consider the knapsack cover problem, where
multiple copies of the same item can be used and the objective is to fill the knapsack with minimum cost. They
show that when item sizes follow exponential distributions, a greedy scheduling strategy solves the problem
optimally.
The stochastic knapsack has also been studied
in an ordered adaptive model where we are given a
fixed sequence of items. Each item in the sequence
is associated with a size distribution. For each item
in the sequence, we have a choice of either inserting
or neglecting the item based on previous realizations
of items. The objective is to maximize the expected
profit. Dean et al [DGV08] show that optimum profit
can be achieved when the capacity is relaxed to 1 +
o(1). Halman et al [HKLOS08] show that a (1 + )
approximation to the optimum can be achieved with a
strict knapsack capacity constraint.
Adaptivity has been also studied in the framework
of two-stage stochastic optimization (see, for instance,
[IKMM04], [RS04], [Shm04]). In this setting, there
is only a single level of adaptive recourse in contrast
to the adaptive stochastic knapsack problem where an
adaptive choice can be made after every item insertion.
1.3 Organization Section 2 presents notation, definitions, and some useful properties of (1 + )approximate policies. In Section 3, we sketch the discretization of size distributions of items; complete details are deferred to Appendix A. The transformations
performed in this section allow us to restrict our search
space to canonical policies that use O() extra space.
In Section 4, we show how to exploit the structure of
canonical policies to get an approximation scheme for
the adaptive stochastic knapsack problem. In Section 5,
we show how the techniques developed in Section 3 and
4 can be used to design a (8/3 + )-approximate policy
under a strict capacity constraint.
In Section 6, we show that our techniques also yield
an approximation scheme for non-adaptive stochastic
knapsack when the capacity is relaxed to (1 + ).
Finally, Sections 7 and 8, describe our results for
the multidimensional and the fixed set variants of the
stochastic knapsack problem respectively.
2
Preliminaries
Let B = {b1 , b2 , ..., bn } be the set of items where the
profit of item bi is denoted by pi . We will denote by π ∗
the original vector of size distributions for items in B
with size distribution of item bi being πi∗ . We assume
that the input size distributions of items are arbitrary.
We will perform a sequence of discretization steps
that will transform π ∗ to a vector of canonical size
distributions, that we denote by π c . In general, given
any vector of size distributions π, the size distribution
of item bi is indicated by πi , the expected size µi of an
item bi is defined to be µi = EXi : πi [Xi ], and profit
density of item bi is defined to be µpi .
i
We use the notation P(σ, π, C) to indicate the
expected profit of the policy σ with knapsack of capacity
C and distributions on items π. We will denote by OPT
the profit of an optimal policy given size distributions
π ∗ and knapsack capacity 1. For any given α > 1,
a policy is called α-approximate if its expected profit
is at least OPT/α. In course of performing various
transformations for our algorithm, we will increase the
knapsack capacity by O() a constant number of times.
Let the final knapsack capacity be Cmax = 1 + O(); we
assume w.l.o.g. that is small enough so that Cmax ≤ 2.
Adaptive Policy and Its Representation: An
adaptive policy is a function σ : 2[n] ×R → [n] that maps
the set of available items and the remaining knapsack
capacity to next item to be inserted into the knapsack.
An adaptive policy may be equivalently viewed as a
decision tree which encodes all possible execution paths
in different realizations of the policy. The root node
corresponds to the first item to be played by the policy,
every other node corresponds to an item to be played
given the path of size realizations from the root to the
node. An edge from a node ν to a child node may
be viewed as labeled with the size realized when the
item at node ν is played. Since a path from root to
any node implicitly encodes both the available items
and the residual knapsack capacity, each node in the
decision tree needs to be only labeled with an item to
be played. A leaf in the decision indicates the end of
the policy, and sum of sizes of items on any root leaf
path (other than potentially the last item) is no more
than the knapsack capacity.
Structured Near-Optimal Policies: We sketch here
a few simple transformations that allow us to restrict
our attention to near-optimal policies with certain useful structural properties. The first transformation below allows us to bound the maximum possible size of
any item. Given size distribution πi∗ of an item bi , its
0
truncated distribution πi is:
Pr 0 (Xi0 = s) =
Xi0 : πi
Pr (Xi = s) ,
Xi : πi∗
Pr 0 (Xi0 = Cmax + ) =
Xi0 : πi
∀s ≤ 1
and
Pr (Xi > 1)
Xi : πi∗
Clearly, the truncation does not affect the expected
profit of the optimal policy. With the truncated size
distribution, the maximum size to which an item can
realize is Cmax + . Here onwards, we thus assume
truncated size distributions. The lemma below holds
for truncated size distributions and its proof is similar
to the Lemma 3.1 in [DGV08].
Lemma 2.1. For a stochastic knapsack of capacity C
where 1 ≤ C ≤ Cmax and any adaptive policy, let S
denote the (random)
P set of items the policy attempts to
insert. Then ES [ bi ∈S µi ] ≤ C + Cmax + = O(1).
Next we show that item profits can be assumed to
be bounded by OPT/. We define an item to be a
huge profit item if it has profit greater than or equal
to OPT/. Given the initial vector of size distributions
π ∗ on items, for any huge profit item bi , we define a new
0
size distribution πi as follows:
pi
Pr ∗ (Xi = s)
,
Pr 0 (Xi0 = s) =
Xi : π i
OPT
Xi0 : πi
and
Pr 0 (Xi0 = Cmax + ) =
Xi0 : πi
1−
X
s≤1
pi
Pr (Xi = s)
Xi : πi∗
OPT
∀s ≤ 1
With unscaled distributions on items, the expected
profit contributed by bi conditioned on the event that
bi is the huge profit item that policy has attempted to
insert, is
pi E[I(Xi , c)].
With scaled distributions, the expected profit contributed by bi conditioned on the event that bi is the
huge profit item that the policy has attempted to insert, is
OPT · E[I 0 (Xi , c)]
We now scale the profit of the item bi by OPT/(pi );
= pi E[I(Xi , c)].
thus the profit of bi is OPT/ after scaling. In Lemma
2.2 and 2.3, we show that that this transformation can This completes the proof.
be performed with only an O() loss in the optimal
profit.
Here onwards, all references to π ∗ will refer to
the distributions with the above two properties. The
Lemma 2.2. There is a (1 + )-approximate policy that preceding transformations allow us to establish the
plays at most one huge profit item in any realization, useful lemma below.
and that also always at the end of the policy.
Lemma 2.4. Given a size distribution vector π ∗ and
Proof. Let E be the event where an optimal policy knapsack capacity 1, there is a (1 + O())-approximate
successfully inserts a huge profit item. Clearly, Pr(E) ≤ policy σ that satisfies the following properties: (1) in
. If S is the (random) set of items which an optimal any realization, σ achieves profit O(OPT/), (2) in any
policy attempts to inserts after successfully inserting the realization, the sum of expected sizes of items that σ
first huge item, then the expected profit contributed inserts is O(1/), and moreover, (3) σ never plays an
by items in S conditioned on the event E is at most item with profit density less than OPT.
OPT, otherwise policy is not optimal. Hence the
expected profit contributed by items in S is at most Proof. To prove the first property, let E1 be the event
Pr(E) · OPT = OPT.
where the policy successfully inserts items with profit
O(OPT/). Clearly Pr(E1 ) ≤ . Let S1 be the
Lemma 2.3. Restricted to the set of policies that play (random) set of items which an optimal policy attempts
at most one huge profit item in any realization and that to inserts after successfully inserting items with total
also at the end, the expected profit before and after the profit OPT/. Then the expected profit contributed by
profit and size scaling operation for huge profit items is items in S conditioned on the event E is at most OPT
1
1
the same.
(otherwise the original policy is not optimal). Hence
expected profit contributed by items in S1 is at most
Proof. Conditioned on the event that the policy does
Pr(E1 ) · OPT = OPT, which is the profit lost if the
not attempt to insert any huge item, the expected profit
policy stops in the event E1 .
of the policy remains unaffected by scaling. We will
To prove the second property, let E2 be the event
analyze the profit of the policy conditioned on the event
where the policy successfully inserts items with the
that the policy attempts to insert bi at the end, where
sum of expected sizes Ω(1/). Clearly, Pr(E2 ) ≤ O()
bi is a huge profit item. The proof follows if we show
by Lemma 2.1. Let S2 be the (random) set of items
that the claim holds true for every choice of bi .
which the optimal policy attempts to insert, after
With unscaled size distributions on items, let
successfully inserting items with sum of expected sizes
I(Xi , c) be the indicator variable of the event that be3/. Then the expected profit contributed by items
fore bi is inserted, amount of space left in the knapsack
in S2 conditioned on the event E2 is at most OPT
is c and bi realizes to size Xi ≤ c. Similarly we define
(otherwise the original policy is not optimal). Hence
I 0 (Xi , c) for the scaled distributions. Since there is no
expected profit contributed by items in S2 is at most
other huge item which the policy has already inserted
Pr(E2 ) · OPT = O(OPT). Now, there is one more
into the knapsack and there is no change in the districlaim that we have to make to complete the proof. The
butions of the non-huge items, we get,
maximum size to which an item can realize is O(1),
0
and hence the very last item that gets inserted does not
OPT · E[I (Xi , c)]
E[I(Xi , c)] =
violate the guarantee in the lemma.
pi
Using Lemma 2.1, for any policy, the expected (1 + ), resulting in q 0 = poly(1/) sizes and in no loss of
profit contributed by items with profit density less than profit for an optimal policy if we increase the knapsack
OPT is O(OPT), this proves the third property in the capacity by a factor of (1 + ).
lemma.
Step 2: Coupled discretization of large-size probLemma 2.4 is crucial to the analysis of the dis- abilities: This step is quite involved, and shows that
cretization step, where the hard upper bounds on the not just the sizes of the items, but the entire large-size
maximum possible profit in any realization, and on the distribution can be discretized into a small number of
sum of expected sizes of items any policy attempts to classes. Observe that each individual probability value
2
insert in any realization are repeatedly used to bound πi (s) can legitimately lie in the range [Θ( /n), O(1)] as
the policy can potentially insert n items.
the loss in expected profit because of error events.
We use a coupling argument to show that for any
We note that even though some steps in our algorithm, e.g. the scaling operation on huge profit items, change in the distributions of items in the large size
assume knowledge of OPT, their correctness does not region such that variation distance for any item bi is
8
rely on exact knowledge of OPT. In particular, it suf- O( πi (large)), the expected profit reduces by only
fices to use the (3 + )-approximate estimate of OPT O(OPT). Thus, we can discretize the probability
given by [DGV08]. In the final approximation ratio of values for a single size to the powers of (1 + poly()).
(1 + O()), this affects the multiplier of by a constant If we store discretized individual probability values, we
would get Ω((log n)poly(1/) ) different size distributions.
factor.
To get around this problem, we represent πi (s) for any
large size s as being relative to πi (large), so that it
3 Discretization of Distributions: A Sketch
has only O(poly(1/)) values. We show that this can
We perform a number of transformations to discretize
be achieved while keeping the total variation distance
the size distributions of items, while ensuring that there
between the original and new distributions small.
remains a (1 + )-approximate adaptive policy that
uses only O() extra space. We provide here a high- After the first two steps, the number of possible largelevel sketch, with a view towards explaining how these size distributions is as desired, i.e., 2poly(1/) log n. We
transformations relate to each other and to the rest of next show that the number of size-distributions can be
the algorithm, and to highlight the novel elements in our similarly bounded even if we take the small sizes into
discretization scheme. Details of these transformations account. For this, we will show (in steps 3 and 4) that
for any item, either we need to store only the largeand full proofs are deferred to Appendix A.
We first divide the size distribution of each item size distribution, or only the small-size distribution, or
into two regions, a large size region where sizes ≥ 5 µi (small) is within a poly(1/) factor of πi (large).
and a small size region which corresponds to sizes < 5 .
Step 3: Upper-bounding µi (small). We show
With reference to size distribution πi for an item bi ,
that if µi (small) is larger than 2πi (large)/3 then for
we will use notation πi (large), πi (small), µi (small) to
such items, the small size distribution stochastically
indicate the probability that an item bi realizes to a
dominates the large size distribution and we can ignore
large size, probability that bi realizes to a small size, and
the large size distribution while reducing the optimal
the expected size of bi conditioned on the event that bi
profit by only O(OPT).
realizes to a small size respectively. For any size s ≥ 0,
we will use notation πi (s) to indicate PrXi : πi (Xi = s). Step 4: Lower-bounding µi (small). We show that if
Also, given two size distributions πi and πi0 for an item µi (small) is smaller than 9 πi (large), then by relaxing
bi , we will use notation ∆(πi , πi0 ) to
Pdenote their total the knapsack capacity by , we can ignore the small-size
distribution of such items while reducing the optimal
variation distance, i.e. ∆(πi , πi0 ) = s |πi (s) − πi0 (s)|.
We now describe the discretization steps. At the profit by only O(OPT).
end of the discretization, we reduce the possible size
Step 5: Dealing with the small-size distribution.
distributions to 2poly(1/) log n while ensuring that there
This is the most critical step in the discretization prois still a (1 + O())-approximate adaptive policy when
cess since we are dealing with adaptive policies. We
knapsack capacity is relaxed to (1 + O()). Proofs of
replace the small size distribution of an item bi by a
these steps crucially depends the fact that policy in consingle size µi (small) and the corresponding probability
sideration satisfies the properties given in Lemma 2.4.
πi (small). Let π and π 0 be the vectors of size distribuStep 1: Discretizing large sizes: Since the size tions before and after the discretization change in this
of any item is O(1) after truncation, the range of large step. Observe that, this is the only step where the real
sizes is [5 , O(1)]. We discretize these sizes to powers of size of an item and the corresponding discretized size
are not within [1/(1 + ), 1] times of each other and we
need to show the existence of an adaptive policy σ c such
that P(σ c , π 0 , 1 + O()) ≥ (1 − O())OPT. Furthermore,
we also need to analyze the performance of such a policy
on items from π.
To begin with, we note that the canonical size
associated with a size realization s of an item bi is
(a) µi (small), if s is in the small size region, and (b)
the discretized size in large size region in the range
(s/(1 + ), s), if s is in the large size region.
We then show that T can be transformed to create a
policy (i.e. the corresponding decision tree) for items in
π 0 such that with extra O() space, the expected profit
of the policy is (1 − O())OPT. This proves the first
claim in the lemma.
The second part of the lemma follows by decoupling the discretized and real distributions and use
of standard tail bounds. Note that, in contrast, for
non-adaptive policies, the proofs of both claims in
Lemma 3.1 immediately follow by a careful application
We now introduce the notion of a canonical policy to of Chernoff’s bound.
handle the discretized item sizes. Given a knapsack of Number of Size Distributions: Now we count the
capacity (1 + O())C, a policy is said to be a canonical number of distinct size distributions. First we observe
policy if (a) for any item bi inserted into the knapsack, that when we have to remember both the small-size
the policy observes its canonical size; and (b) the policy and large-size distributions for an item, π (small) is ini
stops if either the total canonical size of items inserted herent in the large-size distribution (since π (small) =
i
exceeds C or the total real size exceeds (1 + O())C.
1 − π (large)) and need not be explicitly remembered.
i
To summarize, for an adaptive canonical policy, the
decisions are purely based on observed canonical sizes.
At the end of the policy, it observes the real sizes of all
items inserted and if the difference between the sum of
real and canonical sizes of items inserted is more than
O(), it discards the entire profit of all items inserted.
We now show two important properties of the canonical
policies.
Lemma 3.1. There exists an adaptive canonical policy
σ c such that P(σ c , π 0 , 1+O()) ≥ (1−O())OPT. Moreover, for any adaptive canonical policy σ c , P(σ c , π, (1 +
O())C) ≥ P(σ c , π 0 , C) − O()OPT where C = 1 + O().
We briefly outline the proof. The detailed proof
can be found in Appendix A.5. We first consider
the existence of a canonical policy σ c for items in π 0
whose expected profit is (1 − O())OPT. Let T be the
decision tree of the optimal policy for items with size
distributions π (for the knapsack of capacity 1). Each
root-leaf path in T is associated with a (fixed) set of
items and their (fixed) realized sizes. Thus for a given
leaf in T, the difference between the sum of realized
and expected sizes (in the small size region) of items
realizing to small size is fixed quantity. We call a leaf
to be a good leaf if this difference is less than O(), and
a bad leaf otherwise. Given distribution π, each leaf
is associated with a probability of reaching that leaf,
that we refer to as its weight. We show that at least
(1 − O(2 ))-fraction of the leaves (by weight) are good
leaves. Note that, standard tail bounds like Chernoff’s
bound or Azuma’s inequality do not suffice to establish
this, due to adaptive nature of the policy.
This alone does not imply the existence of (1 +
O())-approximate policy for items with size distributions π 0 with O() relaxation in then knapsack capacity.
Next, we observe that when we are storing the smallsize distribution alone, πi (small) is implicitly 1, and
need not be explicitly remembered. Similarly, when we
are remembering both distributions, µi (small) is within
poly(1/) of πi (large) and increases the number of possible distributions by only poly(1/) when appropriately discretized. When we are only storing the smallsize distribution, µi (small) can be easily discretized
into O(poly(1/) log n) values. Thus, we can discretize
the entire large-size distribution as well as the values
πi (small) and µi (small) into a total of 2poly(1/) log n
different values.
Lemma 3.2. Total number of different size distributions is 2poly(1/) log n.
4
An Approximation Scheme for Adaptive
Stochastic Knapsack Problem
By the discretization scheme of Section 3, we know that
there exists an adaptive canonical policy σ c with expected profit (1 − O())OPT that uses C = (1 + O())
space and satisfies the constraints of Lemma 2.4. We
aim to guess the decision tree of such policy by enumerating over decision trees of all canonical policies. This
cannot be done in polynomial time as even with canonical distributions, just the description of a single canonical policy i.e. the its decision tree is of super-polynomial
size. Hence we restrict to the set of canonical policies
with weak adaptivity, where the policies insert a block
of items with total profit Ω(poly()OPT) together and
take the decision based on the sum of canonical size realization of all items in the block. We refer to such policies
as block-adaptive policies. In Lemma 4.1, we show that
to find a policy with expected profit (1 − O())OPT,
it is sufficient to restrict the enumeration of all policies to the set of block-adaptive policies. We then show
that the set of all block-adaptive can be enumerated in
polynomial time. The best policy found by this process
is guaranteed to be a (1 + O())-approximation to the
adaptive optimum.
be done for canonical policies as for any node their
decision tree, the remainder of the policy is uniquely
defined when the corresponding item realizes to a small
size. It is not clear how to apply such transformation to
adaptive policies which look at real sizes of items. The
transformation is explained in detail in Algorithm 4.1.
Lemma 4.1. An optimal canonical adaptive policy σ c
can be transformed into a block-adaptive policy with expected profit (1−O())OPT when the capacity constraint Algorithm 4.1 Policy σ
b
is further relaxed by C.
1. Initially, S = φ. S represents the set of items
added to the auxiliary knapsack.
In the remainder of section, we prove Lemma 4.1.
2. Set σ = σ c , and compute the segments on the
We will denote by σ
b the block-adaptive policy obtained
decision tree of σ.
by suitably transforming σ c . We highlight two keys isrepeat
c
sues that arise in transforming σ to σ
b. One, since the
3.1 Follow the policy σ by continually adding items
c
decision tree of σ can have an arbitrarily complex structo main knapsack until at some node ν, the item
ture, at any node in the decision tree, the remainder of
corresponding to ν, say bν , realizes to a large size,
the policy may be completely different based on two difsay
s.
ferent size realizations of the corresponding item. Thus
3.2
If
any items remain in the segment containing
if we inserting a block of items together, the policy σ
b
ν,
add
these items, say S 0 , to set S. Add items in
c
may end up inserting items that σ would not have in0
S to auxiliary knapsack and the profit of items in
serted for some size realizations for items in the block.
S 0 to the profit collected.
Second, we need to identify a block of items to be played
3.3 Let σ 0 be the remainder of policy in σ corretogether even when decision branches emanating from a
sponding to bν realizing to (large) size s. Note that
node in σ c might insert distinctly different sets of items.
items in S 0 can be present in σ 0 . For each node ν 0 in
We now describe a transformation of σ c into a σ
b
σ 0 which corresponds to an item in S 0 , replace the
that addresses both issues above using C space. For
subtree rooted ν 0 by the subtree rooted at the child
the purpose of analysis, it will be convenient to express
node
of ν 0 corresponding to small size realization of
σ
b as a policy that uses two knapsacks, a main knapsack
the
item
at ν 0 .
of capacity C and an auxiliary knapsack of capacity C.
until
the
policy
σ is over.
Clearly, σ
b can be implemented in a single knapsack of
4.
If
the
auxiliary
knapsack overflows, then discard
capacity (1 + )C. The core step in our transformation
the
entire
profit
of
the
realization.
is the idea of tiling the decision tree of the policy
with segments. A path in the decision tree is called
a small realization path if either every edge on the path
corresponds to a small realization or the path contains
a single node. Our starting point is a partition of nodes
in σ c into small realization paths, called segments such
that if a segment has more than one node, the profit
of the segment (sum of profits of items on it) is at
most 214 OPT, and otherwise, the single node in the
segment satisfies one of the following conditions: (i) it
either has a profit is at least 14 OPT, or (ii) it does not
a child node corresponding to a small size realization.
It is easy to see that such a partition always exists.
At a high level, σ
b inserts all items in a single segment
of σ c together. To compare realizations of σ c and σ
b,
if all items in a segment realize to a small size, then
items inserted in σ
b match the items inserted in σ c , and
when any item in a segment realize to large size, then σ
b
may have inserted extra items which σ c would not have
inserted. Thus in a given realization of σ c , we need
to account for extra space required by the items over
all segments in which there is a large size realization.
It is interesting to note that, such transformation can
Observe that σ
b inserts items in one segment of σ
together. The lemma below establishes useful properties
of σ
b and lower bounds the expected profit of σ
b.
Lemma 4.2. In any realization of σ
b, the sum of profit
of items successfully inserted is O(OPT/); the sum of
expected sizes of items in S at the end of the policy is
O(8 ); the sum of expected sizes of items is O(1/); and
the expected profit of σ
b is (1 − O(2 ))OPT.
Proof. The maximum profit in any realization of σ
b is
bounded by the maximum profit in any realization of σ c
plus total profit of items in S. The former is bounded by
O(OPT/). The total profit of items in S is bounded by
O(9 OPT), since there are O(1/5 ) realizations of items
to a large size before the main knapsack overflows and
with each large realization, items added to S have total
profit O(14 OPT).
The sum of expected sizes of items in S is bounded
by O(8 ), since there are O(1/5 ) realizations of items
to a large size before the main knapsack overflows and S
does not contain any item with profit density less than
OPT.
The sum of expected sizes of items σ
b attempts
to insert in any realization is bounded by the sum of
expected sizes of items in any realization of σ c plus sum
of expected sizes of items in S. The former is bounded
by O(1/) while the later is bounded by O(8 ) as argued
above.
To prove the fourth claim, we start by noting that
if we do not terminate the policy σ
b due to either a
large size realization for an item added to auxiliary
knapsack or an overflow of the auxiliary knapsack, then
the expected profit of σ
b is at least the expected profit of
σ c . Hence to compare the expected profits of σ
b and σ c ,
it suffices to analyze the probability of the event that
either in some segment two or more items realize to large
size, or the auxiliary knapsack overflows before the main
knapsack. Note that since for any item, the canonical
size taken in a small realization is a fixed value (its
expected size conditioned on being small), the auxiliary
knapsack overflows only if some item added to it takes
a large size. The sum of expected sizes of items in S in
any realization is O(8 ). Hence by Markov’s inequality,
the probability that in any realization some item in
S realizes to a large size is O(3 ). It follows that the
expected profit of σ
b is (1 − O(2 ))OPT by Lemma 4.2.
profit of σ
b is at least (1−O())OPT even if items are
arbitrarily permuted within each segment of σ
b. For
the same reason, the expected profit of the policy,
where remainder of the policy for any segment is
chosen based on total canonical size used by items
in the segment even when there are multiple large
size realizations, is no worse.
Now we establish the bound on number of segments
in the decision tree of σ
b.
Lemma 4.3. Any root-leaf path in the decision tree of
σ
b has O(1/15 ) segments. The number of children the
last node of any segment can have is poly(1/). There
are 2poly(1/) segments in the decision tree of σ
b.
Proof. The first property follows from the fact that the
sum of profit of items on any path from root to leaf is
O(OPT/) and each pair of consecutive segments either
contributes a profit of O(14 OPT), or represents the
event that some item realized to a large size. The
number of pairs of the former type is bounded by
O(1/15 ) while the number of pairs of the latter type
can not exceed O(1/5 ).
For the second property, note that in the policy tree
of σ
b, for each segment s, there is a fixed child segment
which corresponds to the first segment in the remainder
of the policy to be followed when all items in s realize to
small size. All remaining child segments of s correspond
We now list important structural properties of the to first segment in the remainder of the policy when
decision tree of σ
b.
at least one item in s0 realizes to a large size, and are
1. The policy is decomposed into segments such that simply labeled with a distinct large size value. Thus
each segment is a path in the tree. A segment the number of child segments for any segment can be
with one item has profit at least 14 OPT, and for bounded by poly(1/).
The third property is an immediate corollary of first
a segment with multiple items, sum of profits is
14
two
claims.
at most 2( OPT). Each node in a segment has
exactly one child node in the decision tree, with
Thus any such policy has f1 () = 2poly(1/) segthe exception of the last node in a segment that
ments. Now we enumerate over all block-adaptive polican have poly(1/) children.
cies and select the policy with the maximum expected
2. For any two consecutive segments, say s0 and s00 profit. The PTAS follows from the lemma below.
where on a root-leaf path (other than last segment
on the path) in the decision tree, either (a) the sum Lemma 4.4. The set of block-adaptive canonical poliof the profits of s0 and s00 is at least 14 OPT, or (b) cies can be enumerated in polynomial time.
s00 corresponds to one of the possible next segments
Proof. To enumerate all policies, we will explicitly
in the remainder of the policy to be followed when
enumerate in top down manner choices of items for each
0
at least one of the item in s realize to a large size.
segment. We will show that there are nf2 () choices
poly(1/)
, yielding an
3. When at least one item in a segment realizes to for each segment, where f2 () = 2
f2 ()f1 ()
large size, the remainder of the policy is decided by algorithm with running time n
.
the first item in the segment that realizes to large
We classify items based on their discretized size
size along with the size to which it realizes. Since distribution. The items belonging to same size class
in lower bounding the profit of σ
b we discarded the have same discretized distribution. We can assume
profit from realizations where more than one item w.l.o.g. that for any pair of items bi and bj same size
realizes to a large size in a segment, the expected class, σ
b always inserts an item with higher profit first.
Thus items can be assumed to be arranged in nonincreasing order of profit in each size class. We have
shown that for the policies in consideration, items can
be permuted within a segment.
We are now ready to describe the enumeration
process for a given segment. For any given segment,
there are two possible choices, either it has only one item
or it has at least two items. Total number of choices for
a segment when the segment has only one item is n.
We now focus on the case when there are at least two
items in the segment; total profit of items in any such
segment is bounded by 214 OPT. It is sufficient to show
poly(1/)
that number of choices for each segment is n2
.
This technique is similar to one used in [CK00]. For
any segment which has profit less than 214 OPT, we
assume that remaining profit is coming from a dummy
class of items. The items in the dummy class do not
contribute any profit while computing the expected
profit of the policy and they have zero size. For any size
class j, let Pji be the profit contributed by the items in
size class j to the current segment. For each size class
2qP i
j
c. We only consider classes j
j, we define αj = b 16 OPT
with αj ≥ 1. Total loss in profit by this step because
of floor operation is at most 16 OPT per segment. By
Lemma 4.3, this will reduce the profit by O(OPT).
Now the problem is to distribute 2q
2 among q classes.
2
Number of ways of doing this is at most 2q/q +q which
is at most
2
q
(2q/ + q)
≤ (3e/2 )q ≤ (1/2 )
(q/e)q
O(log n)
poly(1/)
poly(1/)
= n2
ity (1 − ) with the following exception: if the very first
item inserted into the knapsack realizes to a size between
(1 − ) and 1, then this insertion is still considered a
success, and the policy terminates.
Given the lemma above, we can use Theorem 1.1
to compute a canonical policy which is a (1 + )approximation to such a policy; the only modification
is that the dynamic program adds (pi · PrXi : πi∗ (1 − <
Xi ≤ 1)) to the profit of the very first item bi it inserts into the knapsack. The total real knapsack capacity required for this canonical policy to compensate
for discretization will be 1 − + = 1 and hence, Theorem 1.2 follows. In the remainder of the section, we
prove Lemma 5.1.
Recall that π ∗ is the vector of original size distributions on items. Let σ ∗ be the optimal adaptive policy
for the knapsack of capacity 1, thus P(σ ∗ , π ∗ , 1) = OPT.
For any item bi , we define its scaled profit1 , denoted by
∗
psc
i , as pi PrXi : πi (Xi ≤ 1) . Thus, maximum contribution by bi towards the expected profit of any policy
for a knapsack of capacity 1 is psc
i . We now explain the
two knapsack experiment in Lemma 5.2.
Lemma 5.2. Given any C ≤ 1 − such that 2C ≥ 1,
and any adaptive policy σ such that the maximum scaled
profit of any item played by σ is psc
max , there exists a
policy σ 0 such that
P(σ 0 , π ∗ , C) ≥
P(σ, π ∗ , 1) − psc
max
2
Proof. We simulate realizations of σ for a knapsack
of capacity 1 in two knapsacks, each of capacity C.
We follow the decision tree associated with σ for the
knapsack of capacity 1 assigning each item dynamically
to one of the two knapsacks. Here onwards, any
reference to σ will be to the associated decision tree
for the knapsack of capacity 1.
We start adding items according to σ to the first
knapsack, until the sum of sizes of inserted items is at
least (1 − C). Then we start adding the items to second
knapsack until the end of the policy σ. Note that,
(1 − C) + C = 1 and 2C ≥ 1. Thus, the two knapsacks
together have enough capacity to accommodate all
items in any realization of σ for a knapsack of capacity
5 An ( 38 + )-Approximation for Adaptive 1. We now want to compare the expected profit of
the items inserted into the first and second knapsack
Stochastic Knapsack without Extra Space
∗
In this section, we give a polynomial-time algorithm to to P(σ, π , 1).
In any realization of σ, all items which contribute
compute an ( 83 + )-approximate adaptive policy when
towards
the profit of σ also contribute towards the profit
there is no relaxation in the knapsack capacity. Our
of
one
of
the two knapsacks, with a possible exception
result is based on the following lemma.
Now, for every size class j, we allocate items to the
given segment in the decreasing order of profits until
the sum of profits is more than αj 17 OPT/2q. There
is one more issue that we have to consider here. Since
the weight of the items from the class may not exactly
add up to profit allocated to the class, we consider both
allocations, first being maximum profit possible such
that it is not more than allocated profit and lowest
profit possible which is not less than allocated profit.
poly(1/)
This adds a multiplicative factor of 2q = n2
to
the number of combinations that need to be tried per
segment. Thus the lemma follows.
Lemma 5.1. There exists an adaptive policy with expected profit (3OPT)/8 which uses a knapsack of capac-
1 To clarify, this scaling operation is different than the scaling
operation on huge profit items, mentioned in Section 2.
of the last item added to the first knapsack. The last
item added to the first knapsack may cause an overflow
in the first knapsack which is not an overflow in σ. Thus
the expected profit lost in the two knapsack experiment
is psc
knapsacks,
max . Hence, for at least one of∗ the two
P(σ,π ,1)−psc
max
.
the expected profit is at least
2
Step (1): Start inserting items to the first knapsack according to σ ∗ until the total size of items in the
first knapsack is at least , or the next item to be inserted is of type T3 . At this point we switch to the
second knapsack and follow Step (2a) if it is applicable.
If not, then we follow Step (2b).
If the given set of items contains any item with
scaled profit more than 3OPT/8, then we can simply
play that item in the knapsack of capacity 1 and achieve
the required profit. W.l.o.g. assume that the scaled
profit of any item is at most 3OPT/8. We classify items
into three types based on profits and size distributions.
We say an item bi is of type T1 if psc
i < OPT/4; it is
∗
of type T2 if psc
i ≥ OPT/4 and PrXi : πi (Xi < ) ≥ 2/3;
≥ OPT/4 and
and finally, it is of type T3 if psc
i
PrXi : πi∗ (Xi < ) < 2/3. Now we consider two cases
based on whether or not the given set of items contains
an item of type T2 . We will prove Lemma 5.1 in each
case by showing the existence of the desired policy.
Step (2a): If we switched to the second knapsack
because the total size of items in the first knapsack is at
least , then we insert items into the second knapsack
until the end of the policy.
Step (2b): If we switched to the second knapsack
because the next item to be inserted according to σ ∗
is a type T3 item, then we continue inserting items
into the second knapsack until the total size of items
in the second knapsack is at least . Then we switch
back to the first knapsack and insert items into the first
knapsack until the end of the policy. While adding the
first item in Step (2b), we assume the knapsack capacity
to be 1, not 1 − . After adding the first item, we treat
Case 1: There is at least one item of type T2 , knapsack capacity to be 1 − .
say bi , in the given set of items. Clearly, there exists
Thus in each of the two knapsacks, the space used
a policy σ1 which never plays bi and P(σ1 , π ∗ , 1) ≥ by the policy is 1−, with the possible exception for the
OPT − psc
i . Now using Lemma 5.2 with C = 1 − 2, first item inserted into the second knapsack in Step (2b).
there exists a policy σ2 such that
Note that if the first item realizes to a size more than ,
P(σ1 , π ∗ , 1) − 3OPT/8
P(σ2 , π , 1 − 2) ≥
2
OPT − psc
i − 3OPT/8
≥
2
∗
then then we switch back to the first knapsack and it is
the only item which is inserted into the second knapsack.
Now we establish the lower bound on the expected profit
for the better of two knapsacks in Lemma 5.3.
Lemma 5.3. At least one of the two knapsacks achieves
We now design a policy with expected profit at least an expected profit of (3OPT)/8 or more.
(3OPT)/8. The policy starts by playing item bi . If
item bi realizes to a size less than , then we add items Proof. We define two disjoint events in the realization
according to σ2 for a knapsack of capacity 1 − 2. Now of the policy σ ∗ for a knapsack of capacity 1.
we compute the expected profit of such a policy. We
1. We define an event E1 when there is an overflow
get profit psc
i from item bi (recall that the first item can
in the first knapsack in step 1. This is always
realize to size up to 1), and when bi realizes to a size of
associated with an item of type T1 .
∗
at most , we get an additional profit of P(σ2 , π , 1−2).
sc
Thus using the fact that pi ≥ OPT/4, we get the
2. We define an event E2 when the realization of σ ∗
expected profit of the policy is
enters step 2b. Note that if we enter step 2b, then
there has been no overflow in the first knapsack in
2
psc
(P(σ2 , π ∗ , 1 − 2))
i +
step 1.
3
sc
We define an event E21 which is a sub event of E2 ,
OPT − pi − 3OPT/8
3OPT
≥ psc
≥
i +
where the first item of type T3 inserted into the
3
8
second knapsack realizes to size at least . In this
The space used by the policy when it attempts to insert
event there is no profit lost in the two knapsack
two or more items is no more than + 1 − 2 = 1 − .
experiment, since if the first item realizes to size
Case 2: There is no item of type T2 in the given
more than 1, then there is overflow both in second
set of items. We perform a modified version of the
knapsack and σ ∗ . Similarly, when the first item
∗
two knapsack experiment to simulate realizations of σ
realizes to a size between and 1, there is no
for a knapsack of capacity 1 in two knapsacks, each of
overflow in the second knapsack and items in the
capacity 1 − .
remainder of the policy in σ ∗ now get added to the
order in which the items are played collects (1−2)OPT0
profit since it can at most fail to collect the profit from
the last block played in any realization of σ c . Thus to
Now we want to compute the total profit lost in (1 + O())-approximate σ c , it suffices to merely guess
the two knapsack experiment, by computing the profit items played in each block of σ c , ignoring the order in
of the items which cause an overflow in one of the two which they are played. We can perform this guessing in
knapsacks but with no associated overflow in σ ∗ . The polynomial time, at expense of losing another O(OPT0 )
overflow in the two knapsack experiment which is not profit, as explained next.
associated with an overflow in σ ∗ can only occur in
We can assume w.l.o.g. that σ c plays items with
knapsack 1 in step 1 or in knapsack 2 in step 2b, but same size distribution in non-increasing order of profit.
not both.
We can now use a similar enumeration scheme as used in
Now we compute the profit lost in the two knapsack the adaptive case to obtain a (1 + O())-approximation
experiment compared to σ ∗ in a knapsack of capacity to σ c .
1. Observe that the events E1 and E2 are disjoint.
The expected profit lost in event E1 is at most OPT/4. 7 Stochastic Multidimensional Knapsack
In event E2 − E21 , the expected profit lost is at most
We briefly outline the proof of Theorem 1.3. By apply3OPT/8. Hence, total profit lost is
ing our discretization technique to each dimension, then
we get 2poly(1/) log n size distributions in each dimenPr(E1 )OPT (Pr(E2 ) − Pr(E21 ))3OPT
+
sion. Thus if there are d dimensions, then the number
4
8
d
of size distributions increases to 2poly(1/) log n . We
As Pr(E21 ) ≥ Pr(E2 )/3, the total profit lost is at most will now show how to reduce it to 2poly(d/) log n.
OPT
4
For an item bi , let µ (small, j) and πi (large, j)
Thus in at least one of the two knapsacks, the indicate the expected sizei in the small size
region
OPT−OPT/4
= 3OPT
and the probability in the large size region in the j th
expected profit is at least
2
8 .
dimension. For any item bi , we perform additional
Thus in each of two cases, we have established the
discretization steps as follows.
existence of a policy as required in Lemma 5.1.
Step a: Similar to step 2 of the discretization for one
6 An Approximation Scheme for Non-Adaptive dimension, probability values for all large sizes across
all dimensions can be stored in a relativized manner of
Policies
In this section, we briefly outline the PTAS for non- the maximum among them. The profit lost in this step
of size distributions over
adaptive policies. Let OPT0 be the profit of the optimal is O(dOPT). So the number
poly(d/)
all
dimensions
will
be
2
log n.
non adaptive policy for knapsack capacity 1 and size
first knapsack with their total size no more than
free space available in first knapsack.
distributions π ∗ . Let σ c be the optimal non-adaptive Step b: Let k2 = argmaxj {µi (small, j)πi (small, j)}.
policy for size distributions π c and knapsack capacity For all dimensions j such that
C = 1 + such that it satisfies the properties in
µi (small, j)πi (small, j) ≤ 3 µi (small, k2 )πi (small, k2 ),
Lemma 2.4. It is easy to see that the ordered set of items
chosen by σ c can be partitioned into contiguous sets of we neglect the small size distribution.
items called blocks that satisfy the following properties:
To prove that this discretization change does not
reduce the expected profit by more than O(dOPT),
1. A block with exactly one item has profit at least we introduce an auxiliary knapsack of capacity in
OPT0 , while a block with at least two items has each dimension. We charge to the auxiliary knapsack,
total profit at most 2(OPT0 ).
realization to small size of any item in the dimension
with small size distribution neglected. It can be shown
2. Sum of the profits of any two consecutive blocks is
that, in any realization of the policy, the overflow
at least 2(OPT0 ).
probability of the auxiliary knapsack before the end of
2
the policy is O(2 ), which imply a loss of O(OPT) per
3. Number of blocks is O(1/ ).
dimension.
The last property follows as sum of profits of items in
This enables us to store small size distributions
σ c is at most O(OPT0 /) and sum of profits of two over all dimensions in a relativized manner, and there
consecutive blocks in σ c is at least (OPT0 ).
are at most poly(1/) possible values of the small size
Furthermore, any policy that agrees with σ c on distribution for any dimension other than the dimension
items played in each block but not necessarily on the in which the small size distribution is stored explicitly.
Proof. We assume that γ ≤ 1/(1 + ); otherwise the
problem admits a trivial solution. Since we are only
interested in the deviation in the probability for a set
of items for realizing to size more than 1 and the
probability of an item realizing to size more than 1 is
crucial in this formulation, we do not scale profits of
Thus the number of size distributions reduce to huge profit items. In Lemma 8.1, we limit the sum of
2poly(d/) log n. It can be shown that, with constant expected sizes of items in a set subject to the constraint
number of dimensions, there exists a block adaptive that its overflow probability is less than 1 − , so that
policy which gives a (1 + O()) approximation to the we can use the discretization process in Section 3.
adaptive optimum and we get a PTAS by enumerating
Lemma 8.1. For any set S with overflow probability
over all such policies.
Now we briefly sketch the result with no extra space γ ≤ 1/(1 + ), the sum of expected sizes of items in
in knapsack. For this purpose, consider a generaliza- S is O(1/).
tion of the two knapsack experiment where we have
two knapsacks in each dimension. We start by adding Proof. By Lemma 2.1, the sum of expected sizes of
items according to the optimum policy, with items be- items successfully inserted into the knapsack is at most
ing added to the first knapsack in each dimension. If the O(1). Hence if the sum of expected sizes of items in S
first knapsack is more than full in any dimension, we is more than O(1/), then by Markov’s inequality, the
switch to the second knapsack in that dimension. We probability that all items in S fit in the knapsack is less
continue adding items until the end of the policy. We than , which is a contradiction, since we have assumed
lose profit of at most d items in any realization, namely that overflow probability of S is no more than 1/(1 + ).
the last item in first knapsack in each dimension. The experiment partitions the policy into (d+1) parts, along
We choose 0 = γ/2, and use 0 as the paramewith d items whose profit is lost in two knapsack experter for the discretization process in Section 3. The disiment. Thus we get a factor (2d + 1 + ) approximation
cretization process ensures that for any set S with sum
with no extra space.
of expected sizes of items at most O(1/0 )
Step c: Similar to steps 3 and 4 in discretization, it
can be shown that, either the large size distribution or
the small size distribution need to stored explicitly, and
given a value for one of them, there are only 2poly(d/)
possible values for the other.
8
Approximation Schemes for the Fixed Set
Models for Stochastic Knapsack
1. Pr (X c (S) > 1 + 0 ) ≤ Pr (X ∗ (S) > 1) + 0 .
2. Pr (X ∗ (S) > 1 + 20 ) ≤ Pr (X c (S) > 1 + 0 ) + 0
In this section, we give a PTAS for the fixed set models
of stochastic knapsack, establishing Theorems 1.4 and where X ∗ (S) and X c (S) are the random variables
1.5.
indicating the sum of sizes of items in S with original
and discretized distributions.
8.1 The Bounded Overflow Probability Model
We enumerate over all possible sets to guess the
Recall that in this model, the objective is to identify optimal set when the overflow probability is (1+0 )γ and
0
subset of items S with maximum total profit subject to the knapsack capacity is (1 + 0 ). With 2poly(1/ ) log n
poly(1/0 )
the constraint
types of items, this can be done in time n2
.


The overflow probability of the set computed with
X
distributions π ∗ on items and the knapsack capacity
Pr 
Xi > 1 ≤ γ
(1 + 20 ) is (γ + 20 ) = (1 + )γ. This completes the
1≤i≤|S|
proof.
for some constant γ, that is referred to as the overflow
probability. Here X1 , X2 , ..., X|S| are the random vari- 8.2 The All-or-None Model In the model, the
ables corresponding to the sizes of items in S.
We objective is to identify the set S which maximizes


now state our result for this model.
X
Pr 
Xi ≤ 1 · (Profit of items in S)
Theorem 8.1. For any fixed > 0, for any constant
1≤i≤|S|
overflow probability γ, there is a polynomial time algorithm to compute a set of items S such that the sum of where X1 , X2 , ..., X|S| are the random variables correprofits of items in S is (1−) factor of the optimum and sponding to the sizes of items in S. For this model,
its overflow probability for a knapsack capacity (1 + ) Dean et al [DGV08] gives a factor 9.5 approximation.
is at most (1 + )γ.
We now state our result for this model.
Theorem 8.2. For any fixed > 0, there is a polynomial time algorithm to compute a set of items S with
total profit is at least (1 − ) factor of the optimum when
the knapsack capacity is relaxed to (1 + ).
2P (SOPT0 ), then the expected profit of S2 is more
than 2P (SOPT0 )/2 > f (SOPT0 )P (SOPT0 ), hence it
contradicts that SOPT0 is the optimal set. Otherwise,
P (S2 ) ≤ 2P (SOPT0 ). Hence, P (S1 ) ≥ (1−2)P (SOPT0 )
and the expected profit by only playing S1 is (1 −
For any set of items S, let f (S) be the probability 2)P (S
OPT0 )f (S1 ) ≥ (1 − 2)P (SOPT0 )f (SOPT0 ). Now
that the items in S fit in the knapsack and P (S) be the we have to show that S contains only one item. This
1
sum of profits of items in S . Let OPT0 be the expected follows from the definition of S , when is small enough.
1
profit of the optimal set and SOPT0 be the corresponding Items from S
OPT0 are added in descending order of profit
0
set. Thus OPT = P(SOPT0 )f(SOPT0 ). The overflow and we stop adding items to S , when for the first time
1
probability of SOPT0 is 1 − f (SOPT0 ).
the items in S1 have profit more than P (SOPT0 )/3. In Section 8.1, given an overflow probability γ, we
looked at the problem of finding a subset with maximum
Now we consider the problem of computing such
total profit and the overflow probability at most (1+)γ. set S. The only interested case is when f (SOPT0 ) ≥ .
We cannot use it directly to compute the maximum We select 0 = 2 as approximation parameter for the
profit set for the overflow probability 1 − f (SOPT0 ) bounded overflow probability problem and we solve it
even if we could guess the value of f (SOPT0 ), because for each value of overflow probability between and 1−
the solution found in section 8.1 increases the overflow in the geometric group which is powers of 1/(1 + 0 ) for
probability by (1 + ) factor, which can arbitrarily approximation factor 0 and take the maximum of the
reduce the probability of fitting a set of items into the product of sum of profits of items and probability of all
knapsack when the overflow probability is close to 1. items fitting the knapsack,
Also when the value of f (SOPT0 ) is arbitrarily close
Now we establish a lower bound on the expected
to 1, the overflow probability can be arbitrarily small profit of the set computed by the algorithm. Notice
and running time of the algorithm given in Section 8.1 that, the sum of profits of items in the optimal solution
depends exponentially on overflow probability. We first for the bounded overflow probability problem never
establish an useful property of the optimal solution in decreases with an increase in the overflow probability.
all-or-none-model in Lemma 8.2.
We consider two cases. In the first case, f (SOPT0 ) ≤
1 − . In this case, f (SOPT0 ) ≥ . There is an
Lemma 8.2. For the set SOPT0 , either f (SOPT0 ) ≥ overflow probability value between (1 − f (S
OPT0 )) and
or it contains an item such that only playing that item (1 − f (S
0
0 ))(1 + ) for which we have computed
OPT
achieves expected profit (1 − O())OPT0
the approximate solution for the bounded overflow
probability problem. Let S be that set. We get,
Proof. We only need to consider the case when
P (S) ≥ (1 − 0 )P (SOPT0 ) and its overflow probability
f (SOPT0 ) < . Order the items in SOPT0 in decreasing
is at most (1 + 0 )(1 − f (SOPT0 )). Hence f (S) is at least
order of profit. Partition the items in SOPT0 into two
(1 − )f (SOPT0 ), as 0 = 2 and f (SOPT0 ) ≥ . Thus
sets S1 and S2 as follows. We add items from SOPT0
the expected profit of items in S is f (S)P (S), which is
in the decreasing order of profit to S1 until the sum of
(1 − )f (SOPT0 )P (SOPT0 ).
profits of items in S1 is more than P (SOPT0 )/3. ReIn the second case, f (SOPT0 ) > 1 − . In this
maining items in SOPT0 are moved to S2 . Expected
case, the set computed for the overflow probability profit achieved by only using S1 is P (S1 )f (S1 ). Simapproximates the optimal solution within a factor of
ilarly the expected profit achieved by only using S2 is
(1 − ).
P (S2 )f (S2 ). Clearly, f (SOPT0 ) ≤ f (S1 )f (S2 ).
We consider various cases based on the values of
f (S1 ) and f (S2 ). In the first case, both f (S1 ) and f (S2 ) References
are less than 1/2. In this case, the expected profit of
SOPT0 is at most (P (S1 ) + P (S2 ))f (S1 )f (S2 ) which is
less than at least one of P (S1 )f (S1 ) and P (S2 )f (S2 ), [CK00] C. Chekuri and S. Khanna. A ptas for the multiple
knapsack problem. SODA, pages 213–222, 2000.
hence it contradicts that SOPT0 is the optimal set.
[CSW93] R. L Carraway, R. L. Schmidt, and L. R. WeathWhen f (S1 ) ≥ 1/2, the expected profit by only
erford. An algorithm for maximizing target achieveplaying items from S1 is P (S1 )/2 ≥ P (SOPT0 )/6 >
ment in the stochastic knapsack problem with normal
f (SOPT0 )P (SOPT0 ) for small enough , as f (SOPT0 ) < ,
returns. Naval Res. Logist., 40:161–173, 1993.
hence it contradicts that SOPT0 is the optimal set.
[DGV05] B. C. Dean, M. X. Goemans, and J. Vondrák.
Now the remaining case is when f (S2 ) ≥ 1/2.
Adaptivity and approximation for stochastic packing
In this case, we consider two sub cases. If P (S2 ) >
problems. In SODA ’05: Proceedings of the 16th
Symposium on Discrete Algorithms, pages 395–404,
Vancouver, British Columbia, Canada, 2005. SIAM.
[DGV08] B. C. Dean, M. X. Goemans, and J. Vondrák. Approximating the Stochastic Knapsack Problem: The
Benefit of Adaptivity. MATHEMATICS OF OPERATIONS RESEARCH, 33(4):945–964, 2008.
[DLR78] C. Derman, C. Lieberman, and S. Ross. Stochastic
optimization is (almost) as easy as deterministic optimization. Management Science, 24(5):554–561, 1978.
[GI99] A. Goel and P. Indyk. Stochastic load balancing and
related problems. In FOCS ’99: Proceedings of the
40th Annual Symposium on Foundations of Computer
Science, pages 579–586, Washington, DC, USA, 1999.
IEEE Computer Society.
[GJ79] M. Garey and D. Johnson.
Computers and
Intractability, A Guide to the Theory of NPCompleteness. W.H. Freeman and Company, New
York, 1979.
[Hen90] M Henig. Risk criteria in stochastic knapsack.
Oper. Res., 38(5):820–825, 1990.
[HKLOS08] N. Halman, D. Klabjan, C. Li, J. Orlin, and
D. Simchi-Levi. Fully polynomial time approximation
schemes for stochastic dynamic programs. In SODA
’08: Proceedings of the 19th Symposium on Discrete
Algorithms, pages 700–709, San Francisco, California,
USA, 2008. SIAM.
[IKMM04] N. Immorlica, D. Karger, M. Minkoff, and
V. Mirrokni. On costs and benefits of procrastinations:
Approximation algorithms for stochastic combinatorial
optimization problems. Proc. 15th SODA, pages 684–
693, 2004.
[KK82] N. Karmarkar and R. Karp. An efficient approximation scheme for the one-dimensional bin-packing problem. Proc. 23rd Annual IEEE Symposium on the Foundations of Computer Science, 1982.
[KRT97] J. Kleinberg, Y. Rabani, and É. Tardos. Allocating bandwidth for bursty connections. In STOC
’97: Proceedings of the twenty-ninth annual ACM symposium on Theory of computing, pages 664–673, New
York, NY, USA, 1997. ACM.
[RS04] R. Ravi and A. Sinha. Hedging uncertainty: Approximation algorithms for stochastic optimization
problems. Proc. 10th IPCO, pages 101–115, 2004.
[Shm04] C. Swamy Shmoys, D. B. Stochastic optimization
is (almost) as easy as deterministic optimization. Proc.
45th FOCS, pages 228–237, 2004.
[Sne80] M Sneidovik. Preference order stochastic knapsack
problems: Methodological issues. J. Oper. Res Soc.,
31(11):1025–1032, 1980.
[SP79] E Steinberg and M. S. Parks. Preference order dynamic program for a knapsack problem with stochastic
rewards. J. Oper. Res Soc., 30(2):141–147, 1979.
A
Discretization of Distributions:
Process
The Full
We now provide a detailed description of the transformations to discretize the size distributions of items.
For each step in the discretization, we will use notation π and π 0 to indicate the vector of size distributions
on items before and after performing the discretization
mentioned in the given step, i.e. for an item bi , size
distributions before and after the discretization changes
0
mentioned in the given step are πi and πi respectively.
All references for C i.e. the capacity of knapsack will
be for any C, 1 ≤ C ≤ Cmax . Also, we restrict the allowed set of policies to ones which satisfy the constraints
mentioned in section 2.
A.1 Step 1 We discretize the sizes in the large size
region into geometric groups. For each item, ∀j ≥ 1, j ∈
N, 1/(1 + )j−1 ≥ 5 , all probability mass between sizes
[1/(1 + )j , 1/(1 + )j−1 ) is assigned to size 1/(1 + )j .
Thus for an item bi , its new distribution in the large
size region is
!
1
0
Pr 0 Xi =
=
j
Xi0 : πi
(1 + )
1
1
Pr
Xi ∈ [
,
)
,
Xi : πi
(1 + )j (1 + )j−1
1
∀j ≥ 1,
≥ 5
(1 + )j−1
The number of different sizes for which size distribution
is defined is
log(1/5 )
= O(1/2 )
log(1 + )
We will use q 0 to denote this number.
Clearly for any policy σ, P(σ, π 0 , C) ≥ P(σ, π, C)
and P(σ, π, (1 + )C) ≥ P(σ, π 0 , C).
A.2 Step 2 Now we discretize the probability distribution in the large size region. For this purpose, we
establish an important property in Lemma A.1.
Lemma A.1. Given a vector of distributions π on items
and a knapsack of capacity C (1 ≤ C ≤ Cmax ), consider
any change in the large size distributions of items to π 0
such that for any item bi
0
• For any s(6= 0), πi (s) ≥ πi (s) and
0
• ∆(πi , πi ) ≤ 8 πi (large)
• For each item bi , the probability for size 0 is
0
increased in πi to compensate for the probability
mass reduced elsewhere.
Then for any policy σ,
1. P(σ, π 0 , C) ≥ P(σ, π, C) and
2. P(σ, π, C) ≥ P(σ, π 0 , C) − O(OPT)
Proof. First claim is trivial since for each item bi , the
0
distribution πi dominates πi for every positive size
realization.
Now we prove the second claim. To compute the
loss in profit for the policy σ when items come from π
compared to when items come from π 0 , we are interested
in finding the probability of the event that, any item,
say bi , realizes to different values under distributions
0
πi and πi before the policy terminates. If such event
happens, then we discard the current item and stop the
policy. By Lemma 2.4, the total profit in any realization
is O(OPT/), hence to prove the lemma, it suffices to
show that probability of this event is O(2 ).
For any item bi , µi ≥ 5 πi (large). Let S be the
(random) set of items which the policy has attempted
to insert. By Lemma 2.4,
X
µi = O(1/)
bi ∈S
5 πi (large) = O(1/)
bi ∈S
By assumptions of the lemma on π and π 0 , we get
!
0
X ∆(πj , πj )
5 = O(1/)
8
bi ∈S
X
Lemma A.2. Number of possible different values of
large size distributions is 2poly(1/) log n
A.3 Step 3 For any item bi , if πi (large) ≤
3 µi (small)/2, then we neglect its large size distribution. The new distribution π 0 for any such item bi
will have zero probability in the large size region. For
any policy σ, create a policy σ 0 as follows: σ 0 follows
σ with the exception that it stops when an item bi
with πi (large) ≤ 3 µi (small)/2 realizes to a large size.
Clearly, P(σ 0 , π 0 , C) ≥ P(σ, π, C). In Lemma A.3, we
establish that P(σ 0 , π, C) ≥ P(σ 0 , π 0 , C) − O(OPT).
Lemma A.3. P(σ 0 , π, C) ≥ P(σ 0 , π 0 , C) − O(OPT).
Proof. Let S be the (random) set of items which policy
σ 0 attempts to insert such that the large size distribution
of these items is neglected. We discard the entire profit
of a realization if any item in S realizes to large size
before the policy terminates. It is sufficient to show that
the probability of this event is at most O(2 ), which by
Lemma 2.4 would imply a loss of O(OPT) in the profit.
We know that,
X
X
µi (small)πi (small) ≤
µi
Hence
X
By representing the probability values in the large
size region relative of the highest value, we get following
lemma.
0
∆(πj , πj ) = O(2 )
bi ∈S
bi ∈S
bi ∈S
By Lemma 2.4, we get,
X
We now use Lemma A.1 to discretize the probability
values in the large size region.
bi ∈S
This completes the proof.
1. For every item, we round down the probability for
each discretized size in the large size region to the
1
nearest power of (1+
8 ) . Clearly for each item bi ,
0
Thus we have,
X
µi = O(1/)
µi (small)πi (small) = O(1/)
bi ∈S
∆(πi , πi ) ≤ 8 πi (large)
Since for any item bi in S, πi (large) ≤ 3 µi (small)/2,
2. Recall that there are q 0 different sizes in the large we get,
size region for which the distribution is defined. For
X 2π (large)π (small)
i
i
each item bi , for each size s in these q 0 different
= O(1/)
8
3
πi (large)
b
∈S
,
we
make
π
(s)
zero.
sizes, if πi (s) ≤
i
0
i
q
0
Clearly for each item bi , ∆(πi , πi ) ≤ 8 πi (large). Since π (large) ≤ 3 µ (small)/2 and µ (small) ≤ 5 we
i
i
i
This helps us to indicate the large size distribution can assume
that πi (large) ≤ 1/2 and since πi (large) +
relative of the maximum probability for any size in π (small) = 1, hence π (small) ≥ 1/2. We get,
i
i
the large size region.
X
πi (large) = O(2 )
We perform one more change. For each item b ,
i
bi ∈S
if for any discretized size s in the large size region
2
πi (s) ≤ nq0 , then we make πi (s) zero. Over all items, Thus the probability that any item in S realizes to a
total probability mass which is neglected is O(2 ) and large size is at most O(2 ). This completes the proof.
the expected profit is reduced by O(OPT).
A.4 Step 4 For each item bi , if µi (small) ≤
9 πi (large), then we neglect its small size distribution.
0
The new distribution πi for any such item bi remains
unchanged in the large size region and bi takes size 0
w.p. πi (small).
For any policy σ, create a policy σ 0 as follows. σ 0 is
identical to σ with one exception. For any item bi with
µi (small) ≤ 9 πi (large), if bi realizes to a small size,
then σ 0 follows the remainder of the policy assuming bi
has realized to size 0. Clearly, P(σ 0 , π 0 , C) ≥ P(σ, π, C).
We need to show that, P(σ 0 , π, (1 + )C) ≥ P(σ 0 , π 0 , C) −
O(OPT).
Lemma A.5. 1. For any policy σ, there exists a
canonical policy σ c such that P(σ c , π 0 , (1 + )C) ≥
P(σ, π, C) − O(OPT).
2. For any canonical policy σ c , P(σ c , π, (1 + )C) ≥
P(σ c , π 0 , C) − O(OPT).
Proof. For any leaf in the decision tree of σ for the size
distributions π and the knapsack capacity C, we define
its weight to be the probability of reaching that leaf
when the policy is executed on items with distributions
π. Recall that any path from root to leaf is associated
with a size realization for each intermediate node. For
Lemma A.4. P(σ 0 , π, (1 + )C) ≥ P(σ 0 , π 0 , C) − any given leaf, let S = {b1 , b2 , ..., b|S| } be the set of
O(OPT).
items on the path which realize to small size and let the
corresponding sizes
P be s1 , s2 , ..., s|S| . We call a leaf to
Proof. Let S be the (random) set of items bi which σ 0
be
a
bad
leaf
if
|
{bi ∈S} (µi (small) − si )| ≥ , otherwise
has attempted such that µi (small) ≤ 9 πi (large). In
we call it to be a good leaf.
addition to the main knapsack of capacity C, we create
We will prove the lemma in three steps.
an auxiliary knapsack. If any item bi with µi (small) ≤
9 πi (large) realizes to a small size (i.e. µi (small)), we Step a: We first show that in the decision tree of σ, the
charge it to the auxiliary knapsack, otherwise we put total weight of bad leaves is O(2 ). Thus the expected
it into the main knapsack. Other items, i.e. items bi profit of the policy restricted to the paths ending in
with µi (small) > 9 πi (large), are always put into main good leaves is P(σ, π, C) − O(OPT).
knapsack. We need to compute the sufficient size for
policy
the auxiliary knapsack when the permitted policies are Step b: We then show that there is a randomized
0
constrained by Lemma 2.4. By Lemma 2.4, for any which for items with size distributions π achieves the
expected profit P(σ, π, C)−O(OPT) with extra space
policy
X
in the knapsack. This also implies the existence of a
µi = O(1/)
deterministic policy in such setting, thus establishing
bi ∈S
the part 1 of the lemma.
By conditions on items in S, we get
X
X
Step c: To prove the part 2 of the lemma, we
µi (small) ≤
9 πi (large)
show that if we use the canonical policy σ c for items
bi ∈S
bi ∈S
with size distributions π, then with extra space
By definition of large size region, for any item bi , µi ≥ in the knapsack, the expected profit of the policy is
P(σ c , π 0 , C) − O(OPT).
5 πi (large). Thus
X
X
Proof of Step a: For a node ν, let S be the random
µi (small) ≤
4 µi = O(3 ).
set of items which is played by the policy after reaching
bi ∈S
bi ∈S
node ν (including the item at node ν). We define the
If we limit the size of the auxiliary knapsack to , then
random variable Rν as
2
by Markov’s inequality, w.p. (1 − O( )) there is no
X
overflow in the auxiliary knapsack. Using Lemma 2.4,
Rν =
Xi − µi (small)|Xi ≤ 5
the profit lost is O(OPT)
bi ∈S
A.5 Step 5 Now we discretize the probability dis- We denote its variance by var(ν). Clearly, E [Rν ] = 0
tribution in the small size region. For each item bi , and
we replace the probability distribution in the small size

!2 
region by a single size µi (small) i.e. with probability
X

var(ν) = E 
Xi − µi (small)|Xi ≤ 5
πi (small), bi realizes to size µi (small).
bi ∈S
Recall that canonical policies treat small size realizations by their expected sizes when small. Thus the
decision taken by the policy is based on the canonical Similarly, we define the variance of an item bi as
h
sizes of items already inserted, not the true space used
2 i
var(bi ) = EXi : πi Xi − µi (small)|Xi ≤ 5
in the knapsack.
Clearly, var(bi ) ≤ 5 µi (small). We will use w(ν) to Using the fact that
X
X
indicate maximum total expected size of items on any
πν (si ) +
πν (li ) = 1
path starting at node ν to a leaf. We will inductively
i,1≤i≤k
i,1≤i≤k0
show that, for any node ν in the decision tree, var(ν) ≤
5 w(ν). Since for any path in the decision tree, the we get
sum of expected size of items is bounded by O(1/), the
variance of the root node is O(4 ). We can then apply var(ν) ≤max{max{i,1≤i≤k} (var(νsi )),
max{i,1≤i≤k0 } (var(νli ))} + 5 µν (small)
Chebychev’s inequality to show that total weight of bad
2
leaves is O( ).
The proof follows by applying the inductive assumption.
Now we prove the inductive claim where the inProof of Step b: Consider a randomized policy σ c
duction is applied bottom up in the decision tree of
for items in π c that is generated from σ by following
the policy σ. The induction claim is trivially true for
random process. When an item realizes to a large size,
the leaf nodes. Let ν be a node in consideration. Let
it follows the remainder of the policy as specified by
the corresponding item be bν , s1 , s2 , ..., sk be its posσ. When an item realizes to a small size, it decides
sible small size realizations, the corresponding probthe remainder of policy as follows. Let ν be the
abilities be πν (s1 ), πν (s2 ), ..., πν (sk ) and the roots of
node and bν be the item corresponding to it. Let
the remainder of the policy for these realizations be
s , s , ..., sk are possible small size realizations of bν as
νs1 , νs2 , ..., νsk respectively. Let l1 , l2 , ..., lk0 be its possi- 1 2
per size distribution π and let πν (s1 ), πν (s2 )..., πν (sk )
ble large size realization, the corresponding probabilities
be the corresponding probabilities. Hence at node
be πν (l1 ), πν (l2 ), ..., πν (lk0 ), and the roots of the remainν, if bν realizes to a small size, we choose one of
der of the policy for these realizations be νl1 , νl2 , ..., νlk0
the branches corresponding to sizes s1 , s2 , ..., sk w.p.
respectively.
πν (s1 ), πν (s2 )..., πν (sk ) (normalized) respectively.
The variance of a random variable Rν is,
In this randomized policy, for any leaf in σ, the
h
X
2 i
probability of reaching the leaf remains same as in σ
+
var(ν) =
E πν (si ) Rνsi + si − µν (small)
if we discount the difference between sum of canonical
i,1≤i≤k
and true sizes of items. For any good leaf, the sum
2
X
of canonical and true sizes of items differ by at most
E π(li ) Rνli
. Since the weight of bad leaves is O(2 ) and any
0
i,1≤i≤k
realization has profit O(OPT/), the total profit lost
The first term simplifies as follows.
is O(OPT).
h
X
2 i
Proof of Step c:
Given an arbitrary canonical
E πν (si ) Rνsi + si − µν (small)
policy σ c , consider any leaf ν in its decision tree. Let
i,1≤i≤k
S = {b1 , b2 , ..., b|S| } be the set of items realizing to small
h
X
2 i
=
E πν (si ) Rνsi
size on the path from root to this leaf. Consider a
i,1≤i≤k
scenario when we use σ c for items with distributions π
X
and we reach leaf ν during the execution of the policy.
+
E πν (si )(si − µν (small))2
Let X1 , X2 , ..., X|S| be the random variables indicating
i,1≤i≤k
the sizes to which
items in S have realized. We get
X
P
+
2πν (si )(si − µν (small))E Rνsi
the profit if
{bi ∈S} (Xi − µi (small)) ≤ as we are
i,1≤i≤k
relaxing
the
knapsack
capacity by . Notice that, since


we
have
arrived
at
leaf
ν, ∀bi ∈ S, Xi ≤ 5 , E[Xi ] =
X
5


µi (small), var(Xi ) ≤ µi (small) (items in S have to
≤
πν (si )var(νsi ) + var(bν ) + 0
realize to small size to ensure that correct branch is
i,1≤i≤k
taken in decision tree to reach leaf ν).
Thus we get,
For
P any given leaf ν, we define a random variable


X = {bi ∈S} (Xi − µi (small)). The variance of X is
X
5 · (1/) = 4 . Note, the set S is fixed for a leaf, hence
var(ν) ≤ 
πν (si )var(νsi ) +
the variance of X is the addition of variances of items
i,1≤i≤k
(conditioned on the event that they realize to small size)


X
in S . By Chebychev’s inequality, Pr(|X| ≥ ) = O(2 ).

πν (li )var(νli ) + var(bν )
The error probability for each leaf is O(2 ). Hence profit
i,1≤i≤k0
lost is O(2 ) · O(OPT/) = O(OPT).
Proof of Lemma 3.1: The lemma follows as an
immediate corollary of Lemma A.5 by selecting σ to
be the optimal adaptive policy for a knapsack capacity
C and size distributions π.
Now we discretize the expected sizes of items in
the small size region into the geometric group which is
1
with values below /n made zero. Thus
powers of 1+
by increasing the space in the knapsack by a factor of
O(), the expected profit is unaffected. Total number of
different sizes = log(1/)+log(n)
≤ 2 log(n)
.
log(1+)
2
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertising