Documentation

CslibFrontier.GameTheory.Congestion.BeckmannPotential

Beckmann's potential and existence and uniqueness of Wardrop equilibria #

In a nonatomic congestion game G, a flow f is a Wardrop equilibrium (G.IsWardrop f) when it is feasible and routes flow only along minimum-latency paths of each commodity. Following Roughgarden [Rou07], Sections 18.3.1 and 18.4.1 (originally due to Beckmann, McGuire and Winsten, 1956, and Smith, 1979), this module establishes:

Main definitions #

Main results #

References #

theorem Cslib.GameTheory.NonatomicCongestionGame.edgeFlow_nonneg {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] (G : NonatomicCongestionGame K P E) [DecidableEq E] {f : P → ℝ} (hf : ∀ (p : P), 0 ≤ f p) (e : E) :
0 ≤ G.edgeFlow f e

Nonnegative flows induce nonnegative edge flows.

theorem Cslib.GameTheory.NonatomicCongestionGame.edgeFlow_add {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] (G : NonatomicCongestionGame K P E) [DecidableEq E] (f g : P → ℝ) (e : E) :
G.edgeFlow (f + g) e = G.edgeFlow f e + G.edgeFlow g e

edgeFlow is additive in the path flow.

theorem Cslib.GameTheory.NonatomicCongestionGame.edgeFlow_smul {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] (G : NonatomicCongestionGame K P E) [DecidableEq E] (c : ℝ) (f : P → ℝ) (e : E) :
G.edgeFlow (c • f) e = c * G.edgeFlow f e

edgeFlow commutes with scalar multiplication.

theorem Cslib.GameTheory.NonatomicCongestionGame.IsFeasible.le_rate {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] (G : NonatomicCongestionGame K P E) [DecidableEq K] {f : P → ℝ} (hf : G.IsFeasible f) (p : P) :
f p ≤ G.rate (G.commodity p)

Every coordinate of a feasible flow is bounded by its commodity's demand rate.

theorem Cslib.GameTheory.NonatomicCongestionGame.IsFeasible.convex_combo {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] (G : NonatomicCongestionGame K P E) [DecidableEq K] {f g : P → ℝ} (hf : G.IsFeasible f) (hg : G.IsFeasible g) {a b : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b) (hab : a + b = 1) :
G.IsFeasible (a • f + b • g)

Convex combinations of feasible flows are feasible.

The set of feasible flows is convex.

The feasible flow polytope {f : P → ℝ | G.IsFeasible f} is compact.

theorem Cslib.GameTheory.NonatomicCongestionGame.nonempty_setOf_isFeasible {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] (G : NonatomicCongestionGame K P E) [DecidableEq K] (hr : ∀ (k : K), 0 ≤ G.rate k) (hpath : ∀ (k : K), G.rate k ≠ 0 → ∃ (p : P), G.commodity p = k) :

If every commodity has nonnegative demand rate and every commodity with positive demand has at least one path, then a feasible flow exists.

Proposition 18.20: variational inequality characterization #

theorem Cslib.GameTheory.NonatomicCongestionGame.isWardrop_iff_forall_cost_le_sum_mul_pathLatency {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] {G : NonatomicCongestionGame K P E} [DecidableEq K] {f : P → ℝ} :
G.IsWardrop f ↔ G.IsFeasible f ∧ ∀ (g : P → ℝ), G.IsFeasible g → G.cost f ≤ ∑ p : P, g p * G.pathLatency f p

Variational inequality characterization, path form ([Rou07], Proposition 18.20): a flow f is a Wardrop equilibrium if and only if f is feasible and cost f ≤ ∑ p, g p * pathLatency f p for every feasible flow g.

theorem Cslib.GameTheory.NonatomicCongestionGame.isWardrop_iff_variationalInequality {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] {G : NonatomicCongestionGame K P E} [DecidableEq K] [Fintype E] {f : P → ℝ} :
G.IsWardrop f ↔ G.IsFeasible f ∧ ∀ (g : P → ℝ), G.IsFeasible g → ∑ e : E, G.latency e (G.edgeFlow f e) * G.edgeFlow f e ≤ ∑ e : E, G.latency e (G.edgeFlow f e) * G.edgeFlow g e

Variational inequality characterization, edge form ([Rou07], Proposition 18.20): a flow f is a Wardrop equilibrium if and only if f is feasible and ∑ e, latency e (edgeFlow f e) * edgeFlow f e ≤ ∑ e, latency e (edgeFlow f e) * edgeFlow g e for every feasible flow g.

Proposition 18.11: Beckmann's potential #

noncomputable def Cslib.GameTheory.NonatomicCongestionGame.beckmannPotential {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] [Fintype E] (G : NonatomicCongestionGame K P E) (f : P → ℝ) :

Beckmann's potential ([Rou07], Equation (18.3), originally due to Beckmann, McGuire and Winsten, 1956): Φ(f) = ∑ e, ∫ x in 0..edgeFlow f e, latency e x.

theorem Cslib.GameTheory.NonatomicCongestionGame.beckmannPotential_def {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] [Fintype E] (G : NonatomicCongestionGame K P E) (f : P → ℝ) :
G.beckmannPotential f = ∑ e : E, ∫ (x : ℝ) in 0..G.edgeFlow f e, G.latency e x

Unfolding equation for beckmannPotential.

theorem Cslib.GameTheory.NonatomicCongestionGame.IsFeasible.sum_mul_edgeFlow_le_of_isMinOn {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] [Fintype E] [DecidableEq K] {G : NonatomicCongestionGame K P E} {H : E → ℝ → ℝ} {d : E → ℝ} {f : P → ℝ} (hf : G.IsFeasible f) (hmin : IsMinOn (fun (g : P → ℝ) => ∑ e : E, H e (G.edgeFlow g e)) {g : P → ℝ | G.IsFeasible g} f) (hderiv : ∀ (e : E), HasDerivWithinAt (H e) (d e) (Set.Ici 0) (G.edgeFlow f e)) {g : P → ℝ} (hg : G.IsFeasible g) :
∑ e : E, d e * G.edgeFlow f e ≤ ∑ e : E, d e * G.edgeFlow g e

First-order variational inequality for a separable edge-flow objective: if f is feasible and minimizes g ↦ ∑ e, H e (G.edgeFlow g e) over {g | G.IsFeasible g}, and each H e has derivative d e within [0, ∞) at G.edgeFlow f e, then ∑ e, d e * G.edgeFlow f e ≤ ∑ e, d e * G.edgeFlow g e for every feasible flow g.

theorem Cslib.GameTheory.NonatomicCongestionGame.continuousOn_beckmannPotential {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] [Fintype E] (G : NonatomicCongestionGame K P E) (hc : ∀ (e : E), ContinuousOn (G.latency e) (Set.Ici 0)) :
ContinuousOn G.beckmannPotential {f : P → ℝ | ∀ (p : P), 0 ≤ f p}

beckmannPotential is continuous on the set of nonnegative path flows when resource latencies are continuous on [0, ∞).

theorem Cslib.GameTheory.NonatomicCongestionGame.convexOn_beckmannPotential {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] [Fintype E] (G : NonatomicCongestionGame K P E) [DecidableEq K] (hc : ∀ (e : E), ContinuousOn (G.latency e) (Set.Ici 0)) (hm : ∀ (e : E), MonotoneOn (G.latency e) (Set.Ici 0)) :

beckmannPotential is convex on the feasible flow polytope when resource latencies are continuous and nondecreasing on [0, ∞).

theorem Cslib.GameTheory.NonatomicCongestionGame.IsWardrop.isMinOn_beckmannPotential {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] [Fintype E] [DecidableEq K] {G : NonatomicCongestionGame K P E} (hc : ∀ (e : E), ContinuousOn (G.latency e) (Set.Ici 0)) (hm : ∀ (e : E), MonotoneOn (G.latency e) (Set.Ici 0)) {f : P → ℝ} (hf : G.IsWardrop f) :

With continuous nondecreasing latencies, every Wardrop equilibrium globally minimizes Beckmann's potential over feasible flows.

theorem Cslib.GameTheory.NonatomicCongestionGame.IsFeasible.isWardrop_of_isMinOn_beckmannPotential {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] [Fintype E] [DecidableEq K] {G : NonatomicCongestionGame K P E} (hc : ∀ (e : E), ContinuousOn (G.latency e) (Set.Ici 0)) {f : P → ℝ} (hf : G.IsFeasible f) (hmin : IsMinOn G.beckmannPotential {g : P → ℝ | G.IsFeasible g} f) :

With continuous latencies on [0, ∞), every global minimizer of Beckmann's potential over feasible flows is a Wardrop equilibrium.

theorem Cslib.GameTheory.NonatomicCongestionGame.isWardrop_iff_isMinOn_beckmannPotential {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] [Fintype E] [DecidableEq K] {G : NonatomicCongestionGame K P E} (hc : ∀ (e : E), ContinuousOn (G.latency e) (Set.Ici 0)) (hm : ∀ (e : E), MonotoneOn (G.latency e) (Set.Ici 0)) {f : P → ℝ} (hf : G.IsFeasible f) :

Beckmann's potential characterization ([Rou07], Proposition 18.11): for continuous nondecreasing latencies on [0, ∞), a feasible flow is a Wardrop equilibrium if and only if it globally minimizes Beckmann's potential over all feasible flows.

Theorem 18.8: existence and essential uniqueness of Wardrop equilibria #

theorem Cslib.GameTheory.NonatomicCongestionGame.exists_isWardrop_of_nonempty {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] [Finite E] (G : NonatomicCongestionGame K P E) [DecidableEq K] (hne : {f : P → ℝ | G.IsFeasible f}.Nonempty) (hc : ∀ (e : E), ContinuousOn (G.latency e) (Set.Ici 0)) :
∃ (f : P → ℝ), G.IsWardrop f

Existence of Wardrop equilibria from nonempty feasibility ([Rou07], Theorem 18.8(a)): if a nonatomic congestion game has continuous latencies on [0, ∞) and at least one feasible flow, then it admits a Wardrop equilibrium.

theorem Cslib.GameTheory.NonatomicCongestionGame.exists_isWardrop {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] [Finite E] (G : NonatomicCongestionGame K P E) [DecidableEq K] (hr : ∀ (k : K), 0 ≤ G.rate k) (hpath : ∀ (k : K), G.rate k ≠ 0 → ∃ (p : P), G.commodity p = k) (hc : ∀ (e : E), ContinuousOn (G.latency e) (Set.Ici 0)) :
∃ (f : P → ℝ), G.IsWardrop f

Existence of Wardrop equilibria ([Rou07], Theorem 18.8(a)): if demand rates are nonnegative, every commodity with nonzero demand has at least one path, and resource latencies are continuous on [0, ∞), then a Wardrop equilibrium exists.

theorem Cslib.GameTheory.NonatomicCongestionGame.isWardrop_latency_eq {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] (hm : ∀ (e : E), MonotoneOn (G.latency e) (Set.Ici 0)) {f g : P → ℝ} (hf : G.IsWardrop f) (hg : G.IsWardrop g) (e : E) :
G.latency e (G.edgeFlow f e) = G.latency e (G.edgeFlow g e)

Essential uniqueness of Wardrop edge latencies ([Rou07], Theorem 18.8(b)): if resource latencies are nondecreasing on [0, ∞), any two Wardrop equilibria f and g induce the same latency on every resource e.

theorem Cslib.GameTheory.NonatomicCongestionGame.isWardrop_pathLatency_eq {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] (hm : ∀ (e : E), MonotoneOn (G.latency e) (Set.Ici 0)) {f g : P → ℝ} (hf : G.IsWardrop f) (hg : G.IsWardrop g) (p : P) :

Any two Wardrop equilibria induce the same path latencies under nondecreasing resource latencies.

theorem Cslib.GameTheory.NonatomicCongestionGame.isWardrop_cost_eq {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] (hm : ∀ (e : E), MonotoneOn (G.latency e) (Set.Ici 0)) {f g : P → ℝ} (hf : G.IsWardrop f) (hg : G.IsWardrop g) :
G.cost f = G.cost g

All Wardrop equilibria have equal total cost ([Rou07], Theorem 18.8(b)): in particular, the price of stability equals the price of anarchy in every nonatomic congestion game with nondecreasing latencies.

Uniqueness of the Wardrop equilibrium in Pigou's linear example ([RT07], Example 17.1): on pigouNetwork id 1, ![1, 0] is the unique Wardrop equilibrium.

theorem Cslib.GameTheory.NonatomicCongestionGame.pigouNetwork_id_priceOfStability :
(pigouNetwork (fun (x : ℝ) => x) 1).IsFeasible ![1 / 2, 1 / 2] ∧ (∀ (g : Fin 2 → ℝ), (pigouNetwork (fun (x : ℝ) => x) 1).IsFeasible g → (pigouNetwork (fun (x : ℝ) => x) 1).cost ![1 / 2, 1 / 2] ≤ (pigouNetwork (fun (x : ℝ) => x) 1).cost g) ∧ ∀ (f : Fin 2 → ℝ), (pigouNetwork (fun (x : ℝ) => x) 1).IsWardrop f → (pigouNetwork (fun (x : ℝ) => x) 1).cost f = 4 / 3 * (pigouNetwork (fun (x : ℝ) => x) 1).cost ![1 / 2, 1 / 2]

Price of stability of Pigou's linear example is 4/3 ([RT07], Example 17.1): ![1/2, 1/2] minimizes total cost (3/4) over all feasible flows, and every Wardrop equilibrium f of pigouNetwork id 1 has cost (4/3) * cost ![1/2, 1/2] = 1.

Theorem 18.16 and Corollary 18.17: potential-function price-of-anarchy bounds #

theorem Cslib.GameTheory.NonatomicCongestionGame.beckmannPotential_le_cost {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] {G : NonatomicCongestionGame K P E} [Fintype E] (hc : ∀ (e : E), ContinuousOn (G.latency e) (Set.Ici 0)) (hm : ∀ (e : E), MonotoneOn (G.latency e) (Set.Ici 0)) {f : P → ℝ} (hf : ∀ (p : P), 0 ≤ f p) :

With continuous nondecreasing latencies on [0, ∞), Beckmann's potential is at most the flow cost for every nonnegative flow.

theorem Cslib.GameTheory.NonatomicCongestionGame.IsWardrop.cost_le_mul_of_le_mul_integral {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] {γ : ℝ} (hγ : 0 ≤ γ) (hc : ∀ (e : E), ContinuousOn (G.latency e) (Set.Ici 0)) (hm : ∀ (e : E), MonotoneOn (G.latency e) (Set.Ici 0)) (hub : ∀ (e : E) (x : ℝ), 0 ≤ x → x * G.latency e x ≤ γ * ∫ (y : ℝ) in 0..x, G.latency e y) {f g : P → ℝ} (hf : G.IsWardrop f) (hg : G.IsFeasible g) :
G.cost f ≤ γ * G.cost g

Potential-function price-of-anarchy upper bound ([Rou07], Theorem 18.16; [RT02]): if resource latencies are continuous and nondecreasing on [0, ∞) and x * latency e x ≤ γ * ∫ y in 0..x, latency e y for all x ≥ 0 with γ ≥ 0, then every Wardrop equilibrium costs at most γ times every feasible flow.

theorem Cslib.GameTheory.NonatomicCongestionGame.IsWardrop.cost_le_succ_mul_of_mem_polynomialLatencies {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] {d : ℕ} (hG : ∀ (e : E), G.latency e ∈ polynomialLatencies d) {f g : P → ℝ} (hf : G.IsWardrop f) (hg : G.IsFeasible g) :
G.cost f ≤ (↑d + 1) * G.cost g

Potential-function bound for polynomial latencies ([Rou07], Corollary 18.17): if every resource latency is a polynomial of degree at most d with nonnegative coefficients, then every Wardrop equilibrium costs at most (d + 1) times every feasible flow.