Parametrized Metrical Task Systems
aa r X i v : . [ c s . D S ] A p r Parametrized Metrical Task Systems
S´ebastien Bubeck ∗ Yuval Rabani † April 9, 2019
Abstract
We consider parametrized versions of metrical task systems and metrical service systems, two funda-mental models of online computing, where the constrained parameter is the number of possible distinctrequests m . Such parametrization occurs naturally in a wide range of applications. Striking examplesare certain power management problems, which are modeled as metrical task systems with m = 2 .We characterize the competitive ratio in terms of the parameter m for both deterministic and random-ized algorithms on hierarchically separated trees. Our findings uncover a rich and unexpected picturethat differs substantially from what is known or conjectured about the unparametrized versions of theseproblems. For metrical task systems, we show that deterministic algorithms do not exhibit any asymp-totic gain beyond one-level trees (namely, uniform metric spaces), whereas randomized algorithms donot exhibit any asymptotic gain even for one-level trees. In contrast, the special case of metrical ser-vice systems (subset chasing) behaves very differently. Both deterministic and randomized algorithmsexhibit gain, for m sufficiently small compared to n , for any number of levels. Most significantly, theyexhibit a large gain for uniform metric spaces and a smaller gain for two-level trees. Moreover, it turnsout that in these cases (as well as in the case of metrical task systems for uniform metric spaces with m being an absolute constant), deterministic algorithms are essentially as powerful as randomized algo-rithms. This is surprising and runs counter to the ubiquitous intuition/conjecture that, for most problemsthat can be modeled as metrical task systems, the randomized competitive ratio is polylogarithmic in thedeterministic competitive ratio. ∗ Microsoft Research, Redmond, United States, [email protected] † The Rachel and Selim Benin School of Computer Science and Engineering, The Hebrew University of Jerusalem, Jerusalem9190416, Israel, [email protected] . Research supported in part by ISF grants 956-15 and 2553-17 and by BSF grant2012333. Part of this work was done while visiting Microsoft Research at Redmond.
Introduction
Motivation.
Metrical task systems are a general framework proposed in the early days of online comput-ing to model a wide range of problems. In this model, an algorithm controls its state among n possiblestates. It is presented with a sequence of requests. Each request indicates the cost of serving it in each of the n states. The algorithm must choose a state to serve the request, then pay both the transition cost and the ser-vice cost. It competes against the optimal offline solution, and is c -competitive iff for any request sequenceit pays at most c times this yardstick (plus an allowed additive term independent of the request sequence).The transition costs are assumed to be distances in a finite metric space whose points are the states. Theseminal paper [12] introduces this model and also solves completely a fundamental problem regarding theproposed model. It gives a tight n − upper and lower bound on the competitive ratio of any deterministicalgorithm. The paper also raises the same question regarding randomized algorithms. For a uniform metricspace, it gives a lower bound of H n and a nearly tight upper bound of H n , where H n = 1 + + · · · + n is the n -th harmonic number. In light of this result, a natural folklore conjecture asserts that in any metricspace the randomized competitive ratio is Θ(log n ) . This conjecture turned out to be far more elusive thanthe deterministic case. Currently, the best universal bounds are a lower bound of Ω(log n/ log log n ) [7, 9]and a very recent upper bound of O (log n ) [13].Many online problems can be modeled as special cases of metrical task systems. For instance, pag-ing [31] and more generally the k -server problem [27] are task systems on the state space of k -tuples ofpoints in an underlying metric space. But the best bounds that are known for these problems are muchlower than the general bounds that apply to any metrical task system. Clearly, there are constraints on theallowed requests. For instance, in the k -server problem in an n -point metric space, the state space has size (cid:0) nk (cid:1) , but the number of possible requests is just n , and they have only or ∞ values. Such constraints oftencharacterize concrete applications of metrical task systems (e.g., various problems in networks, see [8] andthe references therein). A striking example of the gain from instances with a restricted set of requests isthe power management problem [25]. It allows only two possible requests, and admits an O (1) -competitivealgorithm [2]. In view of these examples, it is natural to seek a meaningful measure of instance complexitythat will provide at least partial prediction of the better bounds in special cases, a prediction that may beapplied to new problems. An obvious choice is the cardinality m of the set of possible requests. (Clearly,this question is interesting only for m ≪ n , otherwise the known general lower bounds kick in.) Examiningrequest sequences drawn from a given set is proposed explicitly in [15]. They give a deterministic algorithmthat in uniform metric spaces achieves a competitive ratio of O (log n ) times the (unknown) best possiblebound.Motivated by the k -server example, the restriction of the requests to have costs in { , ∞} is a naturaland attractive problem of chasing subsets of points in a finite metric space. Indeed, this problem setting wasproposed in [17], dubbed metrical service systems. We note that this is part of a broader theme of onlinechasing and searching, and other seminal papers in this theme include [28, 3, 23]. The focus of the metricalservice systems literature (e.g. [17, 20, 29, 14, 19, 16]) is the width of the requests, which is the maximumsize of a requested set. In view of the above discussion, it is equally natural to ask about chasing sets drawnfrom a small-sized pool of possible requests and deriving bounds that are independent of the width. Our results.
Our main contribution is an explicit analysis of the competitive ratio of metrical task systemsand metrical service systems with m possible requests, m ≪ n . Perhaps surprisingly, we show that unlikethe general case, the answer here depends on the metric space. In particular, for metrical task systems weshow that in uniform metric spaces, restricting thus the request sequence improves dramatically the deter-ministic competitive ratio, which we characterize tightly, up to constant factors. In contrast, there exist other1etric spaces, namely two-level HSTs (uniform metrics are one-level HSTs), that exhibit no deterministicasymptotic improvement, even if m = 2 . Perhaps even more surprisingly, in uniform metric spaces the ran-domized competitive ratio does not improve asymptotically even if m = 2 , and in this case the deterministiccompetitive ratio is asymptotically the same as the randomized competitive ratio.We also analyze unrestricted width metrical service systems with m possible requests in uniform metricspaces versus two-level HSTs. This case, too, exhibits complex and fascinating behavior, and furthermore itis not identical to the general case. In sufficiently large uniform metric spaces the restriction to m requestsimproves both the deterministic and the randomized competitive ratio. However the two ratios are asymptot-ically the same, linear in m and independent of the size of the metric. The two-level HSTs case also deviatesfrom the general case. As with uniform metric spaces, both the deterministic and the randomized competi-tive ratios improve and are independent of the size of the metric space. However, both the deterministic andthe randomized competitive ratios are now exponential in m (the base of the exponent may be different inthe two cases). We discuss the surprising aspects of these results and their features that persist beyond twolevels in the following sections.We note that our results, most strikingly the bounds for m = 2 metrical task systems in uniform metricspaces, refute a folklore conjecture that for most problems that can be cast as metrical task systems, therandomized competitive ratio is polylogarithmic in the deterministic competitive ratio.Finally, we relate some of our results to the question of quantifying the amount of information an adver-sary needs in order to force an online algorithm to perform poorly. A metrical task system instance consists of a finite metric space M = ( X, d ) , an initial state s ∈ X , and asequence of requests ρ , ρ , . . . , ρ L , where for every t ∈ { , , . . . , L } , the request ρ t is a cost function thatmaps X to R + ∪ { + ∞} . We will denote n , | X | . A solution consists of a choice of states s , s , . . . , s L ∈ X , which incurs a total cost of L X t =1 ( d ( s t − , s t ) + ρ t ( s t )) . A deterministic online algorithm chooses, for every t = 1 , , . . . , L , the next state s t based only on M and ρ , ρ , . . . , ρ t , without knowing the suffix of the requests sequence or even its length L . A randomizedonline algorithm is a probability distribution over deterministic online algorithms, and its cost is defined tobe the expectation of the cost of the deterministic algorithms in the support of the distribution.We use the following notation. For a sequence of requests ρ , let z ∗ ( ρ ) denote the optimal cost of serving ρ . Define c det M to be the infimum over c such that there exists a constant a and a deterministic online algorithm A such that for every sequence of requests ρ , the cost of A of serving ρ is at most c · z ∗ ( ρ ) + a . Definesimilarly c rand M for randomized algorithms. The following theorem is well-known: Theorem 1 (Borodin et al. [12]) . For every finite metric space M , c det M = 2 n − . It is also conjectured that c rand M = Θ(log n ) . The conjecture has been established in special cases. Forinstance tight bounds are known in uniform metric spaces. The currently best known bounds (followingsubstantial previous work [26, 11, 15, 10, 6, 24, 30, 22, 4, 1]) that hold for every metric space are (see belowfor the definition of an HST): 2 heorem 2 (Bartal et al. [7, 9]) . For every finite metric space M , c rand M = Ω (cid:18) log n log log n (cid:19) . Theorem 3 (Bubeck et al. [13]) . For every HST M , c rand M = O (log n ) , and therefore, for every finite metric space M , c rand M = O (log n ) . We are interested in analyzing metrical task systems with constrained requests. The primary constraintthat we investigate in this paper is the following: there exists a finite set R ( ( R + ∪ { + ∞} ) X such thatall the requests lie in R . We will denote m , |R| . Let c det M , R ( c rand M , R , respectively) denote the deterministic(randomized, respectively) competitive ratio when requests are restricted to the set R . Also let c det M ,m ( c rand M ,m ,respectively) denote the supremum of c det M , R ( c rand M , R , respectively) over |R| = m . We find that unlike thegeneral case, the competitive ratio that can be guaranteed for constrained metrical task systems dependscrucially on the underlying metric space M . In particular, we study a class of ultrametrics called hierar-chically separated trees (HSTs), invented in [5]. HSTs play a critical role in both the best known upperbounds and the best known lower bounds for metrical task systems, as well as other problems involvingmetric spaces. For metrical task systems, the best known upper bounds rely on an asymptotically optimalapproximation of any metric space by a convex combination of HSTs, discovered in [18]. The best knownlower bounds rely on a lower bound on HSTs and the fact that any metric space contains a large approximateHST subspace [7, 9]. More concretely, an L -level HST is a metric space defined on the leaves of a leveledrooted node-weighed tree with L + 1 levels. The leaves are at level , the root is the unique node at level L , each node other than the root has a parent at one level above its own, all the nodes at level i have thesame weight, and this weight increases rapidly with the level number. The distance between two leaves isthe weight of their least common ancestor. (We note that HSTs are often defined alternatively without theuniformity constraint on levels.) This defines an ultrametric (which is in particular a metric) on the leaves.We exhibit on the one hand that for uniform metric spaces (which are in the above terms one-levelHSTs), restricting m helps immensely deterministic algorithms, but not randomized algorithms: Theorem 4. If M is a uniform metric space, then for every m ≤ n , c det M ,m = Θ( m log( en/m )) , and c rand M , = Θ( c rand M ) = Θ(log n ) . On the other hand, we study what is in some sense just a slightly more sophisticated family of metricspaces. We consider the following family of two-level HSTs, which we call paired-uniform . Let n be aneven number of points. Partition the points into pairs { i, i ′ } . (So, according to this notation i ′′ = i .) Let C ≫ be a large constant to be determined later. Set d ( i, i ′ ) = 1 for all pairs, and set d ( i, j ) = C forevery two points i = j = i ′ . It turns out that here restricting m helps neither the asymptotic performance ofdeterministic algorithms, nor that of randomized algorithms: Theorem 5. If M is a paired-uniform metric space, then c det M , = Θ( n ) , whereas c rand M , = Θ(log n ) . Θ( m log n ) Θ(log n ) MSS Θ( m ) Θ( m ) deterministic randomizedMTS Θ( n ) Θ(log n ) MSS Θ( m ) Θ( m ) Table 1: Summary of our results, for any n ≫ m .Notice that by prior results, the upper bounds hold even for arbitrary requests in arbitrary HSTs.The lower bound constructions in the proofs of Theorems 4 and 5 use sets of requests that assign manywidely varying cost values. Thus, it makes sense to consider requests using costs from a small set of scales,and in particular to consider metrical service systems that use just two scales, or ∞ (a.k.a. set chasing).Let ˆ c det M ,m , ( ˆ c rand M ,m , respectively) denote the best deterministic (randomized, respectively) competitive ratiothat can be achieved for chasing sets drawn from a collection R of m subsets of points in M . In this case weshow that for uniform spaces, restricting m helps both deterministic and randomized algorithms. Moreover,if m = O (log n ) , the deterministic and the randomized competitive ratios are asymptotically identical. Moreprecisely we have: Theorem 6. If M is a uniform metric space, then for every m ∈ N , ˆ c det M ,m = min { m, n } , and, ˆ c rand M ,m = Θ (min { m, log n } ) . Unlike the more general case of Theorem 5, in the case of metrical service systems on two-level HSTs,restricting the number of possible requests helps, but not as much as in uniform metric spaces. In order tostate the results, we introduce a bit more notation. Let ˆ c det L,m ( ˆ c rand L,m , respectively) denote the supremum of ˆ c det M ,m ( ˆ c rand M ,m , respectively) over all L -level HSTs M . We prove: Theorem 7.
For every m ∈ N , ⌊ m/ ⌋− ≤ ˆ c rand2 ,m ≤ ˆ c det2 ,m ≤ m m . We note that we actually prove a somewhat tighter lower bound of (cid:0) m ⌊ m/ ⌋ (cid:1) on ˆ c det2 ,m , see Lemma 16.We also note that it is not surprising that for sufficiently large HSTs, the competitive ratio (deterministicor randomized) depends solely on m and the number of levels. This is because one can trim isomorphicnodes from the tree. (Note however that for deterministic algorithms the trivial bound obtained this way isexponentially worse than the ones proposed above.) The surprising aspects of these theorems are (a) that thedeterministic competitive ratio nearly matches the randomized competitive ratio, and (b) that for two-levelHSTs, a collection of O (log log n ) set chasing requests is sufficient to generate a randomized lower boundof Ω(log n ) (while the classical lower bound requires Ω( n ) such requests). In fact, this latter aspect extendsto and is amplified in HSTs with any number of levels. So, using just set chasing requests, we can geta lower bound of Ω(log n ) for infinitely many n , on HSTs with more and more levels. The argument isoutlined in Section 4.Our main results are summarized in Table 1. 4 Proofs
Lemma 8.
Let M = ( X, d ) be an n -point uniform metric space. Consider any set of requests R ofcardinality |R| = m and any set S ⊆ X of cardinality | S | > m log( n/m ) . Then, there exists a state s ∈ S such that for every r ∈ R , (cid:12)(cid:12) { s ′ ∈ S : r s ′ ≥ r s } (cid:12)(cid:12) ≥ m · | S | . (1) Proof.
The proof is a simple application of the probabilistic method. Choose s ∈ S uniformly at random.We have that for every r ∈ R , Pr (cid:20) |{ s ′ ∈ S : r s ′ ≥ r s }| < m · | S | (cid:21) < m . Therefore, applying the union bound, Pr (cid:20) ∃ r ∈ R : |{ s ′ ∈ S : r s ′ ≥ r s }| < m · | S | (cid:21) < , so there is a choice of s ∈ S that satisfies Equation (1). Lemma 9.
Let M be an n -point uniform metric space. Then, c det M ,m = O ( m log( en/m )) .Proof. Consider the following algorithm. The algorithm works in phases, and these are further partitionedinto rounds. In a phase, we will denote by S r the set S at the end of round r . We define the cost that astate s acrues during some interval I as Σ( I ; s ) = P t ∈ I ρ t ( s ) . In the beginning of a phase, set S = X and move to a state s that satisfies Equation (1). As soon as at least | S r − | / m states in S r − acrue a costof at least in the current phase (including the new request), round r ends. When this happens, removefrom S r − the ⌈| S r − | / m ⌉ states that acrued the highest cost. Set S r to be the remaining states in S r − . If | S r | ≥ m log( en/m ) , repeat the above process with a new s ∈ S r . Otherwise, this is the last round. In thislast round, use an | S r | -competitive algorithm, restricted to S r . Execute this algorithm until the optimal costof serving this round reaches at least . Notice that this implies that by the end of the phase, all states in X acrued a cost of at least during the phase. Therefore, the adversary’s cost for the entire phase must be atleast , because it either stayed at one state and paid a service cost of , or moved at least once and paid amovement cost of .In order to analyze this algorithm, fix a phase and denote by a r the total cost that the algorithm acruesin round r of this phase. Also denote by o r the average over s ∈ S r of the minimum between and thecost acrued by s in this phase by the end of round r . (Set o = 0 .) Notice that | S r | ≤ (cid:0) − m (cid:1) · | S r − | .This implies that the number of rounds (including the special last round) is at most m log( n/m ) + 1 . Alsonotice that throughout round r , at each request at least | S r − | /m states in S r − pay at least the cost that thealgorithm pays, but less than | S r − | / m states in S r − acrued a total cost of at least . Thus, the averageover S r − increases by at least a r / m . Each state in S r − \ S r contributes | S r − | to this average, and thereare | S r − | / m such states, so removing them reduces the average by at most m . Thus, o r ≥ o r − + a r m − m . Let ¯ r be the penultimate round. Notice that for all r , o r ≤ . Then m ≥ m · o ¯ r ≥ ¯ r X r =1 a r − ¯ r ≥ ¯ r X r =1 a r − m log( n/m ) . P ¯ rr =1 a r = O ( m log( en/m )) . The last phase also costs the algorithm O ( m log( en/m )) . This isbecause | S ¯ r | < m log( en/m ) , we use an | S ¯ r | -competitive algorithm, and an adversary with the same initialstate in this round as the algorithm pays at most —one for moving to the best initial state, and one forserving the request sequence in the round. Lemma 10.
Let M be an n -point uniform metric space. Then, c rand M , = Ω(log n ) .Proof. Assume without loss of generality that n = 2 q is a power of (otherwise we can restrict the instanceto the power of closest to n ; the redundant states can be blocked by assigning to them a cost of ∞ in bothelements of R ). Let { , , . . . , n − } be an arbitrary enumeration of the points of M . Let C = C ( n ) bea large constant. Set R = { r , r } , where r i = C i − n , and let r i = C − i − . We use the minimax principleand generate a random request sequence that “beats” every deterministic algorithm. The request sequenceis generated in phases. In each phase we choose uniformly at random one state h ∈ { , , . . . , n − } wherethe adversary “hides.” Let h h · · · h q − be the binary representation of h . This defines a natural sequenceof nested intervals in the dyadic partition of the set of states. The interval J i consists of all the states whosebinary representation has the prefix h · · · h i . For notational convenience, let J − = { , , . . . , n − } . Thephase consists of q rounds numbered , , . . . , q − . Then, in round i , we request repeatedly r h i until thestate adjacent to J i on the right, if h i = 0 , or on the left, if h i = 1 , acrues a cost of at least in this round.Notice that the algorithm knows the entire round once its first request is given.The analysis is completed as follows. Define ¯ J i = (cid:26) { j : j ≤ max s ∈ J i } h i = 0 , { j : j ≥ min s ∈ J i } h i = 1 . When round i starts, with probability at least , the algorithm occupies a state s ¯ J i . In this case thealgorithm pays at least in this round. This is clear if it moves. Otherwise, every state not in ¯ J i pays at leastas much as the state in this set that is adjacent to J i . Thus, the expected cost of the algorithm for the entirephase is at least q/ n − . On the other hand, the adversary pays at most to move to h . Noticethat the state adjacent to J i that determines the stopping condition pays less than in round i (in fact it paysclose to ). Thus, all the states in J i pay at most C . If the adversary stays at h for the duration of the phase,it pays a service cost of at most qC , which can be made arbitrarily close to by choosing C ≫ q . Lemma 11.
Let M be an n -point uniform metric space. Then, c det M ,m = Ω( m log( en/m )) .Proof sketch. Without loss of generality, we may assume that m is an even number which is at most n/ ,that n is divisible by m and that n/m is a power of . (Otherwise, eliminate some states by having theircost always ∞ and use fewer requests. A constant fraction of both states and requests remains.) So, partitionthe states into m/ disjoint subsets of size n/m each. For each subset, define two new requests as per theproof of Lemma 10, and outside the subset have both requests cost . In each subset, use the adversary’sstrategy from the proof of Lemma 10. The requests according to this strategy will be used in the steps whenthe algorithm occupies a state in the subset. Clearly, while the algorithm hasn’t paid at least Ω(log( n/m )) inall subsets, there’s at least one state that hasn’t paid . Thus, the adversary can choose the last such survivingstate and cause the algorithm to pay Ω( m log( n/m )) before no state survives. When no state survives, aphase that cost the adversary less than and the algorithm Ω( m log( n/m )) ends, and we can repeat theprocess in a new phase. Proof of Theorem 4.
The theorem is a corollary of Lemmas 9, 10, and 11.
Proof of Theorem 5.
The upper bound on c rand M , follows from the general upper bound on trees of Bubeck etal. [13], and the lower bound follows from Theorem 4. The lower bound on c det M , goes as follows. Denote6he pairs of leaves by i, i ′ for i = 0 , , . . . , n/ − . Let h , h , . . . , h n/ − be the sequence defined by h i = ( Cn ) i − n . We use two requests: r is defined by r i = h i and r i ′ = 0 , for all i , and r ′ is defined by r ′ i = 0 and r ′ i ′ = h n − i − , for all i . The request sequence is simple: if the algorithm occupies a state i , use r ,otherwise the algorithm occupies a state i ′ , so use r ′ .For analyzing the competitive ratio, partition the request sequence into rounds. A round ends wheneverthe algorithm either moves from one pair to another pair or pays C while staying in one pair { i, i ′ } . Noticethat either way, the algorithm’s cost is at least C per round. Further partition the rounds into phases. Eachphase contains exactly n/ − rounds. Thus, the cost of the algorithm per phase is at least C ( n/ − . Weshow that the adversary can pay less than C + n/ per round. Choosing C = Ω( n ) completes the proof. Toshow that the adversary’s cost per phase is less than C + n/ , notice that in a phase, the algorithm cannotvisit all the pairs. Let { i, i ′ } be a pair that is not visited by the algorithm during the phase. The adversarywill “hide” in such a pair. Moving to this pair in the beginning of the round costs at most C . For each roundin the phase, the adversary stays either at i or at i ′ , so moving between i and i ′ costs at most n/ − .To complete the analysis, we have to explain how the adversary chooses between i and i ′ , and we have toanalyze the cost of staying at the chosen state. Notice that in a round, by definition the algorithm stays in onepair { j, j ′ } , where i = j . If i < j , the adversary stays at i , otherwise the adversary stays at i ′ . Consider thefirst case (the other case is analogous). By the definition of a round, j acrues a cost of at most C during theround, because it is hit by a positive cost only when the algorithm occupies j , and the algorithm pays at leastthis cost (it might decide to move to j ′ and pay ). Therefore, i acrues a cost of at most C · ( Cn ) i − j ≤ n .This is the service cost that the adversary pays during the round. Thus, since there are n/ − rounds in aphase, the total service cost of the adversary during a phase is less than . Lemma 12.
Let M be an n -point uniform metric space. Then, ˆ c det M ,m = min { m, n } .Proof. The lower bound follows from restricting the number of states that can get a request with a valueto k + 1 = min { m, n } and then applying the deterministic k -server lower bound to this subspace. Noticethat this lower bound uses k + 1 different requests.The upper bound is achieved with a variant of the marking algorithm, as follows. Each request r can beassociated with a subset S r = { i ∈ X : r i = 0 } . If there exists a state i that is in the intersection of all m subsets S r , the algorithm can pay at most to move to this state, and then pay for the rest of the sequence.Otherwise, the algorithm partitions the sequence into phases. In each phase, if the current location of thealgorithm is hit by an ∞ value, it moves to a state in the intersection of all the sets seen so far in the phase.The phase ends, and a new phase begins, when this intersection is empty. Notice that to move, the algorithmneeds to get a request not seen so far in the phase, so the algorithm moves at most m times per phase. Atthe end of the phase, all states were hit by an ∞ value at least once, so any algorithm would have to moveat least once per phase. Lemma 13.
Let M be an n -point uniform metric space. Then, ˆ c rand M ,m = O (min { m, log n } ) .Proof. Theorem 3 implies in particular an upper bound of O (log n ) . Lemma 12 gives an upper bound of m (because the randomized competitive ratio is upper bounded by the deterministic competitive ratio). Lemma 14.
Let M be an n -point uniform metric space. Then, ˆ c rand M ,m = Ω (min { m, log n } ) .Proof. If m ≥ n , then we get a lower bound of H n − from the paging problem [21], which requires n possible requests. Otherwise, let k = ⌊ min { m/ , log n }⌋ . We restrict our attention to a set of size k states. (If there are more, all the others have cost ∞ in all the requests.) We label the states in this setwith the nodes of the binary cube { , } k . We use k possible requests that are constructed as follows.There are two requests r i, and r i, corresponding to each coordinate i = 1 , , . . . , k of the binary cube.7he request r i,b has a cost of ∞ at points with the i -th coordinate of their label being b , and at stateswith the complement i -th coordinate. We use the minimax principle and construct a probabilistic requestsequence that beats every deterministic algorithm. The request sequence consists of phases. In each phasethe adversary draws independently a point b b · · · b k in the binary cube uniformly at random, and thenrequests the sequence r i,b i , i = 1 , , . . . , k , in that order. Against any deterministic algorithm, the expectedcost of each request in the phase is , so the total expected cost of k . The adversary needs to move at mostonce per phase, to the point labeled with the bitwise complement of b b · · · b k . Proof of Theorem 6.
The theorem is an immediate corollary of Lemmas 12, 13, and 14.
Lemma 15.
For every two-level HST M , ˆ c det M ,m ≤ m m .Proof. Let
C > denote the aspect ratio of M . Let T be any level- subtree of M (so in particular T indicates a uniform subspace of M ). We say that T is hit by a subset S of requests iff for every state s ∈ T there is a request r ∈ S such that r s = ∞ . The algorithm works in periods. In the beginning of a periodall level- subtrees are unmarked, and a period ends when they are all marked. Each period is divided intoepochs. In an epoch, the algorithm chooses an unmarked subtree T and stays in it for the entire epoch. Whilein a subtree T , the algorithm runs the uniform metric procedure from the proof of Lemma 12, ignoringthe states outside T . Notice that this divides the epoch into phases, where during a phase the algorithmencounters one subset S of requests that hits T , for which the algorithm pays | S | ≤ m and any algorithmstaying in T pays at least . The epoch ends as soon as the algorithm executes C phases in T . When theepoch ends, the algorithm marks T and any other subtree that was hit at least C times so far in the period.The cost of the algorithm in a period is upper bounded as follows. In each phase the algorithm encounters ahitting set S . If the same set is encountered C times, all the subtrees that it hits get marked. Therefore, sincethe empty set is not a hitting set, the total number of phases is at most C (2 m − . The number of epochsin a period is therefore m − , and thus the total cost of transition between subtrees is C (2 m − (becauseno transition is required at the end of the last epoch in the period). Since the algorithm encounters eachnon-empty set S at most C times, the total “internal” cost of the phases is at most C · P S | S | = Cm m − .Therefore, the total cost of the algorithm per period is C ( m m − + 2 m − < Cm m , for all m ∈ N . Anyalgorithm must pay at least C per period. If it stays in one subtree, then every subtree is hit at least C times.If it moves between subtrees, this incurs a cost of at least C . Lemma 16.
For all m ∈ N , ˆ c det2 ,m ≥ (cid:0) m ⌊ m/ ⌋ (cid:1) .Proof. We construct the following two-level HST with aspect ratio C and request set R . There are (cid:0) m ⌊ m/ ⌋ (cid:1) subtrees, each labeled by a different subset of the requests of cardinality ⌊ m/ ⌋ . Each subtree has ⌊ m/ ⌋ states labeled by the elements of the subtree’s label. A request has cost ∞ at all the states that are labeled byit, and otherwise. The adversary’s strategy is simple: if the algorithm is currently at a subtree labeled S ,apend to the sequence all the requests in S (the order doesn’t matter), then repeat after updating the locationthat the algorithms reaches after the apended requests. In order to analyze the competitive ratio, partitionthe request sequence into periods, where in each period the algorithm leaves all the subtrees. Fix a period,and let k denote the number of times the algorithm changes a subtree in this period, including the departurethat ends the period. Clearly, k ≥ (cid:0) m ⌊ m/ ⌋ (cid:1) . The algorithm pays at least Ck in this period. The adversary canhide at the last tree that is visited. At each step, no matter which subtree the algorithm occupies, there is atleast one state in the last tree that won’t be hit by the apended requests. Each time the algorithm switchestrees, the adversary must move to a new state in this last subtree. At the end of the period, the adversarymay have to move to a new subtree. So, the total cost of the adversary per period is at most k + C . If wechoose C = (cid:0) m ⌊ m/ ⌋ (cid:1) , this gives a lower bound of · (cid:0) m ⌊ m/ ⌋ (cid:1) . However, we can get a lower bound arbitrarilyclose to (cid:0) m ⌊ m/ ⌋ (cid:1) by choosing a larger C . 8 emma 17. For all m ∈ N , ˆ c rand ,m ≥ ⌊ m/ ⌋− .Proof. The argument is basically a “lifting” of the construction in the proof of Lemma 14. As in that proof,we associate the requests with the coordinates of the binary cube { , } m/ (we assume without loss ofgenerality that m is even, otherwise, discard one request). Each state is labeled by a node of the cube,and request r i,b has cost ∞ for all states with a label that has value b in its i -th coordinate, and cost otherwise. The requests are paired into pairs r i, , r i, . Notice that each request hits half of the possible statelabels, and the sets of labels that two paired requests hit are complements. Now, consider a sequence ofrequests generated by choosing one request from each pair. We can label this sequence with a point b in thebinary cube, where the sequence requests r i,b i for i = 1 , , . . . , m/ . Thus, there are m/ possible suchsequences. If such a sequence is requested, it hits all the labels, except for one—the bitwise complementof b . Thus, we can pair such sequences into pairs that have complement labels, and the two sequences in apair miss complement labels of states. There are m/ − pairs of sequences. We can create a meta-sequenceof requests by choosing one sequence in each pair and concatenating all the chosen sequences. This gives m/ − possible meta-sequences. This structure is used to generate the adversary’s strategy.But, before we state the adversary’s strategy, we construct the metric space and set the labels of the states(which imply the structure of the individual requests). The two-level HST that we use has m/ − subtrees.A subtree is labeled by a subset of the binary cube { , } m/ of cardinality m/ − (half the cube) thatcontains exactly one node of each antipodal (i.e., complementary) pair of nodes. There are m/ − possiblechoices, hence the number of subtrees. Such a subtree has m/ − states, each labeled with a distinct nodein the label of the subtree. Aside from the aspect ratio C , to be defined later, this specifies completely M and R .We are now ready to define the adversary’s strategy. As usual, we rely on the minimax principle anddefine a randomized strategy that beats any deterministic algorithm. The adversary repeats the followingprocess. Choose one meta-sequence uniformly at random, then loop through its list of sequences and repeateach sequence C times. Notice that regardless of the state of the algorithm at the beginning of any sequenceof the meta-sequence, it pays at least C for this sequence with probability at least . This is becauseeach sequence hits half the subtrees, and the two possible choices for the sequence hit complement sets ofsubtrees: a sequence labeled b hits all subtrees that contain b , a sequence labeled ¯ b hits all subtrees thatcontain ¯ b , and every subtree contains either b or ¯ b , regardless of b . If the sequence hits the subtree wherethe algorithm is located, it either stays there and pays at least for each time the sequence is requested(because it hits all the states in that subtree), or it moves to a different tree and pays C for the transition.On the other hand, after requesting the entire meta-sequence, there exists one subtree that was not hit evenonce. This is the subtree that is labeled with the set of complements of all the labels of the sequences in themeta-sequence. The adversary can hide in that subtree. It pays C to move there at the start of the currentmeta-sequence, and at most to move to a safe state at the start of each sequence in the meta-sequence. So,the expected cost of the algorithm per meta-sequence is C m/ − , and the total cost of the adversary permeta-sequence is C + 2 m/ − . As C grows, the ratio approaches m/ − . Proof of Theorem 7.
The theorem is a corollary of Lemmas 15 and 17.
Open problems.
Our work initiates the study of metrical task systems (MTS) and metrical service systems(MSS) parametrized by the number of distinct requests. Roughly speaking (and somewhat surprisingly) wefind that this restriction has little effect in general for MTS, in the sense that beyond uniform metric spaces,the achievable competitive ratio with m = 2 is already asymptotically as bad as for m = ∞ (Theorem 5).9n fact, as far as randomized algorithms are concerned this is already true for uniform metric spaces (The-orem 4). On the other hand, the situation for MSS is very different. A number of questions remain openregarding MSS. A particularly interesting qualitative open problem would be to characterize the class ofinfinite size metric spaces for which there exist online MSS algorithms with finite competitiveness for fixed m , say even for m = 3 . For example, is it possible to obtain a finite competitive ratio for chasing arbi-trary sets on the real line? Another intriguing quantitative open problem is to determine if the deterministiccompetitive ratio on a weighted star metric is linear or exponential in m . (A simple argument bounds thedeterministic competitive ratio by O (2 m ) and the randomized competitive ratio by O ( m ) . A lower boundof Ω( m ) in both cases clearly follows from Theorem 6.) Deeper trees.
Consider MSS on an HST. Label each leaf by a binary vector of dimension m indicatingwhich requests hit it. Clearly, if there are two identically labeled leaves that share a parent, we can eliminateone from consideration. Similarly, label each internal node by the set of labels of its children. If there aretwo identically labeled internal nodes with the same label and the same parent, we can eliminate one. Thus,effectively, the maximum number T L of distinct L -level HSTs satisfies: T < m and T L < T L − (thereason for the strict inequality is that we can eliminate the empty tree and also every leaf labeled by theall-ones vector). The maximum number of leaves N L of an L -level HST therefore satisfies N L ≤ Q L − i =0 T i (in fact, this estimate is far from tight for large L ). Notice that log N L = P L − i =0 log T i = O (log T L − ) .Theorem 7 can be generalized to any number of levels L ≥ . Let c = ⌊ m/ ⌋ and for L ≥ let c L = 2 c L − − . Then, for L ≥ , Ω( c L ) ≤ ˆ c rand L,m ≤ O (log N L ) . The upper bound follows from the above observations and previous work (Theorem 3). As for the lowerbound, in the proof of Lemma 17 we constructed m/ − one-level subtrees, each labeled with a subset ofthe binary cube { , } m/ of cardinality m/ − , and also m/ − meta-sequences. Each meta-sequencemisses one subtree. The subtrees can be paired into complement halves of the binary cube, and the meta-sequences can be paired into complement choices of the sequences that compose them. Complement meta-sequences miss complement subtrees. Thus, we can “lift” this construction just as we “lifted” the uniformmetric construction to get a m/ − − randomized lower bound for three-level HSTs, and this “lifting” canbe iterated ad infinitum.For three or more levels, we do not know reasonably tight upper and lower bounds on the determin-istic competitive ratio. We leave this as an open problem. For two levels, the upper and lower boundsof Theorem 7 are similar but not tight asymptotically in m . Thus, deriving asymptotically tight bounds,and moreover determining if the deterministic and randomized competitive ratios are asymptotically (in m )equal (as is the case for uniform metric spaces), are interesting open problems. Leaky randomization.
Generally our results show that the characteristics of the metric spaces have astrong influence on the type of guarantees one can hope for, in stark contrast with the well-known results andconjectures for non-parametrized sequences (e.g., randomized MTS, or the k -server problem). Moreoverour lower bounds constructions also shed a new light on randomization, in the following sense. In onlinecomputing randomness may help because it hides the state of the algorithm. An adversary generating theworst-case sequence for a given algorithm knows the probability distribution but not the outcome of thealgorithm’s coin flips. A natural question in this context is to quantify this phenomenon. In particular,consider an adversary that is given at each step t a signal σ t indicating some information on the algorithm’sstate s t (which is a random variable). Suppose that there exists b such that for all t , the mutual informationis I ( σ t ; s t ) = b . If the adversary is allowed to choose the signals subject to this constraint, what can wesay about the competitive ratio? Before we proceed, two comments are in place. Firstly, by “algorithm’sstate” we could mean simply the position reached by the algorithm in the state space, or we could mean more10roadly also the internal state of the algorithm. The distinction is immaterial for our results. Secondly, noticethat such an adversary is restricted even from having perfect recall, because past requests may reveal morethan b bits of information regarding the algorithm’s current state. So, we denote the best competitive ratioagainst the above adversary by c b M . In every metric space M , the deterministic lower bound in Theorem 1implies that c ⌈ log n ⌉M = 2 n − . Notice that c det M , b reveals something about c b M . In particular, in paired-uniform metric spaces, revealing a single bit is sufficient to force the algorithm to pay asymptotically asmuch as a deterministic algorithm. Corollary 18. If M is a paired-uniform metric space, then c M = Ω( n ) . Proof of Corollary 18. If c det M ,m = Ω( n ) , then in order to force an algorithm to a competitive ratio of Ω( n ) ,all that the adversary needs to know is which of the m requests to use at each step. For this log m bits ofinformation are sufficient, and this is clearly an upper bound on the mutual information. Thus, the corollaryfollows from Theorem 5. References [1] J. Abernethy, P. L. Bartlett, N. Buchbinder, and I. Stanton. A regularization approach to metrical tasksystems. In
Proc. of the 21st Int’l Conf. on Algorithmic Learning Theory , pages 270–284, 2010.[2] J. Augustine, S. Irani, and C. Swamy. Optimal power-down strategies.
SIAM J. Comput. , 37(5):1499–1516, 2008.[3] R. A. Baeza-Yates, J. C. Culberson, and G. J. E. Rawlins. Searching in the plane.
Inf. Comput. ,106(2):234–252, 1993.[4] N. Bansal, N. Buchbinder, and J. Naor. Metrical task systems and the k -server problem on HSTs. In Proc. of the 37th Int’l Colloq. on Automata, Languages and Programming , pages 287–298, 2010.[5] Y. Bartal. Probabilistic approximation of metric spaces and its algorithmic applications. In
Proc. ofthe 37th Ann. IEEE Symp. on Foundations of Computer Science , pages 184–193, 1996.[6] Y. Bartal, A. Blum, C. Burch, and A. Tomkins. Polylog( n )-competitive algorithm for metrical tasksystems. In Proc. of the 29th Ann. ACM Symp. on Theory of Computing , pages 711–719, 1997.[7] Y. Bartal, B. Bollobas, and M. Mendel. A Ramsey-type theorem for metric spaces and its applicationsfor metrical task systems and related problems. In
Proc. of the 42nd Ann. IEEE Symp. on Foundationsof Computer Science , pages 396–405, 2001.[8] Y. Bartal, M. Charikar, and P. Indyk. On page migration and other relaxed task systems. In
Proc. ofthe 8th Ann. ACM-SIAM Symp. on Discrete Algorithms , pages 43–52, 1997.[9] Y. Bartal, N. Linial, M. Mendel, and A. Naor. On metric Ramsey-type phenomena. In
Proc. of the35th Ann. ACM Symp. on Theory of computing , pages 463–472, June 2003.[10] A. Blum and C. Burch. On-line learning and the metrical task system problem. In
Proc. of the 10thAnn. Conf. on Computational Learning Theory , pages 45–53, 1997.1111] A. Blum, H. J. Karloff, Y. Rabani, and M. E. Saks. A decomposition theorem for task systems andbounds for randomized server problems.
SIAM J. Comput. , 30(5):1624–1661, 2000.[12] A. Borodin, N. Linial, and M. E. Saks. An optimal on-line algorithm for metrical task system.
J. ACM ,39(4):745–763, 1992.[13] S. Bubeck, M. B. Cohen, J. R. Lee, and Y.-T. Lee. Metrical task systems on trees via mirror descentand unfair gluing. In
Proc. of the 30th Ann. ACM-SIAM Symp. on Discrete Algorithms , pages 89–97,2019.[14] W. R. Burley. Traversing layered graphs using the work function algorithm.
J. Algorithms , 20(3):479–511, 1996.[15] W. R. Burley and S. Irani. On algorithm design for metrical task systems.
Algorithmica , 18(4):461–485, 1997.[16] A. Chiplunkar and S. Vishwanathan. Metrical service systems with multiple servers.
Algorithmica ,71(1):219–231, 2015.[17] M. Chrobak and L. Larmore. Metrical service systems: deterministic strategies. Technical ReportUCR-CS-93-1, UC Riverside, 1993.[18] J. Fakcharoenphol, S. Rao, and K. Talwar. A tight bound on approximating arbitrary metrics by treemetrics.
J. Comput. Syst. Sci. , 69(3):485–497, 2004.[19] E. Feuerstein. Uniform service systems with k servers. In Cl´audio L. Lucchesi and Arnaldo V. Moura,editors, Proc. of LATIN’98: Theoretical Informatics , pages 23–32, 1998.[20] A. Fiat, D. P. Foster, H. Karloff, Y. Rabani, Y. Ravid, and S. Vishwanathan. Competitive algorithms forlayered graph traversal. In
Proc. of the 32nd Ann. IEEE Symp. of Foundations of Computer Science ,pages 288–297, 1991.[21] A. Fiat, R. M. Karp, M. Luby, L. A. McGeoch, D. D. Sleator, and N. E. Young. Competitive pagingalgorithms.
J. Alg. , 12(4):685–699, 1991.[22] A. Fiat and M. Mendel. Better algorithms for unfair metrical task systems and applications. In
Proc.of the 32nd Ann. ACM Symp. on Theory of computing , pages 725–734, May 2000.[23] J. Friedman and N. Linial. On convex body chasing.
Discrete & Computational Geometry , 9(3):293–321, 1993.[24] S. Irani and S. Seiden. Randomized algorithms for metrical task systems.
Theoretical ComputerScience , 194(1):163–182, 1998.[25] S. Irani, S. Shukla, and R. Gupta. Online strategies for dynamic power management in systems withmultiple power-saving states.
ACM Trans. Embed. Comput. Syst. , 2(3):325–346, 2003.[26] H. J. Karloff, Y. Rabani, and Y. Ravid. Lower bounds for randomized k -server and motion-planningalgorithms. In Proc. of the 23rd Ann. ACM Symp. on Theory of Computing , pages 279–288, May 1991.[27] M. S. Manasse, L. A. McGeoch, and D. D. Sleator. Competitive algorithms for server problems.
J.Algorithms , 11(2):208–230, 1990. 1228] C. H. Papadimitriou and M. Yannakakis. Shortest paths without a map. In
Proc. of the 16th Int’lColloq. on Automata, Languages and Programming , pages 610–620, 1989.[29] H. Ramesh. On traversing layered graphs on-line. In
Proc. of the 4th Ann. ACM-SIAM Symp. onDiscrete Algorithms , pages 412–421, 1993.[30] S. Seiden. Unfair problems and randomized algorithms for metrical task systems.
Inf. Comput. ,148(2):219–240, 1999.[31] D. D. Sleator and R. E. Tarjan. Amortized efficiency of list update and paging rules.