Motivation
Competitive analysis measures an online algorithm, which must answer each request before seeing the next, against the best off-line answer to the whole request sequence. Randomized online algorithms are often much better than deterministic ones against an oblivious adversary, who fixes the requests in advance; the paging problem is the standard example. Against an adaptive adversary, who sees the algorithm's answers before choosing the next request, the advantage can disappear.
Ben-David, Borodin, Karp, Tardos and Wigderson (Algorithmica 11, 1994; preliminary version STOC 1990) made this precise in an abstract framework of request-answer games. Their Corollary 2.1 says: if a game has a randomized algorithm that is α-competitive against adaptive on-line adversaries and one that is β-competitive against oblivious adversaries, then it has a deterministic α∘β-competitive algorithm. That proof is non-constructive: it goes through a game-theoretic determinacy argument. Section 3 of the paper gives a constructive version. Most competitive analyses of randomized algorithms against adaptive adversaries are carried out with a potential function, in the style of Manasse, McGeoch and Sleator (J. Algorithms 11, 1990). The paper shows that such a potential function, together with any oblivious-competitive algorithm H, determines an explicit deterministic algorithm M, answer by answer. This mission formalizes that construction and its guarantee.
Setting
A request-answer game has a request set R, a finite answer set A and cost functions fn:Rn×An→R. The off-line optimum of r∈Rn is c(r)=mina∈Anfn(r,a). A deterministic online algorithm M is a sequence of maps mi:Ri→A; on r=(r1,…,rn) it answers M(r)=(m1(r1),m2(r1,r2),…,mn(r)), at cost cM(r)=fn(r,M(r)). It is α-competitive if cM(r)≤α(c(r)) for all r. Throughout, α and β are affine maps R→R (the paper's "linear functions").
A randomized online algorithm H is a probability distribution over deterministic algorithms Hy; it is β-competitive against any oblivious adversary if Ey[fn(r,Hy(r))]≤β(c(r)) for all r. The algorithm G analysed by the potential function is described by its next-answer laws gn+1(rrn+1,a) on A, given the requests so far, the new request and its own past answers. An adaptive on-line adversary S chooses each request from the algorithm's past answers and answers it itself, before the algorithm does, for at most dQ rounds; a configuration after n rounds is (r,a,b)∈Rn×An×An: requests, algorithm's answers, adversary's answers.
An augmented potential function for α and G (Definition 3.1) is a family Φn:Rn×An×An→R with (1) Φ0=0; (2) Φn(r,a,b)≤α(fn(r,b))−fn(r,a) for every configuration; (3) Ean+1∼gn+1(rrn+1,a)[Φn+1(rrn+1,aan+1,bbn+1)]≥Φn(r,a,b) for every configuration, every rn+1∈R and every bn+1∈A.
Formalization targets
Goal: Theorem 3.1 (p. 15)
Let Φ be an augmented potential function for α and G, and H a β-competitive algorithm against oblivious adversaries. Say that M obeys the potential rule if for every r∈Rn and r′=rt,
Ey[Φn+1(r′,M(r)mn+1(r′),Hy(r′))] ≥ Ey[Φn(r,M(r),Hy(r))].
Then such an M exists, and every such M satisfies
cM(r)≤α(β(c(r)))for all r.
Both parts are part of the goal: the rule can be followed, and following it guarantees α∘β-competitiveness.
Milestones
- In every play of G against an adaptive on-line adversary, the expected final potential is nonnegative (proof of Lemma 3.1).
- Lemma 3.1, "if" direction: an augmented potential function for α and G makes G α-competitive against any adaptive on-line adversary, E[cG(S)]≤E[α(cS(G))].
- For every r, t and every a∈An, some a′∈A satisfies Ey[Φn+1(rt,aa′,Hy(rt))]≥Ey[Φn(r,a,Hy(r))].
- If M obeys the rule, Ey[Φn(r,M(r),Hy(r))]≥0 for every r.
- If M obeys the rule, fn(r,M(r))≤Ey[α(fn(r,Hy(r)))] for every r: M is α-competitive against the randomized adaptive adversary that serves its requests with H.
Significance
The theorem turns two separate analyses into one deterministic algorithm with an explicit description. The potential function certifies G against the strongest on-line adversary; the oblivious algorithm H need not be related to G, and the paper remarks that H may be G itself. The next answer of M is computable whenever the expected potential under H is (Corollary 3.1, stated informally in the paper), and the paper notes that for the potential functions used in the K-server literature this expectation is computable in time polynomial in the number of nodes and K. Read in this light, a potential-function proof for a randomized algorithm doubles as a deterministic algorithm.
The result is proved in the paper. As far as is known, neither this theorem nor the abstract framework of request-answer games with adaptive adversaries has a machine-checked formalization. The mission produces that framework and a checked derandomization principle that applies to every request-answer game with real costs, not to one problem.
Difficulty
The obvious argument for the existence of mn+1(r′) averages property (3) of Φ; the work is in seeing which configuration to apply it to. The rule compares M's configuration against Hy's answers, not against an adversary playing G, and the paper argues through an auxiliary on-line adversary that asks r′ and serves it with Hy. Making this rigorous requires interchanging the expectation over H's coins with the finite expectation over G's next answer, and checking that the needed expectations are finite.
The second difficulty is the two kinds of randomness. G enters only through its next-answer laws, while H must be a single distribution over deterministic algorithms: the rule evaluates Hy(r) and Hy(r′) with the same coins y. Replacing H by a behavioural description breaks the coupling between consecutive rounds.
Formalization scope
Requests and answers are Lean lists, oldest first, and fn(r,a) is F.cost r a on lists of common length; values on lists of different lengths are never used. Costs are real: the paper allows fn=+∞, so every statement here is about the real-valued games. The answer type is finite and nonempty, so the minimum c(r) exists. Affine maps are written α(x)=cx+d. The goal additionally assumes α nondecreasing: the last step of the paper's proof applies α to an inequality, which needs it, and the paper's examples are positive ratios. In Lemma 3.1 and milestone 5 linearity of α is kept as the paper's standing convention, although with α inside the expectation the argument does not use it.
G is a map from (requests, own answers) to a probability mass function on A (behavioural form); its play against an adaptive on-line adversary is a probability mass function on final configurations, with finite support, and its expectations are finite sums. H is a probability measure on a coin space with a deterministic algorithm per coin, each answer measurable in the coins; expectations over H are Bochner integrals of functions with finitely many values. α stays inside expectations, as in the paper's definition of competitiveness against adaptive adversaries. Adversaries stop by returning none and have a uniform depth bound.
The goal cannot be satisfied vacuously: it states the existence of an algorithm obeying the rule alongside the guarantee for every such algorithm, and Definition 3.1 is required at every configuration, not only at reachable ones.
Not formalized: the "only if" direction of Lemma 3.1, which the paper only sketches, and Corollary 3.1, whose notion of computability the paper leaves unspecified. The definitions of request-answer games, online algorithms, adversaries and competitiveness are reusable for the other missions of this paper and for any problem-specific competitive analysis. Contributions welcome: proofs of the milestones, and a lemma relating the mixed and behavioural forms of a randomized algorithm.
Selected references
- S. Ben-David, A. Borodin, R. Karp, G. Tardos, A. Wigderson, On the power of randomization in on-line algorithms, Algorithmica 11 (1994), 2–14. https://doi.org/10.1007/BF01294260
- M. Manasse, L. McGeoch, D. Sleator, Competitive algorithms for server problems, Journal of Algorithms 11 (1990), 208–230. https://doi.org/10.1016/0196-6774(90)90003-W
- D. Sleator, R. Tarjan, Amortized efficiency of list update and paging rules, Communications of the ACM 28 (1985), 202–208. https://doi.org/10.1145/2786.2793
- A. Borodin, R. El-Yaniv, Online Computation and Competitive Analysis, Cambridge University Press, 1998. ISBN 0-521-56392-5