Documentation

CslibFrontier.GameTheory.Congestion.WardropNoRegret

Convergence of regret-minimizing flows to approximate Wardrop equilibria #

In online routing ([BM07b], Section 4.7, following Blum, Even-Dar and Ligett, 2006), a population of nonatomic users routes traffic over T days, producing feasible daily flows f 0, …, f (T - 1). Following [BM07b], Section 4.7, p. 97:

This module formalizes [BM07b], Section 4.7, pp. 96–98 (Theorem 4.18 and the per-day (1 - δ)-fraction convergence theorem of Blum, Even-Dar and Ligett, 2006), together with nonlinear time-average extensions:

Main definitions #

Main results #

References #

noncomputable def Cslib.GameTheory.timeAverageFlow {P : Type u_1} (f : ℕ → P → ℝ) (T : ℕ) (p : P) :

The time-averaged path flow (1 / T) ∑ t < T, f t over T steps ([BM07b], Section 4.7, Theorem 4.18).

def Cslib.GameTheory.NonatomicCongestionGame.IsApproxWardrop {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 → ℝ) :

An ε-approximate Wardrop equilibrium ("ε-Nash flow" in [BM07b], Section 4.7, p. 97): a feasible flow f whose cost exceeds the latency under f of any feasible rerouting g by at most ε.

def Cslib.GameTheory.NonatomicCongestionGame.HasAvgRegretLe {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 → ℝ) (T : ℕ) (ε : ℝ) :

A sequence of flows f 0, …, f (T - 1) has average external regret at most ε ([BM07b], Section 4.7, p. 97) if each f t (t < T) is feasible and the average flow cost exceeds that of any fixed feasible benchmark flow g by at most ε.

At ε = 0, IsApproxWardrop 0 f is equivalent to IsWardrop f.

theorem Cslib.GameTheory.NonatomicCongestionGame.IsApproxWardrop.mono {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] [DecidableEq K] {G : NonatomicCongestionGame K P E} {ε₁ ε₂ : ℝ} (hε : ε₁ ≤ ε₂) {f : P → ℝ} (hf : G.IsApproxWardrop ε₁ f) :
G.IsApproxWardrop ε₂ f

Monotonicity of IsApproxWardrop in the slack ε.

theorem Cslib.GameTheory.NonatomicCongestionGame.isApproxWardrop_unit_iff {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] {G : NonatomicCongestionGame Unit P E} (hr : G.rate () = 1) {ε : ℝ} {f : P → ℝ} :
G.IsApproxWardrop ε f ↔ G.IsFeasible f ∧ ∀ (p : P), G.cost f ≤ G.pathLatency f p + ε

In a single-commodity unit-rate network (K = Unit, G.rate () = 1), G.IsApproxWardrop ε f is equivalent to G.IsFeasible f ∧ ∀ p, G.cost f ≤ G.pathLatency f p + ε, matching C(f) ≤ ε + min_p pathLatency f p in [BM07b], Section 4.7, p. 97.

theorem Cslib.GameTheory.NonatomicCongestionGame.hasAvgRegretLe_unit_iff {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] {G : NonatomicCongestionGame Unit P E} (hr : G.rate () = 1) {f : ℕ → P → ℝ} {T : ℕ} {ε : ℝ} :
G.HasAvgRegretLe f T ε ↔ (∀ t < T, G.IsFeasible (f t)) ∧ ∀ (p : P), (∑ t ∈ Finset.range T, G.cost (f t)) / ↑T ≤ (∑ t ∈ Finset.range T, G.pathLatency (f t) p) / ↑T + ε

In a single-commodity unit-rate network (K = Unit, G.rate () = 1), G.HasAvgRegretLe f T ε is equivalent to feasibility of each f t together with ∀ p, (∑ t < T, G.cost (f t)) / T ≤ (∑ t < T, G.pathLatency (f t) p) / T + ε, i.e., R(T) ≤ ε * T in [BM07b], Section 4.7, p. 97.

theorem Cslib.GameTheory.NonatomicCongestionGame.isFeasible_timeAverageFlow {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] (G : NonatomicCongestionGame K P E) [DecidableEq K] {f : ℕ → P → ℝ} {T : ℕ} (hT : 0 < T) (hf : ∀ t < T, G.IsFeasible (f t)) :

The time average of feasible daily flows over T > 0 days is feasible.

theorem Cslib.GameTheory.NonatomicCongestionGame.edgeFlow_timeAverageFlow {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] (G : NonatomicCongestionGame K P E) (f : ℕ → P → ℝ) (T : ℕ) (e : E) :
G.edgeFlow (timeAverageFlow f T) e = (∑ t ∈ Finset.range T, G.edgeFlow (f t) e) / ↑T

edgeFlow commutes with timeAverageFlow.

Cost Jensen bound and Theorem 4.18 #

theorem Cslib.GameTheory.NonatomicCongestionGame.cost_timeAverageFlow_le {K : Type u_1} {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] {G : NonatomicCongestionGame K P E} [Finite E] (hconv : ∀ (e : E), ConvexOn ℝ (Set.Ici 0) fun (x : ℝ) => x * G.latency e x) {f : ℕ → P → ℝ} {T : ℕ} (hT : 0 < T) (hf : ∀ t < T, ∀ (p : P), 0 ≤ f t p) :
G.cost (timeAverageFlow f T) ≤ (∑ t ∈ Finset.range T, G.cost (f t)) / ↑T

When x ↦ x * latency e x is convex on [0, ∞) for every resource e (in particular for every nondecreasing convex latency), the cost of the time-averaged flow is at most the time average of the daily flow costs.

theorem Cslib.GameTheory.NonatomicCongestionGame.isApproxWardrop_timeAverageFlow_of_concaveOn {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] (hconc : ∀ (e : E), ConcaveOn ℝ (Set.Ici 0) (G.latency e)) (hconv : ∀ (e : E), ConvexOn ℝ (Set.Ici 0) fun (x : ℝ) => x * G.latency e x) {f : ℕ → P → ℝ} {T : ℕ} (hT : 0 < T) {ε : ℝ} (hreg : G.HasAvgRegretLe f T ε) :

Original concave-latency generalization of [BM07b], Theorem 4.18: if latency e is concave on [0, ∞) and x ↦ x * latency e x is convex on [0, ∞) (for instance, c(x) = a x + b or c(x) = x ^ α with 0 ≤ α ≤ 1), then any flow sequence with average external regret at most ε over T > 0 steps has time-average flow that is feasible and ε-Wardrop.

theorem Cslib.GameTheory.NonatomicCongestionGame.HasAffineLatencies.isApproxWardrop_timeAverageFlow {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) {f : ℕ → P → ℝ} {T : ℕ} (hT : 0 < T) {ε : ℝ} (hreg : G.HasAvgRegretLe f T ε) :

Time-averaged no-regret routing with affine latencies is ε-Wardrop ([BM07b], Theorem 4.18, p. 97): if G has nonnegative affine latencies and f 0, …, f (T - 1) has average external regret at most ε, then timeAverageFlow f T is feasible and ε-Wardrop.

theorem Cslib.GameTheory.NonatomicCongestionGame.HasAffineLatencies.isApproxWardrop_timeAverageFlow_unit {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] [Finite E] {G : NonatomicCongestionGame Unit P E} (hG : G.HasAffineLatencies) (hr : G.rate () = 1) {f : ℕ → P → ℝ} {T : ℕ} (hT : 0 < T) {ε : ℝ} (hf : ∀ t < T, G.IsFeasible (f t)) (hR : ∀ (p : P), ∑ t ∈ Finset.range T, G.cost (f t) - ∑ t ∈ Finset.range T, G.pathLatency (f t) p ≤ ε * ↑T) :

Single-commodity unit-rate form of Theorem 4.18 ([BM07b], Section 4.7, p. 97, verbatim): if G has nonnegative affine latencies, G.rate () = 1, each f t (t < T) is feasible, and R(T) ≤ ε * T against every path p, then timeAverageFlow f T satisfies G.cost (timeAverageFlow f T) ≤ G.pathLatency (timeAverageFlow f T) p + ε for every path p.

theorem Cslib.GameTheory.NonatomicCongestionGame.exists_not_isApproxWardrop_timeAverageFlow_sq :
∃ (f : ℕ → Fin 2 → ℝ), (pigouNetwork (fun (x : ℝ) => x ^ 2) 1).HasAvgRegretLe f 2 (44 / 64) ∧ ¬(pigouNetwork (fun (x : ℝ) => x ^ 2) 1).IsApproxWardrop (44 / 64) (timeAverageFlow f 2)

Original quadratic counterexample to literal ε-preservation without concavity/linearity (inspired by [BM07b], Section 4.7, pp. 97–98): on pigouNetwork (· ^ 2) 1, the two-day sequence f 0 = ![0, 1], f 1 = ![1 / 2, 1 / 2] has average external regret 44 / 64, whereas timeAverageFlow f 2 = ![1 / 4, 3 / 4] has Wardrop gap 45 / 64 > 44 / 64 and is therefore not (44 / 64)-Wardrop.

Bounded-slope time-average and per-day convergence (Section 4.7, pp. 97–98) #

theorem Cslib.GameTheory.NonatomicCongestionGame.isApproxWardrop_timeAverageFlow_of_lipschitz {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] {L : ℝ} (hL : 0 ≤ L) (hm : ∀ (e : E), MonotoneOn (G.latency e) (Set.Ici 0)) (hlip : ∀ (e : E) (x y : ℝ), 0 ≤ x → x ≤ y → G.latency e y - G.latency e x ≤ L * (y - x)) {f : ℕ → P → ℝ} {T : ℕ} (hT : 0 < T) {ε : ℝ} (hreg : G.HasAvgRegretLe f T ε) :
G.IsApproxWardrop (ε + (2 * ∑ p : P, f 0 p) * √(↑(Fintype.card E) * L * ε)) (timeAverageFlow f T)

Bounded-slope time-average convergence to approximate Wardrop equilibrium ([BM07b], Section 4.7, pp. 97–98): if every resource latency is nondecreasing and L-Lipschitz on [0, ∞) (L ≥ 0), then any flow sequence f with average external regret at most ε over T > 0 steps has time-average flow timeAverageFlow f T that is (ε + 2 * (∑ p, f 0 p) * √(|E| * L * ε))-Wardrop.

theorem Cslib.GameTheory.NonatomicCongestionGame.isApproxWardrop_timeAverageFlow_of_convexOn_of_lipschitz {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] {L : ℝ} (hL : 0 ≤ L) (hm : ∀ (e : E), MonotoneOn (G.latency e) (Set.Ici 0)) (hconv : ∀ (e : E), ConvexOn ℝ (Set.Ici 0) (G.latency e)) (hlip : ∀ (e : E) (x y : ℝ), 0 ≤ x → x ≤ y → G.latency e y - G.latency e x ≤ L * (y - x)) {f : ℕ → P → ℝ} {T : ℕ} (hT : 0 < T) {ε : ℝ} (hreg : G.HasAvgRegretLe f T ε) :
G.IsApproxWardrop (ε + (∑ p : P, f 0 p) * √(↑(Fintype.card E) * L * ε)) (timeAverageFlow f T)

Original sharpened bounded-slope time-average bound for convex latencies (inspired by [BM07b], Section 4.7, pp. 97–98): when resource latencies are convex, nondecreasing and L-Lipschitz on [0, ∞), convexity gives G.cost (timeAverageFlow f T) ≤ (∑ t < T, G.cost (f t)) / T directly, eliminating one of the two fluctuation error terms.

theorem Cslib.GameTheory.NonatomicCongestionGame.isWardrop_timeAverageFlow_of_hasAvgRegretLe_zero {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] {L : ℝ} (hL : 0 ≤ L) (hm : ∀ (e : E), MonotoneOn (G.latency e) (Set.Ici 0)) (hlip : ∀ (e : E) (x y : ℝ), 0 ≤ x → x ≤ y → G.latency e y - G.latency e x ≤ L * (y - x)) {f : ℕ → P → ℝ} {T : ℕ} (hT : 0 < T) (hreg : G.HasAvgRegretLe f T 0) :

Zero-regret time-average convergence for bounded-slope latencies (corollary of isApproxWardrop_timeAverageFlow_of_lipschitz): at zero external regret (ε = 0), for any nondecreasing L-Lipschitz latencies on [0, ∞), the time-averaged flow is an exact Wardrop equilibrium.

Per-day (1 - δ)-fraction convergence (Section 4.7, pp. 97–98) #

theorem Cslib.GameTheory.NonatomicCongestionGame.isWardrop_of_hasAvgRegretLe_zero {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] {L : ℝ} (hL : 0 ≤ L) (hm : ∀ (e : E), MonotoneOn (G.latency e) (Set.Ici 0)) (hlip : ∀ (e : E) (x y : ℝ), 0 ≤ x → x ≤ y → G.latency e y - G.latency e x ≤ L * (y - x)) {f : ℕ → P → ℝ} {T : ℕ} (hT : 0 < T) (hreg : G.HasAvgRegretLe f T 0) {t : ℕ} (ht : t < T) :
G.IsWardrop (f t)

Zero-regret daily convergence for bounded-slope latencies: at zero average external regret (ε = 0), for any nondecreasing L-Lipschitz latencies on [0, ∞), every daily flow f t (t < T) is an exact Wardrop equilibrium.

theorem Cslib.GameTheory.NonatomicCongestionGame.card_isApproxWardrop_ge_of_lipschitz {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] {L : ℝ} (hL : 0 ≤ L) (hm : ∀ (e : E), MonotoneOn (G.latency e) (Set.Ici 0)) (hlip : ∀ (e : E) (x y : ℝ), 0 ≤ x → x ≤ y → G.latency e y - G.latency e x ≤ L * (y - x)) {f : ℕ → P → ℝ} {T : ℕ} (hT : 0 < T) {ε η : ℝ} (hη : 0 < η) (hreg : G.HasAvgRegretLe f T ε) :
1 - (ε + (4 * ∑ p : P, f 0 p) * √(↑(Fintype.card E) * L * ε)) / η ≤ ↑{t ∈ Finset.range T | G.IsApproxWardrop η (f t)}.card / ↑T

Per-day approximate Wardrop fraction bound ([BM07b], Section 4.7, pp. 97–98): for nondecreasing L-Lipschitz latencies on [0, ∞) (L ≥ 0), average external regret at most ε over T > 0 days, and any threshold η > 0, at least a 1 - (ε + 4 * (∑ p, f 0 p) * √(|E| * L * ε)) / η fraction of days t < T have f t η-Wardrop.

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

The finite set of paths whose latency under f exceeds the latency of every path (in particular, the best path) by at most β.

@[simp]
theorem Cslib.GameTheory.NonatomicCongestionGame.mem_approxBestPaths {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} :
p ∈ G.approxBestPaths β f ↔ ∀ (q : P), G.pathLatency f p ≤ G.pathLatency f q + β
theorem Cslib.GameTheory.NonatomicCongestionGame.sum_within_excessLatency_ge_of_isApproxWardrop_unit {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] {G : NonatomicCongestionGame Unit P E} (hr : G.rate () = 1) {η β : ℝ} (hβ : 0 < β) {f : P → ℝ} (hf : G.IsApproxWardrop η f) :
1 - η / β ≤ ∑ p ∈ G.approxBestPaths β f, f p

User-fraction latency bound on an η-Wardrop day ([BM07b], Section 4.7, p. 97): in a single-commodity unit-rate network (K = Unit, G.rate () = 1), if f is η-Wardrop and β > 0, then at least a 1 - η / β fraction of users traverse a path in G.approxBestPaths β f.

theorem Cslib.GameTheory.NonatomicCongestionGame.card_daily_user_approx_wardrop_ge_of_lipschitz {P : Type u_2} {E : Type u_3} [Fintype P] [DecidableEq E] [Fintype E] {G : NonatomicCongestionGame Unit P E} (hr : G.rate () = 1) {L : ℝ} (hL : 0 ≤ L) (hm : ∀ (e : E), MonotoneOn (G.latency e) (Set.Ici 0)) (hlip : ∀ (e : E) (x y : ℝ), 0 ≤ x → x ≤ y → G.latency e y - G.latency e x ≤ L * (y - x)) {f : ℕ → P → ℝ} {T : ℕ} (hT : 0 < T) {ε δ : ℝ} (hδ : 0 < δ) (hδ3 : ε + 4 * √(↑(Fintype.card E) * L * ε) ≤ δ ^ 3) (hreg : G.HasAvgRegretLe f T ε) :
1 - δ ≤ ↑{t ∈ Finset.range T | 1 - δ ≤ ∑ p ∈ G.approxBestPaths δ (f t), f t p}.card / ↑T

Per-day (1 - δ)-of-days, (1 - δ)-of-users convergence to approximate Wardrop equilibrium ([BM07b], Section 4.7, pp. 97–98, following Blum, Even-Dar and Ligett, 2006): in a single-commodity unit-rate network with nondecreasing L-Lipschitz latencies on [0, ∞) (L ≥ 0), if daily feasible flows f 0, …, f (T - 1) have average external regret at most ε (T > 0), then for every δ > 0 satisfying ε + 4 * √(|E| * L * ε) ≤ δ ^ 3, at least a 1 - δ fraction of days t < T have the property that at least a 1 - δ fraction of users on day t experience travel time at most δ larger than the best path for day t.