Double Coverage is k-competitive on the line #
This file proves the theorem of Chrobak, Karloff, Payne and Vishwanathan, New results on server
problems: the Double Coverage algorithm for k servers on
the line is k-competitive. Together with the general lower bound
(CslibFrontier.DataStructure.KServer.LowerBound) this settles the deterministic competitive ratio
of the k-server problem on the line: from any start with distinct servers it is exactly k,
with an additive constant depending on the start. Double Coverage is not competitive with one
additive constant for all starts (IsCompetitive). The proof is the standard
potential-function argument for this algorithm (see also Borodin and El-Yaniv, Online
Computation and Competitive Analysis, Chapter 10). The line is usually taken
to be the real line; here the points are integers, which keeps distances natural numbers.
The algorithm #
Double Coverage (dcStep) serves a request r on the line ℤ with k = n + 1 servers as
follows. If r lies left of all servers, the leftmost server moves to r; symmetrically on the
right. Otherwise let a, b be the nearest servers with s a ≤ r < s b. Both move toward r by
min (r - s a) (s b - r), so one of them reaches r. A request on a server costs nothing. When
several servers share a position, only one of them moves. The implementation sorts the
configuration (Tuple.sort), applies the sorted rule dcSorted and undoes the sort, so labels
are preserved.
Potential function #
With M_min the minimum-cost matching between the Double Coverage and offline configurations
(matchCost) and Σ_{i<j} |s_i - s_j| the pairwise spread, the potential is
Φ = k * M_min + Σ_{i<j} |s_i - s_j|. We use the doubled potential
2 * Φ = 2 * k * matchCost + pairSum, since pairSum counts ordered pairs. Then each request
satisfies 2 * cost_DC + Δ(2 * Φ) ≤ 2 * k * cost_OPT (dcStep_amortized_offline).
- Outer request. One server moves
d. The matching distance drops byd, by uncrossing an optimal matching onto the moving server. The spread grows by(k - 1) * d. - Inner request. Two servers move
dtoward each other. The matching distance does not grow, because one of the two is matched towardrafter uncrossing. The spread drops by2 * d. - Offline move. The matching distance grows by at most the offline movement.
Main definitions #
Cslib.DataStructure.KServer.dcSorted: Double Coverage on a sorted configuration.Cslib.DataStructure.KServer.dcStep: Double Coverage on an arbitrary configuration.Cslib.DataStructure.KServer.doubleCoverage: the Double CoverageOnline.DetStrategy.
Main results #
dcStep_amortized_offline: the doubled amortized step inequality.doubleCoverage_cost_le:cost_DC ≤ k * cost_OPT + k * matchCost s₀ s_off + pairSum s₀ / 2, for any offline schedule from any starts_off.doubleCoverage_isCompetitiveFrom: Double Coverage isk-competitive from every initial configurations₀, with additive constantpairSum s₀ / 2 = Σ_{i<j} |s₀ i - s₀ j|.
References #
Double Coverage on a sorted configuration #
Double Coverage on a sorted configuration of n + 1 servers. With c servers at or left of
r: if c = 0 the leftmost server moves to r, if c = n + 1 the rightmost does, and otherwise
servers c - 1 and c move toward r by min (r - t (c - 1)) (t c - r).
The amortized step inequality #
The doubled amortized step inequality when the offline configuration o already covers the
request: 2 * cost_DC + Δ(2 * k * matchCost + pairSum) ≤ 0.
The doubled amortized step inequality: if the offline schedule moves from o to o' to serve
r, then 2 * cost_DC + Δ(2 * Φ) ≤ 2 * k * cost_OPT for 2 * Φ = 2 * k * matchCost + pairSum.
The strategy and its competitive ratio #
The Double Coverage strategy for n + 1 servers on the integer line.
Telescoped doubled potential bound for Double Coverage from configuration s, against any
valid offline schedule from s_off.
Chrobak–Karloff–Payne–Vishwanathan. With k = n + 1 servers on the line, Double
Coverage from s₀ costs at most k times any valid offline schedule from any s_off, plus
k * matchCost s₀ s_off + Σ_{i<j} |s₀ i - s₀ j|.
Chrobak–Karloff–Payne–Vishwanathan. Double Coverage with k = n + 1 servers on the line
is k-competitive from every initial configuration s₀, with additive constant
pairSum s₀ / 2 = Σ_{i<j} |s₀ i - s₀ j|.
Double Coverage's cost on a nonempty request sequence: the first step plus the rest.