Competitive Paging Algorithms II: Algorithm EATR Is 3/2-Competitive for Two ServersResearch Paper
Motivation
Paging is the problem of managing a two-level memory: a fast cache holding pages and a slow memory holding the rest. When a requested page is not in the cache (a page fault), it must be brought in and, if the cache is full, some page must be evicted. An on-line paging algorithm decides which page to evict without knowing future requests. Sleator and Tarjan (CACM 1985) compared on-line algorithms with the optimal off-line algorithm on every request sequence and showed that the best deterministic algorithms (LRU, FIFO) lose a factor of exactly , and that no deterministic on-line algorithm does better.
Randomization changes this picture. Fiat, Karp, Luby, McGeoch, Sleator and Young (J. Algorithms 1991; arXiv:cs/0205038) showed that the randomized marking algorithm is -competitive, where , and that no randomized algorithm is better than -competitive. For the marking algorithm does not reach , already for and . For two servers the same paper gives a different algorithm, EATR ("end after twice requested"), and proves it -competitive. Since , EATR is strongly competitive for : no randomized algorithm has a smaller competitive factor. This mission formalizes that result.
Timeline:
- 1985: Sleator and Tarjan, deterministic paging: factor , and is optimal.
- 1988: Karlin, Manasse, Rudolph and Sleator introduce the term competitive (Algorithmica 3:79–119); Manasse, McGeoch and Sleator formulate the -server problem and extend competitiveness to randomized algorithms (J. Algorithms 1990).
- 1991: Fiat et al.: the marking algorithm is -competitive, the lower bound , and EATR is -competitive for .
- 1991: McGeoch and Sleator give an -competitive algorithm for every (Algorithmica 6, 1991; reference [12] of the paper).
Setting
The uniform -server problem has a finite set of vertices, any two distinct vertices at distance , and two servers. A request sequence is a list of vertices; each request must be covered by a server when it is served, and the cost is the number of server moves. This is paging with a cache of two pages: vertices are pages and the covered vertices are the cache.
A deterministic algorithm has a cost ; a randomized algorithm has an expected cost , averaged over its random choices. is -competitive if there is a constant such that for every request sequence and every deterministic algorithm (on-line or off-line),
Algorithm EATR. The servers start on the vertices and . The algorithm divides into phases; the first phase starts at the first request to a vertex other than and . Let be the set of vertices occupied by the servers at the end of the previous phase ( before the first phase). During a phase, a vertex is clean if it is not in and has not been requested during this phase; a vertex is stale if it is neither clean nor the most recently requested vertex . EATR keeps one server on and the other uniformly at random on the stale set. When a stale vertex is requested, the servers are placed on and and the phase ends; the next phase starts at the next request to a vertex not covered by a server. Requests between phases, and repeated requests to , move nothing.
For a phase, denotes the number of clean vertices requested in it. For a deterministic algorithm , and denote the numbers of 's servers that do not coincide with any of EATR's servers at the beginning and at the end of the phase. An algorithm is lazy if it moves no server on a request to a covered vertex and exactly one server on a request to an uncovered one.
Formalization targets
Goal: Theorem 3
With the optimal off-line cost of serving from the servers' starting position , there is a constant such that for all
The constant is left free; the factor is the paper's and is optimal.
Milestones, in the order of the proof
- Laziness (p. 4): every deterministic algorithm is dominated by a lazy one (a published theorem, reused).
- Adversary bound for structured phases (p. 5): in a complete EATR phase with clean requests, a lazy pays at least .
- Stale set before the terminating request (p. 6): it has elements, each covered with probability .
- Expected cost of a phase to EATR (p. 6): exactly .
- Per-phase ratio (p. 6): EATR's expected phase cost is at most , since .
Significance
The result. Theorem 3 settles the randomized competitive ratio of paging with two cache slots: combined with the paper's lower bound (Corollary 5, the subject of a companion mission), the optimal factor for is exactly , against for every deterministic algorithm. The general case was settled later by McGeoch and Sleator's -competitive partitioning algorithm, which is considerably more complicated.
Formalizing it. The result has been proved since 1991; no machine-checked proof of it is on the platform (a search for EATR, randomized paging and two-server results on 2026-09-26 found only deterministic -server theorems). The mission produces a formal model of a randomized on-line algorithm as a probability distribution over states evolving with the request sequence, a formal treatment of the phase decomposition and of the telescoping amortization that relates expected on-line cost to the optimal off-line cost, and a first strongly competitive randomized paging result on the platform, alongside the deterministic -server results already there.
Difficulty
The per-phase computations are short. The main difficulty is the global accounting. The adversary's cost in a phase is bounded only in amortized form, , where and compare the adversary's servers with EATR's at the phase boundaries; the bound becomes a statement about only after the and terms telescope across phases. This needs care with the requests that lie outside every phase (before the first phase, between phases, and in an unfinished last phase), during which the adversary may move. A further difficulty is that the off-line optimum ranges over arbitrary schedules, which may move several servers on one request, while the phase bound is proved for lazy on-line algorithms: the reduction from one to the other must be made explicit. Finally, the uniform law of the stale server is an invariant of a Markov chain on states that must be tracked through the whole phase.
Formalization scope
The vertices are an abstract metric space with an enumeration , , and the hypothesis that distinct points are at distance ; the metric of is not used. The starting vertices are . is KServer.offlineCost of the published KServer model: the infimum of total movement over all schedules serving from . Comparing with this infimum covers every deterministic starting from EATR's position; a starting elsewhere differs by at most , which the constant absorbs. The constant is quantified before .
EATR is a PMF over states: a deterministic record (the set , whether a phase is in progress, the last requested vertex, the vertices requested in the phase) and the random position of the second server. Its expected cost is the expected number of server moves, summed over the requests. The paper fixes only that the second server is uniform on the stale set; when a clean request enlarges the stale set, the formalization moves one server by a fixed coupling that keeps the law uniform, and this choice is stated in the definition. A formalization that defines EATR's expected cost by the closed formula of the proof, or that restricts to complete phases, would make the goal a different statement; neither is done here. The pre-phase prefix and an unfinished last phase belong to and are covered by the constant.
Needed infrastructure: finite probability distributions (Mathlib's PMF), the published KServer model and its laziness theorem, and bookkeeping lemmas on the deterministic phase record. The phase record and the amortization argument are reusable for the marking algorithm of the companion mission. Proofs of any milestone, and alternative decompositions of the goal, are welcome.
Selected references
- A. Fiat, R. M. Karp, M. Luby, L. A. McGeoch, D. D. Sleator, N. E. Young, Competitive Paging Algorithms, Journal of Algorithms 12(4):685–699, 1991. https://doi.org/10.1016/0196-6774(91)90041-V ; arXiv:cs/0205038v1, https://arxiv.org/abs/cs/0205038
- D. D. Sleator, R. E. Tarjan, Amortized Efficiency of List Update and Paging Rules, Communications of the ACM 28(2):202–208, 1985. https://doi.org/10.1145/2786.2793
- M. S. Manasse, L. A. McGeoch, D. D. Sleator, Competitive Algorithms for Server Problems, Journal of Algorithms 11(2):208–230, 1990. https://doi.org/10.1016/0196-6774(90)90003-W
- L. A. McGeoch, D. D. Sleator, A Strongly Competitive Randomized Paging Algorithm, Algorithmica 6:816–825, 1991 (reference [12] of the paper).
- A. R. Karlin, M. S. Manasse, L. Rudolph, D. D. Sleator, Competitive Snoopy Caching, Algorithmica 3(1):79–119, 1988 (reference [9] of the paper).