Documentation

CslibFrontier.GameTheory.Mechanism.GreedyKnapsack

Greedy 1/2-approximate DSIC knapsack auction #

In a single-parameter knapsack auction ([Rou13], Lecture 4, §2.2, pp. 4–5; [Rou16], Lecture 4), bidder i : ι has a publicly known positive size w i > 0 and private nonnegative bid b i ≥ 0, and the seller has capacity W ≥ 0 with feasible allocations SingleParameter.knapsackFeasible w W (CslibFrontier.GameTheory.Mechanism.Knapsack).

Because exact knapsack welfare maximization is NP-hard, Roughgarden's greedy allocation rule (GreedyKnapsack.allocation w W) trades exact optimality for a simple 1/2-approximation, reusing the canonical tie-broken strict comparison SingleParameter.MultiUnit.Beats:

  1. Order bidders by decreasing bang-per-buck fun i => b i / w i, breaking ties in favour of smaller indices (MultiUnit.Beats (fun i => b i / w i)).
  2. Pack bidders in that order until the first bidder that does not fit and halt (prefixWinners: equivalently, when w j > 0, all bidders whose bang-per-buck prefix fits within W).
  3. Return whichever of prefixWinners and the highest feasible single bidder (singleWinners, ordered by MultiUnit.Beats b) achieves larger reported surplus (greedyWinners).

This module proves:

This module proves the mathematical properties of the greedy allocation rule and its critical-bid mechanism over real bids; no machine-level running-time theorem is claimed here.

Main definitions #

Main results #

References #

Strict linear orders on finite sets #

Step 1 & Step 2: Bang-per-buck order and prefix packing #

noncomputable def Cslib.GameTheory.SingleParameter.GreedyKnapsack.densityPrefix {ι : Type u_1} [LinearOrder ι] [Fintype ι] (w b : ι → ℝ) (i : ι) :

Bidders ranked at or before i in the bang-per-buck order MultiUnit.Beats (fun j => b j / w j).

noncomputable def Cslib.GameTheory.SingleParameter.GreedyKnapsack.prefixWinners {ι : Type u_1} [LinearOrder ι] [Fintype ι] (w : ι → ℝ) (W : ℝ) (b : ι → ℝ) :

Step 2 of the greedy knapsack rule ([Rou13], Lecture 4, §2.2): the set of bidders whose bang-per-buck prefix fits within capacity W.

Step 3: Best feasible single bidder and greedy knapsack rule #

def Cslib.GameTheory.SingleParameter.GreedyKnapsack.IsBestSingle {ι : Type u_1} [LinearOrder ι] (w : ι → ℝ) (W : ℝ) (b : ι → ℝ) (i : ι) :

Bidder i is the unique highest-bidding feasible single bidder (w i ≤ W), breaking ties in favour of smaller indices (MultiUnit.Beats b).

noncomputable def Cslib.GameTheory.SingleParameter.GreedyKnapsack.singleWinners {ι : Type u_1} [LinearOrder ι] [Fintype ι] (w : ι → ℝ) (W : ℝ) (b : ι → ℝ) :

The singleton (or empty, if no bidder fits) set containing the best feasible single bidder.

noncomputable def Cslib.GameTheory.SingleParameter.GreedyKnapsack.greedyWinners {ι : Type u_1} [LinearOrder ι] [Fintype ι] (w : ι → ℝ) (W : ℝ) (b : ι → ℝ) :

Greedy knapsack winning set ([Rou13], Lecture 4, §2.2, step (3)): returns whichever of prefixWinners w W b and singleWinners w W b has higher reported surplus (breaking ties in favour of prefixWinners).

noncomputable def Cslib.GameTheory.SingleParameter.GreedyKnapsack.allocation {ι : Type u_1} [LinearOrder ι] [Fintype ι] (w : ι → ℝ) (W : ℝ) (b : ι → ℝ) (i : ι) :

Greedy knapsack 0-1 allocation rule ([Rou13], Lecture 4, §2.2).

noncomputable def Cslib.GameTheory.SingleParameter.GreedyKnapsack.mechanism {ι : Type u_1} [LinearOrder ι] [Fintype ι] (w : ι → ℝ) (W : ℝ) :

Greedy knapsack critical-bid mechanism ([Rou13], Lecture 4, §2.2): pairs allocation w W with Myerson's critical-bid payments (SingleParameter.criticalBidMechanism).

allocation w W is a 0-1 allocation rule.

theorem Cslib.GameTheory.SingleParameter.GreedyKnapsack.allocation_mem_knapsackFeasible {ι : Type u_1} [LinearOrder ι] [Fintype ι] {w : ι → ℝ} (hw : ∀ (i : ι), 0 ≤ w i) {W : ℝ} (hW : 0 ≤ W) (b : ι → ℝ) :

For nonnegative sizes and capacity W ≥ 0, allocation w W always chooses a knapsack-feasible allocation.

Monotonicity and DSIC / IR (Roughgarden Lecture 4, Exercise 18) #

theorem Cslib.GameTheory.SingleParameter.GreedyKnapsack.isMonotone_allocation {ι : Type u_1} [LinearOrder ι] [Fintype ι] {w : ι → ℝ} (hw : ∀ (i : ι), 0 < w i) {W : ℝ} :

Monotonicity of the greedy knapsack allocation rule ([Rou13], Lecture 4, Exercise 18): when all bidder sizes w i are strictly positive, raising bidder i's bid from z to z' ≥ z never turns a winner into a loser.

theorem Cslib.GameTheory.SingleParameter.GreedyKnapsack.mechanism_isDSIC {ι : Type u_1} [LinearOrder ι] [Fintype ι] {w : ι → ℝ} (hw : ∀ (i : ι), 0 < w i) (W : ℝ) :

Greedy knapsack mechanism is DSIC ([Rou13], Lecture 4, §2.2 & Ex. 18).

Greedy knapsack mechanism is individually rational.

Greedy knapsack mechanism is normalized (a zero bid pays 0).

theorem Cslib.GameTheory.SingleParameter.GreedyKnapsack.mechanism_payment_eq_myersonPayment {ι : Type u_1} [LinearOrder ι] [Fintype ι] {w : ι → ℝ} (hw : ∀ (i : ι), 0 < w i) (W : ℝ) {b : ι → ℝ} (hb : 0 ≤ b) (i : ι) :

Greedy knapsack critical-bid payments equal Myerson's payments.

Approximation guarantees (Roughgarden Lecture 4, §2.2, Theorem 2.1) #

theorem Cslib.GameTheory.SingleParameter.GreedyKnapsack.two_mul_welfare_ge {ι : Type u_1} [LinearOrder ι] [Fintype ι] {w : ι → ℝ} (hw : ∀ (i : ι), 0 < w i) {W : ℝ} (hfit : ∀ (i : ι), w i ≤ W) {b : ι → ℝ} (hb : 0 ≤ b) {y : ι → ℝ} (hy : y ∈ knapsackFeasible w W) :
∑ i : ι, b i * y i ≤ 2 * ∑ i : ι, b i * allocation w W b i

Greedy knapsack is a 1/2-approximation to optimal welfare ([Rou13], Lecture 4, §2.2, Theorem 2.1, p. 5): assuming 0 < w i ≤ W for every bidder i and nonnegative bids b, twice the surplus of allocation w W b is at least the surplus of every knapsack-feasible allocation y ∈ knapsackFeasible w W.

theorem Cslib.GameTheory.SingleParameter.GreedyKnapsack.one_sub_mul_welfare_le_prefixValue {ι : Type u_1} [LinearOrder ι] [Fintype ι] {w : ι → ℝ} (hw : ∀ (i : ι), 0 < w i) {W α : ℝ} (hW : 0 < W) (hα0 : 0 ≤ α) (hsmall : ∀ (i : ι), w i ≤ α * W) {b : ι → ℝ} (hb : 0 ≤ b) {y : ι → ℝ} (hy : y ∈ knapsackFeasible w W) :
(1 - α) * ∑ i : ι, b i * y i ≤ ∑ j ∈ prefixWinners w W b, b j

Small-item (1 - α)-approximation without step 3 ([Rou13], Lecture 4, §2.2 remark after Theorem 2.1, p. 5): when 0 < W, 0 ≤ α, and every bidder satisfies 0 < w i ≤ α * W, step 2 alone (prefixWinners) already achieves surplus at least (1 - α) times the surplus of every knapsack-feasible allocation y ∈ knapsackFeasible w W.