Documentation

CslibFrontier.GameTheory.Congestion.Queueing

Price of anarchy for M/M/1 and M/G/1 queueing delay functions #

In Roughgarden's topology-independent selfish routing framework ([Rou03], Sections 5.2 and 5.3), link latencies model queueing delays with capacity (expected service rate) u > 0 and traffic flow x ∈ [0, u):

Outside [0, u), Lean's real division returns 0 at x = u and negative values for x > u; every routing theorem in this module keeps the capacity constraint edgeFlow < u explicit (either edgewise or via total demand ∑ k, rate k ≤ R_max < u_min ≤ u e).

Because neither class contains constant functions ([Rou03], Remark 5.4, p. 20), matching lower bounds cannot use two-link Pigou networks with a constant edge. Instead, we instantiate the single-commodity union-of-paths construction (NonatomicCongestionGame.unionOfPaths and NonatomicCongestionGame.exists_unionOfPaths_lt_cost from CslibFrontier.GameTheory.Congestion.InhomogeneousPigou, following [Rou03], Lemma 4.8 and Theorem 4.9, pp. 16–17) with the same queueing latency function ℓ on every edge, giving exact iff characterizations of the worst-case price of anarchy for both M/M/1 (Proposition 5.3) and arbitrary M/G/1 families (Proposition 5.5).

Main definitions #

Main results #

References #

Queueing latency functions and exact PoA bounds #

noncomputable def Cslib.GameTheory.mm1Latency (u x : ℝ) :

The M/M/1 queueing delay function with service rate (capacity) u > 0 and arrival rate x ∈ [0, u) ([Roughgarden2003], Section 5.2, p. 19): mm1Latency u x = (u - x)⁻¹. Outside [0, u), Lean's real inverse returns 0 at x = u and negative values for x > u; theorems using this function assume 0 ≤ x < u.

noncomputable def Cslib.GameTheory.mg1Latency (u σ x : ℝ) :

The M/G/1 queueing delay function with expected service rate u > 0, service-time standard deviation σ ≥ 0, and arrival rate x ∈ [0, u) ([Roughgarden2003], Section 5.3, p. 20): mg1Latency u σ x = 1 / u + x * (1 + σ ^ 2 * u ^ 2) / (2 * u * (u - x)). At σ = u⁻¹ (exponential service times) this coincides with mm1Latency u x for all x ≠ u. Outside [0, u), Lean's real division returns 1 / u at x = u and smaller values for x > u; theorems using this function assume 0 ≤ x < u.

noncomputable def Cslib.GameTheory.mm1Bound (u r : ℝ) :

The exact M/M/1 price-of-anarchy bound of [Rou03], Proposition 5.3 (p. 20), for minimum capacity u and maximum flow/demand r < u: (1 + √(u / (u - r))) / 2.

noncomputable def Cslib.GameTheory.mg1Bound (u σ r : ℝ) :

The exact M/G/1 price-of-anarchy bound of [Rou03], Proposition 5.5 (p. 21), for service rate u, standard deviation σ, and maximum flow/demand r < u: (1 + √(u / (u - r))) * (2 u + r (σ² u² - 1)) / (4 u + (u + r - √(u (u - r))) (σ² u² - 1)).

theorem Cslib.GameTheory.mg1Latency_inv_eq_mm1Latency {u x : ℝ} (hu : u ≠ 0) (hxu : x ≠ u) :

At σ = u⁻¹ (exponential service times), mg1Latency equals mm1Latency away from x = u.

For exponential service times (σ = u⁻¹), mg1Bound simplifies to mm1Bound.

theorem Cslib.GameTheory.mm1Latency_pos {u x : ℝ} (hxu : x < u) :

mm1Latency u x is positive on [0, u) (in fact for all x < u).

theorem Cslib.GameTheory.mg1Latency_pos {u σ x : ℝ} (hu : 0 < u) (hx : 0 ≤ x) (hxu : x < u) :
0 < mg1Latency u σ x

mg1Latency u σ x is positive for 0 < u and 0 ≤ x < u.

theorem Cslib.GameTheory.one_le_mm1Bound {u r : ℝ} (hr : 0 ≤ r) (hru : r < u) :

mm1Bound u r is at least 1 for 0 ≤ r < u.

theorem Cslib.GameTheory.mm1Bound_anti_left {u₁ u₂ r : ℝ} (hr : 0 ≤ r) (hru : r < u₁) (hu : u₁ ≤ u₂) :
mm1Bound u₂ r ≤ mm1Bound u₁ r

mm1Bound u r is nonincreasing in the capacity u (for 0 ≤ r < u₁ ≤ u₂).

theorem Cslib.GameTheory.mm1Bound_mono_right {u r₁ r₂ : ℝ} (hu : 0 < u) (hr : r₁ ≤ r₂) (hr₂ : r₂ < u) :
mm1Bound u r₁ ≤ mm1Bound u r₂

mm1Bound u r is nondecreasing in the traffic bound r (for r₁ ≤ r₂ < u, 0 < u).

theorem Cslib.GameTheory.mg1Bound_mono_right {u σ r₁ r₂ : ℝ} (hu : 0 < u) (hr₁ : 0 ≤ r₁) (hr : r₁ ≤ r₂) (hr₂ : r₂ < u) :
mg1Bound u σ r₁ ≤ mg1Bound u σ r₂

mg1Bound u σ r is nondecreasing in r on [0, u) for fixed 0 < u and σ.

theorem Cslib.GameTheory.one_le_mg1Bound {u σ r : ℝ} (hu : 0 < u) (hr : 0 ≤ r) (hru : r < u) :
1 ≤ mg1Bound u σ r

mg1Bound u σ r is at least 1 for 0 < u and 0 ≤ r < u.

theorem Cslib.GameTheory.mg1_pigou_ineq {u σ x y : ℝ} (hu : 0 < u) (hx : 0 ≤ x) (hxu : x < u) (hyu : y < u) :
x * mg1Latency u σ x ≤ mg1Bound u σ x * (y * mg1Latency u σ y + (x - y) * mg1Latency u σ x)

Edgewise M/G/1 Pigou inequality: for 0 < u, 0 ≤ x < u, and y < u, x * mg1Latency u σ x ≤ mg1Bound u σ x * (y * mg1Latency u σ y + (x - y) * mg1Latency u σ x).

theorem Cslib.GameTheory.mg1_pigou_eq {u σ x : ℝ} (hu : 0 < u) (hx : 0 ≤ x) (hxu : x < u) :
have y := u - √(u * (u - x)); 0 ≤ y ∧ y ≤ x ∧ x * mg1Latency u σ x = mg1Bound u σ x * (y * mg1Latency u σ y + (x - y) * mg1Latency u σ x)

Attainment of the M/G/1 Pigou inequality: at y = u - √(u (u - x)) ∈ [0, x], the edgewise inequality mg1_pigou_ineq holds with equality.

theorem Cslib.GameTheory.mm1_pigou_ineq {u x y : ℝ} (hx : 0 ≤ x) (hxu : x < u) (hyu : y < u) :
x * mm1Latency u x ≤ mm1Bound u x * (y * mm1Latency u y + (x - y) * mm1Latency u x)

Edgewise M/M/1 Pigou inequality: for 0 ≤ x < u and y < u, x * mm1Latency u x ≤ mm1Bound u x * (y * mm1Latency u y + (x - y) * mm1Latency u x).

Upper bounds on the price of anarchy for M/G/1 and M/M/1 networks #

theorem Cslib.GameTheory.NonatomicCongestionGame.IsFeasible.edgeFlow_le_sum_rate {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] {G : NonatomicCongestionGame K P E} [Fintype K] [DecidableEq K] {f : P → ℝ} (hf : G.IsFeasible f) (e : E) :
G.edgeFlow f e ≤ ∑ k : K, G.rate k

Every edge flow of a feasible flow is bounded by the sum of all commodity demand rates.

theorem Cslib.GameTheory.NonatomicCongestionGame.IsWardrop.cost_le_mg1Bound_mul {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] {u σ : E → ℝ} {R_max α : ℝ} (hR : 0 ≤ R_max) (hRu : ∀ (e : E), R_max < u e) (hlat : ∀ (e : E), G.latency e = mg1Latency (u e) (σ e)) (hα : ∀ (e : E), mg1Bound (u e) (σ e) R_max ≤ α) {f g : P → ℝ} (hf : G.IsWardrop f) (hg : G.IsFeasible g) (hfR : ∀ (e : E), G.edgeFlow f e ≤ R_max) (hgu : ∀ (e : E), G.edgeFlow g e < u e) :
G.cost f ≤ α * G.cost g

M/G/1 price-of-anarchy upper bound (headroom form) ([Rou03], Section 5.3): if every edge e has M/G/1 latency mg1Latency (u e) (σ e) with 0 < u e, f is a Wardrop equilibrium with G.edgeFlow f e ≤ R_max < u e, g is a feasible flow with G.edgeFlow g e < u e, and mg1Bound (u e) (σ e) R_max ≤ α on every edge, then G.cost f ≤ α * G.cost g.

theorem Cslib.GameTheory.NonatomicCongestionGame.IsWardrop.cost_le_mg1Bound_mul_of_sum_rate_le {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] {G : NonatomicCongestionGame K P E} [Fintype K] [DecidableEq K] [Finite E] {u σ : E → ℝ} {R_max α : ℝ} (hR : 0 ≤ R_max) (hRu : ∀ (e : E), R_max < u e) (hlat : ∀ (e : E), G.latency e = mg1Latency (u e) (σ e)) (hα : ∀ (e : E), mg1Bound (u e) (σ e) R_max ≤ α) (hrate : ∑ k : K, G.rate k ≤ R_max) {f g : P → ℝ} (hf : G.IsWardrop f) (hg : G.IsFeasible g) :
G.cost f ≤ α * G.cost g

M/G/1 price-of-anarchy upper bound under bounded total demand ([Rou03], Proposition 5.5, p. 21): if every edge e has M/G/1 latency mg1Latency (u e) (σ e) with R_max < u e, the sum of all commodity rates is at most R_max, and mg1Bound (u e) (σ e) R_max ≤ α on every edge, then every Wardrop equilibrium f costs at most α times every feasible flow g.

theorem Cslib.GameTheory.NonatomicCongestionGame.IsWardrop.cost_le_mm1Bound_mul {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] {u : E → ℝ} {u_min R_max : ℝ} (hR : 0 ≤ R_max) (hRu : R_max < u_min) (hu : ∀ (e : E), u_min ≤ u e) (hlat : ∀ (e : E), G.latency e = mm1Latency (u e)) {f g : P → ℝ} (hf : G.IsWardrop f) (hg : G.IsFeasible g) (hfR : ∀ (e : E), G.edgeFlow f e ≤ R_max) (hgu : ∀ (e : E), G.edgeFlow g e < u e) :
G.cost f ≤ mm1Bound u_min R_max * G.cost g

M/M/1 price-of-anarchy upper bound (headroom form) ([Rou03], Section 5.2): if every edge e has M/M/1 latency mm1Latency (u e) with u_min ≤ u e, 0 ≤ R_max < u_min, f is a Wardrop equilibrium with G.edgeFlow f e ≤ R_max, and g is a feasible flow with G.edgeFlow g e < u e, then G.cost f ≤ mm1Bound u_min R_max * G.cost g.

theorem Cslib.GameTheory.NonatomicCongestionGame.IsWardrop.cost_le_mm1Bound_mul_of_sum_rate_le {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] {G : NonatomicCongestionGame K P E} [Fintype K] [DecidableEq K] [Finite E] {u : E → ℝ} {u_min R_max : ℝ} (hR : 0 ≤ R_max) (hRu : R_max < u_min) (hu : ∀ (e : E), u_min ≤ u e) (hlat : ∀ (e : E), G.latency e = mm1Latency (u e)) (hrate : ∑ k : K, G.rate k ≤ R_max) {f g : P → ℝ} (hf : G.IsWardrop f) (hg : G.IsFeasible g) :
G.cost f ≤ mm1Bound u_min R_max * G.cost g

M/M/1 price-of-anarchy upper bound ([Rou03], Proposition 5.3, p. 20): if every edge has M/M/1 latency mm1Latency (u e) with u_min ≤ u e and the sum of all commodity demand rates is at most R_max < u_min (0 ≤ R_max), then every Wardrop equilibrium f costs at most (1 + √(u_min / (u_min - R_max))) / 2 times every feasible flow g.

Union-of-paths networks and exact tightness without constant functions #

theorem Cslib.GameTheory.NonatomicCongestionGame.exists_mg1_lt_cost {u σ R_max β : ℝ} (hR : 0 < R_max) (hRu : R_max < u) (hβ : β < mg1Bound u σ R_max) :
∃ (q : ℕ) (n : ℕ) (p : ℕ) (f : Fin (n + 1) → ℝ) (g : Fin (n + 1) → ℝ), (unionOfPaths q n p (mg1Latency u σ) (mg1Latency u σ) R_max).IsWardrop f ∧ (unionOfPaths q n p (mg1Latency u σ) (mg1Latency u σ) R_max).IsFeasible g ∧ 0 < (unionOfPaths q n p (mg1Latency u σ) (mg1Latency u σ) R_max).cost g ∧ β * (unionOfPaths q n p (mg1Latency u σ) (mg1Latency u σ) R_max).cost g < (unionOfPaths q n p (mg1Latency u σ) (mg1Latency u σ) R_max).cost f

Union-of-paths tightness for M/G/1 queueing latencies ([Rou03], Proposition 5.5, p. 21): for 0 < R_max < u, σ : ℝ, and every β < mg1Bound u σ R_max, there exists a single-commodity union-of-paths network of rate R_max whose every edge has latency mg1Latency u σ, a Wardrop equilibrium f, and a feasible flow g with 0 < G.cost g and β * G.cost g < G.cost f.

theorem Cslib.GameTheory.NonatomicCongestionGame.mg1Bound_le_iff {u_min R_max β : ℝ} (hR : 0 < R_max) (hRu : R_max < u_min) {L : Set (ℝ × ℝ)} (hL : ∀ p ∈ L, u_min ≤ p.1) :
(∀ p ∈ L, mg1Bound p.1 p.2 R_max ≤ β) ↔ ∀ (K P E : Type) [inst : Fintype K] [inst_1 : Fintype P] [Finite E] [inst_3 : DecidableEq K] [inst_4 : DecidableEq E] (G : NonatomicCongestionGame K P E) (u σ : E → ℝ) (f g : P → ℝ), (∀ (e : E), (u e, σ e) ∈ L) → (∀ (e : E), G.latency e = mg1Latency (u e) (σ e)) → ∑ k : K, G.rate k ≤ R_max → G.IsWardrop f → G.IsFeasible g → G.cost f ≤ β * G.cost g

Exact price of anarchy for M/G/1 queueing delay functions ([Rou03], Proposition 5.5, p. 21): for 0 < R_max < u_min and any collection L of M/G/1 parameters (u, σ) with u_min ≤ u (vacuously for L = ∅), a factor β bounds the price of anarchy of every multicommodity network with edge latencies in L and total demand at most R_max if and only if mg1Bound u σ R_max ≤ β for every (u, σ) ∈ L.

theorem Cslib.GameTheory.NonatomicCongestionGame.exists_mm1_lt_cost {u_min R_max β : ℝ} (hR : 0 < R_max) (hRu : R_max < u_min) (hβ : β < mm1Bound u_min R_max) :
∃ (q : ℕ) (n : ℕ) (p : ℕ) (f : Fin (n + 1) → ℝ) (g : Fin (n + 1) → ℝ), (unionOfPaths q n p (mm1Latency u_min) (mm1Latency u_min) R_max).IsWardrop f ∧ (unionOfPaths q n p (mm1Latency u_min) (mm1Latency u_min) R_max).IsFeasible g ∧ 0 < (unionOfPaths q n p (mm1Latency u_min) (mm1Latency u_min) R_max).cost g ∧ β * (unionOfPaths q n p (mm1Latency u_min) (mm1Latency u_min) R_max).cost g < (unionOfPaths q n p (mm1Latency u_min) (mm1Latency u_min) R_max).cost f

Union-of-paths tightness for M/M/1 queueing latencies ([Rou03], Proposition 5.3, p. 20): for 0 < R_max < u_min and every β < mm1Bound u_min R_max, there exists a single-commodity union-of-paths network of rate R_max whose every edge has latency mm1Latency u_min, a Wardrop equilibrium f, and a feasible flow g with 0 < G.cost g and β * G.cost g < G.cost f.

theorem Cslib.GameTheory.NonatomicCongestionGame.mm1Bound_le_iff {u_min R_max β : ℝ} (hR : 0 < R_max) (hRu : R_max < u_min) :
mm1Bound u_min R_max ≤ β ↔ ∀ (K P E : Type) [inst : Fintype K] [inst_1 : Fintype P] [Finite E] [inst_3 : DecidableEq K] [inst_4 : DecidableEq E] (G : NonatomicCongestionGame K P E) (u : E → ℝ) (f g : P → ℝ), (∀ (e : E), u_min ≤ u e) → (∀ (e : E), G.latency e = mm1Latency (u e)) → ∑ k : K, G.rate k ≤ R_max → G.IsWardrop f → G.IsFeasible g → G.cost f ≤ β * G.cost g

Exact price of anarchy for M/M/1 queueing delay functions ([Rou03], Proposition 5.3, p. 20): for 0 < R_max < u_min, a factor β bounds the price of anarchy of every multicommodity network with M/M/1 capacities at least u_min and total demand at most R_max if and only if (1 + √(u_min / (u_min - R_max))) / 2 ≤ β.