Manuscript Offprint
arXiv:2610.30430Tight Bounds for Paging with Time Windows and Joint Replenishment with Varying Opening Costs
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
We study the paging with time windows problem, a natural generalization of classical paging, in which each request must be served within a specified time interval. This model allows the algorithm to delay service and batch service requests over time, but also introduces significant challenges due to overlapping requests. While the problem is well understood in the unweighted setting, where optimal -competitive algorithms are known, the weighted case remains more elusive. The best previously known algorithm, due to Gupta, Kumar, and Panigrahi [20], achieves an -competitive ratio, leaving a gap between weighted and unweighted settings.
We obtain an -competitive algorithm for weighted paging with time windows, matching the optimal competitive ratio. The core of our approach is a structural decomposition that separates the evolution of the cache from the scheduling of page loads. We show that, given a sequence of cache configurations, computing a near-optimal sequence of page loads reduces to a variant of the Joint Replenishment Problem with deadlines (JRP-D) with time-dependent opening costs. We design a constant-competitive online algorithm for this variant and prove that the reduction is tight. Combining this with an existing online construction of cache configurations yields the desired bound.
Supported in part by ISF grant 3001/24 and United States–Israel BSF grant 2022418.
1 Introduction
In the classical weighted paging problem there is a universe of n pages, where each page p has a weight , and there is a cache that can hold up to k pages. At each time step, a page is requested, and if the requested page is already in the cache then no cost is incurred, otherwise, the page must be loaded into the cache, incurring a cost equal to its weight. The goal is to minimize the total cost incurred. In the unweighted version of the problem, all weights are equal (unit weights).
Paging is one of the earliest and most extensively studied problems in online computation and competitive analysis [26, 18, 27, 29, 25, 6, 5, 1, 2, 10, 9, 21, 22, 23], including works on non-standard caching models, e.g., elastic caches [19], caching with time windows [20], caching with dynamic weights [16], and caching with machine learning predictions [24]. In fact, online paging has become a focal point for many of the recent developments in competitive analysis, e.g., the online primal-dual method, projections, and mirror descent [14, 12, 11].
In their seminal paper, Sleator and Tarjan [26] showed that any deterministic online algorithm is at least k-competitive and that the LRU policy (Least Recently Used) is exactly k-competitive for unweighted paging. The k-competitive bound was later generalized to weighted paging as well [15, 28]. When randomization is allowed, Fiat et al. [18] gave the elegant randomized marking algorithm for unweighted paging, which is -competitive against an oblivious adversary. Bansal et al. [6] gave a -competitive randomized algorithm for weighted paging based on the online primal-dual framework [14].
We now elaborate on the two problems on which we focus in the paper.
Paging with time windows. A natural and well-studied generalization is paging with time windows, where each request must be served within a specified interval. Formally, a request is represented by a triple , where is the requested page, is the release time, and is the deadline for serving it. A request is satisfied if page is present in the cache at some time during the interval .
This model significantly increases the flexibility of any paging algorithm, allowing it to delay service, while batching together the service of several requests with overlapping time windows. At the same time, it introduces new challenges, as requests may overlap and interact in complex ways.
In the unweighted setting, Azar et al. [4] showed that paging with time windows admits an -competitive deterministic algorithm and an -competitive randomized algorithm. The latter matches the optimal randomized guarantee for classical paging up to constant factors. At a high level, the randomized algorithm delays loading a page until the deadline of one of its pending requests, thereby batching together overlapping requests for the same page.
However, in the weighted setting, the authors of [4] showed that this structural approach no longer holds, although the lower bound for deterministic algorithms continues to hold. Gupta et al. [20] subsequently introduced a novel LP formulation based on sophisticated covering constraints. They showed that paging with time windows is NP-hard and APX-hard even when k = 1 and all pages have unit weight. Nevertheless, their LP has a constant integrality gap, yielding an -approximation algorithm for the problem. In the online setting, they obtained an -competitive algorithm for weighted paging with time windows, which remains the best known bound to date.
Gupta et al. [20] also considered the more general problem of paging with delays. Here, each request is represented by a triple , where is the requested page, is the release time, and is a non-decreasing delay-loss function associated with . If request is served at time , the algorithm incurs delay cost . The objective is to minimize the total weight of the loaded pages plus the total delay costs incurred by all requests.

Figure 1: A depth-2 tree view of JRP. The root represents the warehouse, with opening cost 12, and each leaf represents an item together with its item cost. An order corresponds to selecting the root together with any subset of the leaves. For example, serving items incurs total cost , while serving only item 4 costs .
This formulation strictly generalizes paging with time windows: a request with deadline d and release time s corresponds to the delay function that is 0 throughout the interval and afterwards. Gupta et al. [20] showed how to extend their algorithmic framework from paging with time windows to paging with delays, while preserving the same asymptotic competitive guarantees.
We focus primarily on the time-window formulation in the paper in order to present the main ideas more cleanly, though our techniques naturally extend to the more general setting of paging with delays.
Joint Replenishment Problem. A well-studied problem that turns out to be closely related to paging with time windows is the Joint Replenishment Problem with deadlines (JRP-D). The problem can be viewed as a depth-2 tree (see Figure 1), consisting of a warehouse at the root and a single leaf for each item, with a bijection between items and leaves. Requests for items arrive over time and an item can be requested multiple times. At any time t, an order can be placed by opening the warehouse and selecting a subset of the leaves with pending requests for items. A request for an item is served at time t if its corresponding leaf is included in the order. Opening the warehouse incurs a fixed cost, while serving requests for item i incurs an additional item-specific cost .
Requests for items must be served within prescribed time intervals. Equivalently, serving a request after its deadline incurs infinite cost. An algorithm may place an order at any time and use it to serve multiple pending requests simultaneously. Thus, the main trade-off is between serving requests immediately vs. delaying service to batch multiple requests together. While the opening cost may be smaller than the item costs in general, the most interesting regime is when the opening cost is large, making it advantageous to postpone service and aggregate requests belonging to different items into a single order. For this problem, Bienkowski et al. [8] gave a 2-competitive online algorithm, matching the optimal competitive ratio.
JRP-D is a special case of the more general Joint Replenishment Problem (JRP), in which requests incur arbitrary delay costs while awaiting service, rather than hard deadlines. JRP and its variants have been extensively studied in both offline [3, 7] and online settings. In particular, Buchbinder et al. [13] showed that JRP admits a 3-competitive online algorithm.
In this work, we study a variant of JRP-D with time-dependent warehouse opening costs. Unlike the classical setting, the algorithm must account not only for the possibility of batching requests, but also for changes in the cost of placing an order. Although time-dependent opening costs have previously been investigated experimentally [17], we examine this setting from the perspective of online competitive analysis. As we show, paging with time windows admits a natural reduction to this JRP-D variant.
Throughout the paper, when discussing randomized algorithms, all costs and competitive guarantees are in expectation, unless stated otherwise.
This representation is purely conceptual: it does not alter the objective function, but rather decomposes a paging solution into two components, corresponding to cache evolution and page-load scheduling. Given a request sequence , let denote the cost of the solution represented by a feasible pair . We define , where the minimum is taken over all completions of that are feasible for . When the request sequence is clear from context, we omit the subscript and write and .
Furthermore, we show that the online cache-configuration construction implicit in [20] yields a cache trajectory C, i.e., a sequence of cache configurations, satisfying
where OPT denotes the cost of an optimal offline solution to paging with time windows.
Our second contribution is to isolate the completion problem as a problem in its own right. In the completion problem, the sequence of cache configurations C is fixed, but revealed online, and the goal is to compute a feasible minimum-cost completion of C. We show that the completion problem can be formulated as an instance of JRP with deadlines (JRP-D) with time-dependent opening costs, i.e., opening costs can vary over time.
The varying opening costs make this problem fundamentally harder than classical JRP-D, as without additional information about the future no bounded competitive ratio is possible. To get around this difficulty, we introduce a prediction-augmented model in which the algorithm receives limited information regarding future opening costs. Specifically, for each request that has been released but not yet served, which we call an active request, the prediction identifies the cheapest opening opportunity before its deadline. In fact, we show that an even weaker prediction suffices to obtain a constant-competitive online algorithm.
Theorem 1.1. There exists a constant-competitive online algorithm for JRP-D with time-dependent opening costs under our prediction model.
Our next contribution is to show that the prediction required by the JRP-D algorithm is naturally available in the reduction we provide from paging with time windows. In fact, the prediction used by the JRP-D algorithm in this case is simply the weight of the page whose pending request has the earliest deadline. Consequently, given any sequence of cache configurations C revealed online, our algorithm computes online a completion D satisfying
Combining this completion procedure with the cache-configuration bound in (11) immediately yields
and therefore an -competitive online algorithm for paging with time windows, improving upon the previous -competitive bound of Gupta et al. [20].
Theorem 1.2. There exists a randomized -competitive online algorithm for weighted paging with time windows.
The same framework also yields an -competitive algorithm for the more general paging-with-delays model of Gupta et al. [20].
Theorem 1.3. There exists a randomized -competitive online algorithm for weighted paging with delays.
1.2 Technical overview
Separating cache configurations from page loads. A key contribution of Gupta et al. [20] is a novel LP formulation for paging with time windows based on sophisticated covering constraints (see Section 2.2 for details). Their framework proceeds in two stages. First, they compute an online fractional solution to their LP and round it to an integral solution. This rounding incurs only an loss in the offline setting, but an loss online. The resulting integral solution, however, is not necessarily a feasible solution. In the second stage, they convert it into a feasible paging solution. This conversion incurs only an additional loss offline, yet an additional loss online, resulting in an -competitive algorithm.
Although this distinction is not made explicit in [20], a closer examination of [20] reveals that both online and offline conversion algorithms produce the exact same cache configuration at the end of every time step. The only difference lies in how they schedule the “extra” page loads used to satisfy pending requests. This raises a natural question: if both algorithms maintain the same cache configuration at the end of every time step, how does the additional factor arise?
The answer is that in contrast to classical paging, the cache configurations alone do not fully determine the paging solution. In classical paging, one may assume without loss of generality that the only page loaded at each time step is the requested page, which then remains in cache. Consequently, if denotes the cache configuration at time , then the paging cost incurred at time is exactly , where denotes the total weight of the pages in a set . Thus, in the classical setting, the sequence of cache configurations completely determines the solution cost.
In paging with time windows, however, this is no longer the case. Since requests may be delayed and then batched together, an algorithm may load several pages simultaneously at a single time step. Moreover, a page may be loaded only to satisfy a pending request and then evicted immediately, without ever appearing in the cache configurations. As a consequence, the quantity may be strictly smaller than the actual cost incurred at time , and the sequence of cache configurations by itself no longer captures all load operations performed by an algorithm.
This distinction motivates our formalism. The cache trajectory records only the pages present at the end of each time step, whereas the completion records all page loads used to serve the request sequence, including (i) pages that are loaded and immediately evicted; and (ii) page loads that are implied by the changes in the cache configurations. Recall that denotes the cost of the solution represented by , and that is the minimum cost over all completions of C. Thus, two solutions may induce the same cache trajectory C while using different completions and incurring different costs.
Although Gupta et al. [20] do not explicitly introduce this decomposition, it is implicit in their analysis. Through the lens of our formalism, their online conversion algorithm takes an integral solution and constructs a pair whose cost is within an factor of that integral solution.
At the same time, the same cache trajectory C does admit (offline) a completion such that is within an factor of the same integral solution. Thus, the additional factor arises entirely from the online construction of D, rather than the cache trajectory C itself. We formalize this reinterpretation in Section 2.4.
This perspective suggests focusing exclusively on the completion problem. Our goal is therefore the following. Given a sequence of cache configurations C revealed online, compute online a completion D such that .
A replenishment view of the completion problem. To compute such a completion , we reinterpret the problem as a covering problem over time. Consider a request such that . In order for a pair to be feasible, page must appear in one of the sets for . Thus, every such request naturally induces a covering constraint over its time window.
The second key observation concerns the cost of loading a set of pages while following a fixed cache trajectory . Assume throughout that the cache is full at every time step, i.e., for all . Suppose that at time we wish to load a set of pages in order to serve active requests, where .
First, suppose that . The transition from to already creates space for loading pages: the pages in are evicted, while the pages in are loaded as part of . We may therefore load all pages in while realizing the prescribed cache transition, with .
In contrast, suppose that . Since the cache is full, loading a page outside the cache requires temporarily evicting a page from . We may evict a minimum-weight page , load and immediately evict the pages in (one by one), and finally reload so that the cache configuration at the end of the time step is again . In this case, , and the additional cost of performing the load is .
This suggests viewing the completion problem as a replenishment problem, where loading the pages in corresponds to serving a set of items. If the cache configuration changes at time , the opening cost is effectively 0, since the pages in can be loaded as part of the mandatory cache transition. If instead the cache configuration remains unchanged, performing a load may require an additional cost of , corresponding to evicting and subsequently reloading a minimum-weight page from . This page plays the role of the warehouse in a JRP instance. For simplicity, we define the opening cost at every time as
The JRP formulation may therefore charge slightly more than the corresponding paging load: at times when the cache changes, the opening cost is charged separately even though the cache transition itself already provides the required loading opportunity. However, this additional cost can be charged to the pages loaded as part of the cache transition, increasing the total cost by at most a factor of 2.
Taken together, these observations naturally define an instance of JRP-D with time-dependent opening costs. Each page corresponds to an item, represented by a leaf in the JRP tree (see Figure 1). The covering constraints induced by the requests specify the time intervals during which the requests must be served. At every time t, an order specifies a set of pages to load. The cost of placing an order consists of the opening cost together with the costs of the items served by the order.
We show that this reduction faithfully captures the completion problem. Every completion of C induces a feasible solution to with comparable cost, and conversely, every solution to can be transformed online into a feasible completion of C with no asymptotic loss. Consequently, solving is, up to a constant factor, equivalent to solving the completion problem.
JRP-D with time-dependent opening costs. The next challenge is therefore to design an online algorithm for JRP-D with time-dependent opening costs. Unlike the classical JRP-D setting, where the opening cost is fixed, in our model the opening costs may vary significantly over time. Without additional information, this makes the problem substantially harder: an online algorithm may place an expensive order shortly before a much cheaper opening opportunity occurs, leading to an unbounded competitive ratio.
To get around this difficulty, we consider a prediction-augmented setting that provides information about cheaper future opening opportunities before the earliest pending deadline, allowing an algorithm to decide whether to serve a request immediately or postpone service. As in paging with time windows, release and deadline times of each JRP-D request are denoted by and , respectively. For times define . For a request for item , define . Thus, may overestimate the minimum opening cost when .
The prediction value of a request at time , denoted by , is defined as follows. If there exists a request whose time window satisfies , then may take any value in ; otherwise, . The algorithm has access to only when has the earliest deadline among the requests that are active at that point. Thus, as requests are served, predictions for later-deadline active requests become available. Using these predictions, the algorithm decides whether a current earliest-deadline request should be served immediately or deferred in anticipation of a cheaper future opening opportunity.
Importantly, the required predictions are naturally available in the paging reduction. Consider an active page request for page . We show that, if no request that has not yet arrived has a deadline earlier than , then one may assume that . Therefore, , and hence . Thus, whenever the prediction is required to be exact, the paging reduction naturally provides it: the prediction value is simply the weight of the requested page.
When a request that has not yet arrived has an earlier deadline, the exact value may depend on information that is not yet available at . In this case, our prediction model permits an arbitrary underestimation of . In particular, the reduction may provide the value , which is valid since . Thus, even when the exact prediction value cannot yet be determined, the reduction provides a valid prediction to the JRP algorithm.
Using this prediction model, we design a constant-competitive online algorithm for JRP-D with time-dependent opening costs. Combining the reduction with our JRP algorithm yields an online procedure that, given a sequence of cache configurations C, computes a completion D satisfying .
Combining this completion procedure with the cache-configuration bound in (11) yields
and therefore an -competitive online algorithm for paging with time windows.
Our techniques also extend to the more general paging-with-delays model introduced by Gupta et al. [20]. They first show that paging with delays is equivalent to a variant of paging with time windows in which requests can remain unserved at the cost of paying a request-specific penalty.
For intuition, suppose p is the only page with deadline . Any feasible solution may postpone loading p until time . Furthermore, if p is evicted at time in order to load another page q, then the same load can instead be performed at time . This preserves feasibility, since no other request has deadline , and incurs the same cost. Hence, there exists an optimal solution in which p belongs to the cache at time . The general case, without the uniqueness assumption, is addressed in Lemma B.1.
Then they extend their analysis of paging with time windows to this penalty model. We show that our analysis admits the same extension, yielding an -competitive algorithm for paging with a general delay function as well.
Organization. The remainder of the paper is organized as follows. In Section 2, we define the problems we consider, introduce our approach, and expand on previous work. In Section 3, we define the reduction from paging with time windows to JRP-D with time-dependent opening costs. In Section 4, we present and analyze our constant-competitive algorithm for JRP-D with time-dependent opening costs. Finally, Appendix A extends our framework to paging with delays.
2 Our Model and Approach
2.1 Paging with Time Windows
In the paging with time windows problem, there is a universe of pages, denoted by . Each page is associated with a positive weight , and there is a cache of size . The system evolves over discrete time steps . At each time , the cache stores a subset of pages , referred to as the cache configuration at time . Without loss of generality, we assume that at every time , since there is no benefit to evicting a page unless another page is loaded in its place.
Requests. Requests arrive over time. Each request specifies a page , a release time , and a deadline , defining a time window . In the online setting, a request becomes known only at time . A request is served if the page is present in the cache at some time . Note that pages can be loaded and evicted at the same time step, thus allowing for multiple requests to be served simultaneously.
Cost. The cost of an algorithm is the total cost of all page loads over the time horizon. Loading a page p into the cache incurs cost , while evictions are free. Some prior work instead charges for page evictions; the two cost measures are equivalent up to an additive term determined by the initial and final cache configurations. The objective is to minimize the total cost while serving all requests.
The classical paging problem corresponds to the special case in which every request satisfies .
2.2 Prior Work: Gupta et al. [20]
The main difficulty in extending classical paging to the time-window setting arises from limitations of standard linear programming (LP) relaxations. In classical weighted paging, a request for page p at time t requires the page to reside in cache at time t. In contrast, in paging with time windows, a request r only requires that appear in the cache at some time during the interval .
A natural LP relaxation would therefore require that the total fractional residency of page over the interval be at least 1. However, Gupta et al. [20] showed that this formulation suffers from an integrality gap of . Intuitively, such a fractional solution can satisfy a request by keeping a small fraction of the page in cache throughout the entire window, while an integral solution must eventually pay the full cost .
To overcome this issue, Gupta et al. [20] introduced a fundamentally different LP formulation based on sophisticated covering constraints, which they call the hitting-set LP. For each page and time , the variable represents the extent to which page is evicted at time .
At a high level, the LP guarantees cache capacity through covering constraints over time intervals. Informally, if an interval I contains requests to distinct pages, then the cache cannot simultaneously retain all of them throughout I, and therefore at least one of these pages must be evicted during the interval. The LP utilizes this observation by requiring that every such pair , where S is a set of pages requested during I, be “hit” by an eviction within the time interval of one of the pages in S.
In the standard LP formulations for paging, the LP directly specifies which pages reside in cache at each time step. In contrast, the hitting-set LP only determines when pages are evicted, and does not explicitly specify how requests are served. Consequently, an integral solution to the hitting-set LP does not immediately define a feasible paging schedule. Solving paging with time windows therefore requires addressing two separate challenges: first, rounding the fractional LP solution online, and second, transforming the resulting eviction schedule into a feasible paging solution.
Gupta et al. [20] showed that the hitting-set LP admits an online rounding procedure with an loss and an offline rounding procedure with only an loss, both relative to the optimal fractional solution. Their approach exploits the interval structure of the constraints and refines the primal-dual techniques developed by Bansal et al. [14] for the classical weighted paging LP.
To bridge the gap between the rounded eviction schedule and a feasible paging solution, Gupta et al. [20] introduced an additional scheduling layer. At each time step t, the algorithm determines whether a page must be loaded into the cache. Before updating the cache configuration, the algorithm may also perform additional “load-and-evict” operations: pages are loaded in order to satisfy requests and are evicted within the same time step, thus not appearing in .
Implementing this scheduling layer is precisely what separates the online and offline guarantees. The offline algorithm uses future knowledge of the cache trajectory to coordinate these “load-and-evict” operations more efficiently, achieving only an loss relative to the rounded hitting-set LP solution. In contrast, the online algorithm incurs an additional factor, resulting in an overall -competitive ratio.
This gap is the starting point of our work. It suggests that the remaining difficulty in obtaining an optimal online algorithm lies not in constructing the cache trajectory itself, but in scheduling the additional page loads needed to satisfy requests.
2.3 Our Approach
The discussion above suggests that paging with time windows can be naturally decomposed into two tasks: determining how the cache evolves over time, and then deciding which additional pages to load in order to serve unsatisfied requests. While these two tasks are intertwined in the online algorithm of Gupta et al. [20], their offline algorithm suggests that they can be partially decoupled: after the cache configurations are determined, a final scheduling step is used to complete the solution by specifying the additional page loads.
Our approach is to formalize this separation. Intuitively, the cache trajectory captures the structural decisions of the algorithm, while the loading schedule determines how requests are served. The cache trajectory is not known in advance, but is revealed online one configuration at a time. Given this trajectory, the remaining task is to construct a loading schedule online that satisfies all requests at minimum cost.
At first glance, this is an interval-covering problem: each request induces a time interval during which its page must be loaded, and loading a page can simultaneously cover multiple overlapping intervals. However, the cache trajectory makes loading pages at certain times inherently more expensive than at other times, as a load may require an additional page to be evicted and then reloaded in order to preserve the given cache configuration. This creates a batching trade-off analogous to that in JRP-D, where serving a set of items requires paying an opening cost (of the warehouse) in addition to the item costs.
Solutions. We represent a solution using two components. Let denote a sequence of cache configurations, where is the set of pages in the cache at the end of time . Let denote a sequence of page loads, where is the set of pages loaded at time . A page belongs to whenever it is loaded at time , i.e., if it is reloaded at the same time step that it is evicted, or if it is immediately evicted after it is loaded.
Feasibility. A pair is a feasible solution if it satisfies the following conditions:
• Capacity. For every time , .
-
Consistency. For every time , . This implies that, for any page , if there exist times such that but , then there exists a time such that .
-
Non-degeneracy. For every time , if , then . That is, whenever pages are loaded at time , at least one of the loaded pages remains in cache at the end of the time step. For example, if and a page is temporarily evicted to create space and subsequently reloaded, then .
-
Service. For every request , the requested page must appear in the cache at some time during the interval . Equivalently, a request is served if either is already present in the cache at the beginning of its window, or it is loaded at some time during the window. Formally, .
Cost. The cost of a feasible pair with respect to a request sequence is . For an infeasible pair , we define .
Observe that by the consistency condition, every page that is not in , but belongs to , must be loaded at time and hence belongs to . Consequently, any feasible pair satisfies . The left-hand side is precisely the cost incurred at time in classical weighted paging, where only pages that remain in cache are loaded. Equality need not hold in paging with time windows, since pages may be loaded solely to satisfy requests and evicted immediately afterwards.
For a fixed sequence of cache configurations , we define .
Critical pages. For every time , define as the set of pages that enter the cache at time . By the consistency condition, every such page must be loaded at time , and therefore . We refer to as the set of critical pages at time .
2.4 A Reinterpretation of Gupta et al. [20]
The separation between cache configurations and page loads allows us to reinterpret the guarantees of Gupta et al. [20] in terms of the quantity . Consider any integral solution to their hitting-set LP whose objective value is M, and let C be the cache trajectory obtained online from this solution. They provide an online conversion procedure that builds on the cache trajectory and yields a feasible solution. (To this end, recall that it is allowed to load a page p and then immediately evict it, so that p does not appear in the cache configuration at the end of the time step.) They also provide an offline conversion procedure that optimizes the online solution by considering for each page p the times at which such load-and-evict operations occur and removing some of these loads, while preserving feasibility. Since only loads of pages that do not remain in cache are removed, the cache trajectory C remains unchanged.
The resulting offline completion computed by [20] is feasible and satisfies . Since is defined as the minimum cost of any completion of , it follows that .
Thus, every integral LP solution naturally induces a cache trajectory whose completion cost is within a constant factor of the LP objective value.
Gupta et al. [20] further showed how to construct online an integral solution whose objective value satisfies , where OPT denotes the cost of an optimal offline solution to paging with time windows. We combine the two observations and get the following.
Lemma 2.1. There exists an online algorithm that constructs a cache trajectory C satisfying .
Lemma 2.1 shows that an -competitive algorithm for paging with time windows can be obtained by completing the cache trajectory C produced online by Gupta et al. [20]. Thus, it remains to solve the completion problem online: at each time t, the algorithm observes and computes a completion D, satisfying .
2.5 Joint Replenishment Problem (JRP)
To formulate the completion problem as a replenishment problem, we introduce a variant of JRP that will be central to our reduction. Joint replenishment is defined over a discrete time horizon and a set of items , where each item has cost . In our setting, items correspond to pages.
Each request is specified by a triple , where is the requested item, is the release time, and is the delay cost incurred if is served at time .
A solution consists of choosing, for each time , a set of items to be served at time . If , we say that an order is placed at time . A request is served at the earliest time such that . The cost of a solution has three components:
• Opening cost. For each time with , we pay a cost for opening the warehouse.
• Item cost. For each time and each item , we pay .
• Delay cost. For each request r served at time t, we pay .
The objective is to minimize the total cost.
JRP with deadlines. A special case of JRP is obtained when each request is specified by a triple , where is its deadline, and must be served within the interval . This corresponds to the delay-cost function
We refer to this variant as JRP with deadlines (JRP-D).
JRP-D with time-dependent opening costs. We consider a variant of JRP-D in which the fixed opening cost is replaced by a time-dependent opening cost . This additional flexibility makes the problem substantially harder in the online setting. Consider an instance with a single item of cost and a single request . Let the opening cost at time 1 be . At time 2, the opening cost is either or , and its value is not known to the online algorithm at time 1.
If the algorithm waits until time 2, then when it pays , while the optimum pays by serving at time 1. Thus, any bounded-competitive algorithm must serve at time 1. However, when , the algorithm then pays , while the optimum waits until time 2 and pays 1. Hence, the competitive ratio is at least , which is unbounded. Therefore, no online algorithm can achieve a bounded competitive ratio without additional information on future opening costs.
To get around this difficulty, we consider a prediction-augmented setting. For times , define , the minimum opening cost during the interval . For a request to item , define . Thus, may overestimate the minimum opening cost in cases where .
The prediction value of a request at time , denoted by , is defined as follows. If there exists a request whose time window satisfies , then may be any value in ; otherwise, .
We next specify which prediction values are available to the algorithm. A request is active at time t if it has arrived, but has not yet been served, and an item is active if it has an active request. During the construction of an order, requests for items already committed to that order are treated as inactive for subsequent prediction queries. All committed items must be served by the order placed at the same time step.
The algorithm has access to only when r has the earliest deadline among the requests active at that point. Thus, committing items to an order may make predictions for other active requests available.
3 A Reduction for Completing Cache Configurations
We study here the completion problem: given a sequence of cache configurations C, what is the minimum cost of completing it into a feasible paging solution? We show that this problem is captured, up to a constant factor, by a suitable instance of the JRP-D variant introduced in Section 2.5. We prove that the reduction preserves the completion problem up to a constant factor. First, any completion of C induces a feasible solution to with comparable cost. Second, any solution to can be transformed online into a feasible completion of C with no asymptotic loss. Consequently, characterizes up to a constant factor.
3.1 Defining the Instance
Fix a sequence of page requests and a cache trajectory . We construct an instance of JRP-D with time-dependent opening costs. Since is fixed throughout the discussion, we omit it from the notation and write and . To distinguish between the two problems, we refer to requests in as page requests and to requests in as JRP requests.
The instance has three ingredients: items, JRP requests, and time-dependent opening costs. The items correspond to pages, the JRP requests encode the page loads required for feasibility, and the opening cost at time t captures the additional cost of performing a load while following the cache trajectory C.
Items. For each page , there is a corresponding item with item cost .
Opening costs. By the non-degeneracy condition (see 2.3), every nonempty load must contain a page from . Thus, any load performed at time incurs cost at least .
Motivated by this observation, we define the opening cost at time t by
Observe that this may overestimate the actual cost incurred by a load. For example, if at time a completion loads a single page that remains in cache, that is , then the paging cost incurred at time is , whereas the corresponding order in incurs cost . Thus, the reduction can increase the cost by at most a factor of two, which is reflected in our analysis.
Prediction availability. Suppose that at time , is the active request with the earliest deadline, breaking ties by maximum page weight. Set . If there exists a request with , this prediction is valid because our prediction model permits underestimation and .
Otherwise, let be the set of remaining active requests with deadline . No remaining active request outside , and no unrevealed request, has deadline at most . By Lemma B.1, without loss of generality we may assume that some request in has its page in . By the tie-breaking rule, , and hence
Therefore, , as required by the prediction model in this case.
JRP requests. The JRP requests in encode two requirements: serving page requests and performing page loads forced by the cache trajectory. Let
These are exactly the page requests that are not served by the cache at their release time and must therefore be satisfied by a subsequent page load.
For every page request , we introduce a JRP request for item with release time and deadline . In addition, for every time and every page , we introduce a JRP request for item with release time and deadline both equal to .
The first type of JRP request ensures that every page request in is served within its time window. The second type enforces consistency with the prescribed cache trajectory: if page p enters the cache at time t, then every feasible completion must load p at time t.
Finally, the reduction must preserve the online nature of the problem: at time t, the algorithm must be able to determine and all JRP requests arriving at time t using only information available up to time t.
Theorem 3.1. Given a cache trajectory C revealed online, the instance can be constructed online. In particular, at each time t, the opening cost and all JRP requests arriving at time t depend only on the history up to time t.
3.2 Upper Bounding
We show that any feasible paging solution induces a feasible solution to with comparable cost. In particular, given any sequence of page loads that completes , we can construct a solution to whose cost is within a constant factor of . As a consequence, .
Fix any loading sequence such that is feasible for . Define the associated JRP solution by
Thus, the order serves precisely the items corresponding to the pages loaded at time t.
Feasibility. We claim that is feasible for . Consider a page request for page . Since is feasible for , there exists a time such that . Hence , and the corresponding JRP request is served within its time window.
For every time and page , we have , and thus . Hence, the corresponding JRP request, whose release time and deadline are both , is also served. Thus, is feasible for .
Cost analysis. The item-cost part satisfies
It remains to bound the opening-cost part. Fix a time such that . By the non-degeneracy condition, . Therefore,
Summing over all times with , we obtain
Conclusion. We conclude that for every feasible ,
Taking the minimum over all feasible loading sequences D, we obtain
3.3 From JRP-D Solutions to Paging Solutions
We now show how to complete a cache trajectory C into a feasible paging solution using a solution to the instance .
Let be a feasible solution to , where is the order placed at time . Our goal is to construct a sequence of page loads such that is feasible and has cost comparable to that of .
Construction. We define the loading sequence online as follows. For every time , let be a minimum-weight page in , i.e., , and define
Intuitively, when , we load the pages corresponding to the items in . If , we temporarily evict to create space in the cache, and then load and immediately evict all other pages corresponding to items in (one by one). We then reload to restore the cache configuration . When , evicting and reloading may be unnecessary. For simplicity, we include in and charge its cost to the opening cost of the corresponding JRP order.
Feasibility. We show that is a feasible paging solution.
Capacity. The capacity constraint depends only on C and is therefore satisfied.
Service. Let be a page request. If , then is already served. Otherwise, contains a JRP request for item with release time and deadline . Since is feasible, there exists a time such that . Hence , and is served.
Consistency. Fix a time . If , the consistency condition is immediate. Otherwise, for every page , the instance contains a JRP request for item with release time and deadline both equal to . Since is feasible, , and hence . Thus, .
Non-degeneracy. Fix a time such that . By construction, , and therefore .
Cost analysis. If , then and no cost is incurred. Otherwise,
By the definition of ,
Therefore,
Summing over all times such that , we obtain
Thus, , which completes the proof.
3.4 Consequences for Paging with Time Windows
We now show that a constant-competitive algorithm for JRP-D with time-dependent opening costs, as introduced in Section 2.5, immediately implies an -competitive algorithm for paging with time windows.
Theorem 3.2. Assume there exists a constant-competitive online algorithm for JRP-D with time-dependent opening costs under the prediction model of Section 2.5. Then there exists an online algorithm that, given a sequence R of page requests and a cache trajectory C, computes a completion sequence D online such that is feasible for R and
Proof. Given and , we construct the instance online as in Section 3.1. We then run the assumed constant-competitive algorithm on , obtaining an online solution satisfying
Using the reduction of Section 3.3, we convert S online into a feasible paging solution such that
Finally, by Section 3.2,
Combining these inequalities yields
Combining Theorem 3.2 with Lemma 2.1, we obtain the following.
Theorem 3.3. Assume there exists a constant-competitive online algorithm for JRP-D with time-dependent opening costs under the prediction model of Section 2.5. Then there exists an -competitive online algorithm for paging with time windows.
Proof. Let C be the cache trajectory produced by the algorithm of Lemma 2.1. By Theorem 3.2, we can compute online a loading sequence D satisfying
By Lemma 2.1,
Combining the bounds yields
The next section is devoted to proving the assumption in Theorems 3.2 and 3.3 on the existence of a constant-competitive online algorithm for JRP-D with time-dependent opening costs.
4 JRP-D with Time-Dependent Opening Costs
In this section, we study the variant of JRP-D with time-dependent opening costs introduced in Section 2.5. Recall that placing an order at time t incurs opening cost , and that the algorithm has access to the predictions described in Section 2.5. Throughout this section, we assume that is a power of two for every t. This can be achieved by rounding each opening cost up to the next power of two, increasing the cost of any solution by at most a factor of two.
We now present a constant-competitive online algorithm that combines the classical batching approach of Bienkowski et al. [8] with predictions of future opening costs to handle their variability over time.
4.1 Algorithm
For an active item i, we refer to the deadline of its earliest-deadline active request as the active deadline of i. At each time t, the algorithm constructs a set of items and places an order for if it is nonempty.
The algorithm consists of two stages. Stage I initiates an order either to meet a deadline or based on a prediction of future opening costs. It then greedily adds active items as long as the total cost of does not exceed the opening cost . Stage II uses predictions to determine which additional active items to include. Throughout both stages, the algorithm maintains and processes the active items in nondecreasing order of their active deadlines, breaking ties by nonincreasing item cost and then by item index.
The algorithm performs the following at each time t:
Stage I: Deadline items and greedy batching. The algorithm initializes
If , let be the first active request in the maintained order. If no active request exists, or if
the algorithm proceeds directly to time .
Otherwise, if , the algorithm considers the remaining active items and greedily adds them to as long as the total weight does not exceed . The greedy procedure stops when the next item cannot be added without exceeding .
The algorithm then proceeds to Stage II.
Stage II: Prediction-based orders. The algorithm continues with the set constructed in Stage I and considers the remaining active items in the maintained order. For each such item , let be its earliest-deadline active request. The algorithm stops if either of the following conditions holds:
Otherwise, the algorithm adds i to and continues to the next item.
After stopping, or after considering all remaining active items, the algorithm places an order for if it is nonempty and proceeds to time .
Prediction availability. During the construction of , requests for items already included in are treated as inactive. Whenever the algorithm queries , the request has the earliest deadline among the remaining active requests, and its item has maximum cost among the remaining active items with that deadline. Thus, every prediction queried by the algorithm is available under our prediction model.
4.2 Competitive Analysis
We prove that the algorithm is constant-competitive. Fix an optimal offline solution, denoted by OPT, and partition the time horizon into phases according to the order times of OPT.
Definition 4.1. A phase is a half-open interval between two consecutive order times of OPT.
Fix a phase , and let be the order times of the algorithm during this phase. For convenience, define . We represent each item service by a pair , indicating that item is served at time . We partition these pairs into two sets:
• M: pairs for which the active deadline of i at t is at most .
• N: pairs for which the active deadline of i at t is at least h.
When is clear from context, we write instead of , and similarly for . We also refer to items from or . Note that the same item may appear in both and during a phase, through services at different times.
We analyze the costs associated with M and N separately. We show that the costs associated with M can be charged to the corresponding item costs incurred by OPT and to its opening cost at time g. The costs associated with N are bounded in terms of the opening cost incurred by OPT at time h.
The interval preceding the first OPT order is treated as an initial phase containing only items from N, whose costs are charged to the opening cost of the first OPT order. Similarly, the interval following the last OPT order is treated as a final phase containing only items from M. Its costs are bounded by the analysis of M and charged to the opening cost of the last OPT order and the corresponding item costs incurred by OPT.
Each item cost and opening cost incurred by OPT is charged at most a constant number of times. Thus, summing these bounds over all phases yields the following theorem.
Theorem 4.2. The algorithm is -competitive.
4.2.1 Bounding the Cost of M
The total item cost incurred by the algorithm for services in M can be charged to the corresponding item costs incurred by OPT. Indeed, since OPT places no orders during , the requests defining the active deadlines of these items must be served by OPT by time g.
Lemma 4.3. The total item cost incurred by the algorithm for items in M, summed over all phases, is at most the total item cost incurred by OPT.
Proof. Fix a phase . Since OPT places no orders in , every request defining the active deadline of an item in M must be served by OPT no later than time g.
Moreover, each item appears in M at most once during the phase. Indeed, whenever the algorithm serves an item, it satisfies all its currently active requests. Any subsequent appearance of that item must therefore be due to a request arriving after its previous service, which cannot have a deadline before h.
Finally, between two consecutive appearances of the same item in M across different phases, OPT must also serve that item. Hence, each appearance can be charged to a distinct item cost incurred by OPT.
By Lemma 4.3, it remains to bound the opening costs of orders serving items from M. We will use the following observation throughout the analysis.
Lemma 4.4. Let r be an active request at time with . Then, .
Proof. Suppose there exists a request such that . Then every feasible solution must place an order serving during , contradicting the fact that OPT places no orders in . Hence, by the definition of the prediction model, .
Let be the last index such that the order placed at time contains an item from . We bound the opening costs of the orders serving items from using two lemmas: the first bounds the opening costs of all orders preceding , while the second bounds the opening cost at .
Lemma 4.5. For every , let denote the first item from M served by the order placed at time . Then,
Proof. Fix . Since , it is already active at time and is the first remaining item in deadline order after the order at . If Stage II adds any item, it must first add the item that terminated the greedy procedure in Stage I, implying .
Otherwise, Stage II adds no items and is the item that terminated the greedy procedure in Stage I, and hence
Thus, the claimed inequality holds in all cases.
It remains to bound the opening cost of the last order serving an item from M, placed at time . If , its opening cost can be charged directly to OPT. Otherwise, recall that . If , its opening cost can be charged to the preceding opening cost (or to OPT when ). The following lemma handles the remaining case.
Lemma 4.6. Suppose and . Let be the first item from M served by the order placed at time . Then,
Proof. If , the claim is immediate. Hence, assume that . Let be the earliest-deadline active request of at time . Since , we have , and therefore, by Lemma 4.4, for every satisfying .
We claim that is the minimum opening cost in . First, suppose there exists such that . Then
Since , the item is not due at time . Moreover, since is the first item served at , no active item has an earlier deadline. Thus, Stage I initializes .
As the earliest active request satisfies , Stage I proceeds directly to time without placing an order, contradicting the fact that is served at .
Next, suppose there exists such that , and let be the last such time. By the preceding argument, is the minimum opening cost in . Consequently,
Since no order is placed by the algorithm between and , Stage I initializes . Moreover, is the first active item in deadline order at time .
Since
Stage I performs greedy batching.
If , then Stage I adds to .
Otherwise, , so Stage I cannot add . However, , and hence neither stopping condition of Stage II holds when is considered. Thus, Stage II adds to .
In either case, the algorithm serves at time , a contradiction. Therefore, is the minimum opening cost in , proving the claim. In particular,
If and , then the algorithm places no order at . Since , Stage I cannot skip time . If , greedy batching adds . Otherwise, since , Stage II adds . In either case, the algorithm serves at , a contradiction. Hence, we may assume .
Since the request of remains active after the order at , was not added during Stage I. Moreover, it is the earliest active item remaining after that order. Therefore, Stage II stops when considering .
The first stopping condition cannot hold, since
Therefore, the second stopping condition must hold, giving
as required.
Combining Lemmas 4.5 and 4.6, we obtain
Indeed, every order preceding contains only items from M. Applying Lemma 4.5 to each order preceding bounds its opening cost by the total item cost of that order and the cost of the first item served in the next order. Since all these services belong to M, each item service is charged at most twice. The final opening cost is bounded by , the preceding opening cost, or by Lemma 4.6. By Lemma 4.3, these costs, summed over all phases, are bounded by a constant multiple of the cost incurred by OPT.
4.2.2 Bounding the Cost of N
We next consider items in N. We show that the opening costs of the relevant orders are strictly increasing. Since the opening costs are powers of two, this allows us to bound their total cost by and charge it to the order placed by OPT at time h.
Recall that is the last order time during the phase at which the algorithm serves an item from M. Observe that every order preceding contains only items from M. Indeed, all requests with deadlines before h must have arrived by time g, since OPT places no orders in . Moreover, both stages process items in nondecreasing order of their active deadlines and cannot skip an item to serve one with a later deadline. Thus, an order containing an item from N must serve all remaining items from M, and hence cannot precede .
The total cost of items from N added during Stage I at is at most , and is therefore accounted for by the bound on the opening cost in the analysis of M. We therefore consider the order at only if Stage II adds an item from N, together with all subsequent orders in the phase.
Let
denote these order times. If , we instead consider all orders in the phase. For every such order at time , one of the following holds:
-
Stage II adds at least one item from N.
-
Stage II adds no items, and the order consists entirely of items added during Stage I.
Indeed, after , no active request has deadline before , so Stage I initializes .
Lemma 4.7. For every ,
Moreover, for every ,
Proof. Fix and consider the order at time .
First, suppose Stage II adds an item , and let be its earliest-deadline active request when it is considered.
Since neither stopping condition holds,
and
where denotes the set immediately before adding i.
Using , we obtain
Since , it follows that .
Now suppose Stage II adds no items. Let be the first item added during Stage I, and let be its earliest-deadline active request. Since was initially empty, is the earliest active request at time . Thus, by the condition for initiating greedy batching, .
Moreover, Stage I adds i while maintaining , so . Consequently,
implies . Thus, in either case, there exists an item with active request such that . Since , its active deadline satisfies . Therefore, for every ,
The same argument, applied to instead of , gives for every .
It remains to bound the item costs of these orders.
Fix . If Stage II adds an item from , let be the last such item, and let be its earliest-deadline active request when it is considered. Since the second stopping condition does not hold, . Moreover,
It follows that . Since , we obtain for , and .
Otherwise, Stage II adds no items, so all items in the order were added during Stage I, which guarantees . By Lemma 4.7, the same bounds follow.
Thus, in either case,
By Lemma 4.7, the opening costs form a strictly increasing sequence of powers of two, with . Consequently, both the total opening cost and the total item cost are , giving
Since OPT places an order at time h, these costs can be charged to its opening cost .
AI Usage Disclosure
The authors used ChatGPT to refine and polish the text. All suggestions were reviewed and edited by the authors, who take full responsibility for the final manuscript.
Submission History
An earlier version of this paper was submitted to a conference in July 2026.
References
[1] Dimitris Achlioptas, Marek Chrobak, and John Noga. Competitive analysis of randomized paging algorithms. Theor. Comput. Sci., 234(1-2):203–218, 2000. doi:10.1016/S0304-3975(98)00116-9.
[2] Susanne Albers, Sanjeev Arora, and Sanjeev Khanna. Page replacement for general caching problems. In Robert Endre Tarjan and Tandy J. Warnow, editors, Proceedings of the Tenth Annual ACM-SIAM Symposium on Discrete Algorithms, 17-19 January 1999, Baltimore, Maryland, USA, pages 31–40. ACM/SIAM, 1999. URL: http://dl.acm.org/citation.cfm?id=314500.314528.
[3] Esther Arkin, Dev Joneja, and Robin Roundy. Computational complexity of uncapacitated multi-echelon production planning problems. Operations research letters, 8(2):61–66, 1989.
[4] Yossi Azar, Arun Ganesh, Rong Ge, and Debmalya Panigrahi. Online service with delay. In Proceedings of the 49th Annual ACM SIGACT Symposium on Theory of Computing, pages 551–563, 2017.
[5] Nikhil Bansal, Niv Buchbinder, and Joseph Naor. Randomized competitive algorithms for generalized caching. SIAM J. Comput., 41(2):391–414, 2012. doi:10.1137/090779000.
[6] Nikhil Bansal, Niv Buchbinder, and Joseph Seffi Naor. A primal-dual randomized algorithm for weighted paging. Journal of the ACM (JACM), 59(4):19, 2012.
[7] Luca Becchetti, Alberto Marchetti-Spaccamela, Andrea Vitaletti, Peter Korteweg, Martin Skutella, and Leen Stougie. Latency-constrained aggregation in sensor networks. ACM Transactions on Algorithms (TALG), 6(1):1–20, 2009.
[8] Marcin Bienkowski, Jaroslaw Byrka, Marek Chrobak, Łukasz Jeż, Dorian Nogneng, and Jiří Sgall. Better approximation bounds for the joint replenishment problem. In Proceedings of the twenty-fifth annual ACM-SIAM symposium on discrete algorithms, pages 42–54. SIAM, 2014.
[9] A. Blum, M. Furst, and A. Tomkins. What to do with your free time: algorithms for infrequent requests and randomized weighted caching, 1996.
[10] Avrim Blum, Carl Burch, and Adam Kalai. Finely-competitive paging. In 40th Annual Symposium on Foundations of Computer Science, FOCS '99, 17-18 October, 1999, New York, NY, USA, pages 450–458. IEEE Computer Society, 1999. doi:10.1109/SFFCS.1999.814617.
[11] Sébastien Bubeck, Michael B. Cohen, Yin Tat Lee, James R. Lee, and Aleksander Madry. k-server via multiscale entropic regularization. In Ilias Diakonikolas, David Kempe, and Monika Henzinger, editors, Proceedings of the 50th Annual ACM SIGACT Symposium on Theory of Computing, STOC 2018, Los Angeles, CA, USA, June 25-29, 2018, pages 3–16. ACM, 2018. doi:10.1145/3188745.3188798.
[12] Niv Buchbinder, Shahar Chen, and Joseph Naor. Competitive analysis via regularization. In Chandra Chekuri, editor, Proceedings of the Twenty-Fifth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2014, Portland, Oregon, USA, January 5-7, 2014, pages 436–444. SIAM, 2014. doi:10.1137/1.9781611973402.32.
[13] Niv Buchbinder, Tracy Kimbrel, Retsef Levi, Konstantin Makarychev, and Maxim Sviridenko. Online make-to-order joint replenishment model: Primal-dual competitive algorithms. Operations Research, 61(4):1014–1029, 2013.
[14] Niv Buchbinder, Joseph Seffi Naor, et al. The design of competitive online algorithms via a primal-dual approach. Foundations and Trends® in Theoretical Computer Science, 3(2–3):93–263, 2009.
[15] Marek Chrobak and Lawrence L. Larmore. An optimal on-line algorithm for k-servers on trees. SIAM J. Comput., 20(1):144–148, 1991. doi:10.1137/0220008.
[16] Guy Even, Moti Medina, and Dror Rawitz. Online generalized caching with varying weights and costs. In Christian Scheideler and Jeremy T. Fineman, editors, Proceedings of the 30th on Symposium on Parallelism in Algorithms and Architectures, SPAA 2018, Vienna, Austria, July 16-18, 2018, pages 205–212. ACM, 2018. doi:10.1145/3210377.3210404.
[17] Awi Federgruen and Michal Tzur. The joint replenishment problem with time-varying costs and demands: Efficient, asymptotic and -optimal solutions. Operations Research, 42(6):1067–1086, 1994.
[18] Amos Fiat, Richard M. Karp, Michael Luby, Lyle A. McGeoch, Daniel Dominic Sleator, and Neal E. Young. Competitive paging algorithms. J. Algorithms, 12(4):685–699, 1991. doi:10.1016/0196-6774(91)90041-V.
[19] Anupam Gupta, Ravishankar Krishnaswamy, Amit Kumar, and Debmalya Panigrahi. Elastic caching. In Timothy M. Chan, editor, Proceedings of the Thirtieth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2019, San Diego, California, USA, January 6-9, 2019, pages 143–156. SIAM, 2019. doi:10.1137/1.9781611975482.10.
[20] Anupam Gupta, Amit Kumar, and Debmalya Panigrahi. Caching with time windows. In Konstantin Makarychev, Yury Makarychev, Madhur Tulsiani, Gautam Kamath, and Julia Chuzhoy, editors, Proceedings of the 52nd Annual ACM SIGACT Symposium on Theory of Computing, STOC 2020, Chicago, IL, USA, June 22-26, 2020, pages 1125–1138. ACM, 2020. doi:10.1145/3357713.3384277.
[21] Sandy Irani. Competitive analysis of paging. In Amos Fiat and Gerhard J. Woeginger, editors, Online Algorithms, The State of the Art (the book grow out of a Dagstuhl Seminar, June 1996), volume 1442 of Lecture Notes in Computer Science, pages 52–73. Springer, 1996. doi:10.1007/BFb0029564.
[22] Sandy Irani. Page replacement with multi-size pages and applications to web caching. In Frank Thomson Leighton and Peter W. Shor, editors, Proceedings of the Twenty-Ninth Annual ACM Symposium on the Theory of Computing, El Paso, Texas, USA, May 4-6, 1997, pages 701–710. ACM, 1997. doi:10.1145/258533.258666.
[23] Sandy Irani. Randomized weighted caching with two page weights. Algorithmica, 32(4):624–640, 2002. doi:10.1007/s00453-001-0095-6.
[24] Thodoris Lykouris and Sergei Vassilvitskii. Competitive caching with machine learned advice. In Jennifer G. Dy and Andreas Krause, editors, Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholm, Sweden, July 10-15, 2018, volume 80 of Proceedings of Machine Learning Research, pages 3302–3311. PMLR, 2018. URL: http://proceedings.mlr.press/v80/lykouris18a.html.
[25] Lyle A. McGeoch and Daniel Dominic Sleator. A strongly competitive randomized paging algorithm. Algorithmica, 6(6):816–825, 1991. doi:10.1007/BF01759073.
[26] Daniel Dominic Sleator and Robert Endre Tarjan. Amortized efficiency of list update and paging rules. Commun. ACM, 28(2):202–208, 1985. doi:10.1145/2786.2793.
[27] Neal E. Young. On-line caching as cache size varies. In Alok Aggarwal, editor, Proceedings of the Second Annual ACM/SIGACT-SIAM Symposium on Discrete Algorithms, 28-30 January 1991, San Francisco, California, USA, pages 241–250. ACM/SIAM, 1991. URL: http://dl.acm.org/citation.cfm?id=127787.127832.
[28] Neal E. Young. The k-server dual and loose competitiveness for paging. Algorithmica, 11(6):525–541, 1994. doi:10.1007/BF01189992.
[29] Neal E. Young. On-line file caching. In Symposium on Discrete algorithms, pages 82–86, 1998.
A Extension to Paging with Delays
We explain how our framework extends to the paging-with-delays model of Gupta et al. [20]. Gupta et al. show that it suffices to consider a penalty version of paging with time windows. In this variant, each request has a time window and may either be served within its window or left unserved by paying a request-specific penalty. They further show that their analysis for paging with time windows extends to this penalty model.
We follow the same approach. In paging with time windows and penalties, each request is specified by a page , a release time , a deadline , and a penalty . A solution may either serve during or pay the penalty . The objective is to minimize the sum of the costs and the penalties of all unserved requests.
Fix an integral solution to the hitting-set LP of Gupta et al. [20] with objective value X. Recall that their conversion procedure (see Section 2.4) transforms an integral LP solution into a paging with time windows solution. The solution consists of two components: the cache trajectory and the sequence of load-and-evict sets . We now use both components to partition online the requests into two sets, and . If a request r is not served (a penalty is paid), we add r to . Otherwise, let t be the first time at which the online conversion procedure serves r, either through cache residency or by loading , and add the page request to . Since the partition is determined by the online conversion procedure, both and can be constructed online.
We first bound the completion cost of C with respect to . Gupta et al. showed that the offline conversion procedure preserves the cache trajectory C and only removes some of the “load-and-evict” steps (determined online). Nevertheless, it remains feasible for every request served by the online procedure and therefore serves every request in . Since its total cost is , it follows that
Moreover, every request in is left unserved by the online conversion procedure. Since the offline procedure only removes loads, these requests remain unserved, and the offline procedure pays their penalties. Therefore,
Since can be constructed online, we apply our online completion algorithm to C and , obtaining a loading sequence D satisfying
Now, the penalties paid for the requests in add up to at most . Thus, the resulting solution has total cost . Combining this with the bound on the integral solution of Gupta et al. [20] yields an -competitive online algorithm for paging with delays.
B A Local Repair of Cache Trajectories
Lemma B.1. Let be a feasible paging solution, and let be a nonempty set of requests active at time , all with deadline . Suppose that no active or unrevealed request outside has deadline at most . Then can be modified, without increasing its cost, so that for some . The modification can be implemented online whenever is generated online.
Proof. Follow S until all requests in Q have been served. Let r be the last request in Q to be served, and let K be the cache configuration immediately after this service. In particular, this configuration contains .
At this point, all requests with deadline at most have been served. Indeed, every request in Q has been served, while every request outside Q with such a deadline was already served at time , by assumption. Postpone all subsequent loadings and evictions through the end of time to the beginning of time . Execute these operations in their original order, before the operations originally scheduled at that time.
This preserves feasibility: any request whose service is postponed and that has not already been served has deadline at least . Capacity is preserved because the postponed operations start from the same configuration and are executed in the same order. No additional loads are introduced, so the cost does not increase. If is the final time step, the postponed operations can instead be omitted. The configuration persists through time , so .
To implement the modification online, buffer the postponed operations. If a new request with deadline at most arrives, execute the buffered operations before processing it and resume S. This preserves feasibility even when the hypothesis of the lemma does not hold. Under the hypothesis, no such request arrives, so the configuration K persists until the end of time , as required.
Thus, any feasible paging solution can be modified at no additional cost to satisfy the stated property for the specified times and set Q.