betaFeedback

WorksComputer Science

Two Holes Make a Difference: Deterministic Paging with Delay and Deadlines

Abstract

In this paper, we study online paging with delay or deadlines. In online paging with delay, an online algorithm manages a cache of size kk and needs to serve incoming requests by adding the requested pages to the cache. In addition, it has the option to delay serving incoming requests at a cost that depends on the delay. We propose a new online algorithm, which combines a threshold rule with first-in, first-out (FIFO) replacement, and show that it is (2k+2)(2k+2)-competitive for cache size kk. This result corrects a previously published claim that the competitive ratio is exactly 2k+12k+1 regardless of the number of holes (pages outside the cache). However, in the case of one hole, we show that the FIFO rule with a different threshold is indeed (2k+1)(2k+1)-competitive, giving a tight result. In the case of deadlines, the same analysis gives a deadline-triggered algorithm that is (k+1)(k+1)-competitive in general and kk-competitive if there is only one hole. Moreover, we show that the second hole makes paging with deadlines strictly harder than classical paging, where the competitive ratio is independent of the number of holes. For paging with deadlines, we prove a deterministic lower bound of k+12k+\tfrac12, already for two holes. We show that, as a consequence, no threshold-triggered algorithm can achieve a competitive ratio less than 2k+322k+\frac32 in general.

Introduction

The paging problem is a fundamental problem in online computation, and it is one of the first problems studied in the competitive analysis framework [17]. In paging, an algorithm maintains a cache of kk pages from a universe of n>kn > k pages. Upon requests to pages outside the cache—the holes—the algorithm must load them and evict others. The problem was first introduced in its offline variant by Belady [3], who was studying virtual-storage computers, which allowed algorithms to access larger amounts of data than could be stored in the physical memory of the computer. Today, the paging problem is often presented as a way to maintain a small fast local memory—the cache—by pulling and pushing data to and from a slow large memory. The requests are issued by the CPU directly to the cache, and one often cannot predict which page will be requested in the future. Paging has served as the starting point for weighted [2] and learning-augmented [14, 16] variants, and for broader models such as the kk-server problem [15] and metrical task systems [5].

Classical paging assumes that every request needs to be served immediately. In practice, however, many requests can wait: background jobs, prefetches, or batch queries can tolerate some latency. As a result, requests can be batched, reducing the overall cost. This is captured by the paging with delay problem, first introduced by Azar et al. [1] as a special case of online service with delay, who proved a competitive ratio of O(k)O(k). Here, an algorithm decides not only which page to evict but also when a page is worth fetching. A first exact analysis of this problem was presented in [13]. The authors proved a lower bound of 2k+12k+1 for the competitive ratio of any algorithm and claimed to derive a tight upper bound for the problem. However, the claimed upper bound may only hold when k+1k+1 pages are considered (the case with one hole). The example below shows that the LRU algorithm from [13] fails to be (2k+1)(2k+1)-competitive on k+2k+2 pages, so that the best remaining upper bound is the competitive ratio of 6k6k from [1].

Example 1.1. Consider the LRU rule from [13]: if the adversary requests a page that is not in the cache already, the algorithm waits until the cost of delaying the request reaches the threshold δ:=k+1k\delta:= \frac{k+1}{k}, and then fetches it. To serve the page, the algorithm evicts the least recently used page from the cache. Figure 1 presents a sample input sequence, where the competitive ratio of the algorithm is strictly larger than 2k+12k+1, disproving the claimed upper bound from [13].

A request sequence where the LRU algorithm with delays has competitive ratio larger than 2k + 1

Figure 1. A request sequence where the LRU algorithm with delays has competitive ratio larger than 2k+12k+1 (illustrated for the case k=2k=2, with 4 pages). Each y-level represents a page, and the cache trajectories of LRU and OPT are shown in blue and orange, respectively. Each line represents a cache slot, and a line at the y-level of some page means that the corresponding cache slot holds the page associated with the y-level.

On this input sequence, LRU fetches a new page 5 times, incurring delay δ\delta each time. Its total cost therefore is 5⋅(1+δ)=12.55 \cdot(1+\delta)=12.5. OPT does not pay any delay cost and achieves a cost of exactly 2. The competitive ratio of LRU on this input sequence is 6.25>5=2k+16.25>5=2k+1. Observe that the sequence can be continued by swapping the outer and the inner pages, and repeating the same request sequence. For general kk, see Theorem 6.1.

The results in this paper open new questions about the competitive ratio of the paging problem with delays, and suggest that there may be interesting new bounds to be discovered when two or more holes are considered, or through eviction rules other than the standard rules from classical paging.

Our results We give a simple, nearly optimal algorithm for paging with delay, relate the remaining gap to paging with deadlines, and show that, for deadlines, two holes make paging strictly harder than classical paging. Table 1 summarizes all bounds.

ProblemPagesAlgorithmsLower boundUpper bound
Delayn=k+1n=k+1any2k+12k+1 Krnetić et al. [13]2k+12k+1 Theorem 3.5
n≥k+2n\ge k+2any2k+12k+1 Krnetić et al. [13]$2k+2 Theorem 1.2
threshold2k+322k+\frac{3}{2} Theorem 6.42k+22k+2 Theorem 1.2
δ\delta-FIFO2k+22k+2 Theorem 6.12k+22k+2 Theorem 1.2
Deadlinesn=k+1n=k+1anykk Sleator and Tarjan [17]kk Theorem 4.2
n≥k+2n\ge k+2anyk+12k+\frac{1}{2} Theorem 1.3k+1k+1 Theorem 4.3

Table 1. Deterministic bounds for the competitive ratios of paging with delay and with deadlines. Results from this paper are in bold. Lower bounds hold for clairvoyant algorithms and non-strict competitive guarantees; upper bounds are strict and attained by nonclairvoyant algorithms. The row for threshold algorithms concerns the best algorithm within that class. The δ\delta-FIFO lower bound holds for every threshold δ>0\delta>0, and its upper bound uses δ=1\delta=1.

For paging with delay, we show that a simple nonclairvoyant algorithm, which fetches a page once its accumulated delay reaches a fixed threshold δ\delta and evicts pages in first-in, first-out order (δ\delta-FIFO), is strictly (2k+2)(2k+2)-competitive.

Theorem 1.2. 1-FIFO is strictly (2k+2)(2k+2)-competitive.

This is only an additive 1 above the lower bound of 2k+12k+1, which holds even for clairvoyant algorithms. On k+1k+1 pages and with threshold k+1k\frac{k+1}{k}, the algorithm is strictly (2k+1)(2k+1)-competitive, recovering the claimed bound from [13] through a new analysis. Our analysis is tight: for every fixed threshold, δ\delta-FIFO is no better than (2k+2)(2k+2)-competitive on k+2k+2 or more pages (Theorem 6.1).

An algorithm for paging with delay makes two decisions: when to fetch a page, which is a rent-or-buy decision, and which page to evict. Deciding which page to evict is already reflected in the paging with deadlines problem. For this problem, the same analysis as for Theorem 1.2 gives an upper bound of k+1k+1 in general, and a tight bound of kk for the case of one hole. The latter coincides with the competitive ratio of classical paging, which does not depend on the number of holes. For paging with deadlines, however, we prove that the problem is strictly harder with more than one hole.

Theorem 1.3. Every deterministic clairvoyant online algorithm for paging with deadlines has competitive ratio at least k+12k+\frac{1}{2} on n≥k+2n \ge k+2 pages.

The reason is that, with at least two pages missing from the cache, the optimal offline algorithm can serve requests in a different order than the online algorithm does.

Lastly, we study threshold algorithms for paging with delay, which time a fetch based on a fixed threshold for the delay cost. We show that this rule costs an additive k+1k+1 in the competitive ratio over the deadlines case: every lower bound ρ\rho for deadlines yields a lower bound of ρ+k+1\rho+k+1 for threshold algorithms with delay (Proposition 6.3). For threshold-triggered FIFO, our analysis gives delay upper bounds exactly k+1k+1 above the deadline upper bounds.

All proofs were verified in Lean.4

Related work Online problems with delay were first considered in the definition of the online TCP acknowledgment problem, where sending acknowledgments of messages can be delayed and aggregated to reduce the number of sent messages, while the delay results in latency costs [6, 7]. The idea of explicitly adding delays to online problems was proposed by Emek et al. [8], who presented the problem of min-cost perfect matching with delays, showing that delaying a decision may help to match nodes at a lower cost.

The paging problem with delay was introduced by Azar et al. in [1] as a special case of online service with delay problems. The authors present an O(kd4)O(kd^4)-competitive clairvoyant algorithm on hierarchically separated trees (HSTs) of depth dd. By using a randomized embedding of general metrics into HSTs, they also present an O(klog⁡5n)O(k\log^5 n)-competitive algorithm on general metrics. On star metrics, which correspond to weighted paging with delay, their algorithm is O(k)O(k)-competitive. Krnetić et al. [13] prove a 2k+12k+1 clairvoyant lower bound and claim a 2k+12k+1 nonclairvoyant upper bound. In this work, we show that the latter upper bound only holds when one hole is allowed.

For a single server in general nn-point metric spaces, Touitou [18] presented an upper bound of O(log⁡n)O(\log n) on the competitive ratio of clairvoyant online service with delay. In the nonclairvoyant case, Touitou [19] later presented an upper bound of O(nlog⁡n)O(\sqrt{n}\log n). In the special case of uniform line metrics, Bienkowski et al. [4] showed an upper bound of O(log⁡n)O(\log n) without clairvoyance.

Online service with deadlines contains the kk-server problem as a special case, where each request must be served immediately. Thus, the clairvoyant lower bound of kk on the competitive ratio [17] carries over to the paging problem with deadlines, already on k+1k+1 pages.

Randomized versions of these problems have also been considered in the literature. Gupta et al. [12] give a clairvoyant upper bound of O(log⁡nlog⁡k)\mathcal{O}(\log n \log k) on the weighted paging problem with delay, leaving a gap of a factor O(log⁡n)\mathcal{O}(\log n) to the Ω(log⁡k)\Omega(\log k) lower bound from classical paging [10]. For classical (weighted) paging, the bound Θ(log⁡k)\Theta(\log k) is tight [2]. For arbitrary metrics, Gupta et al. [11] present a clairvoyant O(poly⁡log⁡(n,Δ))\mathcal{O}(\operatorname{poly}\log(n,\Delta))-competitive algorithm, where Δ\Delta is the aspect ratio of the metric space, i.e., the ratio of the largest to the smallest inter-point distance.

Model and notation

Let VV denote the set of all pages, where ∣V∣=n|V|=n. An instance σ\sigma of paging with delay is a sequence of requests r=(vr,ar,delay⁡r)r=(v_r,a_r,\operatorname{delay}_r), where vr∈Vv_r \in V is the requested page, ar≥0a_r \ge0 is the arrival time of the request, and delay⁡r:[0,∞)→[0,∞)\operatorname{delay}_r:[0,\infty)\to[0,\infty) is its delay cost function. We require that delay⁡r\operatorname{delay}_r is continuous, nondecreasing and unbounded, and has delay⁡r(0)=0\operatorname{delay}_r(0)=0. An algorithm holds a cache with up to kk pages at any given time and must, for each request rr, have vrv_r cached at some time in [ar,∞)[a_r,\infty). To this end, the algorithm may alter its cache instantaneously at any time, and may go through multiple cache configurations at one instant of time. We say that a request is served at the first time sr≥ars_r \ge a_r when its page is in the algorithm’s cache.

An algorithm is online if its actions at time tt depend only on the requests with arrival time at most tt. If its actions additionally do not depend on the trajectory of the delay cost curves after time tt, we say that the algorithm is nonclairvoyant. Otherwise, the algorithm is clairvoyant. Further, we call an algorithm offline if it has full knowledge of the request sequence σ\sigma before the start of the algorithm.

We assume that the online and offline algorithms both start with the same initial cache C0⊆VC_0 \subseteq V of size kk. If a page corresponding to a request is already in the cache of the algorithm (cache hit), this page can be served without incurring costs. Fetching a page that was not in the cache into the cache (upon a cache miss) costs the algorithm one unit of cost, while evicting a page is free. We write CAlgC_{\mathrm{Alg}} and COptC_{\mathrm{Opt}} for the current caches of the online algorithm and of the offline optimum, respectively. The pages outside a full cache are called its holes. When a request rr is served at time srs_r, the algorithm additionally pays delay⁡r(sr−ar)\operatorname{delay}_r(s_r-a_r) in delay cost.

An algorithm is ρ\rho-competitive if, for every input sequence σ\sigma, its total cost

Alg⁡(σ):=number of page fetches+∑rdelay⁡r(sr−ar)\operatorname{Alg}(\sigma):=\text{number of page fetches}+\sum_r \operatorname{delay}_r(s_r-a_r)

satisfies Alg⁡(σ)≤ρ⋅Opt⁡(σ)+c\operatorname{Alg}(\sigma)\leq\rho\cdot\operatorname{Opt}(\sigma)+c, where Opt⁡(σ)\operatorname{Opt}(\sigma) is the minimum cost of any (offline) algorithm on σ\sigma, and cc is a constant that is independent of the input sequence. We say that the algorithm is strictly competitive if the additive constant cc is 0. We denote Opt⁡\operatorname{Opt}’s total number of fetches by FOptF_{\mathrm{Opt}}, and its total delay cost by DOptD_{\mathrm{Opt}}, so that Opt⁡(σ)=FOpt+DOpt\operatorname{Opt}(\sigma)=F_{\mathrm{Opt}}+D_{\mathrm{Opt}}.

Threshold algorithms For a page vv outside the cache, the accumulated delay of its pending requests at time tt is

delay⁡v(t):=∑r:vr=vr is pending at time tdelay⁡r(t−ar).\operatorname{delay}_v(t):=\sum_{\substack{r:v_r=v\\ r\text{ is pending at time }t}}\operatorname{delay}_r(t-a_r).

Definition 2.1. A deterministic algorithm for paging with delay is a threshold algorithm with fixed threshold δ>0\delta>0 if it fetches a page vv exactly when delay⁡v(t)\operatorname{delay}_v(t) reaches δ\delta for the first time. It serves all pending requests for the fetched page; its replacement rule specifies which page to evict when the cache is full.

We exclude the case δ=0\delta= 0 from the definition, since it gives an unbounded competitive ratio.

We call each threshold-triggered fetch, together with the service of its pending requests, a payment. We write PP for the number of payments, viv_i for the page fetched at payment ii, tit_i for the time of the payment, and RiR_i for the requests served with that payment. These symbols refer to the particular execution and threshold under discussion.

Paging with deadlines In paging with deadlines, each request has a fixed deadline drd_r, requiring that the request is served at sr≤drs_r \le d_r. Before the deadline, the request incurs no delay, so that an algorithm’s total cost is only the number of page fetches.

Paging with deadlines can be modeled as a special case of paging with delay, where the delay cost functions are zero until the deadline and “jump” (using a ramp) to a very large value immediately after.

In paging with deadlines, an algorithm is nonclairvoyant if its actions at time tt do not depend on deadlines that expire after tt.

Timing convention At each time, we use the convention that events happen in the following order: First, new requests arrive and their information is revealed. Then, the offline optimum performs its cache updates. Afterwards, the online algorithm moves, serving all requests on visited pages. Finally, deadlines expire (in the deadlines case), so that requests can be served exactly at the time of their deadline.

FIFO upper bounds for paging with delay

The δ\delta-FIFO algorithm

We combine the threshold rule with threshold δ\delta and the standard first-in, first-out (FIFO) cache replacement strategy. The algorithm keeps track of the pages in the cache by ordering them in a queue by the time they were fetched into the cache. The initial FIFO queue order is arbitrary but fixed. A cache hit does not change the ordering in the queue. Upon a cache miss, the page at the front of the queue—the page that entered the cache earliest—is evicted, and the newly fetched page is inserted at the back of the queue. For δ>0\delta> 0, continuity and unboundedness of the delay functions ensure that pending requests eventually trigger a payment at exactly the threshold. The δ\delta-FIFO algorithm is nonclairvoyant for every choice of δ\delta.

At each payment, the pending requests being served have accumulated exactly δ\delta units of delay cost. Together with the unit fetch cost, every payment therefore costs 1+δ1 + \delta.

Observation 3.1. The total cost of δ\delta-FIFO is (1+δ)P(1 + \delta)P.

Upper bounds for the competitive ratio of FIFO

In this section, we prove two upper bounds. The first bound is 2k+22k + 2 for paging with delay for any n>kn > k. The second is 2k+12k + 1 for the same problem under the assumption n=k+1n = k + 1, showing that the algorithm is optimal in this special case. We prove these bounds by dividing the time into payment windows. We then use a potential function to upper bound the competitive ratio for three possible cases. We keep the threshold δ>0\delta> 0 arbitrary until choosing it in the two competitive-ratio theorems. The improvement on k+1k + 1 pages comes from a guaranteed potential decrease at certain offline fetches.

We may assume that OPT evicts a page only when fetching another page into a full cache: retaining a page until its slot is needed cannot increase either fetch cost or delay cost. Thus, both caches remain full.

Payment windows We compare the online and offline algorithms by dividing the time into payment windows. A payment window is defined with respect to the online algorithm. A payment window WiW_i ends at payment time tit_i. It starts at time 0 (included) if viv_i has never been evicted; otherwise, it starts immediately after the last time FIFO evicted viv_i. In the first case, vi∉C0v_i \notin C_0, i.e., a page initially in the cache must be evicted before it can trigger a payment. The window includes payment ii and excludes the eviction at its start.

Lemma 3.2 (Properties of payment windows). For every payment ii, the following properties hold:

  1. Page viv_i is outside the cache of the online algorithm throughout WiW_i up to its final fetch, and every request in RiR_i arrives during WiW_i.

  2. The requests served at the payment satisfy

∑r∈Ridelay⁡r(ti−ar)=δ.\sum_{r\in R_i} \operatorname{delay}_r(t_i-a_r)=\delta.
  1. For any fixed page, its payment windows are pairwise disjoint.

Proof. If viv_i has been evicted before payment ii, it stays outside the online cache from its last eviction until that payment. Otherwise, it has been absent since initialization. Any earlier request for viv_i was served either on arrival while the page was cached or at its preceding fetch, so every request in RiR_i arrives in WiW_i. The threshold rule gives the second assertion. Finally, between two payments for the same page, that page must first be fetched and then evicted again. Thus, the later window starts strictly after the earlier window ends, in the fixed event order.

On k+1k+1 pages, viv_i is the unique page outside the online cache before payment ii. For i>1i>1, it was evicted at payment i−1i-1, so its payment window runs from immediately after that payment through payment ii; the first window starts at initialization. On more than k+1k+1 pages, windows for different pages may overlap.

The rank potential We define the potential function using the ordering of the pages in the queue. We assign the pages in the cache of the online algorithm the ranks 1,…,k1,\ldots,k according to the FIFO queue order. Here, rank 1 corresponds to the page next in line to be evicted, and rank kk corresponds to the most recently fetched page. Suppressing the time argument in the cache notation, define

Φ=∑q∈CAlg∖COptrank⁡(q),0≤Φ≤k(k+1)2.(1)\Phi=\sum_{q\in C_{\mathrm{Alg}}\setminus C_{\mathrm{Opt}}}\operatorname{rank}(q), \qquad0\leq\Phi\leq\frac{k(k+1)}{2}. \tag*{(1)}

Up to an additive constant, this is analogous to the FIFO potential in the paging problem without delays used in [9]. The caches of δ\delta-FIFO and the offline algorithm initially equal C0C_0, so Φ0=0\Phi_0=0. For the potential value Φfinal\Phi_{\mathrm{final}} after both schedules have served every request, it holds that Φfinal≥Φ0=0\Phi_{\mathrm{final}}\geq\Phi_0=0.

Lemma 3.3 (Potential changes). Throughout the execution, the potential changes as follows:

(i) At an offline fetch, ΔΦ≤k\Delta\Phi\leq k.

(ii) At an offline fetch, if the evicted page is outside the online cache, then ΔΦ≤0\Delta\Phi\leq0; on n=k+1n=k+1 pages, the stronger bound ΔΦ≤−1\Delta\Phi\leq-1 holds.

(iii) At online payment ii, ΔΦ≤−1\Delta\Phi\leq-1 if vi∈COptv_i\in C_{\mathrm{Opt}} immediately before the payment, and ΔΦ≤k\Delta\Phi\leq k otherwise.

Proof. We prove each item separately. An offline fetch adds the rank of the evicted page to the potential if that page is in the online cache, and removes the rank of the fetched page if that page is in the online cache. The added contribution is at most kk, and the removed contribution is nonnegative; thus (i) holds.

To prove (ii), note that if the evicted page is outside the online cache, no contribution is added. On k+1k + 1 pages, it is then the unique page outside the online cache, so the fetched page qq belongs to the online cache, and its contribution rank⁡(q)≥1\operatorname{rank}(q) \ge1 is removed. With more than k+1k + 1 pages, both the evicted and fetched pages may be outside the online cache, in which case the potential change is zero.

Finally, for (iii), for online payment ii, write m=∣CAlg∩COpt∣m = |C_{\mathrm{Alg}} \cap C_{\mathrm{Opt}}| immediately before the payment. Each of the k−mk-m pages in the online cache but outside the offline cache loses one unit of rank contribution: the page of rank 1 is evicted, and the ranks of the other pages decrease by one. The newly fetched page contributes kk precisely when it is outside the offline cache. Hence,

ΔΦ=m−k 1{vi∈COpt}.(2)\Delta\Phi= m - k \, 1\{v_i \in C_{\mathrm{Opt}}\}. \tag*{(2)}

If vi∈COptv_i \in C_{\mathrm{Opt}}, then m≤k−1m \le k - 1, since the offline cache also contains viv_i, which was absent from the online cache. Thus, the potential change is m−k≤−1m-k \le-1; otherwise, it is m≤km \le k. □

Charging the payments The next lemma separates the charges to offline fetches and offline delay. Its two bounds differ only in the coefficient of the fetch cost; choosing the threshold will balance the two coefficients.

Lemma 3.4 (Payment accounting). For every threshold δ>0\delta> 0, the number of payments of δ\delta-FIFO satisfies

P+Φfinal−Φ0≤(k+1)FOpt+k+1δDOpt.(3)P + \Phi_{\mathrm{final}} - \Phi_0 \le(k + 1)F_{\mathrm{Opt}} + \frac{k+1}{\delta}D_{\mathrm{Opt}}. \tag*{(3)}

On n=k+1n = k + 1 pages, the stronger bound

P+Φfinal−Φ0≤kFOpt+k+1δDOpt(4)P + \Phi_{\mathrm{final}} - \Phi_0 \le kF_{\mathrm{Opt}} + \frac{k+1}{\delta}D_{\mathrm{Opt}} \tag*{(4)}

holds.

Proof. We prove the lemma statement by showing that it holds for each payment window. In particular, to prove (3), we prove that, during a payment window WiW_i,

1≤(k+1)ΔiFOpt+k+1δΔiDOpt−ΔiΦ1 \leq(k+1)\Delta_i F_{\mathrm{Opt}} + \frac{k+1}{\delta}\Delta_i D_{\mathrm{Opt}} - \Delta_i\Phi

holds. Here, ΔiFOpt\Delta_i F_{\mathrm{Opt}}, ΔiDOpt\Delta_i D_{\mathrm{Opt}} and ΔiΦ\Delta_i\Phi denote the changes in FOptF_{\mathrm{Opt}}, DOptD_{\mathrm{Opt}} and Φ\Phi during the payment window related to viv_i, i.e., the number of offline evictions of viv_i, the delay cost Opt accumulates for pending requests on viv_i, and the potential change at payment ii and offline evictions of viv_i. We prove a similar bound for n=k+1n=k+1 pages by proving (4) for each payment window WiW_i:

1≤kΔiFOpt+k+1δΔiDOpt−ΔiΦ.1 \leq k\Delta_i F_{\mathrm{Opt}} + \frac{k+1}{\delta}\Delta_i D_{\mathrm{Opt}} - \Delta_i\Phi.

Lastly, we show that for every offline eviction (in particular, those not accounted for in any payment window), the offline cost covers the corresponding potential change, i.e.,

0≤kΔFOpt−ΔΦ.(5)0 \leq k\Delta F_{\mathrm{Opt}} - \Delta\Phi. \tag*{(5)}

By Lemma 3.2, payment windows for the same page are disjoint. Summing over all payment windows and pages and adding (5) for all remaining offline fetches accounts for all offline actions and online payments exactly once, giving the claimed bounds.

To prove (5), observe that kΔFOpt−ΔΦ=k−ΔΦ≥0k\Delta F_{\mathrm{Opt}}-\Delta\Phi=k-\Delta\Phi\geq0, since ΔΦ≤k\Delta\Phi\leq k by Lemma 3.3(i). For the remaining bounds, fix some payment ii. We distinguish three cases, illustrated in Figure 2.

Three charging cases for page $a$ with $k=2$ and $n=3$, showing FIFO and Opt cache lines, request releases, delay thresholds, and payment windows

Figure 2. The three charging cases for page aa with k=2k = 2 and n=3n = 3. Each horizontal level represents a page, a colored line is a cache slot, and a vertical step x→yx \to y means evicting xx and fetching yy. Blue lines trace the pages in the cache of FIFO; orange lines show an offline comparator Opt. The shaded windows are payment windows WiW_i for page aa. During each window, the quantity kFOpt+k+1δDOpt−ΦkF_{\mathrm{Opt}} + \frac{k+1}{\delta}D_{\mathrm{Opt}} - \Phi increases by at least 1, which accounts for the online payment. This is the bound for n=k+1n = k + 1 pages.

Case 1: The requested page is cached by Opt at tit_i. At the online payment, Lemma 3.3(iii) gives −ΔΦ≥1-\Delta\Phi\geq1, so the potential decrease pays for this online payment. The potential changes at offline actions are covered by the offline cost using (5). Summing this gives

1≤kΔiFOpt−ΔiΦ≤kΔiFOpt+k+1δΔiDOpt−ΔiΦ.1 \leq k\Delta_i F_{\mathrm{Opt}}-\Delta_i\Phi\leq k\Delta_i F_{\mathrm{Opt}}+\frac{k+1}{\delta}\Delta_i D_{\mathrm{Opt}}-\Delta_i\Phi.

Case 2: The requested page was cached by Opt during the window, but is no longer cached. Then Opt evicted viv_i during WiW_i. At that eviction, viv_i was outside the online cache; hence, ΔΦ≤0\Delta\Phi\leq0 in general, and ΔΦ≤−1\Delta\Phi\leq-1 on k+1k+1 pages by Lemma 3.3(ii). At the online payment, the potential increases by at most kk. Summing these bounds and (5) for the remaining offline evictions in window WiW_i, we get

(k+1)ΔiFOpt−ΔiΦ≥(k+1)−0−k=1(k+1)\Delta_i F_{\mathrm{Opt}}-\Delta_i\Phi\geq(k+1)-0-k=1

in general, and

kΔiFOpt−ΔiΦ≥k+1−k=1k\Delta_i F_{\mathrm{Opt}}-\Delta_i\Phi\geq k+1-k=1

for k+1k+1 pages. As before, the change in offline delay cost is nonnegative, and the claimed bounds follow.

Case 3: The requested page is never cached by Opt during the window. Every request in RiR_i arrives in WiW_i and remains pending for both schedules until payment ii. By Lemma 3.2, it follows that

k+1δΔiDOpt≥k+1δ∑r∈Ridelay⁡r(ti−ar)=k+1.\frac{k+1}{\delta}\Delta_i D_{\mathrm{Opt}}\geq\frac{k+1}{\delta}\sum_{r\in R_i}\operatorname{delay}_r(t_i-a_r)=k+1.

At the online payment, the potential increases by at most kk, and potential changes at offline evictions can be covered by offline fetch cost using (5). It follows that

kΔiFOpt+k+1δΔiDOpt−ΔiΦ≥k+1−k=1,k\Delta_i F_{\mathrm{Opt}}+\frac{k+1}{\delta}\Delta_i D_{\mathrm{Opt}}-\Delta_i\Phi\geq k+1-k=1,

completing the proof.

Competitive guarantees Here, we show the main result of this section, stating that the δ\delta-FIFO algorithm is (2k+2)(2k+2)-competitive when δ\delta is chosen appropriately.

Theorem 1.2. 1-FIFO is strictly (2k+2)(2k+2)-competitive.

Proof. Choose δ=1\delta=1 so that the fetch and delay coefficients in (3) are both k+1k+1. Since Φ0=0\Phi_0=0 and Φfinal≥0\Phi_{\mathrm{final}}\ge0, Lemma 3.4 gives

P≤(k+1)(FOpt+DOpt)=(k+1)Opt.P \le(k+1)(F_{\mathrm{Opt}}+D_{\mathrm{Opt}})=(k+1)\mathrm{Opt}.

Observation 3.1 then yields

Alg=(1+δ)P=2P≤(2k+2)Opt.\mathrm{Alg}=(1+\delta)P=2P\le(2k+2)\mathrm{Opt}.

The following theorem shows that the algorithm is optimal when n=k+1n=k+1.

Theorem 3.5. For k≥1k\ge1 and n=k+1n=k+1, k+1k\frac{k+1}{k}-FIFO is strictly (2k+1)(2k+1)-competitive.

Proof. Choose δ=(k+1)/k\delta=(k+1)/k so that the fetch and delay coefficients in (4) are both kk. Since Φ0=0\Phi_0=0 and Φfinal≥0\Phi_{\mathrm{final}}\ge0, Lemma 3.4 gives

P≤k(FOpt+DOpt)=kOpt.P\le k(F_{\mathrm{Opt}}+D_{\mathrm{Opt}})=k\mathrm{Opt}.

Observation 3.1 then yields

Alg=(1+δ)P=2k+1kP≤(2k+1)Opt.\mathrm{Alg}=(1+\delta)P=\frac{2k+1}{k}P\le(2k+1)\mathrm{Opt}.

FIFO upper bounds for paging with deadlines

The deadline-triggered FIFO algorithm In this model, we define the deadline-triggered FIFO algorithm. This algorithm fetches a noncached page when one of its pending requests reaches its deadline and applies the same replacement rule as in Section 3. The fetch also serves every other pending request for that page. We use PP to denote the number of payments, viv_i for the page fetched, tit_i for the payment time, and RiR_i for the requests served with the payment, just as we did for payments with delay. Since the requests do not incur any delay cost before the deadline, the cost of the deadline-triggered FIFO algorithm is Alg=P\mathrm{Alg}=P.

Upper bounds for the competitive ratio of deadline-triggered FIFO We again differentiate between the general case n≥k+1n\ge k+1 and the special case n=k+1n=k+1. Both upper bounds follow from the charging argument of Section 3.2 once we observe that deadlines rule out its third case.

Lemma 4.1 (Deadline accounting). The number of fetches of deadline-triggered FIFO satisfies

P+Φfinal−Φ0≤(k+1)FOpt.P+\Phi_{\mathrm{final}}-\Phi_0\le(k+1)F_{\mathrm{Opt}}.

On n=k+1n=k+1 pages, the stronger bound P+Φfinal−Φ0≤kFOptP+\Phi_{\mathrm{final}}-\Phi_0\le kF_{\mathrm{Opt}} holds.

Proof. The payment windows, the rank potential, items 1 and 3 of Lemma 3.2, and Lemma 3.3 depend only on the replacement rule and the cache contents, not on what triggers a fetch, so they apply verbatim. Fix a payment ii. Some request r∈Rir\in R_i has deadline dr=tid_r=t_i, and it arrives during WiW_i by Lemma 3.2. Any feasible offline schedule serves rr at some time in [ar,ti]⊆Wi[a_r,t_i]\subseteq W_i, so Opt\mathrm{Opt} caches viv_i at some point during WiW_i. Hence, Case 3 in the proof of Lemma 3.4 cannot occur. Cases 1 and 2 use only offline fetches and potential changes, and give

1≤(k+1)ΔiFOpt−ΔiΦ,and1≤kΔiFOpt−ΔiΦ on n=k+1 pages.1\le(k+1)\Delta_iF_{\mathrm{Opt}}-\Delta_i\Phi,\qquad\text{and}\qquad1\le k\Delta_iF_{\mathrm{Opt}}-\Delta_i\Phi\text{ on }n=k+1\text{ pages}.

Summing over all payments and adding (5) for the remaining offline fetches, exactly as in the proof of Lemma 3.4, proves both bounds.

Finally, we can show the competitiveness of deadline-triggered FIFO.

Theorem 4.2. On n=k+1n = k + 1 pages, deadline-triggered FIFO is strictly kk-competitive, and no deterministic online algorithm for paging with deadlines has competitive ratio less than kk.

Proof. For the upper bound, Lemma 4.1 with Φ0=0\Phi_0 = 0, Φfinal≥0\Phi_{\mathrm{final}} \ge0, Alg=P\mathrm{Alg} = P and Opt=FOpt\mathrm{Opt} = F_{\mathrm{Opt}} gives Alg≤kOpt\mathrm{Alg} \le k\mathrm{Opt}. For the lower bound, classical paging is the special case dr=ard_r = a_r for all requests, and no deterministic paging algorithm has competitive ratio less than kk, already on k+1k + 1 pages [17].

Theorem 4.3. On n≥k+1n \ge k + 1 pages, deadline-triggered FIFO is strictly (k+1)(k + 1)-competitive.

Proof. Lemma 4.1 with Φfinal≥Φ0=0\Phi_{\mathrm{final}} \ge\Phi_0 = 0, Alg=P\mathrm{Alg} = P and Opt=FOpt\mathrm{Opt} = F_{\mathrm{Opt}} gives Alg≤(k+1)Opt\mathrm{Alg} \le(k + 1)\mathrm{Opt}.

Together with Theorem 1.3, the deterministic competitive ratio of paging with deadlines on n≥k+2n \ge k + 2 pages lies in [k+12,k+1][k + \frac{1}{2}, k + 1].

A deterministic lower bound for paging with deadlines

Theorem 1.3. Every deterministic clairvoyant online algorithm for paging with deadlines has competitive ratio at least k+12k + \frac{1}{2} on n≥k+2n \ge k + 2 pages.

To prove the theorem, we present a construction with k+2k + 2 pages and assume that the adversary always requests a page that is not in the cache of the online algorithm. Observe that such a construction would also work with n>k+2n > k + 2 pages, if the adversary does not issue requests on n−k−2n - k - 2 of the pages not in C0C_0. This is because an online algorithm that visits pages that have not been requested incurs additional moving costs and can thus only have higher costs. The cost of the online algorithm is at least the number of requests. Our goal is to find an offline schedule which pays a cost of at most 1 every time an online algorithm pays about k+1/2k + 1/2. To analyze the costs of the offline algorithm, we define an offline budget which describes the costs an offline algorithm should stay within. With respect to this budget, we divide the request sequence into phases. We show that there exists a “cheap” schedule that allows the offline algorithm to have a bounded cost of at most 1 in each phase, while the online algorithm must incur a cost of kk or k+1k + 1. In the following, we describe the full construction.

The offline choices and the adversary

Without loss of generality, assume that Alg\mathrm{Alg} moves only at times when a request’s deadline expires. Postponing a move until the next deadline does not increase the cost of the algorithm, and serves every request in time.

We assume that the adversary always requests pages that are currently not in the online cache, while finding an appropriate schedule for the offline algorithm. In particular, it maintains a budget for the offline algorithm. The adversary holds a set of so-called cheap offline schedules, which can shrink with each request. Once no cheap schedule remains, the offline budget is increased by one unit, and the set of cheap schedules is refilled. We call the sequence of requests between two budget increases a phase. We will show that a completed phase has at least kk requests, and at least every other phase has k+1k + 1 requests. The competitive ratio is then shown using the property that each request increases Alg\mathrm{Alg}’s cost by at least one, while Opt\mathrm{Opt}’s cost increases by at most one per phase.

For each phase, the adversary chooses a distinguished page hh that is requested before the phase starts and whose deadline expires only at the end of the phase. We call this request the held request and write dhd_h for its deadline.

We define the current offline budget, denoted BB, as the cost we want an offline algorithm to stay within. We define cheap schedules as schedules that start in the configuration C0C_0, serve all requests so far whose deadline has passed, stay within the current offline budget, and are at the current time in a configuration with holes at the held page hh and at one other page zz. We use CC to denote the set of pages zz such that some schedule currently having holes hh and zz is guaranteed to be cheap; thus C⊆V∖{h}C \subseteq V \setminus\{h\}. We maintain the following invariants for the possible current configurations, with at most one starred member of CC allowed to violate the third guarantee:

  1. For every z≠hz \ne h, some schedule that currently has holes hh and zz has a cost of at most B+1B+1.

  1. For every z∈Cz \in C, such a schedule costs at most BB.

  1. For every unstarred z∈Cz \in C, a schedule of cost at most B+1B+1 ends with holes h,zh,z and has also served the held request.

Construction initialization We restrict the construction to the pages in the initial cache and two pages u0u_0 and v0v_0 that are initially not in the cache, and write VV only for these pages. At time 0, the adversary releases a request at u0u_0 with deadline 1 and one at v0v_0 with deadline 2. At time 1, a new phase starts with

h=v0,C=V∖{u0,v0},B=1,no starred members of C.h = v_0,\qquad C = V \setminus\{u_0,v_0\},\qquad B = 1,\qquad\text{no starred members of } C.

We assume that the considered offline schedules end at the current time. To denote the moves of an algorithm, we write x→yx \to y for a move where a page xx is evicted and yy is fetched instead. For each z≠v0z \ne v_0, we describe an offline schedule that ends with holes v0,zv_0,z through a sequence of moves at time 1, maintaining the invariants:

  1. To end with holes at v0,u0v_0,u_0, perform the move p→u0→pp \to u_0 \to p for any page pp from C0C_0. This move incurs a cost of two, serves the request at u0u_0 and ends with holes v0,u0v_0,u_0 (inv. 1).

  1. For each z∈Cz \in C, the move z→u0z \to u_0 gives the cheap schedule with v0,zv_0,z missing (inv. 2).

  1. For each z∈Cz \in C, the path z→v0→u0z \to v_0 \to u_0 costs two, serves the held request and ends with holes v0,zv_0,z (inv. 3).

Continuing a phase The goal of the adversary is to make sure that a phase continues as long as possible. To continue a phase, the adversary chooses any page p≠hp \ne h not in the cache maximizing ∣C∖{p}∣|C \setminus\{p\}|. This is possible as long as there is some remaining y∈C∖{p}y \in C \setminus\{p\}. In this case, release a request at pp with deadline dpd_p strictly between the current time and dhd_h. We advance time to dpd_p, update the cheap page set to the nonempty set C∖{p}C \setminus\{p\}, and erase the star at pp if it had one.

The invariants are preserved as follows:

  1. For every z≠hz \ne h, consider the cheap schedule ending with holes h,yh,y, followed by the move z→yz \to y after pp has been requested, or no action if z=yz=y. This serves the new request and ends with holes h,zh,z at cost at most B+1B+1. Note that this strategy has served all previously expired requests (inv. 1).

  1. For every z∈C∖{p}z \in C \setminus\{p\}, the cheap schedule ending with holes h,zh,z serves the new request at pp for free, and ends with holes h,zh,z at cost at most BB (inv. 2).

  1. Analogously, for every unstarred z∈C∖{p}z \in C \setminus\{p\}, the schedule of cost B+1B+1 that serves hh and ends with holes h,zh,z serves the new request at pp for free (inv. 3).

Starting a new phase Suppose we cannot continue the current phase. Choose any absent page p≠hp\ne h. This page must satisfy p∈Cp\in C, since the phase could not be continued. Release a new request at pp before dhd_h, with deadline dp=dh+1d_p=d_h+1. Advance the current time to dhd_h and start a new phase with new assignments

h′=p,C′={V∖{h,p}if p starred,V∖{p}if p unstarred,B′=B+1,h starred if p unstarred.h^{\prime}=p,\qquad C^{\prime}=\begin{cases}V\setminus\{h,p\}&\text{if }p\text{ starred},\\ V\setminus\{p\}&\text{if }p\text{ unstarred},\end{cases}\qquad B^{\prime}=B+1,\qquad h\text{ starred if }p\text{ unstarred}.

Thus, if pp was previously starred, the phase starts with kk candidates, all unstarred; otherwise, it starts with k+1k+1 candidates, one starred.

We again prove that the three invariants hold for the new phase. Figure 3(a) and (b) illustrate the new schedules of cost B′+1B^{\prime}+1 for maintaining invariants 1 and 3. Figure 3(c) and (d) illustrate the new cheap schedules of cost B′B^{\prime} (inv. 2), showing how the old schedule for unstarred pp can be extended to give an extra cheap schedule.

Updating the offline schedules at a phase boundary

Figure 3. Updating the offline schedules at a phase boundary. Top row: schedules with budget B′+1B^{\prime}+1 (inv. 1 and 3). In (a), the old witness costs at most B+1B+1 and ends with holes at h,zh,z. The move p→hp\to h extends it to a new schedule missing p,zp,z of cost B′+1B^{\prime}+1 with the held page pp already served (inv. 3). In (b), the old cheap schedule missing h,ph,p is extended into a schedule with cost B′+1B^{\prime}+1 missing h,ph,p. Since pp is not served yet, hh is starred. Bottom row: cheap schedules with budget B′B^{\prime} (inv. 2); the previous schedules end with holes at h,ph,p. In (c), the old cheap witness costs at most BB. Swapping the page zz for hh gives the new cheap schedule missing p,zp,z. In (d), available when pp was unstarred, the old witness missing p,hp,h has already served hh at cost at most B+1B+1.

  1. For every z∉{p,h}z\notin\{p,h\}, the old schedule ending with holes h,zh,z can be extended by the move p→hp\to h to serve the old held request and end with p,zp,z missing at cost at most B+2=B′+1B+2=B^{\prime}+1. For the schedule ending with holes at p,hp,h, the old cheap schedule missing p,hp,h can be extended by a round trip z→h→zz\to h\to z serving hh with final cost B+2=B′+1B+2=B^{\prime}+1 (inv. 1).

  1. For every z∉{h,p}z\notin\{h,p\}, consider the old cheap schedule missing h,ph,p. At time dhd_h, move z→hz\to h. This serves the old held request and leaves p,zp,z missing, at cost at most B+1=B′B+1=B^{\prime}. If h∈C′h\in C^{\prime}, then pp was previously unstarred, meaning that there exists a schedule of cost at most B+1B+1 that ends with holes h,ph,p and has served the old held request. This schedule can stay put, giving a cheap schedule ending with holes h,ph,p (inv. 2).

  1. For each z∉{h,p}z\notin\{h,p\}, the old schedule ending with holes h,zh,z and cost B+1B+1 can be extended by the move p→hp\to h at time dhd_h to serve the old held request and the new request at pp, and end with p,zp,z missing at cost at most B+2=B′+1B+2=B^{\prime}+1 (inv. 3).

Cost analysis

Let N≥2N \ge2 and consider the input σN\sigma_N constructed by the adversary with NN requests released in total.

Lemma 5.1. ALG\mathrm{ALG} incurs cost at least NN on σN\sigma_N.

Proof. The request sequence is designed such that any requested page in this sequence is not in the cache of ALG\mathrm{ALG} at the time when it is requested. Moreover, the construction ensures that no windows of two requests at the same page overlap, so each request must be served by a separate online move.

Lemma 5.2. OPT\mathrm{OPT} incurs cost at most 2N+2k2k+1+1\frac{2N+2k}{2k+1}+1 on σN\sigma_N.

Proof. Observe that the budget BB corresponds to the number of phases started: initialization sets it to one, and each new phase increases it by one. We call a phase short if it starts with ∣C∣=k|C|=k and long if it starts with ∣C∣=k+1|C|=k+1. Observe that, if a phase is short, then it has no star, and therefore the next phase is long. Each step within a phase releases a request and removes at most one page from CC. Since a phase ends when CC would become empty, a short phase accounts for at least kk requests, and a long phase accounts for at least k+1k+1 requests. The first B−1B-1 phases are complete; at least ⌊(B−1)/2⌋\left\lfloor(B-1)/2 \right\rfloor of them are long. Counting also the first request of the last phase gives

N≥1+k(B−1)+⌊B−12⌋≥2k+12B−k,henceB≤2N+2k2k+1.N \ge1+k(B-1)+\left\lfloor\frac{B-1}{2} \right\rfloor\ge\frac{2k+1}{2}B-k, \qquad\text{hence}\qquad B \le\frac{2N+2k}{2k+1}.

We can now choose any cheap offline schedule as the offline algorithm. This results in a cost of at most BB, and the algorithm has served every request before its deadline expired. To serve the held request, at most one additional move is needed, giving the claimed bound.

We can finally prove the main theorem of the section:

Proof of Theorem 1.3. Let 1≤ρ<k+121 \le\rho< k+\frac{1}{2} and assume ALG\mathrm{ALG} is ρ\rho-competitive. By Lemmas 5.1 and 5.2, for every N≥2N \ge2, there is an input σN\sigma_N such that

ALG(σN)−ρOPT(σN)≥N(1−2ρ2k+1)−ρ(1+2k2k+1).\mathrm{ALG}(\sigma_N)-\rho\mathrm{OPT}(\sigma_N) \ge N\left(1-\frac{2\rho}{2k+1}\right)-\rho\left(1+\frac{2k}{2k+1}\right).

This tends to infinity with N→∞N \to\infty, contradicting any fixed additive constant in the competitive guarantee.

Lower bounds for threshold algorithms

In this section, we focus on proving lower bounds for threshold algorithms. We show that our analysis of the δ\delta-FIFO algorithm is tight on n≥k+2n \ge k+2 pages, if the threshold δ\delta is fixed. Additionally, we show that any threshold algorithm has a competitive ratio of at least 2k+322k+\frac{3}{2} for online paging with delay for n≥k+2n \ge k+2.

Tightness for fixed-threshold FIFO

Theorem 6.1. The competitive ratio of δ\delta-FIFO is at least 2k+22k+2 for every fixed threshold value δ>0\delta>0 and n≥k+2n \ge k+2 pages.

Proof. In the proof, we present repeatable adversarial runs that force the δ\delta-FIFO algorithm to incur a cost of (1+δ)(2k+2)(1+\delta)(2k+2) per run, while an offline schedule pays at most 1+δ1+\delta per run, apart from a constant initialization and final-service cost. An instance of a repeatable adversarial run is depicted in Figure 4.

FIFO and OPT cache trajectories for pages $f_1$, $f_2$, $f_3$, $a$, $b$, and $c$; request releases and delay reaches $\delta$ are marked

Figure 4. A request sequence where δ\delta-FIFO has competitive ratio at least 2k+22k+2 (illustrated is k=4k=4). The online cache trajectories are blue, and an offline witness is orange. FIFO fetches 2k+22k+2 times per run, while the offline witness fetches once and leaves the request on aa pending. The start and end situations of the run are identical up to renaming bb and cc, so the run can be repeated indefinitely.

We repeatedly issue a request right after FIFO evicts a page, and initially issue a request at each absent page used in the construction. A page becomes critical when its pending request reaches delay δ\delta. Choose each delay function to mimic a deadline, with delay δ\delta instead of the deadline: it is zero until a short continuous ramp just before its designated critical time, then constant at δ\delta through the finite construction. To ensure the technical constraint that delay functions are unbounded, the delay functions may grow unboundedly after the finite construction. The ramps can be chosen short enough that the offline moves described below precede the relevant increases in delay.

The request sequence is defined as follows: Use k+2k+2 pages, labeled f1,f2,…,fk−1,a,bf_1,f_2,\ldots,f_{k-1},a,b and cc. Label the initial FIFO queue, from oldest to newest, as b,fk−1,…,f1b,f_{k-1},\ldots,f_1, leaving a,ca,c outside the cache. We make pages critical in the order (c,a,fk−1,…,f1,b,c,fk−1,…,f1)(c,a,f_{k-1},\ldots,f_1,b,c,f_{k-1},\ldots,f_1), then relabel bb as cc and cc as bb, i.e., the next run starts with (b,a,…)(b,a,\ldots) in terms of the old labeling. It is easy to see that FIFO faults on every request, as every run of k+1k+1 requests is on distinct pages, and FIFO covers the most recently fetched kk requests.

Next, we show an upper bound on the cost of OPT. To this end, we define an offline witness that first fetches cc and evicts bb, at one unit of initialization cost, so its cache is {f1,…,fk−1,c}\{f_1,\ldots,f_{k-1},c\}. We describe one run of this offline witness, using it to bound OPT. The offline witness leaves the request at page aa pending, accounting for at most δ\delta delay per run. Note that FIFO has the most recently fetched kk requests in its cache at any given time, meaning that, before bb becomes critical, FIFO has f1,…,fk−1f_1,\ldots,f_{k-1} and aa in its cache. Therefore, cc is already evicted by FIFO, and the request on page cc that will turn critical after bb turns critical is already issued. Accordingly, the offline witness performs the move c→bc\to b, thereby serving the requests at bb and cc without incurring any delay cost. The remaining requests of the run are to pages cached by the offline witness. Finally, the offline witness has f1,…,fk−1f_1,\ldots,f_{k-1} and bb in its cache, with bb being renamed to cc. In the end, the offline witness has to fetch aa once to serve all outstanding requests.

We conclude that the offline witness incurs at most 1+δ1+\delta per run, while FIFO faults on each of the 2k+22k+2 requests, incurring cost (1+δ)(2k+2)(1+\delta)(2k+2) (11 for fetching and δ\delta for the accumulated delay). After NN runs, ALG≥(1+δ)(2k+2)N\mathrm{ALG}\ge(1+\delta)(2k+2)N and OPT≤(1+δ)N+2\mathrm{OPT}\le(1+\delta)N+2. Letting NN tend to infinity proves the lower bound even when the competitive guarantee allows an additive constant.

Remark. This lower bound also holds for the LRU algorithm, which keeps the most recently accessed pages in the cache, since requests are only to pages that are absent from the online cache, and LRU and FIFO coincide on such sequences.

Transferring deadline lower bounds

We now relate deadline lower bounds to the threshold class of Definition 2.1, allowing arbitrary deterministic replacement rules.

Lemma 6.2. Let AlgAlg be a ρ\rho-competitive threshold algorithm with threshold δ>0\delta> 0. Then there exists a ρ1+δ\frac{\rho}{1+\delta}-competitive deterministic algorithm Alg′Alg' for paging with deadlines that is clairvoyant iff AlgAlg is clairvoyant.

Proof. We give the construction here only in the clairvoyant case. For the nonclairvoyant version, the same construction can be applied once information is revealed.

We construct a deterministic deadline algorithm Alg′Alg' that, for an instance σ′\sigma' of paging with deadlines, simulates AlgAlg on a delay instance σ\sigma constructed online from σ′\sigma'. The two algorithms start with C0C_0, and Alg′Alg' copies every simulated fetch and eviction.

Let τ(t)\tau(t) denote the virtual time assigned to real time tt, before processing its arrivals and deadlines. We set τ\tau at arrivals and deadlines and extend it linearly in between. At the release of each request r′r', we assign its counterpart rr an effective deadline drd_r and a duration ϵr>0\epsilon_r > 0. The intervals [dr,dr+ϵr][d_r,d_r+\epsilon_r] for distinct original deadlines are disjoint and ordered in the same way as those deadlines; equal deadlines share an interval. We retain each interval until its original deadline has been processed, even if its requests have already been served.

Virtual time starts at zero. At each real arrival or deadline time tt, first advance virtual time to the midpoint between its current value and the start of the earliest remaining interval, or by one unit if no interval remains; this defines τ(t)\tau(t). As justified below, no fetch occurs during this advance. Release all requests arriving at tt at virtual time τ(t)\tau(t). For a deadline already announced, reuse its interval. Otherwise, write r−r^- for the request preceding the new request and r+r^+ for the following one in the original deadline order of the already announced deadlines. If there is no preceding interval, use dr−=τ(t)d_{r^-}=\tau(t) and ϵr−=0\epsilon_{r^-}=0; if there is no following interval, use dr+=dr−+ϵr−+1d_{r^+}=d_{r^-}+\epsilon_{r^-}+1. Define the interval for the new request as the middle third of the gap between the preceding and following intervals:

ϵr=dr+−dr−−ϵr−3,dr=dr−+ϵr−+ϵr.\epsilon_r=\frac{d_{r^+}-d_{r^-}-\epsilon_{r^-}}{3},\qquad d_r=d_{r^-}+\epsilon_{r^-}+\epsilon_r.

The gap is positive, so ϵr>0\epsilon_r>0 and

dr−+ϵr−<dr<dr+ϵr<dr+.d_{r^-}+\epsilon_{r^-}<d_r<d_r+\epsilon_r<d_{r^+}.

These choices preserve the interval order without changing any previous assignment and ensure ar=τ(ar′)<dra_r=\tau(a_{r'})<d_r. Define the delay function by

delay⁡r(x)=δϵrmax⁡{0,x−dr+ar},x≥0.\operatorname{delay}_r(x)=\frac{\delta}{\epsilon_r}\max\{0,x-d_r+a_r\},\qquad x\geq0.

It is continuous, nondecreasing, unbounded, and zero at arrival. It starts growing at absolute virtual time drd_r and reaches δ\delta at dr+ϵrd_r+\epsilon_r. The entire function is fixed at release using only information already available.

After processing all arrivals at a real deadline dr′d_{r'}, run the simulation through dr+ϵrd_r+\epsilon_r, copy its cache actions at real time dr′d_{r'} in their simulated order, and remove the interval. Equal deadlines are processed together. Inductively, all requests with earlier deadlines have already been served, whereas requests with later deadlines have zero delay throughout this advance. Every request with this deadline is served by the end of its interval, since its individual delay reaches δ\delta there and thus forces a fetch at or before that time. Multiple pending requests on one page may cause their aggregate delay to reach the threshold earlier, which only advances their service. All pending requests therefore have zero delay between successive intervals, justifying the advances to τ(t)\tau(t). This defines a feasible deterministic online algorithm Alg′, including for requests arriving at their own deadlines, since arrivals are processed first.

For the offline comparison, observe that any feasible schedule for σ′\sigma' can be transformed into a schedule for σ\sigma with no delay, by mapping actions according to the virtual time τ\tau. The number of fetches is unchanged, proving Opt⁡(σ)≤Opt⁡(σ′)\operatorname{Opt}(\sigma) \le\operatorname{Opt}(\sigma').

Every fetch of Alg′ corresponds to a fetch of Alg with associated delay cost δ\delta. Thus, Alg⁡(σ)=(1+δ)Alg⁡′(σ′)\operatorname{Alg}(\sigma) = (1+\delta)\operatorname{Alg}'(\sigma'). Using that Alg is ρ\rho-competitive (i.e., Alg⁡(σ)≤ρOpt⁡(σ)+c\operatorname{Alg}(\sigma) \le\rho\operatorname{Opt}(\sigma)+c for some constant cc), it follows that

Alg⁡′(σ′)=11+δAlg⁡(σ)≤ρ1+δOpt⁡(σ)+c1+δ≤ρ1+δOpt⁡(σ′)+c1+δ.\operatorname{Alg}'(\sigma')=\frac{1}{1+\delta}\operatorname{Alg}(\sigma)\le\frac{\rho}{1+\delta}\operatorname{Opt}(\sigma)+\frac{c}{1+\delta}\le\frac{\rho}{1+\delta}\operatorname{Opt}(\sigma')+\frac{c}{1+\delta}.

Proposition 6.3. Let k≥1k \ge1 and n≥k+1n \ge k+1 be integers, and let ρ≥1\rho\ge1. If the competitive ratio of deterministic paging with deadlines on nn pages with cache size kk is at least ρ\rho, then no threshold algorithm for paging with delay on the same universe can have competitive ratio less than ρ+k+1\rho+k+1.

Proof. Fix a threshold algorithm Alg with threshold δ\delta. First, suppose that δ≥(k+1)/ρ\delta\ge(k+1)/\rho, and assume for a contradiction that Alg has competitive ratio less than ρ+k+1\rho+k+1. Then Lemma 6.2 gives a deterministic algorithm Alg′ with competitive ratio less than ρ+k+11+δ≤ρ+k+11+(k+1)/ρ=ρ\frac{\rho+k+1}{1+\delta} \le\frac{\rho+k+1}{1+(k+1)/\rho}=\rho, contradicting the assumed deadline lower bound.

Now, suppose that 0<δ<(k+1)/ρ0<\delta<(k+1)/\rho. Fix N≥1N \ge1 and a set of k+1k+1 pages containing the initial cache. At each time 2i2i, for i=0,…,N−1i=0,\ldots,N-1, issue one request to the unique page in this set outside Alg’s cache. Let its delay grow linearly from zero to δ\delta during the next time unit, stay at δ\delta until absolute time 2N2N, and grow linearly and unboundedly thereafter. Alg makes exactly one fetch per round, and thus Alg⁡=(1+δ)N\operatorname{Alg}=(1+\delta)N.

For an offline comparator, choose a page receiving the fewest requests. This page receives at most N/(k+1)N/(k+1) requests. An offline schedule may use at most one initial fetch to cache all other pages, keep this cache until time 2N2N, and then fetch the omitted page if necessary. All requests to the other pages are served at arrival, and each request to the omitted page incurs delay at most δ\delta. Therefore,

Opt⁡≤Nδk+1+2.\operatorname{Opt}\le\frac{N\delta}{k+1}+2.

By letting N→∞N\to\infty, this gives a lower bound on the competitive ratio of at least

(1+δ)(k+1)δ=(k+1)(1+1δ)>(k+1)(1+ρk+1)=ρ+k+1.\frac{(1+\delta)(k+1)}{\delta}=(k+1)\left(1+\frac{1}{\delta}\right)>(k+1)\left(1+\frac{\rho}{k+1}\right)=\rho+k+1.

The above results imply the correctness of the following theorem:

Theorem 6.4. No threshold algorithm has competitive ratio less than 2k+322k+\frac{3}{2} for online paging with delay on at least k+2k+2 pages.

Proof. Apply Proposition 6.3 with ρ=k+12\rho=k+\frac{1}{2}, using Theorem 1.3.

Discussion and future work

One open question is to determine the optimal deterministic competitive ratio for paging with delay on at least k+2k+2 pages. Our results leave a gap between the lower bound of 2k+12k+1 and the upper bound of 2k+22k+2. Although the latter bound is tight for fixed-threshold FIFO, it need not be optimal among all online algorithms. Moreover, our lower bound of 2k+322k+\frac{3}{2} for fixed-threshold algorithms shows that attaining a competitive ratio of 2k+12k+1, if possible, would require an algorithm outside this class. Even for n=4n=4 and k=2k=2, the optimal deterministic competitive ratio for paging with delay remains between 5 and 6.

Paging with deadlines helps isolate the cache-replacement difficulty from the additional decision of when to serve requests under delay costs. For this variant, our deterministic bounds are k+12k+\frac{1}{2} and k+1k+1. Understanding this gap may also help clarify the remaining gap for paging with delay. In particular, Proposition 6.3 transfers deterministic deadline lower bounds to the fixed-threshold class, with an additive increase of k+1k+1. However, this connection alone does not resolve the optimal competitive ratio for unrestricted delay algorithms.

Another important direction is to understand the benefit of randomization against an oblivious adversary. We leave both closing the remaining gaps in the deterministic competitive ratios and investigating the power of randomization to future work.

Acknowledgments

We would like to thank Yann Disser for useful discussions and feedback. Darya Melnyk is supported by German Research Foundation (DFG), Schwerpunktprogramm SPP 2378 - ReNO2 (grant 511099228), 2025-2029. Linda Thelen is supported by a doctoral scholarship from the Studienstiftung des deutschen Volkes. Yuyi Wang is supported by the Science and Technology Innovation Program of Hunan Province (No.2026RC1078).

Disclosure of AI assistance An initial draft of the (2k+2)(2k+2)-competitive upper bound (Theorem 1.2) was obtained with the assistance of GPT-5.6 Sol to develop the argument. After we proved the (2k+1)(2k+1)-competitive bound on k+1k+1 pages by hand, asking GPT-5.6 Sol for potential-based proofs for the competitive ratio of classical FIFO pointed us to the rank potential, which we then used to reprove and unify the two results. The lower bound of k+12k+\frac{1}{2} for deadline algorithms was obtained with the help of Claude Opus 5.5, after turning the basic idea of the construction of Theorem 6.1 into a computational search over instances on four pages with k=2k=2. We then generalized the resulting rule on small instances to arbitrary universe size n=k+2n=k+2. The proof formalizations in Lean were written entirely by Claude Opus 5.5, and the problem and algorithm definitions were written both by human authors and Claude Opus 5.5.

The authors independently checked all resulting proofs and take full responsibility for the content and accuracy of the paper, including any errors that may remain.

References

  1. [1]Y. Azar, A. Ganesh, R. Ge, and D. Panigrahi. Online service with delay. ACM Transactions on Algorithms, 17(3):23:1–23:31, 2021. doi: 10.1145/3459925. (STOC 2017).
  2. [2]N. Bansal, N. Buchbinder, and J. Naor. A primal-dual randomized algorithm for weighted paging. Journal of the ACM, 59(4):19:1–19:24, 2012. doi: 10.1145/2339123.2339126.DOI
  3. [3]L. A. Belady. A study of replacement algorithms for a virtual-storage computer. IBM Systems Journal, 5(2):78–101, 1966. doi: 10.1147/sj.52.0078.DOI
  4. [4]M. Bienkowski, A. Kraska, and P. Schmidt. Online service with delay on a line. In Proceedings of the 25th International Colloquium on Structural Information and Communication Complexity (SIROCCO), volume 11085 of LNCS, pages 237–248. Springer, 2018. doi: 10.1007/978-3-030-01325-7\_22.DOI
  5. [5]A. Borodin, N. Linial, and M. E. Saks. An optimal on-line algorithm for metrical task system. Journal of the ACM, 39(4):745–763, 1992. doi: 10.1145/146585.146588.DOI
  6. [6]D. R. Dooly, S. A. Goldman, and S. D. Scott. TCP dynamic acknowledgment delay: Theory and practice (extended abstract). In Proceedings of the 30th Annual ACM Symposium on Theory of Computing (STOC), pages 389–398. ACM, 1998. doi: 10.1145/276698.276792.DOI
  7. [7]D. R. Dooly, S. A. Goldman, and S. D. Scott. On-line analysis of the TCP acknowledgment delay problem. Journal of the ACM, 48(2):243–273, 2001. doi: 10.1145/375827.375843.DOI
  8. [8]Y. Emek, S. Kutten, and R. Wattenhofer. Online matching: Haste makes waste! In Proceedings of the 48th Annual ACM Symposium on Theory of Computing (STOC), pages 333–344. ACM, 2016. doi: 10.1145/2897518.2897557.DOI
  9. [9]E. Feuerstein and A. Marchetti-Spaccamela. Memory paging for connectivity and path problems in graphs. Journal of Graph Algorithms and Applications, 2(6):1–22, 1998. doi: 10.7155/jgaa.00009.DOI
  10. [10]A. Fiat, R. M. Karp, M. Luby, L. A. McGeoch, D. D. Sleator, and N. E. Young. Competitive paging algorithms. Journal of Algorithms, 12(4):685–699, 1991. doi: 10.1016/0196-6774(91)90041-V.DOI
  11. [11]A. Gupta, A. Kumar, and D. Panigrahi. A hitting set relaxation for k-server and an extension to time-windows. In Proceedings of the 62nd IEEE Annual Symposium on Foundations of Computer Science (FOCS), pages 504–515. IEEE, 2021. doi: 10.1109/FOCS52979.2021.00057.DOI
  12. [12]A. Gupta, A. Kumar, and D. Panigrahi. Caching with time windows and delays. SIAM Journal on Computing, 51(4):975–1017, 2022. doi: 10.1137/20M1346286. (STOC 2020).DOI
  13. [13]P. Krnetić, D. Melnyk, Y. Wang, and R. Wattenhofer. The k-server problem with delays on the uniform metric space. In Proceedings of the 31st International Symposium on Algorithms and Computation (ISAAC), volume 181 of LIPIcs, pages 61:1–61:13. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2020. doi: 10.4230/LIPIcs.ISAAC.2020.61.DOI
  14. [14]T. Lykouris and S. Vassilvitskii. Competitive caching with machine learned advice. Journal of the ACM, 68(4):24:1–24:25, 2021. doi: 10.1145/3447579.
  15. [15]M. S. Manasse, L. A. McGeoch, and D. D. Sleator. Competitive algorithms for on-line problems. In Proceedings of the 20th Annual ACM Symposium on Theory of Computing (STOC), pages 322–333. ACM, 1988. doi: 10.1145/62212.62243.DOI
  16. [16]D. Rohatgi. Near-optimal bounds for online caching with machine learned advice. In Proceedings of the 31st Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 1834–1845. SIAM, 2020. doi: 10.1137/1.9781611975994.112.DOI
  17. [17]D. D. Sleator and R. E. Tarjan. Amortized efficiency of list update and paging rules. Communications of the ACM, 28(2):202–208, 1985. doi: 10.1145/2786.2793.DOI
  18. [18]N. Touitou. Improved and deterministic online service with deadlines or delay. In Proceedings of the 55th Annual ACM Symposium on Theory of Computing (STOC), pages 761–774. ACM, 2023. doi: 10.1145/3564246.3585107.DOI
  19. [19]N. Touitou. Nearly-optimal algorithm for non-clairvoyant service with delay. In Proceedings of the 42nd International Symposium on Theoretical Aspects of Computer Science (STACS), volume 327 of LIPIcs, pages 74:1–74:21. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2025. doi: 10.4230/LIPIcs.STACS.2025.74.DOI

Paper details

vlnc:W_4gcv4duj
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

GPT-5.6 Sol (bare), Claude Opus 5.5 (bare)

View statement
Looking for related papers…
Contents