Documentation

CslibFrontier.DataStructure.KServer.LowerBound

Deterministic lower bound k for the k-server problem #

This file proves the deterministic lower bound of Manasse, McGeoch and Sleator, Competitive algorithms for server problems (Theorem 6 with h = k, and Corollary 7): on any metric space with at least k + 1 points, no deterministic online k-server algorithm is c-competitive for any c < k, whatever the additive constant. More generally no rational ratio p / q < k is achievable (exists_ratio_violation). The argument follows the source proof: a lazy online algorithm, its nemesis request sequence, and an ensemble of offline algorithms whose average cost is a 1 / k fraction of the online cost. The source theorem also compares against h < k offline servers, giving k / (k - h + 1); that case is not formalized. See also Borodin and El-Yaniv, Online Computation and Competitive Analysis, Chapter 10.

Proof structure #

  1. Lazy normalization (lazify, cost_lazify_le). Any online strategy A can be simulated by one that moves at most one server per request, and only when the request is uncovered. By the triangle inequality this never costs more than A.
  2. Adversary. Fix k + 1 points S (the initial k distinct positions and one more point z). The adversary always requests the unique point of S not covered by the lazy simulation. The simulation then pays exactly the length of the request path, and at least 1 per request (lazy_costFrom_ge).
  3. Shadow schedules (shadowStates, exists_shadow_le). For each initial server position there is an offline schedule that keeps exactly that point of S uncovered after the first request. When it must serve its hole it moves the server sitting on the previous request. Summed over the k holes, these schedules pay the path length once, plus the initial distances to z (sum_holeCost). So the cheapest pays at most a 1 / k fraction.

Main definitions #

Main results #

References #

Lazy normalization #

noncomputable def Cslib.DataStructure.KServer.lazyNext {α : Type} {k : ℕ} (c a : Fin k → α) (r : α) :
Fin k → α

One lazy response at current configuration c when the simulated strategy is at a: stay if r is covered, otherwise move the server whose label covers r in a.

theorem Cslib.DataStructure.KServer.lazyNext_spec {α : Type} {k : ℕ} (c a : Fin k → α) (r : α) (ha : ∃ (j : Fin k), a j = r) :
(∃ (i : Fin k), lazyNext c a r i = r) ∧ (lazyNext c a r = c ∨ ∃ (j : Fin k), a j = r ∧ lazyNext c a r = Function.update c j r)
theorem Cslib.DataStructure.KServer.moveCost_lazyNext_add_le {α : Type} (M : NatMetric α) {k : ℕ} (c a a' : Fin k → α) (r : α) (ha : ∃ (j : Fin k), a' j = r) :
moveCost M c (lazyNext c a' r) + moveCost M (lazyNext c a' r) a' ≤ moveCost M c a + moveCost M a a'

One lazy step costs no more than following the simulated strategy, measured with the distance between the two configurations as a potential.

Lazy normalization of an online strategy: simulate A and move at most one server per request, only when the request is uncovered.

theorem Cslib.DataStructure.KServer.cost_lazify_le {α : Type} (M : NatMetric α) {k : ℕ} (A : Online.DetStrategy (problem M k)) (s₀ : Fin k → α) (reqs : List α) :
(lazify M A).cost s₀ reqs ≤ A.cost s₀ reqs

The lazy simulation never costs more than the original strategy.

Offline shadow schedules #

def Cslib.DataStructure.KServer.relocate {α : Type} {k : ℕ} [DecidableEq α] (s : Fin k → α) (x y : α) :
Fin k → α

Move every server located at x to y.

def Cslib.DataStructure.KServer.shadowStates {α : Type} {k : ℕ} [DecidableEq α] (s : Fin k → α) (q : α) :
List α → List (Fin k → α)

Shadow schedule: stay when the request is covered, otherwise move the server at the previous request q to the new request.

def Cslib.DataStructure.KServer.holeCost {α : Type} (M : NatMetric α) [DecidableEq α] (h q : α) :
List α → ℕ

Cost of the shadow schedule whose uncovered point is h, after previous request q.

def Cslib.DataStructure.KServer.pathLen {α : Type} (M : NatMetric α) (q : α) :
List α → ℕ

Length of the path q, r₁, r₂, ….

theorem Cslib.DataStructure.KServer.shadowStates_spec {α : Type} (M : NatMetric α) {k : ℕ} [DecidableEq α] (S : Finset α) {rs : List α} (hrs : ∀ r ∈ rs, r ∈ S) {s : Fin k → α} {h q : α} :
Function.Injective s → (∀ (x : α), (∃ (i : Fin k), s i = x) ↔ x ∈ S ∧ x ≠ h) → q ∈ S → q ≠ h → (problem M k).ValidSchedule s rs (shadowStates s q rs) ∧ (problem M k).scheduleCost s rs (shadowStates s q rs) = holeCost M h q rs

If s covers exactly S \ {h} with distinct servers, and the previous request q lies in S \ {h}, then the shadow schedule is valid on requests from S and costs holeCost h q rs.

theorem Cslib.DataStructure.KServer.sum_holeCost {α : Type} (M : NatMetric α) [DecidableEq α] (S : Finset α) {rs : List α} (hrs : ∀ r ∈ rs, r ∈ S) {q : α} :
q ∈ S → ∑ h ∈ S.erase q, holeCost M h q rs = pathLen M q rs

Summing the shadow costs over all holes gives the path length.

theorem Cslib.DataStructure.KServer.exists_shadow_le {α : Type} (M : NatMetric α) {k : ℕ} [DecidableEq α] {s₀ : Fin k → α} (hs₀ : Function.Injective s₀) {z : α} (hz : ∀ (i : Fin k), s₀ i ≠ z) (hk : 0 < k) {rest : List α} (hrest : ∀ r ∈ rest, r ∈ insert z (Finset.image s₀ Finset.univ)) :
∃ (offStates : List (problem M k).State), (problem M k).ValidSchedule s₀ (z :: rest) offStates ∧ k * (problem M k).scheduleCost s₀ (z :: rest) offStates ≤ ∑ i : Fin k, M.dist (s₀ i) z + pathLen M z rest

Averaging over the k shadow schedules: if the first request is the extra point z and all later requests lie in the (k + 1)-point set, some valid offline schedule costs at most a 1 / k fraction of the request path plus the initial distances to z.

The adversary: request the uncovered point #

The lower bound #

theorem Cslib.DataStructure.KServer.exists_ratio_violation {α : Type} (M : NatMetric α) {k : ℕ} {s₀ : Fin k → α} (hs₀ : Function.Injective s₀) {z : α} (hz : ∀ (i : Fin k), s₀ i ≠ z) (A : Online.DetStrategy (problem M k)) {p q : ℕ} (hpq : p < k * q) (b : ℕ) :
∃ (reqs : List (problem M k).Req) (offStates : List (problem M k).State), (problem M k).ValidSchedule s₀ reqs offStates ∧ p * (problem M k).scheduleCost s₀ reqs offStates + b < q * A.cost s₀ reqs

Manasse–McGeoch–Sleator lower bound, rational form. Let s₀ place the k servers on distinct points and let z be a further point. For every deterministic online strategy A, every rational ratio p / q < k and every additive constant b, some request sequence and valid offline schedule from s₀ satisfy p * OPT + b < q * cost_A.

theorem Cslib.DataStructure.KServer.not_isCompetitiveFrom_of_lt {α : Type} (M : NatMetric α) {k : ℕ} {s₀ : Fin k → α} (hs₀ : Function.Injective s₀) {z : α} (hz : ∀ (i : Fin k), s₀ i ≠ z) (A : Online.DetStrategy (problem M k)) {c : ℕ} (hc : c < k) (b : ℕ) :

Manasse–McGeoch–Sleator lower bound. From k distinct initial positions avoiding some further point, no deterministic online k-server strategy is (c, b)-competitive for c < k.

theorem Cslib.DataStructure.KServer.not_isCompetitive_of_lt {α : Type} (M : NatMetric α) {k : ℕ} {s : Fin (k + 1) → α} (hs : Function.Injective s) (A : Online.DetStrategy (problem M k)) {c : ℕ} (hc : c < k) (b : ℕ) :

On any metric with k + 1 distinct points, no deterministic online k-server strategy is (c, b)-competitive for c < k.

theorem Cslib.DataStructure.KServer.not_isCompetitiveAnyInit_of_lt {α : Type} (M : NatMetric α) {k : ℕ} {s : Fin (k + 1) → α} (hs : Function.Injective s) (A : Online.DetStrategy (problem M k)) {c : ℕ} (hc : c < k) (b : ℕ) :

The lower bound also refutes competitiveness against offline schedules from arbitrary initial configurations.