Documentation

CslibFrontier.GameTheory.Congestion.CapacityAugmentation

Capacity augmentation, concave and polynomial Pigou bounds, and Braess's paradox #

This module formalizes the remaining nonatomic routing bounds, resource-augmentation guarantees, atomic separation counterexamples, and network-design paradoxes from Roughgarden [Rou07], Chapter 18 (originally due to Braess, 1968, Roughgarden and Tardos, 2002, Roughgarden, 2003/2005/2006, Chakrabarty, 2004, and Correa, Schulz and Stier-Moses, 2005):

Main definitions #

Main results #

References #

Exercise 18.6: Pigou bound of concave latencies #

The class of nonnegative, nondecreasing, concave latency functions on [0, ∞) ([Roughgarden2007Routing], Exercise 18.6).

Membership in concaveLatencies, unfolded.

The identity latency x ↦ x belongs to concaveLatencies.

theorem Cslib.GameTheory.const_mem_concaveLatencies (a : ℝ) (ha : 0 ≤ a) :
(fun (x : ℝ) => a) ∈ concaveLatencies

Every nonnegative constant latency belongs to concaveLatencies.

The Pigou bound of concave latencies is 4/3 ([Rou07], Exercise 18.6): for any nonnegative, nondecreasing, concave c on [0, ∞) and 0 ≤ x ≤ r with 0 < r, concavity between 0 and r gives c(x) ≥ (x / r) c(r), whence x (c(r) - c(x)) ≤ (x / r) (1 - x / r) r c(r) ≤ (1/4) r c(r).

theorem Cslib.GameTheory.NonatomicCongestionGame.IsWardrop.cost_le_four_thirds_of_mem_concaveLatencies {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq K] [DecidableEq E] [Finite E] {G : NonatomicCongestionGame K P E} (hG : ∀ (e : E), G.latency e ∈ concaveLatencies) {f g : P → ℝ} (hf : G.IsWardrop f) (hg : G.IsFeasible g) :
G.cost f ≤ 4 / 3 * G.cost g

Price of anarchy for concave latencies is at most 4/3 ([Rou07], Exercise 18.6): every nonatomic congestion game whose latencies belong to concaveLatencies has price of anarchy at most 4/3.

Exercise 18.1: asymptotic growth of the polynomial Pigou bound #

Asymptotic growth of pigouBound (polynomialLatencies d) ([Rou07], Exercise 18.1): (pigouBound (polynomialLatencies d)).toReal * (Real.log d / d) → 1 as d → ∞.

Capacity augmentation (Theorem 18.29, Corollary 18.30, Example 18.28, Exercise 18.8) #

The demand-scaled game (G, α r, c) where every commodity's traffic rate is multiplied by α ([Rou07], Section 18.5.2).

noncomputable def Cslib.GameTheory.NonatomicCongestionGame.speedup {K : Type u_1} {P : Type u_2} {E : Type u_3} (G : NonatomicCongestionGame K P E) (α : ℝ) :

The link-speedup game (G, r, c̃) with c̃_e(x) = c_e(x / α) / α ([Rou07], Corollary 18.30, where α = 2).

@[simp]
theorem Cslib.GameTheory.NonatomicCongestionGame.scaleRate_rate {K : Type u_1} {P : Type u_2} {E : Type u_3} (G : NonatomicCongestionGame K P E) (α : ℝ) (k : K) :
(G.scaleRate α).rate k = α * G.rate k
@[simp]
theorem Cslib.GameTheory.NonatomicCongestionGame.scaleRate_edgeFlow {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] (G : NonatomicCongestionGame K P E) (α : ℝ) (f : P → ℝ) (e : E) :
(G.scaleRate α).edgeFlow f e = G.edgeFlow f e
@[simp]
theorem Cslib.GameTheory.NonatomicCongestionGame.scaleRate_pathLatency {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] (G : NonatomicCongestionGame K P E) (α : ℝ) (f : P → ℝ) (p : P) :
@[simp]
theorem Cslib.GameTheory.NonatomicCongestionGame.scaleRate_cost {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] (G : NonatomicCongestionGame K P E) (α : ℝ) (f : P → ℝ) :
(G.scaleRate α).cost f = G.cost f
@[simp]
theorem Cslib.GameTheory.NonatomicCongestionGame.speedup_rate {K : Type u_1} {P : Type u_2} {E : Type u_3} (G : NonatomicCongestionGame K P E) (α : ℝ) :
(G.speedup α).rate = G.rate
@[simp]
theorem Cslib.GameTheory.NonatomicCongestionGame.speedup_latency {K : Type u_1} {P : Type u_2} {E : Type u_3} (G : NonatomicCongestionGame K P E) (α : ℝ) (e : E) (x : ℝ) :
(G.speedup α).latency e x = G.latency e (x / α) / α
@[simp]
theorem Cslib.GameTheory.NonatomicCongestionGame.speedup_edgeFlow {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] (G : NonatomicCongestionGame K P E) (α : ℝ) (f : P → ℝ) (e : E) :
(G.speedup α).edgeFlow f e = G.edgeFlow f e
theorem Cslib.GameTheory.NonatomicCongestionGame.IsFeasible.smul_scaleRate {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] {G : NonatomicCongestionGame K P E} [DecidableEq K] {g : P → ℝ} (hg : G.IsFeasible g) {α : ℝ} (hα : 0 ≤ α) :
(G.scaleRate α).IsFeasible (α • g)

Rescaling a feasible flow g by α ≥ 0 produces a feasible flow of G.scaleRate α.

theorem Cslib.GameTheory.NonatomicCongestionGame.IsWardrop.cost_le_inv_mul_of_scaleRate {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] {G : NonatomicCongestionGame K P E} [DecidableEq K] [Finite E] (h0 : ∀ (e : E) (x : ℝ), 0 ≤ x → 0 ≤ G.latency e x) (hm : ∀ (e : E), MonotoneOn (G.latency e) (Set.Ici 0)) {δ : ℝ} (hδ : 0 < δ) {f g : P → ℝ} (hf : G.IsWardrop f) (hg : (G.scaleRate (1 + δ)).IsFeasible g) :
G.cost f ≤ 1 / δ * G.cost g

General (1 + δ)r capacity-augmentation bound ([Rou07], Exercise 18.8(c)): if resource latencies are nonnegative and nondecreasing on [0, ∞), 0 < δ, f is a Wardrop equilibrium for G, and g is feasible for G.scaleRate (1 + δ), then G.cost f ≤ (1 / δ) * G.cost g.

theorem Cslib.GameTheory.NonatomicCongestionGame.IsWardrop.cost_le_of_scaleRate_two {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] {G : NonatomicCongestionGame K P E} [DecidableEq K] [Finite E] (h0 : ∀ (e : E) (x : ℝ), 0 ≤ x → 0 ≤ G.latency e x) (hm : ∀ (e : E), MonotoneOn (G.latency e) (Set.Ici 0)) {f g : P → ℝ} (hf : G.IsWardrop f) (hg : (G.scaleRate 2).IsFeasible g) :
G.cost f ≤ G.cost g

Roughgarden–Tardos 2r capacity-augmentation theorem ([Rou07], Theorem 18.29, originally [RT02]): for arbitrary nonnegative nondecreasing latencies on [0, ∞), a Wardrop equilibrium for G costs at most any flow feasible for twice the traffic (G.scaleRate 2).

theorem Cslib.GameTheory.NonatomicCongestionGame.IsWardrop.speedup_cost_le {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] {G : NonatomicCongestionGame K P E} [DecidableEq K] [Finite E] (h0 : ∀ (e : E) (x : ℝ), 0 ≤ x → 0 ≤ G.latency e x) (hm : ∀ (e : E), MonotoneOn (G.latency e) (Set.Ici 0)) {δ : ℝ} (hδ : 0 < δ) {f_tilde g : P → ℝ} (hf : (G.speedup (1 + δ)).IsWardrop f_tilde) (hg : G.IsFeasible g) :
(G.speedup (1 + δ)).cost f_tilde ≤ 1 / δ * G.cost g

Link-speedup corollary, general (1 + δ) factor ([Rou07], Corollary 18.30 and Exercise 18.8(a)): deduced directly from IsWardrop.cost_le_inv_mul_of_scaleRate by rescaling f̃ to (1 + δ)⁻¹ • f̃.

theorem Cslib.GameTheory.NonatomicCongestionGame.IsWardrop.speedup_two_cost_le {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] {G : NonatomicCongestionGame K P E} [DecidableEq K] [Finite E] (h0 : ∀ (e : E) (x : ℝ), 0 ≤ x → 0 ≤ G.latency e x) (hm : ∀ (e : E), MonotoneOn (G.latency e) (Set.Ici 0)) {f_tilde g : P → ℝ} (hf : (G.speedup 2).IsWardrop f_tilde) (hg : G.IsFeasible g) :
(G.speedup 2).cost f_tilde ≤ G.cost g

Doubling link speed beats centralized routing ([Rou07], Corollary 18.30 and Exercise 18.8(a)): if f̃ is a Wardrop equilibrium for G.speedup 2 (c̃_e(x) = c_e(x/2)/2) and g is feasible for G, then (G.speedup 2).cost f̃ ≤ G.cost g.

theorem Cslib.GameTheory.NonatomicCongestionGame.exists_pigouNetwork_pow_scaleRate_cost_lt {δ ε : ℝ} (hδ : 0 < δ) (hε : 0 < ε) :
∃ (d : ℕ) (g : Fin 2 → ℝ), ((pigouNetwork (fun (x : ℝ) => x ^ d) 1).scaleRate (1 + δ)).IsFeasible g ∧ (pigouNetwork (fun (x : ℝ) => x ^ d) 1).cost g < δ + ε

Tightness of the (1 + δ)r capacity-augmentation bound 1 / δ ([Rou07], Example 18.28 and Exercise 18.8(d)): for every δ > 0 and ε > 0, there exist a degree d : ℕ and a flow g feasible for (pigouNetwork (· ^ d) 1).scaleRate (1 + δ) with cost g < δ + ε (while the Wardrop equilibrium ![1, 0] at rate 1 has cost 1). Consequently, no factor β < 1 / δ can replace 1 / δ in IsWardrop.cost_le_inv_mul_of_scaleRate.

Exercise 18.8(e): exact affine capacity-augmentation threshold δ = 1/4 #

theorem Cslib.GameTheory.NonatomicCongestionGame.HasAffineLatencies.cost_le_of_scaleRate {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] {G : NonatomicCongestionGame K P E} [DecidableEq K] [Finite E] (hG : G.HasAffineLatencies) {δ : ℝ} (hδ : 1 / 4 ≤ δ) {f g : P → ℝ} (hf : G.IsWardrop f) (hg : (G.scaleRate (1 + δ)).IsFeasible g) :
G.cost f ≤ G.cost g

Affine capacity augmentation at (5/4) r ([Rou07], Exercise 18.8(e); credited in Section 18.6 to Chakrabarty, 2004, and Correa, Schulz and Stier-Moses, 2005): if G has nonnegative affine latencies, 1 / 4 ≤ δ, f is a Wardrop equilibrium for G, and g is feasible for G.scaleRate (1 + δ), then G.cost f ≤ G.cost g.

theorem Cslib.GameTheory.NonatomicCongestionGame.affine_scaleRate_bound_iff {δ : ℝ} (hδ0 : 0 ≤ δ) :
(∀ (K P E : Type) [inst : Fintype P] [Finite E] [inst_2 : DecidableEq K] [inst_3 : DecidableEq E] (G : NonatomicCongestionGame K P E) (f g : P → ℝ), G.HasAffineLatencies → G.IsWardrop f → (G.scaleRate (1 + δ)).IsOptimal g → G.cost f ≤ G.cost g) ↔ 1 / 4 ≤ δ

Exact characterization of the affine augmentation threshold ([Rou07], Exercise 18.8(e)): for 0 ≤ δ, every nonatomic congestion game with nonnegative affine latencies satisfies G.cost f ≤ G.cost f* (for Wardrop f at rate r and feasible/optimal f* at rate (1 + δ) r) if and only if 1 / 4 ≤ δ.

Exercise 18.8(b): atomic counterexample to 2r capacity augmentation #

theorem Cslib.GameTheory.CongestionGame.exists_atomic_pureNash_socialCost_gt_doubled :
∃ (C₁ : CongestionGame (Fin 4) (fun (x : Fin 4) => Bool) (Fin 4)) (C₂ : CongestionGame (Fin 2 × Fin 4) (fun (x : Fin 2 × Fin 4) => Bool) (Fin 4)) (s : Fin 4 → Bool) (s_star : Fin 2 × Fin 4 → Bool), (∀ (p : Fin 2 × Fin 4) (b : Bool), C₂.resources p b = C₁.resources p.2 b) ∧ (∀ (e : Fin 4), C₂.latency e = C₁.latency e) ∧ (∀ (e : Fin 4), Monotone (C₁.latency e)) ∧ (∀ (e : Fin 4) (k : ℕ), 0 ≤ C₁.latency e k) ∧ C₁.toCostGame.IsPureNash s ∧ C₁.toCostGame.socialCost s = 972 ∧ C₂.toCostGame.socialCost s_star = 128 ∧ C₂.toCostGame.socialCost s_star < C₁.toCostGame.socialCost s

Atomic counterexample to 2r capacity augmentation ([Rou07], Exercise 18.8(b)): there is a four-commodity network with nonnegative nondecreasing polynomial latency k ^ 4 such that the unweighted 4-player atomic congestion game C₁ has a pure Nash equilibrium s of social cost 972, whereas the doubled 8-player atomic congestion game C₂ (two unit-weight players per commodity, and equivalently a 4-player weight-2 profile) has a profile s* of social cost 128 < 972.

Braess's paradox and subnetwork bounds (Example 18.4 & Remark 18.22) #

def Cslib.GameTheory.NonatomicCongestionGame.restrictPaths {K : Type u_1} {P₁ : Type u_2} {P₂ : Type u_3} {E : Type u_4} (G : NonatomicCongestionGame K P₂ E) (ι : P₁ ↪ P₂) :

The subnetwork congestion game obtained by restricting available paths along an injection ι : P₁ ↪ P₂ ([Rou07], Remark 18.22).

@[simp]
theorem Cslib.GameTheory.NonatomicCongestionGame.restrictPaths_commodity {K : Type u_1} {P₁ : Type u_2} {P₂ : Type u_3} {E : Type u_4} (G : NonatomicCongestionGame K P₂ E) (ι : P₁ ↪ P₂) (p : P₁) :
@[simp]
theorem Cslib.GameTheory.NonatomicCongestionGame.restrictPaths_resources {K : Type u_1} {P₁ : Type u_2} {P₂ : Type u_3} {E : Type u_4} (G : NonatomicCongestionGame K P₂ E) (ι : P₁ ↪ P₂) (p : P₁) :
@[simp]
theorem Cslib.GameTheory.NonatomicCongestionGame.restrictPaths_rate {K : Type u_1} {P₁ : Type u_2} {P₂ : Type u_3} {E : Type u_4} (G : NonatomicCongestionGame K P₂ E) (ι : P₁ ↪ P₂) :
@[simp]
theorem Cslib.GameTheory.NonatomicCongestionGame.restrictPaths_latency {K : Type u_1} {P₁ : Type u_2} {P₂ : Type u_3} {E : Type u_4} (G : NonatomicCongestionGame K P₂ E) (ι : P₁ ↪ P₂) :
theorem Cslib.GameTheory.NonatomicCongestionGame.isFeasible_extend {K : Type u_1} {P₁ : Type u_2} {P₂ : Type u_3} {E : Type u_4} [Fintype P₁] [Fintype P₂] (G : NonatomicCongestionGame K P₂ E) (ι : P₁ ↪ P₂) [DecidableEq K] {f₁ : P₁ → ℝ} (hf₁ : (G.restrictPaths ι).IsFeasible f₁) :
G.IsFeasible (Function.extend (⇑ι) f₁ 0)

Zero-extending a feasible flow of G.restrictPaths ι yields a feasible flow of G.

theorem Cslib.GameTheory.NonatomicCongestionGame.edgeFlow_extend {K : Type u_1} {P₁ : Type u_2} {P₂ : Type u_3} {E : Type u_4} [Fintype P₁] [Fintype P₂] [DecidableEq E] (G : NonatomicCongestionGame K P₂ E) (ι : P₁ ↪ P₂) (f₁ : P₁ → ℝ) (e : E) :
G.edgeFlow (Function.extend (⇑ι) f₁ 0) e = (G.restrictPaths ι).edgeFlow f₁ e

Zero-extension preserves every edge flow.

theorem Cslib.GameTheory.NonatomicCongestionGame.cost_extend {K : Type u_1} {P₁ : Type u_2} {P₂ : Type u_3} {E : Type u_4} [Fintype P₁] [Fintype P₂] [DecidableEq E] (G : NonatomicCongestionGame K P₂ E) (ι : P₁ ↪ P₂) [Finite E] (f₁ : P₁ → ℝ) :
G.cost (Function.extend (⇑ι) f₁ 0) = (G.restrictPaths ι).cost f₁

Zero-extension preserves total social cost: in particular, adding paths/edges to a network can only decrease or preserve the minimum feasible cost.

theorem Cslib.GameTheory.NonatomicCongestionGame.IsWardrop.cost_le_toReal_pigouBound_mul_restrictPaths {K : Type u_1} {P₁ : Type u_2} {P₂ : Type u_3} {E : Type u_4} [Fintype P₁] [Fintype P₂] [DecidableEq E] (ι : P₁ ↪ P₂) [DecidableEq K] [Finite E] {G : NonatomicCongestionGame K P₂ E} {C : Set (ℝ → ℝ)} (htop : pigouBound C ≠ ⊤) (hC : ∀ (e : E), G.latency e ∈ C) (h0 : ∀ (e : E) (x : ℝ), 0 ≤ x → 0 ≤ G.latency e x) (hm : ∀ (e : E), MonotoneOn (G.latency e) (Set.Ici 0)) {f₂ : P₂ → ℝ} (hf₂ : G.IsWardrop f₂) {f₁ : P₁ → ℝ} (hf₁ : (G.restrictPaths ι).IsFeasible f₁) :
G.cost f₂ ≤ (pigouBound C).toReal * (G.restrictPaths ι).cost f₁

General bound on Braess's paradox ([Rou07], Remark 18.22): if G has nonnegative nondecreasing latencies in C with pigouBound C ≠ ⊤, then any Wardrop equilibrium f₂ of the larger network G costs at most (pigouBound C).toReal times any feasible flow (and in particular any Wardrop equilibrium) f₁ of the subnetwork G.restrictPaths ι.

theorem Cslib.GameTheory.NonatomicCongestionGame.HasAffineLatencies.cost_le_four_thirds_restrictPaths {K : Type u_1} {P₁ : Type u_2} {P₂ : Type u_3} {E : Type u_4} [Fintype P₁] [Fintype P₂] [DecidableEq E] (ι : P₁ ↪ P₂) [DecidableEq K] [Finite E] {G : NonatomicCongestionGame K P₂ E} (hG : G.HasAffineLatencies) {f₂ : P₂ → ℝ} (hf₂ : G.IsWardrop f₂) {f₁ : P₁ → ℝ} (hf₁ : (G.restrictPaths ι).IsFeasible f₁) :
G.cost f₂ ≤ 4 / 3 * (G.restrictPaths ι).cost f₁

Affine bound on Braess's paradox ([Rou07], Remark 18.22): adding edges or paths to a network with nonnegative affine latencies cannot increase the Wardrop equilibrium cost by more than a 4/3 factor.

Initial four-node Wheatstone network before adding the cross edge ([Rou07], Example 18.4, Figure 18.2(a)): edges 0 = (s, v) and 3 = (w, t) have latency x, edges 1 = (v, t) and 2 = (s, w) have latency 1; path 0 is {0, 1} and path 1 is {2, 3}, routing 1 unit of traffic.

Augmented four-node Wheatstone network after adding the zero-cost edge 4 = (v, w) and cross path 2 = {0, 4, 3} (s → v → w → t, [Rou07], Example 18.4, Figure 18.2(b)).

Path latencies in braessInitial: f 0 + 1 and 1 + f 1.

Cost formula for braessInitial.

Unique Wardrop equilibrium of the initial Braess network ([Rou07], Example 18.4): f is a Wardrop equilibrium of braessInitial iff f = ![1 / 2, 1 / 2], with total cost 3 / 2.

theorem Cslib.GameTheory.NonatomicCongestionGame.braessAugmented_cost (f : Fin 3 → ℝ) :
braessAugmented.cost f = f 0 * (f 0 + f 2 + 1) + f 1 * (1 + (f 1 + f 2)) + f 2 * (f 0 + f 2 + (f 1 + f 2))

Cost formula for braessAugmented.

Unique Wardrop equilibrium of the augmented Braess network ([Rou07], Example 18.4): f is a Wardrop equilibrium of braessAugmented iff f = ![0, 0, 1], with total cost 2 = 4 / 3 * (3 / 2) (whereas ![1 / 2, 1 / 2, 0] is socially optimal of cost 3 / 2).

The even split ![1 / 2, 1 / 2, 0] (avoiding the cross edge) is socially optimal in braessAugmented, with total cost 3 / 2.

Braess's paradox ([Rou07], Example 18.4 and Remark 18.22): adding the zero-cost cross edge to the four-node Wheatstone network increases every Wardrop equilibrium's cost by a factor of 4 / 3 (from 3 / 2 to 2), attaining the worst-case affine bound HasAffineLatencies.cost_le_four_thirds_restrictPaths.