In stochastic knapsack, items with random sizes are inserted one at a time into a knapsack of fixed capacity; an item's size is revealed only once it is inserted, and the process stops at the first overflow. Dean, Goemans and Vondrák (DGV08) showed that simple non-adaptive orderings lose only a constant factor against the best adaptive policy. Many applications charge for an attempt even when it fails. Examples are running a job that may miss its deadline, hiring an agent whose effort takes an uncertain amount of time, or opening a box in the sense of Weitzman's Pandora's box problem (Weitzman 1979). Barak, Berlin, Cohen, Eden, Porat and Talgam-Cohen, Pandora's Knapsack via Simple Policies (2026, STOC 2027 submission), study this costly version. They show that, once attempts cost money, non-adaptive and stop-only policies can be arbitrarily worse than full adaptivity, by a factor governed by the inverse return on investment. Their positive result is that one more kind of adaptivity, skipping a planned item when too little capacity remains, recovers a constant factor in polynomial time. This mission formalizes that result.
An instance of multi-choice Pandora's Knapsack (MPK) has items, choices per item and capacity . Item has value , and its choice has cost and size law , an arbitrary law on . Here stands for every size that overflows; this grid, equivalently rational sizes with a common denominator, is the paper's standing assumption for its Section 5. Every pair is profitable in an empty knapsack: .
A run starts with used capacity . Attempting choice of an item not yet attempted pays and reveals , independent of the past. If the item fits and contributes , and becomes . Otherwise it is the overflow item, contributes , and the run ends. Each item is attempted at most once, with one choice.
For let and . The time-indexed LP maximizes subject to for all , for every item, and . It has variables. The compact LP keeps only the breakpoints , with coefficients evaluated at , so it has variables and constraints.
Algorithm 1 takes an optimal of . Independently for each item, it assigns the pair with probability , and nothing otherwise. It sorts the assigned pairs by and attempts each pair whose start time is at least the capacity already used, which is a skipping-adaptive policy with threshold .
There is a polynomial-time algorithm that, for every MPK instance , outputs a random skipping-adaptive policy with
The paper states . The constant is the one its proof gives for the polynomial-time version: factor for Algorithm 1 run on , and factor lost by solving and spreading each breakpoint's mass uniformly over its dyadic interval. The polynomial is in , and the bit length of .
Theorem 5.1 says how much adaptivity is enough when attempts cost money. The paper's lower bounds show that non-adaptive and stopping-adaptive policies lose a factor growing with the inverse return on investment. Skipping, a fixed order with per-item capacity thresholds, already achieves a constant factor that does not depend on the instance. The policy is also simple to describe: a sorted list and one number per entry, which the paper uses in a contract-design application with sequential agents.
The result has not been machine-checked. A formal proof would check a mixed-sign objective, in which the overflowing item is charged and not rewarded. It would also check that the proof's probability step is correct at time zero, where the printed Markov argument divides by zero (recorded as a finding on this mission). The LP bound for adaptive policies and the dyadic compression are reusable for other stochastic scheduling and knapsack results built on time-indexed LPs.
The obvious route rounds the LP solution independently per pair and inserts the selected pairs in order. With costs this fails: a pair with small positive value in an empty knapsack can have a large negative value when little capacity remains. A policy that cannot skip pays for such attempts. The difficulty is to show that a random start time per pair, sorted and executed with skipping, still reaches each pair with enough remaining capacity, with probability at least one half, whatever the earlier sizes. This has to hold together with an upper bound on every fully-adaptive policy, whose decisions depend on the entire history. Turning the pseudo-polynomial LP into a polynomial one adds a second argument about how much value survives the dyadic grid.
The MPK objects are defined in the namespace PandoraKnapsack.Skipping. Sizes take values in Fin (T + 2), laws are PMFs, and items and choices are indexed by Fin n and Fin m. Expected utilities are exact finite recursions over the size laws. Fully-adaptive policies are arbitrary functions of the full history, and choosing an already attempted item counts as stopping. Every LP inequality between optimal values is stated against every feasible point, with no supremum. The effective value uses real subtraction , so it equals beyond the capacity.
The computational clause is stated on the published real pointer machine SmaleNinth.RAMInstr, extended with exact access to , , and , and independent uniform draws. One program and one exponent are fixed before the instance. Every executed instruction, including each coefficient query and draw, counts toward the bound . Any optimization must be implemented through the program's arithmetic, comparisons and memory instructions within this bound. The output must decode to a valid skipping-adaptive policy for every draw sequence. The expected utility is an integral over the product uniform law, with integrability asserted in the conclusion. This is a declared exact-coefficient-access arithmetic reading of the source's unspecified computational model; a bit-complexity realization for rational encoded data is discussed separately in the moderation notes. Lemma 5.3 is stated for the exact Algorithm 1 as a finite random experiment.
Contributions welcome: a library for stochastic knapsack runs and adaptive policies, the time-indexed LP bound, the dyadic compression, and an implementation of the algorithm on the machine.
namespace PandoraKnapsack.Skipping
/-- **Theorem 5.1** (Barak et al. 2026, *Pandora's Knapsack via Simple Policies*, supplied PDF,
SHA256 45e5830b…7a2d, printed p. 21, PDF 23). There exists a polynomial-time algorithm for MPK
that computes, for every instance `I`, a skipping-adaptive policy `π_I` such that
`ADAPT(I) / E[utility(π_I)] = O(1)`.
**Formalization Note.** The algorithm is one program `P` of the costed machine of
`Def_PandoraKnapsack_Skipping_Machine`, fixed before the instance; "polynomial time" is a
step bound `(n + m + bitlength(T) + 2)^k`, valid for every draw sequence. The only oracle
instructions access coefficients or draw uniform reals; all optimization work must be executed
by the program within this bound. The output must decode to a valid skipping-adaptive policy for every draw sequence.
The constant is explicit: `32 = 8 · 4`, the factor 8 of Algorithm 1 times the factor 4 lost by
the compact LP of Appendix B.1. `ADAPT(I) ≤ 32 · E[utility(π_I)]` is stated against every
fully-adaptive policy, and the expectation (over the algorithm's draws and the sizes) is
asserted to exist. -/
theorem theorem_5_1 :
∃ (P : Program) (k : ℕ), ∀ (n m T : ℕ) (I : Instance n m T), IsValid I →
(∀ ω : Fin ((inputSize n m T + 2) ^ k) → unitInterval,
Halted P (run I (extendDraws ω) P ((inputSize n m T + 2) ^ k)) ∧
∃ σ : SkipList n m,
decodeOutput n m (run I (extendDraws ω) P ((inputSize n m T + 2) ^ k)).core.mem =
some σ ∧ IsSkippingPolicy T σ) ∧
Integrable (fun ω => skipValue I (outputPolicy I P ((inputSize n m T + 2) ^ k) ω))
(drawLaw ((inputSize n m T + 2) ^ k)) ∧
∀ π : AdaptivePolicy n m,
adaptValue I π ≤ 32 * ∫ ω, skipValue I (outputPolicy I P ((inputSize n m T + 2) ^ k) ω)
∂(drawLaw ((inputSize n m T + 2) ^ k)) := by sorry
end PandoraKnapsack.Skipping
There is a single program of the costed machine (unit-cost real pointer machine with exact coefficient oracles for , , and , uniform draws) and an exponent such that, for every valid MPK instance on the grid with any capacity , any items and any choices, with :
so , i.e. .
The source states ; its proof gives for Algorithm 1 with the time-indexed LP , and Appendix B.1 replaces by the compact LP at a further factor .
Differences from the source:
No open leaves. Every sub-goal is proved or awaiting decomposition.