Documentation

CslibFrontier.GameTheory.LoadBalancing.Basic

Selfish load-balancing games (Koutsoupias–Papadimitriou model) #

In a selfish load-balancing game ([KP99]; [Voc07]), a finite set ι of selfish tasks (jobs) each choose one machine from a finite set M. Each job pays the total load of the machine it selects, while the social objective is the makespan (the maximum machine load).

This module defines two standard machine models:

Both models embed into Cslib.GameTheory.CostGame via toCostGame, so pure Nash equilibria (CostGame.IsPureNash), improvement steps (CostGame.Improves), the finite improvement property (CostGame.HasFIP), and mixed Nash equilibria (CostGame.IsMixedNash) are inherited directly from CslibFrontier.GameTheory.Strategic. Note that CostGame.socialCost is the sum of player costs, whereas the Koutsoupias–Papadimitriou social cost is makespan (for pure assignments) and expected makespan (for mixed profiles, in CslibFrontier.GameTheory.LoadBalancing.MixedNash).

Main definitions #

Main results #

References #

structure Cslib.GameTheory.UnrelatedLoadBalancingGame (ι : Type u_1) (M : Type u_2) :
Type (max u_1 u_2)

A selfish load-balancing game on unrelated machines: job i : ι has nonnegative processing time procTime i j on machine j : M.

  • procTime : ι → M → ℝ

    The processing time (load contribution) of job i on machine j.

  • procTime_nonneg (i : ι) (j : M) : 0 ≤ self.procTime i j

    Processing times are nonnegative.

def Cslib.GameTheory.UnrelatedLoadBalancingGame.load {ι : Type u_1} {M : Type u_2} [Fintype ι] [DecidableEq M] (U : UnrelatedLoadBalancingGame ι M) (A : ι → M) (j : M) :

The load of machine j under pure assignment A: the sum of processing times of all jobs assigned to j.

The strategic cost game induced by U: each job pays the load of its chosen machine.

theorem Cslib.GameTheory.UnrelatedLoadBalancingGame.load_nonneg {ι : Type u_1} {M : Type u_2} [Fintype ι] [DecidableEq M] (U : UnrelatedLoadBalancingGame ι M) (A : ι → M) (j : M) :
0 ≤ U.load A j
theorem Cslib.GameTheory.UnrelatedLoadBalancingGame.procTime_le_load {ι : Type u_1} {M : Type u_2} [Fintype ι] [DecidableEq M] (U : UnrelatedLoadBalancingGame ι M) (A : ι → M) (i : ι) :
U.procTime i (A i) ≤ U.load A (A i)
theorem Cslib.GameTheory.UnrelatedLoadBalancingGame.load_update {ι : Type u_1} {M : Type u_2} [Fintype ι] [DecidableEq M] (U : UnrelatedLoadBalancingGame ι M) [DecidableEq ι] (A : ι → M) (i : ι) (k j : M) :
U.load (Function.update A i k) j = (U.load A j - if A i = j then U.procTime i j else 0) + if k = j then U.procTime i j else 0

Load of a machine after moving job i to machine k.

theorem Cslib.GameTheory.UnrelatedLoadBalancingGame.load_update_of_ne {ι : Type u_1} {M : Type u_2} [Fintype ι] [DecidableEq M] (U : UnrelatedLoadBalancingGame ι M) [DecidableEq ι] (A : ι → M) (i : ι) {k : M} (hk : k ≠ A i) :
U.load (Function.update A i k) k = U.load A k + U.procTime i k

Load of the target machine k ≠ A i after moving job i to k.

theorem Cslib.GameTheory.UnrelatedLoadBalancingGame.load_update_self_of_ne {ι : Type u_1} {M : Type u_2} [Fintype ι] [DecidableEq M] (U : UnrelatedLoadBalancingGame ι M) [DecidableEq ι] (A : ι → M) (i : ι) {k : M} (hk : k ≠ A i) :
U.load (Function.update A i k) (A i) = U.load A (A i) - U.procTime i (A i)

Load of the vacated machine A i after moving job i to k ≠ A i.

theorem Cslib.GameTheory.UnrelatedLoadBalancingGame.load_update_other {ι : Type u_1} {M : Type u_2} [Fintype ι] [DecidableEq M] (U : UnrelatedLoadBalancingGame ι M) [DecidableEq ι] (A : ι → M) (i : ι) {k j : M} (h1 : j ≠ A i) (h2 : j ≠ k) :
U.load (Function.update A i k) j = U.load A j

Load of any machine unaffected by moving job i to k.

theorem Cslib.GameTheory.UnrelatedLoadBalancingGame.isPureNash_iff {ι : Type u_1} {M : Type u_2} [Fintype ι] [DecidableEq M] (U : UnrelatedLoadBalancingGame ι M) [DecidableEq ι] (A : ι → M) :
U.toCostGame.IsPureNash A ↔ ∀ (i : ι) (k : M), k ≠ A i → U.load A (A i) ≤ U.load A k + U.procTime i k

Pure Nash equilibrium characterization on unrelated machines: no job can strictly reduce its machine's load by unilaterally moving to another machine.

The makespan (social cost) of assignment A: the maximum machine load.

The optimal makespan OPT(U): the minimum makespan over all pure assignments.

theorem Cslib.GameTheory.UnrelatedLoadBalancingGame.load_le_makespan {ι : Type u_1} {M : Type u_2} [Fintype ι] [DecidableEq M] (U : UnrelatedLoadBalancingGame ι M) [Fintype M] [Nonempty M] (A : ι → M) (j : M) :
U.load A j ≤ U.makespan A
theorem Cslib.GameTheory.UnrelatedLoadBalancingGame.makespan_le_iff {ι : Type u_1} {M : Type u_2} [Fintype ι] [DecidableEq M] (U : UnrelatedLoadBalancingGame ι M) [Fintype M] [Nonempty M] (A : ι → M) {B : ℝ} :
U.makespan A ≤ B ↔ ∀ (j : M), U.load A j ≤ B
theorem Cslib.GameTheory.UnrelatedLoadBalancingGame.exists_load_eq_makespan {ι : Type u_1} {M : Type u_2} [Fintype ι] [DecidableEq M] (U : UnrelatedLoadBalancingGame ι M) [Fintype M] [Nonempty M] (A : ι → M) :
∃ (j : M), U.load A j = U.makespan A
structure Cslib.GameTheory.LoadBalancingGame (ι : Type u_1) (M : Type u_2) :
Type (max u_1 u_2)

A selfish load-balancing game on uniformly related machines ([KP99]; [Voc07]): job i : ι has nonnegative weight weight i, machine j : M has positive speed speed j, and assigning job i to machine j adds weight i / speed j to machine j's load.

  • weight : ι → ℝ

    The weight (size) of job i.

  • speed : M → ℝ

    The speed of machine j.

  • weight_nonneg (i : ι) : 0 ≤ self.weight i

    Every job has nonnegative weight.

  • speed_pos (j : M) : 0 < self.speed j

    Every machine has positive speed.

def Cslib.GameTheory.LoadBalancingGame.identical {ι : Type u_1} {M : Type u_2} (weight : ι → ℝ) (weight_nonneg : ∀ (i : ι), 0 ≤ weight i) :

Construct a load-balancing game on identical machines (all speeds equal to 1).

Predicate asserting that all machines are identical (have unit speed 1).

theorem Cslib.GameTheory.LoadBalancingGame.isIdentical_identical {ι : Type u_1} {M : Type u_2} (weight : ι → ℝ) (weight_nonneg : ∀ (i : ι), 0 ≤ weight i) :
(identical weight weight_nonneg).IsIdentical

View a uniformly related load-balancing game as an unrelated load-balancing game with processing times weight i / speed j.

noncomputable def Cslib.GameTheory.LoadBalancingGame.load {ι : Type u_1} {M : Type u_2} [Fintype ι] [DecidableEq M] (G : LoadBalancingGame ι M) (A : ι → M) (j : M) :

The load of machine j under assignment A: (∑ i with A i = j, weight i) / speed j = ∑ i with A i = j, weight i / speed j.

noncomputable def Cslib.GameTheory.LoadBalancingGame.toCostGame {ι : Type u_1} {M : Type u_2} [Fintype ι] [DecidableEq M] (G : LoadBalancingGame ι M) :
CostGame ι fun (x : ι) => M

The strategic cost game induced by G: each job pays the load of its chosen machine.

theorem Cslib.GameTheory.LoadBalancingGame.load_eq_sum_div {ι : Type u_1} {M : Type u_2} [Fintype ι] [DecidableEq M] (G : LoadBalancingGame ι M) (A : ι → M) (j : M) :
G.load A j = (∑ i : ι with A i = j, G.weight i) / G.speed j
theorem Cslib.GameTheory.LoadBalancingGame.load_nonneg {ι : Type u_1} {M : Type u_2} [Fintype ι] [DecidableEq M] (G : LoadBalancingGame ι M) (A : ι → M) (j : M) :
0 ≤ G.load A j
theorem Cslib.GameTheory.LoadBalancingGame.weight_div_speed_le_load {ι : Type u_1} {M : Type u_2} [Fintype ι] [DecidableEq M] (G : LoadBalancingGame ι M) (A : ι → M) (i : ι) :
G.weight i / G.speed (A i) ≤ G.load A (A i)
theorem Cslib.GameTheory.LoadBalancingGame.speed_mul_load {ι : Type u_1} {M : Type u_2} [Fintype ι] [DecidableEq M] (G : LoadBalancingGame ι M) (A : ι → M) (j : M) :
G.speed j * G.load A j = ∑ i : ι with A i = j, G.weight i
theorem Cslib.GameTheory.LoadBalancingGame.sum_speed_mul_load {ι : Type u_1} {M : Type u_2} [Fintype ι] [DecidableEq M] (G : LoadBalancingGame ι M) [Fintype M] (A : ι → M) :
∑ j : M, G.speed j * G.load A j = ∑ i : ι, G.weight i

Total speed-weighted load equals total job weight: ∑ j, speed j * load A j = ∑ i, weight i.

theorem Cslib.GameTheory.LoadBalancingGame.IsIdentical.sum_load {ι : Type u_1} {M : Type u_2} [Fintype ι] [DecidableEq M] [Fintype M] {G : LoadBalancingGame ι M} (hId : G.IsIdentical) (A : ι → M) :
∑ j : M, G.load A j = ∑ i : ι, G.weight i

On identical machines, the machine loads sum to the total job weight.

theorem Cslib.GameTheory.LoadBalancingGame.load_update_of_ne {ι : Type u_1} {M : Type u_2} [Fintype ι] [DecidableEq M] (G : LoadBalancingGame ι M) [DecidableEq ι] (A : ι → M) (i : ι) {k : M} (hk : k ≠ A i) :
G.load (Function.update A i k) k = G.load A k + G.weight i / G.speed k
theorem Cslib.GameTheory.LoadBalancingGame.load_update_self_of_ne {ι : Type u_1} {M : Type u_2} [Fintype ι] [DecidableEq M] (G : LoadBalancingGame ι M) [DecidableEq ι] (A : ι → M) (i : ι) {k : M} (hk : k ≠ A i) :
G.load (Function.update A i k) (A i) = G.load A (A i) - G.weight i / G.speed (A i)
theorem Cslib.GameTheory.LoadBalancingGame.load_update_other {ι : Type u_1} {M : Type u_2} [Fintype ι] [DecidableEq M] (G : LoadBalancingGame ι M) [DecidableEq ι] (A : ι → M) (i : ι) {k j : M} (h1 : j ≠ A i) (h2 : j ≠ k) :
G.load (Function.update A i k) j = G.load A j
theorem Cslib.GameTheory.LoadBalancingGame.isPureNash_iff {ι : Type u_1} {M : Type u_2} [Fintype ι] [DecidableEq M] (G : LoadBalancingGame ι M) [DecidableEq ι] (A : ι → M) :
G.toCostGame.IsPureNash A ↔ ∀ (i : ι) (k : M), k ≠ A i → G.load A (A i) ≤ G.load A k + G.weight i / G.speed k

Pure Nash equilibrium characterization ([Voc07], §20.1.1, Proposition 20.2, p. 519): an assignment A is a pure Nash equilibrium if and only if no job i can strictly lower its load by switching to another machine k.

theorem Cslib.GameTheory.LoadBalancingGame.isPureNash_load_le {ι : Type u_1} {M : Type u_2} [Fintype ι] [DecidableEq M] [DecidableEq ι] {G : LoadBalancingGame ι M} {A : ι → M} (hA : G.toCostGame.IsPureNash A) (i : ι) (k : M) :
G.load A (A i) ≤ G.load A k + G.weight i / G.speed k

Unconditional pure Nash inequality: for every job i and machine k (including k = A i), load A (A i) ≤ load A k + weight i / speed k.

noncomputable def Cslib.GameTheory.LoadBalancingGame.makespan {ι : Type u_1} {M : Type u_2} [Fintype ι] [DecidableEq M] (G : LoadBalancingGame ι M) [Fintype M] [Nonempty M] (A : ι → M) :

The makespan (social cost) of assignment A: the maximum load over all machines.

noncomputable def Cslib.GameTheory.LoadBalancingGame.optMakespan {ι : Type u_1} {M : Type u_2} [Fintype ι] [DecidableEq M] (G : LoadBalancingGame ι M) [Fintype M] [Nonempty M] [DecidableEq ι] :

The optimal makespan OPT(G) ([Voc07], §20.1.3, Definition 20.4, pp. 521–522): the minimum makespan over all pure assignments.

theorem Cslib.GameTheory.LoadBalancingGame.load_le_makespan {ι : Type u_1} {M : Type u_2} [Fintype ι] [DecidableEq M] (G : LoadBalancingGame ι M) [Fintype M] [Nonempty M] (A : ι → M) (j : M) :
G.load A j ≤ G.makespan A
theorem Cslib.GameTheory.LoadBalancingGame.makespan_le_iff {ι : Type u_1} {M : Type u_2} [Fintype ι] [DecidableEq M] (G : LoadBalancingGame ι M) [Fintype M] [Nonempty M] (A : ι → M) {B : ℝ} :
G.makespan A ≤ B ↔ ∀ (j : M), G.load A j ≤ B
theorem Cslib.GameTheory.LoadBalancingGame.makespan_nonneg {ι : Type u_1} {M : Type u_2} [Fintype ι] [DecidableEq M] (G : LoadBalancingGame ι M) [Fintype M] [Nonempty M] (A : ι → M) :
theorem Cslib.GameTheory.LoadBalancingGame.exists_load_eq_makespan {ι : Type u_1} {M : Type u_2} [Fintype ι] [DecidableEq M] (G : LoadBalancingGame ι M) [Fintype M] [Nonempty M] (A : ι → M) :
∃ (j : M), G.load A j = G.makespan A
theorem Cslib.GameTheory.LoadBalancingGame.sum_weight_le_sum_speed_mul_makespan {ι : Type u_1} {M : Type u_2} [Fintype ι] [DecidableEq M] (G : LoadBalancingGame ι M) [Fintype M] [Nonempty M] (A : ι → M) :
∑ i : ι, G.weight i ≤ (∑ j : M, G.speed j) * G.makespan A

Volume lower bound: total job weight is at most (∑ j, speed j) * makespan A.

Volume lower bound against the optimum: ∑ i, weight i ≤ (∑ j, speed j) * optMakespan.

On identical machines, total job weight is at most |M| * optMakespan.

theorem Cslib.GameTheory.LoadBalancingGame.weight_div_speed_le_makespan {ι : Type u_1} {M : Type u_2} [Fintype ι] [DecidableEq M] (G : LoadBalancingGame ι M) [Fintype M] [Nonempty M] (A : ι → M) (i : ι) :
G.weight i / G.speed (A i) ≤ G.makespan A

Single-job lower bound: weight i / speed (A i) ≤ makespan A.

On identical machines, every job's weight is at most optMakespan.

When optMakespan = 0, every job has weight 0.

When some job i has strictly positive weight, 0 < optMakespan.

theorem Cslib.GameTheory.LoadBalancingGame.makespan_eq_zero_of_optMakespan_eq_zero {ι : Type u_1} {M : Type u_2} [Fintype ι] [DecidableEq M] (G : LoadBalancingGame ι M) [Fintype M] [Nonempty M] [DecidableEq ι] (hopt0 : G.optMakespan = 0) (A : ι → M) :
G.makespan A = 0

When optMakespan = 0, every assignment has makespan 0.