K Server Problem
K Server Problem
Document Version:
Publisher’s PDF, also known as Version of Record (includes final page, issue and volume numbers)
General rights
Copyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright owners
and it is a condition of accessing publications that users recognise and abide by the legal requirements associated with these rights.
• Users may download and print one copy of any publication from the public portal for the purpose of private study or research.
• You may not further distribute the material or use it for any profit-making activity or commercial gain
• You may freely distribute the URL identifying the publication in the public portal.
If the publication is distributed under the terms of Article 25fa of the Dutch Copyright Act, indicated by the “Taverne” license above, please
follow below link for the End User Agreement:
[Link]/taverne
Grigorios Koumoutsos
This research was supported by the European Research Council (ERC) grant
617951 (“Algorithms for coping with uncertainty and intractability”).
PROEFSCHRIFT
door
Grigorios Koumoutsos
v
since childhood. Thanks to my mother for all her patience and understanding.
Thanks to my brother for his presence and love at all times.
Last and most importantly, I would like to thank Mina for standing by me
during the PhD life. Mina, in the last 8 years you have been a girlfriend, a
partner, the best friend, a flatmate, a travel buddy and a “FightFun” classmate.
Thank you for your unlimited support throughout the highs and lows of those
years. Thank you for sharing your life with me. I look forward to everything
that is to come.
vi
Contents
1 Introduction 1
1.1 Online Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1.1 Competitive Analysis . . . . . . . . . . . . . . . . . . . 2
1.1.2 Metrical Task Systems . . . . . . . . . . . . . . . . . . . 4
1.1.3 The k-Server Problem . . . . . . . . . . . . . . . . . . . 5
1.2 The (h, k)-Server Problem . . . . . . . . . . . . . . . . . . . . . 7
1.3 The Generalized k-Server Problem . . . . . . . . . . . . . . . . 8
Bibliography 83
Summary 89
Curriculum Vitae 91
Chapter 1
Introduction
1
2 1. Introduction
For each query, the displayed ads should be targeted, so that there is a
good chance that the user will click on them. Clearly, if all the queries
of the day were known in advance, the search engine could choose which
ads to display to each query in order to maximize the expected revenue.
However, this information is not available, and whenever a user submits
a query, the search engine should decide immediately which ads to show.
All the examples above show problems where the input is not available
from the beginning, but it arrives over time and our goal is to optimize some
objective function. We call such problems online optimization problems, or
simply online problems. To solve problems in online optimization, we need to
devise algorithms which make decisions without knowledge of the future. We
call such algorithms online algorithms.
oblivious adversary model, unless stated otherwise. We refer the reader to [18]
for a more detailed discussion on different adversary models for randomized
algorithms and connections between them.
An excellent reference on competitive analysis is [19].
Connection with MSS and paging. Note that the k-server problem can be
viewed as a MSS on N = nk states corresponding to all possible configurations
of the k servers. The distance between two states equals the minimum cost
perfect matching between the corresponding configurations. For each request,
the set of feasible MSS states corresponds to all configurations which have a
server at the requested point.
The paging problem is the special case of the k-server problem in a uniform
metric, i.e. when all distances between distinct points are 1. Here, the k-servers
correspond to the k slots in the cache, and the pages correspond to the points.
Evicting a page from the cache and bringing a new one maps to moving a
server between the corresponding points at a cost of 1. Equivalently, we can
think of a uniform metric as a star graph on n leaves corresponding to the n
pages, where all edges have length 1/2.
Background. In their seminal paper, Manasse et al. [57] showed that the
competitive ratio of deterministic algorithms is at least k, even if the metric
space contains n = k+1 points. For the paging problem, Sleator and Tarjan [66]
showed that many natural algorithms are k-competitive. Manasse et al. [57]
conjectured that this competitive ratio can be achieved in any metric space.
Conjecture 1.2 (The k-Server Conjecture). For any metric space, there exists
a k-competitive deterministic online algorithm.
6 1. Introduction
At the time the k-server conjecture was posed, it was not even known
whether a competitive ratio f (k) depending only on k is possible for general
metric spaces. The initial research focused on special metrics like weighted
stars, lines and trees, and for many cases tight k-competitive algorithms were
obtained [29, 30, 42, 54] (we discuss some of those results in detail in Chapter 2).
For general metric spaces, Fiat et al. [41] obtained the first f (k)-competitive
algorithm, with competitive ratio O((k!)3 ). Several improvements followed [5,
44, 18], but the ratio was still exponential in k. Then, in a breakthrough result,
Koutsoupias and Papadimitriou [53] showed that the Work Function Algorithm
(WFA) is (2k − 1)-competitive for every metric space, almost resolving the
conjecture. This remains up to date the best known upper bound on the
competitive ratio of the k-server problem.
We refer the reader to [19, 52] for an extensive treatment of the large body
of work on the k-server conjecture.
Previous Work. In their seminal paper [66], Sleator and Tarjan gave several
k
k−h+1 -competitive algorithms for uniform metrics (the (h, k)-paging problem)
and also showed that this is the best possible ratio. This bound was later
extended to the weighted star metric (weighted paging) [68]. Note that this
guarantee equals k for k = h (the usual k-server setting), and tends to 1 as
k/h approaches infinity. In particular, for k = 2h, this is smaller than 2.
This shows that the resource augmentation model gives a more accurate
interpretation on the performance of online algorithms: The competitive ratio
improves substantially when the number of servers grows.
Interestingly, in contrast to the classic k-server problem, the (h, k)-server
problem is not well understood beyond uniform metrics. Prior to our work,
no o(h)-competitive algorithm was known, even for very simple extensions of
the weighted star, like trees of depth 2. In particular, for k h it was not
even known whether using k servers any better performance can be achieved
compared to simply disabling the extra k − h servers and run the standard
k-server algorithms using only h servers.
8 1. Introduction
Our Contribution. In this thesis we initiate a systematic study of the (h, k)-
server problem. In Chapter 2, we focus on the (h, k)-server problem in the
euclidean line and in trees. We consider the Double Coverage (DC) algorithm,
which is known to be k-competitive for the standard k-server problem in those
metric spaces. We show that, surprisingly, its performance does not improve
as k increases, and its competitive ratio is exactly k(h+1)
k+1 . Note that this ratio
equals h for k = h and tends to h + 1 as k grows.
In Chapter 3, we consider trees of bounded depth. We show that the
previously known k-server algorithms (DC and WFA) do not improve as k
increases and they have competitive ratio Ω(h). Furthermore, we design a
new algorithm which is O(1)-competitive for trees of constant depth, whenever
k = (1 + )h for any > 0. This gives the first o(h)-competitive algorithm for
any metric space other than the weighted star. Finally, we give a general lower
bound that any deterministic online algorithm has competitive ratio at least
2.4, even for trees of depth 2 and when k/h is arbitrarily large. This gives a
surprising qualitative separation between trees of depth 1 (weighted star) and
trees of depth 2 for the (h, k)-server problem.
Note on joint work. Chapter 2 is based on joint work with Nikhil Bansal,
Marek Eliáš, Lukasz Jeż and Kirk Pruhs, which is published in Theory of Com-
puting Systems [11]. A preliminary version of this work appeared in the 13th
International Workshop on Approximation and Online Algorithms (WAOA),
2015 [10]. Chapter 3 is based on joint work with Nikhil Bansal, Marek Eliáš
and Lukasz Jeż. A preliminary version of this work appeared in the 28th
ACM-SIAM Symposium on Discrete Algorithms (SODA), 2017 [9].
Previous Work. Despite the intense interest, this problem is poorly un-
derstood. Prior to our work, competitive algorithms were known only for
k = 2 [65, 63]. Sitters [63] highlights that the existence of an f (k)-competitive
algorithm is among the most intriguing and important open problems in online
computation.
Note on joint work. The results in Chapter 4 are based on joint work with
Nikhil Bansal, Marek Eliáš and Jesper Nederlof, which appeared in the 29th
ACM-SIAM Symposium on Discrete Algorithms (SODA), 2018 [13].
Chapter 2
2.1 Introduction
In this chapter we study the Double Coverage (DC) algorithm for the (h, k)-
server problem. It is well-known that DC is k-competitive for h = k in any
tree metric. We prove that even if k > h the competitive ratio of DC does not
improve; in fact, it increases up to h + 1 as k grows. In particular, we show
matching upper and lower bounds of k(h+1)
k+1 on the competitive ratio of DC in
tree metrics.
11
12 2. Tight Bounds for Double Coverage Against Weak Adversaries
The (h, k)-server problem: In the (h, k)-setting, the online algorithm has
k servers, but its performance is compared to an offline optimal algorithm
with h ≤ k servers. The (h, k)-server setting turns out to be much more
intriguing and is much less understood than the standard k-server. For uniform
metrics (the (h, k)-paging problem), k/(k − h + 1)-competitive algorithms are
known [66] and no deterministic algorithm can achieve a better ratio. Note
that this guarantee equals k for h = k, and tends to 1 as the ratio k/h becomes
arbitrarily large. In particular, for k = 2h, this is smaller than 2. The same
competitive ratio can also be achieved for the weighted caching problem [68],
which is equivalent to the (h, k)-server problem on weighted stars (and even
for the more general file caching problem [69], which is not a special case of
the (h, k)-server problem).
It might seem natural to conjecture that, analogously to the k-server case,
general metrics are no harder than the uniform metrics, and hence that k/(k −
h + 1) is the right bound for the (h, k)-server problem in all metrics. However,
surprisingly, Bar-Noy and Schieber (cf. [19, p. 175]) showed this to be false:
In the line metric, for h = 2, no deterministic algorithm can be better than
2-competitive, regardless of the value of k. This is the best known lower bound
for the general (h, k)-server problem.
On the other hand, the best known upper bound is 2h, even when k/h → ∞.
In particular, Koutsoupias [51] showed that the WFA with k servers is 2h-
competitive1 against an offline optimum with h servers. Note that one way to
achieve a guarantee of 2h − 1 is simply to disable the k − h extra online servers
and use WFA with h servers only. The interesting thing about the result
of [51] is that the online algorithm does not know h and is 2h-competitive
simultaneously for every h ≤ k. But, even if we ignore this issue of whether
the online algorithm knows h or not, no guarantee better than h is known,
even for very special metrics such as depth-2 HSTs or the line, and even when
k/h → ∞.
as the adjacent server for this location, and the others are considered non-
adjacent.
DC-Line: If the current request r lies outside the convex hull of current loca-
tions of the servers, serve it with the nearest server. Otherwise, we move the
two servers adjacent to r towards it at equal speed until some server reaches r.
DC-Tree: We move all the servers adjacent to r towards it at equal speed until
some server reaches r. Note that the set of servers adjacent to r can change
during the move, in particular when some server reaches a vertex of the tree.
We call the parts of the move where the set of adjacent servers stays the same
elementary moves.
There are several natural reasons to consider DC for the line and trees. For
paging (and weighted paging), all known k-competitive algorithms also attain
the optimal ratio for the (h, k) version. This suggests that a k-competitive
algorithm for the k-server problem might attain the “right” ratio in the (h, k)-
setting. DC is the only deterministic k-server algorithm known to be k-
competitive for the line and trees. Moreover, DC obtains the optimum k/(k −
h+1)-competitive ratio for the (h, k)-paging problem, as we show2 in Section 2.5.
Our Results: We show that the exact competitive ratio of DC on lines and
trees in the (h, k)-setting is k(h+1)
(k+1) .
k(h+1)
Theorem 2.1. The competitive ratio of DC is at least (k+1) , even for a line.
Note that for a fixed h, the competitive ratio worsens slightly as the num-
ber of online servers k increases. In particular, it equals h for k = h and it
approaches h + 1 as k → ∞.
Consider the seemingly trivial case of h = 1. If k = 1, clearly DC is 1-
competitive. However, for k = 2 it becomes 4/3 competitive, as we now sketch.
Consider the instance where all servers are at x = 0 initially. A request arrives
at x = 2, upon which both DC and offline move a server there and pay 2.
Then a request arrives at x = 1. DC moves both servers there and pays 2
while offline pays 1. All servers are now at x = 1, and the instance repeats.
Generalizing this example to (1, k) already becomes quite involved. Our
lower bound in Theorem 2.1 for general h and k is based on an adversarial
strategy obtained by a careful recursive construction.
We also give a matching upper bound.
k(h+1)
Theorem 2.2. For any tree, the competitive ratio of DC is at most (k+1) .
2
This was known implicitly since the work of Chrobak and Larmore [30], where it was
pointed out that DC in star metrics is equivalent to Flush-When-Full (FWF) algorithm, and
it is well-known that FWF attains the optimal competitive ratio. In Section 2.5 we give an
explicit proof.
14 2. Tight Bounds for Double Coverage Against Weak Adversaries
request
L R
qL qR
δ δ
Figure 2.1: DC server is pulled to the right by δ
This generalizes the previous results for h = k [29, 30]. Our proof also
follows similar ideas, but our potential function is more involved (it has three
terms instead of two), and the analysis is more subtle. To keep the main ideas
clear, we first prove Theorem 2.2 for the simpler case of a line in Section 2.3.
The proof for trees is analogous but more involved, and is described in Section
2.4.
Sk
•
L R
Sk−1• •.Sk−1
.. ..
Sh+2 •. •Sh+2
L R L R
Sh+1• • • •Sh+1
L R L R
Sh• •• •• •• •Sh
Figure 2.2: Representation of strategies and the areas that they define using a
binary tree.
• pi , Pi , lower resp. upper bound for the “pull” exerted on any external
DC servers located to the left of the working interval of Si . Note that,
as will be clear later, by symmetry the same pull is exerted to the right.
For i ≥ h, the ratio ri = Adii is a lower bound for the competitive ratio of DC
with i servers against an adversary with h servers.
We now define the right and left front precisely. Let ε > 0 be a sufficiently
small constant. For i ≥ h, we define the size of working intervals for strategy Si
as sh := h and si+1 := si /ε. Note that sk = h/εk−h . The working interval for
strategy Sk is [0, sk ], and inside it we have two working intervals for strategies
Sk−1 : [0, sk−1 ] and [sk −sk−1 , sk ]. We continue this construction recursively and
the nesting of these intervals creates a tree-like structure as shown in Figure
2.2. For i ≥ h, the working intervals for strategy Si are called type-i intervals.
Strategies Si , for i ≤ h, are special and are executed in type-h intervals.
qh+1 qh ... q4 q3 q2 q1
points of Q
servers of adversary
servers of DC
→
Figure 2.3: The initial position for Strategy S3 (for h ≥ 3), in which the
adversary requests q4 , q3 , q2 , q1 . DC’s servers move for a total of 6, exerting a
pull of 1 in the process, only to return to the same position. The adversary’s
cost is 0 if h > 3 and 2 if h = 3: in such case, the adversary serves both q4 and
q3 with the server initially located in q3 .
Strategies Si for i > h: We define the strategy Si for i > h, assuming that
S1 , . . . , Si−1 are already defined. Let I denote the working interval for Si . We
assume that, initially, all offline and DC servers lie in the leftmost (or analo-
gously rightmost) type-(i − 1) interval of I. Indeed, for Sk this is achieved by
the initial configuration, and for i < k we will ensure this condition before ap-
plying strategy Si . In this case our phase consists of left-to-right step followed
by right-to-left step (analogously, if all servers start in the rightmost interval,
we apply first right-to-left step followed by left-to-right step to complete the
phase).
For each h ≤ j < i, let Lj and Rj denote the leftmost and the rightmost
type-j interval contained in I respectively.
Left-to-right step:
1. The adversary moves all its servers from Li−1 to Rh , specifically to the
→
points q1 , . . . , qh to prepare for the strategy S1 . Next, point q1 is reque-
sted, which forces DC to move one server to q1 , thus satisfying the initial
→
conditions of S1 . The figure below illustrates the servers’ positions after
these moves are performed.
2.2. Lower Bound 17
request
Li−1 Ri−1 qh+1 DC
q1
Si
ADV
Lh Rh
Rh+1
→
2. For j = 1 to h: Apply S j to interval Rh until the (j + 1)-th server of DC
→
arrives at the point qj+1 of Rh . Then, complete the request sequence Sj ,
so that DC servers will reside in points qj+1 , . . . , q1 , ready for strategy
→
Sj+1 . The figure below illustrates the servers’ positions after all those
moves (i.e., the whole outer loop, for j = 1 . . . , h) are performed.
request
Li−1 Ri−1 qh+1 DC
q1
Si
ADV
Rh
Rh+1
Rh+1
→ ←
Right-to-left step: Same as Left-to-right, just replace Sj by Sj , Rj intervals by
Lj , and Lj by Rj .
Bounding Costs: We begin with a simple but useful observation that follows
directly from the definition of DC. For any subset X of i ≤ k consecutive DC
servers, let us call center of mass of X the average position of servers in X.
We call a request external with respect to X, when it is outside the convex
hull of X and internal otherwise.
18 2. Tight Bounds for Double Coverage Against Weak Adversaries
Lemma 2.3. For any sequence of internal requests with respect to X, the
center of mass of X remains the same.
Proof. Follows trivially since for any internal request, DC moves precisely two
servers towards it, by an equal amount in opposite directions.
In the inequality above, we take the cost for left-to-right step multiplied by
2, since left-to-right and right-to-left step are symmetric. The term si h is the
cost incurred by the adversary in the beginning of the step, when moving all its
servers from the left side of I to the right. The costs Aj psji are incurred during
the phases of Sj for j = 1, . . . , i − 1, because Aj is an upper bound on the cost
of the adversary during a phase of strategy Sj and psji is an upper bound on
the number of phases of Sj during Si . This follows because Sj (during left to
right phase) executes as long as the (j + 1)-th server moves from left of I to
right of I. It travels a distance of at most si and receives a pull of pj during
each iteration of Sj in R. Finally, the equality in (2.1) follows, as Aj = 0 for
j < h.
We now lower bound the cost of DC. Let us denote δ := (1 − 2ε). The
length of I \ (Li−1 ∪ Ri−1 ) is δsi and all DC servers moving from right to left
δs
have to travel at least this distance. Furthermore, as Pjj is a lower bound for
the number of iterations of strategy Sj , we obtain:
i−1 i−1
X δsi X dj
di ≥ 2 δsi i + dj = 2δsi i + (2.2)
Pj Pj
j=1 j=1
It remains to show the upper and lower bounds on the pull Pi and pi exerted
on external servers due to the (right-to-left step of) strategy Si . Suppose Si
is being executed in interval I. Let x denote the closest DC server strictly to
the left of I. Let X denote the set containing x and all DC servers located
in I. During the right-to-left step of Si , all requests are internal with respect
to X. So by Lemma 2.3, the center of the mass of X remains unchanged. As
i servers moved from right to left during right-to-left step of Si , this implies
that x should have been pulled to the left by the same total amount, which is
at least iδsi and at most isi . Hence,
Due to a symmetric argument, during the left-to-right step, the same amount
of pull is exerted to the right.
Now we are ready to prove Theorem 2.1.
di Ai 2(i + 1) −(i−h)
≥ 2iδ i−h and ≤ δ (2.4)
Pi pi h+1
k(h+1)
Therefore, as δ = (1 − 2ε), it is easy to see that rk → k+1 when ε → 0:
Induction base (i = h): For the base case we have ah = 2, dh = 2h, and
ph = Ph = 1, so Pdhh = 2h and Aphh = 2, i.e., (2.4) holds.
Induction step (i > h): Using (2.2), (2.3), and induction hypothesis, we
obtain
i−1 i−1
di 2δ X dj 2δ X
j−h 2δ
≥ i+ ≥ i+ 2jδ ≥ δ i−1−h (i + i(i − 1)) = 2iδ i−h ,
Pi i Pj i i
j=1 j=1
Pi−1
where the last inequality follows from the fact that j=1 2j = i(i − 1). Simi-
larly, we prove the second part of (2.4). The first inequality follows from (2.1)
and (2.3), the second from the induction hypothesis:
i−1 i−1
Ai 2 X Aj 2 X 2(j + 1) −(j−h)
≤ h+ ≤ h+ δ
pi iδ pj iδ h+1
j=h j=h
Pi−1
2 −(i−1−h) h(h + 1) + 2 j=h (j + 1)
≤ δ
iδ h+1
2 i(i + 1) 2(i + 1) −(i−h)
≤ i−h = δ ,
iδ h+1 h+1
Pi−1
The last inequality follows from 2 j=h (j + 1) = i(i + 1) − h(h + 1).
20 2. Tight Bounds for Double Coverage Against Weak Adversaries
where c = k(h+1)
k+1 is the desired competitive ratio, and DC(t) and OP T (t)
denote the cost incurred by DC and OPT at time t. Coming up with a potential
function Φ that satisfies (2.5) is sufficient, as c-competitiveness follows from
summing this inequality over time.
For a set of points A, let DA denote the sum of all |A|
2 pairwise distances
between points in A. Let M ⊆ X be some fixed set of h servers of DC and
M(M, Y ) denote the minimum weight perfect matching between M and Y ,
where the weights are determined by the distances. Abusing the notation
slightly, we will denote by M(M, Y ) both the matching and its cost. We
denote
k(h + 1) k
ΨM (X, Y ) := · M(M, Y ) + · DM .
k+1 k+1
Then the potential function is defined as follows:
1
Φ(X, Y ) = min ΨM (X, Y ) + · DX
M
k+1
k(h + 1) k 1
= min · M(M, Y ) + · DM + · DX .
M k+1 k+1 k+1
Note that this generalizes the potential considered in [29, 30] for the case of
h = k. In that setting, all the online servers are matched and hence DM = DX
and is independent of M , and thus the potential above becomes k times that
minimum cost matching between X and Y plus Dx . On the other hand in our
setting, we need to select the right set M of DC servers to be matched to the
offline servers based on minimizing ΨM (X, Y ).
Let us first give a useful property concerning minimizers of Ψ, which will
be crucial later in our analysis. Note that ΨM (X, Y ) is not simply the best
matching between X and Y , but also includes the term DM which makes the
argument slightly subtle.
2.3. Upper Bound 21
Lemma 2.4. Let X and Y be the configurations of DC and OPT and consider
some fixed offline server at location y ∈ Y . There exists a minimizer M of Ψ
that contains some DC server x which is adjacent to y. Moreover, there is a
minimum cost matching M between M and Y that matches x to y.
We remark that the statement does not necessarily hold simultaneously for
every offline server, but only for a single fixed offline server y. Moreover, we
note that the adjacency in the lemma statement and the proof is defined as for
the DC algorithm (cf. Section 2.1); specifically, as if there was a request at y’s
position.
(h + 1)k k(h − 1)
ΨM (X, Y ) − ΨM 0 (X, Y ) ≤ − · d(x, x0 ) + · d(x, x0 )
k+1 k+1
2k
=− · d(x, x0 ) < 0 ,
k+1
Proof. Recall, that we are at time t and request r is arriving. We divide the
analysis into two steps: (i) OPT serves r, and then (ii) DC serves r. As a
consequence, whenever a server of DC serves r, we can assume that a server of
OPT is already there.
For all following steps considered, M is the minimizer of ΨM (X, Y ) in the
beginning of the step. It might happen that, after change of X, Y during
the step, a better minimizer can be found. However, an upper bound for
∆ΨM (X, Y ) is sufficient to bound the change in the first term of the potential
function.
OPT moves: If OPT moves one of its servers by distance d to serve r, the
value of ΨM (X, Y ) increases by at most k(h+1)
k+1 d. As OP T (t) = d and X does
not change, it follows that
k(h + 1)
∆Φ(X, Y ) ≤ · OP T (t) ,
k+1
and hence (2.5) holds. We now consider the second step, when DC moves.
1. Suppose DC moves its rightmost server (the leftmost server case is iden-
tical) by distance d. Let y denote the offline server at r. By Lemma 2.4
we can assume that y is matched to the rightmost server of DC. Thus,
the cost of the minimum cost matching between M and Y decreases by d.
Moreover, DM increases by exactly (h − 1)d (as the distance to rightmost
server increases by d for all servers of DC). Thus, ΨM (X, Y ) changes by
k(h + 1) k(h − 1) 2k
− ·d+ ·d=− ·d .
k+1 k+1 k+1
Proof of Theorem 2.2. We use the same potential as before, i.e, we let
k(h + 1) k
ΨM (X, Y ) := · M(M, Y ) + · DM ,
k+1 k+1
and define
1
Φ(X, Y ) = min ΨM (X, Y ) + · DX .
M k+1
24 2. Tight Bounds for Double Coverage Against Weak Adversaries
a1 v
a3
s
a2
To prove the theorem, we show that for any time t the following holds:
where c = k(h+1)
k+1 .
As in the analysis for the line, we split the analysis in two parts: (i) OPT
serves r, and then (ii) DC serves r. As a consequence, whenever a server of
DC serves r, we can assume that a server of OPT is already there.
OPT moves: If OPT moves a server by distance d, only the matching cost
is affected in the potential function, and it can increase by at most d · k(h +
1)/(k + 1). Therefore
k(h + 1)
∆Φ(X, Y ) ≤ · OP T (t) ,
k+1
M(M, Y ) by d. The move of all other servers of AM can increase the cost of
M(M, Y ) by at most (|AM | − 1) · d. We get that
∆M(M, Y ) ≤ (|AM | − 2) · d .
P
as a∈A qa
= k.
Similarly, for DM , we first note that it can change only due to moves of
servers in AM . Specifically, each a ∈ AM moves further away from ha − 1
servers in M and gets closer to the remaining h − ha of them. Thus, the
change of DM associated with a is (2ha − h − 1)d. Therefore we have
X
∆DM = (2ha − h − 1)d ≤ (2h − |AM |(h + 1)) d ,
a∈AM
P P
since a∈AM ha ≤ a∈A ha = h.
Using above inequalities, we see that the change of potential is at most
since
−k − h + 1 + 2(h − 1) −k + h − 1
∆Φ ≤ k= k
2(k − h + 1) 2(k − h + 1)
k−h+1 k
− k=− .
2(k − h + 1) 2
k k
Overall we get that DC + ∆Φ ≤ 2 − 2 = 0.
Chapter 3
3.1 Introduction
In this chapter, we consider the (h, k)-server problem on special tree metrics,
in particular trees of bounded depth. Our motivation comes from the fact that
for (weighted) star graphs (trees of depth 1) we have a very good understan-
ding of the problem, while for more complex metrics like the line and arbitrary
trees, no o(h)-competitive algorithm is known. Moreover, as we mentioned in
the previous chapter, for trees of depth 1, all algorithms that are k-competitive
for k = h, attain also the optimum competitive ratio for the (h, k) setting. In
contrast, in the line we showed that the Double Coverage algorithm, which
attains the optimal competitive ratio for k = h, does not perform well in the
(h, k)-setting. Thus, it is natural to consider trees of depth 2, which are the
simplest possible extension of the weighted star, and try to get a better under-
standing on the effect of the structure of the metric space on the competitive
ratio of the (h, k)-server problem.
We first show that already in trees of small depth, all the previously known
algorithms (beyond uniform metrics), specifically the Double Coverage (DC)
algorithm and the Work Function Algorithm (WFA) have competitive ratio
Ω(h). This suggests that we need substantially new ideas in order to deal with
the (h, k)-server problem.
29
30 3. The (h, k)-Server Problem on Bounded Depth Trees
Preliminaries
A depth-d tree is an edge-weighted rooted tree with each leaf at depth exactly d.
In the (h, k)-server problem in a depth-d tree, the requests arrive only at leaves,
3.2. Lower Bound for Double Coverage on Depth-2 HSTs 31
and the distance between two leaves is defined as the distance in the underlying
tree. A depth-d hierarchically separated tree (HST) is a depth-d tree with the
additional property that the distances decrease geometrically away from the
root (see e.g. [15]). We will first present our algorithm for general depth-d trees
(without the HST requirement), and later show how to (easily) extend it to
arbitrary trees with bounded diameter, where requests are also allowed in the
internal nodes.
Work Function Algorithm. Consider a request sequence σ = r1 , r2 , . . . , rm .
For each i = 1, . . . , m, let wi (A) denote the optimal cost to serve requests
r1 , r2 , . . . , ri and end up in the configuration A, which is specified by the set
of locations of the servers. The function wi is called work function. The Work
Function Algorithm (WFA) decides its moves depending on the values of the
work function. Specifically, if the algorithm is in a configuration A and a
request ri ∈ / A arrives, it moves to a configuration X such that ri ∈ X and
wi (X) + d(A, X) is minimized. For more background on the WFA, see [19].
Organization
In Section 3.2, we describe the lower bound for the DC in depth-2 HSTs.
The shortcomings of the DC might help the reader to understand the motiva-
tion behind the design of our algorithm for depth-d trees, which we describe
in Section 3.3. Its extension to the bounded-diameter trees is discussed in
Section 3.4. In Section 3.5 we describe the general lower bound (Theorem 3.4)
and the lower bound for the WFA (Theorem 3.2) for depth-3 HSTs. The
extension of Theorem 3.2 to the line is discussed in Section 3.6.
r
si
q
u
...
v s1 si−1
Figure 3.1: Move of DC during Step i. Servers s1 , . . . , si−1 are moving towards
u by distance and si is moving down the edge (r, u) by the same distance.
While si is in the interior of (r, u), no server q from some other branch is
adjacent to v because the unique path between v and q passes through si .
empty, and the adversary moves all its servers there, starting a new phase. The
adversary can execute an arbitrary number of such phases.
The key observation is that DC is “too slow” when bringing new servers
to Tu , and incurs a cost of order Ω(h2 ) during each phase, while the adversary
only pays O(h).
1− 1 − 2
(2(i − 1) + ) ≥ · 2(i − 1) + 1 = (1 − 2)(2i − 1)
h h
X X h2
ALG ≥ 1 + (1 − 2)(2i − 1) ≥ (1 − 2)(2i − 1) = (1 − 2)h2 ≥
2
i=2 i=1
To conclude the proof, we note that ALG / ADV ≥ (h2 /2)/(2h) = h/4 = Ω(h)
for all phases.
1 q ...
3/6
2/6
1/6
Figure 3.2: A request at v, and Phase 2 of Algorithm 1. Note that kq− equals
6 in the visualised case. Speed is noted next to each server moving.
We note two properties, the first of which follows directly from the design
of Algorithm 1.
Observation 3.6. No edge e ∈ T contains more than one server of Algorithm 1
in its interior.
Note that during both the phases, the various servers move at non-uniform
speeds depending on their respective ks . The following observations about
these speeds will be useful.
Observation
P 3.7. During Phase 1, the total speed of servers is 1. This follows
as s∈A ks = k. Analogously, during Phase P2, the total speed of servers inside
Tq− is 1, if there are any. This follows as s∈A\{q} ks = kq− .
3.3. Algorithm for Depth-d Trees 35
The intuition behind the algorithm is the following. Recall that the problem
with DC is that it moves its servers too slowly towards an active region when
requests start arriving there. In contrast, we change the speeds of the servers
adjacent to v to make the algorithm more aggressive. From each region, an
adjacent server moves at speed proportional to the number of the online servers
in that region. This way, if a region has many servers and not many requests
appear there (we call such regions excessive), servers move quickly from there
to a more active region. Moreover, in Phase 2, server q is viewed as a helper
coming to aid the servers inside Tq− . The second main idea is to keep the total
speed of the helper proportional to the total speed of the servers inside Tq− .
This prevents the algorithm from becoming overly aggressive and keeps the
cost of the moving helpers comparable to the cost incurred within Tq− .
3.3.2 Analysis
We will analyze the algorithm based on a suitable potential function Φ(t). Let
ALG(t) and OPT(t) denote the cost of the algorithm and of the adversary
respectively, for serving the request at time t. Let ∆t Φ = Φ(t) − Φ(t − 1)
denote the change of the potential at time t. We will ensure that Φ is non-
negative and bounded from above by a function of h, k, d, and length of the
longest edge in T . Therefore, to show R-competitiveness, it suffices to show
that the following holds at each time t: ALG(t) + ∆t Φ ≤ R · OPT(t).
To show this, we split the analysis into two parts: First, we let the adversary
move a server (if necessary) to serve the request. Then we consider the move
of the algorithm. Let ∆OP t
T Φ and ∆ALG Φ denote the changes in Φ due to
t
the move of the adversary and the algorithm respectively. Clearly, ∆t Φ =
∆OP
t
T Φ + ∆ALG Φ, and thus it suffices to show the following two inequalities:
t
∆OP
t
T
Φ ≤ R · OP T (t) (3.1)
ALG(t) + ∆ALG
t Φ≤0 (3.2)
Potential function
Before we define the potential, we need to formalize the notion of excess and
deficiency in the subtrees of T . Let d(a, b) denote the distance of points a
and b. For e = P (u, v) ∈ T , where v is the node closer to the root, we define
1
ke := ku + d(u,v) s∈e d(s, v). Note that this is the number of online servers in
Tu , plus the possible single server in e counted fractionally, proportionally to
its position along e. For an edge e, let `(e) denote its level with the convention
that the edges from leaf to their parents have level 1, and the edges from root
to its children have level d. For ` = 1, . . . , d, let β` be some geometrically
increasing constants that will be defined later. For any point x ∈ T , similarly
36 3. The (h, k)-Server Problem on Bounded Depth Trees
Note that these compare ke to hu with respect to the excess threshold β`(e) .
We call an edge excessive, if Ee > 0, otherwise we call it deficient. Let us state
a few basic properties of these two terms.
Note that no other server can pass through e while s still resides there and the
contribution of s to ke is a nonzero value strictly smaller than 1, while bβ` hu c
is an integer.
This is because ke changes by x/d(u, v), and therefore the change of De (resp. Ee )
is x.
β ≤ δ 1/d . (3.3)
For each ` = 1, . . . , d, we define the excess threshold for all edges in the level `
as β` := β `−1 .
Now, we can define the potential. Let
X
D E
Φ := α`(e) De + α`(e) Ee ,
e∈T
3.3. Algorithm for Depth-d Trees 37
α`D := 2` − 1 for ` = 1, . . . , d
1 D
αdE := γ(1 + α )
β d
d−1
X 1
α`E := γ i−`+1
2 + αiD + γ d−` αdE for ` = 1, . . . , d − 1.
β
i=`
Lemma 3.11 (Excess in Phase 1). Consider a moment during Phase 1 and
assume that no server of A resides at a node. For the set E = {s ∈ A | s ∈
e, Ee > 0} of servers which are located in excessive edges, and for D = A \ E,
the following holds.
X 1 X 1
ks ≤ k and ks ≥ k.
β γ
s∈D s∈E
Lemma 3.12 (Excess in Phase 2). Consider a moment during Phase 2 and
assume that no server of A resides at a node. Let ` be the level of the edge
containing q and A0 = A \ {q}. For the set E = {s ∈ A0 | s ∈ e, Ee > 0} of
servers which are located in excessive edges, and for D = A0 \ E, the following
holds. If kq− ≥ bβ` h−
q c, then we have
X 1 − X 1 −
ks ≤ k and ks ≥ k .
β q γ q
s∈D s∈E
Proof. The proof is quite similar to the proof of Lemma 3.11. Instead of using
the fact that δ ≥ β d = β · β d−1 = β · βd , we now crucially use the fact that
β` = β · β`−1 . However, now we have to be more careful with the counting of
the servers of the adversary.
For each s ∈ D, let `(s) be the level of the edge e containing s. Similarly
to the proof of Lemma 3.11, we have ks ≤ bβ`(s) · hs c ≤ β`−1 · hs for each
server s ∈ D, since `(s) ≤ ` − 1. Recall that we assume that the adversary has
already served the request. Let a be the server of the adversary located at the
requested point. Since no online servers reside in the path between q and the
requested point,
P a does not belong to Ts for any s ∈ D ∪ E. Therefore we have
− − 1. We get that
P
h
s∈D s ≤ h
s∈(D∪E) s ≤ hq
X X
ks ≤ β`−1 · hs ≤ β`−1 (h−
q − 1). (3.4)
s∈D s∈D
To finish the proof of the first inequality, observe that our assumption that
kq− ≥ bβ` h−
q c implies
kq− + 1
kq− ≥ bβ` h− − − −
q c ⇒ β` hq ≤ kq + 1 ⇔ hq ≤ .
β`
Therefore, from (3.4) we have
X kq− + 1 β`−1 − 1 1
ks ≤ β`−1 (h−
q − 1) ≤ β`−1 ( − 1) = kq + − β`−1 ≤ kq− .
β` β` β β
s∈D
1 1 −
P
P For the second inequality, note that γ = (1 − β ). Since kq = s∈D ks +
s∈E ks , we have
X 1 1
ks ≥ kq− − kq− = kq− .
β γ
s∈E
3.3. Algorithm for Depth-d Trees 39
2d d 2d 2d
γd ≤ βd · ( ) ≤ δ · ( )d = O(( )d ).
As we show in Lemma 3.16 below, dβ` eα`D and dβ` eα`E are of order O(d · γ d ).
Therefore, setting R = Θ(d · γ d ) will satisfy (3.1).
We now consider (3.2) which is much more challenging to show. Let us
denote AE the set of edges containing some server from A in their interior. We
call an elementary step a part of the motion of the algorithm during which A
and AE remain unchanged, and all the servers of A are located in the interior
of the edges of T . Lemmas 3.14 and 3.15 below show that (3.2) holds during
an elementary step, and the theorem would follow by summing (3.2) over all
the elementary steps.
Proof. Without loss of generality, let us assume that the elementary step lasted
exactly 1 unit of time. This makes the distance traveled by each server equals
to its speed, and makes calculations cleaner.
Let ALG denote the cost incurred by the algorithm during this step. Note
that ALG = 1, since by Observation 3.7, the total speed of the servers in A, is
1.
To estimate the change of the potential ∆Φ, we decompose A into two sets,
called D and E. D is the set of the servers of A residing in deficient edges,
and E are the servers residing in excessive edges. Next, we evaluate ∆Φ due
to the movement of the servers from each class separately.
The movement of servers of E is good, i.e. decreases the excess in their
edges, while the movement of servers of D increases the deficiency. By taking
the largest possible αD (which is αdD ) and the smallest possible αE (which is
αdE ) coefficient in the estimation, we can bound the change of the potential due
to the move of the servers of A as
X ks X ks 1 1
∆Φ ≤ αdD − αdE ≤ αdD − αdE ,
k k β γ
s∈D s∈E
where the last inequality holds due to the Lemma 3.11. We get that
1 D 1 E 1 1 1
ALG +∆Φ ≤ 1 + αd − αd = 1 + αdD − · γ(1 + αdD ) = 0.
β γ β γ β
Lemma 3.15. During an elementary step in Phase 2 of Algorithm 1, the
inequality (3.2) holds.
Proof. Similarly to the proof of the preceding lemma, we denote by ALG the
cost incurred by the algorithm and we assume (without loss of generality) that
the duration of the elementary step is exactly 1 time unit, so that the speed of
each server equals the distance it travels. As the speed of the server q is 1, it
also moves by distance 1. Moreover, by Observation 3.7, the servers in Tq− (if
any) move in total by s∈A\{q} kk−s = 1, and therefore ALG ≤ 2. We denote by
P
q
` the level of the edge containing q. To estimate the change of the potential,
we consider two cases.
1. When kq− ≥ bβ` h− q c. Here the movement of q increases the excess in the
edge containing q. Let us denote E (resp. D) the servers of A\{q} residing
in the excessive (resp. deficient) edges. By taking the largest possible αD
D ) and the smallest possible αE (which is αE ) coefficient
(which is α`−1 `−1
in the estimation, we can upper bound the change of the potential due
to the move of the servers in Tq− as,
X ks X ks 1 D 1 E
D E
α`−1 − − α`−1 − ≤ β α`−1 − γ α`−1 ,
k
s∈D q
k
s∈E q
3.3. Algorithm for Depth-d Trees 41
where the above inequality holds due to the Lemma 3.12. As the mo-
vement of q itself causes an increase of Φ by α`E , we have
1 D 1 E
ALG + ∆Φ ≤ 2 + α`−1 − α`−1 + α`E .
β γ
To see that this is non-positive, recall that α`E = d−1 i−`+1 2 + 1 αD +
P
i=` γ β i
γ d−` αdE . Therefore
d−1
1 E 1 X i−`+2 1 1
α`−1 = γ 2 + αiD + γ d−`+1 αdE
γ γ β γ
i=`−1
d−1
1 D X i−`+1 1
2 + αiD + γ d−` αdE
= 2+ α`−1 + γ
β β
i=`
1 D
= 2 + α`−1 + α`E .
β
Proof. Without loss of generality both the online and offline algorithms are
“lazy”, i.e. they move a server only for serving a request (this is a folklore
k-server property, see e.g. [19]). Since requests only appear at leaves of T , all
the offline and online servers are always located at the leaves. We say that a
server is inside an elementary subtree Tu , if it is located at some leaf of Tu . If
there are no online servers at the leaves of Tu , we say that Tu is empty. Observe
that at any given time there exists at least one empty elementary subtree.
Let A be an online algorithm. The adversarial strategy consists of arbitra-
rily many iterations of a phase. During a phase, some offline servers are moved
to an empty elementary subtree Tu and requests are made there until the cost
incurred by A is sufficiently large. At this point the phase ends and a new
phase may start in another empty subtree. Let ALG and ADV denote the cost
of A and the adversary respectively during a phase. We will ensure that for
all phases ALG ≥ 2.4 · ADV. This implies the lower bound on the competitive
ratio of A.
We describe a phase of the adversarial strategy. The adversary moves some
` ≤ h servers to the empty elementary subtree Tu and makes requests at leaves
of Tu until A brings m servers there. In particular, each request appears at a
leaf of Tu that is not occupied by a server of A. We denote by s(i) the cost that
A has to incur for serving requests inside Tu until it moves its ith server there
(this does not include the cost of moving the server from outside Tu ). Clearly,
s(1) = 0 and s(i) ≤ s(i + 1) for all i > 0. The choice of ` and m depends on
the values s(i) for 2 ≤ i ≤ h. We will now show that for any values of s(i)’s,
the adversary can choose ` and m such that ALG ≥ 2.4 · ADV.
First, if there exists an i such that s(i) ≥ 3i, we set ` = m = i. Intuitively,
the algorithm is too slow in bringing its servers to Tu in this case. Both A
and the adversary incur a cost of 2i to move i servers to Tu . However, A pays
a cost of s(i) for serving requests inside Tu , while the adversary can serve all
those requests at zero cost (all requests can be located at leaves occupied by
offline servers). Overall, the cost of A is 2i + s(i) ≥ 5i, while the offline cost is
2i. Thus we get that ALG ≥ 2.5 · ADV.
Similarly, if s(i) ≤ (10i − 24)/7 for some i, we choose ` = 1 and m = i.
Roughly speaking, in that case the algorithm is too “aggressive” in bringing
its first i servers, thus incurring a large movement cost. Here, the adversary
only moves one server to Tu . Each request is issued at an empty leaf of Tu .
Therefore A pays for each request in Tu and the same holds for the single server
of the adversary. So, ALG = 2i + s(i) and ADV = 2 + s(i). By our assumption
on s(i), this gives
ALG −2.4 · ADV = 2i + s(i) − 4.8 − 2.4 · s(i) = 2i − 4.8 − 1.4 · s(i) ≥ 0.
We can thus restrict our attention to the case that s(i) ∈ ( 10i−24
7 , 3i), for
all 2 ≤ i ≤ h. Now we want to upper bound the offline cost, for 1 < ` < h and
44 3. The (h, k)-Server Problem on Bounded Depth Trees
m = h. Clearly, the offline movement cost is 2`, and for the time that A has
less than ` servers in Tu , the offline cost is zero. It remains to count the offline
cost during the time that A has at least ` servers inside Tu .
For the part of the request sequence when A has ` ≤ j < h servers in Tu ,
it incurs a cost s(j + 1) − s(j). Since the problem restricted to an elementary
subtree is equivalent to the paging problem, using the lower bound result of
[66] for paging1 , we get that the adversary incurs a cost of at most (s(j + 1) −
s(j)) · j−`+1
j
h−`
+ 2j ≤ (s(j + 1) − s(j)) · h−1 + 2j. Also, there are h − ` requests
where A brings new servers. Clearly, those requests cost to the adversary at
most (h − `)2. Thus the cost of the adversary inside Tu is at most
h−1
X h−`
(s(j + 1) − s(j)) · + 2j + (h − `)2
h−1
j=`
h−1
h−` X
= s(h) − s(`) + 2 j + (h − `)2.
h−1
j=`
For any value of h, we can take small enough, such that the terms involving
tend to zero. Thus the upper bound on the offline cost is arbitrarily close to
h−`
2` + (s(h) − s(`)) · h−1 , where the first term is the cost of moving ` servers to
Tu . Let us denote c = s(h)/h. Note that assuming h is large enough, c ∈ (1, 3).
We get that
ALG 2h + s(h) 2h + ch
≥ h−`
≥ (3.5)
ADV 2` + (s(h) − s(`)) · h−1 2` + (ch − 10`−24
7 )· h−`
h−1
2h + ch
= (3.6)
2` + h · (c − 10`−24 h−`
7h ) · h−1
We now show that for every value of c ∈ (1, 3), there is an ` = bβhc, where
β ∈ (0, 1) is a constant depending on c, such that this ratio is at least 2.4.
First, as h is large enough, (3.6) is arbitrarily close to
2h + ch 2h + ch
=
2` + h · (c − 10`/7h) · (1 − `/h) 2` + h c − c`/h − 10`/(7h) + 10`2 /(7h2 )
2h + ch
≥
2βh + h c − c(βh − 1)/h − 10(βh − 1)/(7h) + 10β 2 h2 /(7h2 )
1
Sleator and Tarjan [66] show that an adversary with h servers can create a request
sequence against an online algorithm with k servers such that the cost of the adversary is at
most k−h+1
k
ALG +(k − h + 1) · D, where D is the distance between two leaves.
3.5. Lower Bounds 45
2+c 2+c
→
2β + c − cβ + c/h − 10β/7 + 10/(7h) + 10β 2 /7 (10/7) · β 2 + (4/7 − c)β + c
Proof. Let T be a depth-3 HST. We assume that the lengths of the edges in a
−0 0 0
root-to-leaf path are 1−
2 , 2 , 2 , for 1. So the diameter of T is 1 and
the diameter of depth-2 subtrees is . We also assume that N = 1 is integer
such that N 3h 2 . Let L and R be two subtrees of depth 2. Inside each
one of them, we focus on 2 elementary subtrees L1 , L2 and R1 , R2 respectively
(see figure 3.3), each one containing exactly h leaves. All requests appear at
leaves of those elementary subtrees. Initially all servers are at leaves of L.
Thus, both the WFA and the adversary always have their servers at leaves.
This way, we say that some servers of the WFA (or the adversary) are inside
a subtree, meaning that they are located at some leaves of that subtree.
The adversarial strategy consists of arbitrary many iterations of a phase.
At the beginning of the phase, all online and offline servers are in the same
subtree, either L or R. At the end of the phase, all servers have moved to
the other subtree (R or L resp.), so a new phase may start. Before describing
46 3. The (h, k)-Server Problem on Bounded Depth Trees
L R
L1 L2 R1 R2
· · ·· · · · · ·· · · · · ·· · · · · ·· · ·
Figure 3.3: The tree where the lower bound for WFA is applied: All requests
arrive at leaves of L1 , L2 , R1 and R2 .
the phase, we give the basic strategy, which is repeated many times. For any
elementary subtree T with leaves t1 , . . . , th , any 1 ≤ ` ≤ h and any c > 0, we
define strategy S(T, `, c).
Strategy S(T, `, c):
Note that the 2nd part might not be executed at all, depending on the values
of ` and c.
We now describe a left-to-right phase, i.e., a phase which starts with all
servers at L and ends with all servers at R. A right-to-left phase is completely
symmetric, i.e., we replace R by L and Ri by Li . Recall that N = 1 .
Left-to-right phase:
Step 1: For ` = 1 to h: Apply strategy S(R1 , `, 2)
Step 2: For i = 1 to N + 1:
For ` = 1 to h: Apply strategy S(R2 , `, 2)
For ` = 1 to h: Apply strategy S(R1 , `, 2)
Intuitively, the WFA starts with no server at R and at the end of Step 1,
it has h servers there (more precisely, in R1 ). During Step 2, the WFA moves
all its servers to R, as we show later.
Let ALG and ADV be the online and offline cost respectively. We now state
two basic lemmas for evaluating ALG and ADV during each step. Proofs of
3.5. Lower Bounds 47
0
ALG 3h2 + h − 3h3 − 2(h − 1)h − 0 (h − 1)h 3h2 + h 1
≥ → =h+
ADV (3 + 2)h 3h 3
Also, let w and w0 be the work function before and after a request r respectively.
For a configuration X such that r ∈ X, we have that w0 (X) = w(X). Last,
48 3. The (h, k)-Server Problem on Bounded Depth Trees
let C and C 0 be the configurations of the WFA before and after serving r
respectively. The work function w0 satisfies w0 (C) − w0 (C 0 ) = d(C, C 0 ).
Notation: Let (Li , Rk−i ) denote a configuration which has i servers at L and
(k − i) servers at R. Let w(Li , Rk−i ) be the minimum work function value of a
configuration (Li , Rk−i ). If we need to make precise how many servers are in
each elementary subtree, we denote by (Li , r1 , r2 ) a configuration which has i
servers at L, r1 servers at R1 and r2 servers at R2 . Same as before, w(Li , r1 , r2 )
denotes the minimum work function value of those configurations.
Definition: For two configurations X and Y , we say that X supports Y , if
w(Y ) = w(X) + d(X, Y ). The set of configurations that are not supported by
any other configuration is called the support of work function w. The following
observation will be useful later in our proofs.
Initialization: For convenience we assume that at the beginning of the phase
the minimum work function value of a configuration is zero. Note that this is
without loss of generality: If m = minX w(X) when the phase starts, we just
subtract m from the work function values of all configurations. We require the
invariant that at the beginning of the phase, for 0 ≤ i ≤ k :
w(Lk−i , Ri ) = i.
This is clearly true for the beginning of the first phase, as all servers are
initially at L. We are going to make sure, that the symmetric condition (i.e.
w(Li , Rk−i ) = m + i) holds at the end of the phase, so a right-to-left phase
may start.
We now state two auxiliary lemmata which would be helpful later.
Lemma 3.19. Consider a left-to-right phase. At any time after the end of stra-
tegy S(R1 , `, 2), for 1 ≤ ` ≤ h, we have that w(Lk−`+1 , R`−1 ) = w(Lk−` , R` )+1.
At a high-level, the reason that this lemma holds is that any schedule S
that uses no more than ` − 1 servers in R1 , incurs a cost of at least 2 during
the execution of S(R1 , `, 2). Thus, by moving an `th server to R1 (cost 1), and
serving all requests of S(R1 , `, 2) at zero cost, we obtain a schedule which is
cheaper than S by at least 1. The formal proof is deferred to the end of this
section.
Lemma 3.20. Consider a left-to-right phase. At any time after the end of
strategy S(R1 , `, 2), for 1 ≤ ` ≤ h, we have that w(Lk−i , Ri ) = w(Lk−` , R` ) +
(` − i) for any 0 < i < `.
Induction Step: Assume that the lemma is true for some i < `. We show
that the lemma holds for i − 1. Clearly, time t is after the end of S(R1 , i, 2).
From Lemma 3.19 we have that
First Step: We now focus on the first step of the phase. Using the two
lemmata above, we can characterize the structure of the work function at the
end of the execution of S(R1 , `, 2), for 1 ≤ ` ≤ h.
In other words, having ` servers in R is the lowest state, and all other states
are tight with respect to it.
Proof. For i < `, the lemma follows from Lemma 3.20. We focus on i ≥ `:
Until the end of S(R1 , `, 2) there are ` ≤ i points in R requested, so w(Lk−i , Ri )
does not change. Since at the beginning w(Lk−i , Ri ) = i, we have that for all
i≥`+1
w(Lk−i , Ri ) − w(Lk−` , R` ) = i − `.
Lemma 3.22. For any 0 ≤ i < h, the optimal schedule to serve c consecutive
iterations of Step 2 using h + i servers in R, starting from a configuration
(Lh−i , h, i) and ending up in a configuration (Lh−i , h − i0 , i + i0 ), for 0 ≤ i0 ≤
h − i, has cost c · 2(h − i) + · i0 .
c
X
= c · 2(h − i) + · aj − aj−1 = c · 2(h − i) + · ac .
j=1
(i) During the whole iteration, for all 0 ≤ i < h and 0 < j ≤ h − i, there is
no configuration C ∈ (Lh−i , Rh+i ) which is supported by a configuration
C 0 ∈ (Lh−i−j , Rh+i+j ).
(ii) At the beginning of the iteration, for all 0 ≤ i < h, we have that
w(Lh−i , Rh+i ) = w(Lh−i , h, i) and for all 0 < i0 ≤ h − i,
Let us get some intuition behind this definition. The first condition im-
plies that during good iterations the work function values of configurations
(Lh−i , Rh+i ) are not affected by configurations (Lh−j , Rh+j ) for j 6= i. This
makes it easier to argue about w(Lh−i , Rh+i ). Moreover, by basic properties, it
implies that the WFA does not move servers from L to R (see Observation 3.25
below). Since the WFA has h servers in R when Step 2 starts, our goal is to
show that there are too many consecutive good iterations in the beginning
of Step 2. This implies that for the largest part of Step 2, the WFA has h
servers in R. Then, it suffices to get a lower bound on the cost of the WFA
during those iterations. The second condition implies that at the beginning
of a good phase, any optimal schedule for configurations (Lh−i , Rh+i ) is at a
configuration (Lh−i , h, i).
We now state some basic observations that follow from the definition of a
good iteration and will be useful in our analysis.
Observation 3.25. During a good iteration the WFA does not move any server
from L to R.
To see why this is true, consider any time during the iteration when the
WFA moves from a configuration C to C 0 , such that C ∈ (Lh−i , Rh+i ), for some
0 ≤ i < h. By basic properties of work functions, C is supported by C 0 . Since
the iteration is good, C is not supported by any configuration (Lh−i−j , Rh+i+j ),
i.e. C 0 ∈
/ (Lh−i−j , Rh+i+j ). Thus the WFA does not move a server from L to
R.
The following observation comes immediately from Corollary 3.23 and the
definition of a good iteration.
Observation 3.26. Consider a good iteration and let w, w0 be the work function
at the beginning and at the end of the iteration respectively. Then for all
0 ≤ i ≥ h we have that
3h
Lemma 3.30. The first dN − 2 e iterations of Step 2 are good.
Proof. By Observation 3.27, we have that at the end of a good iteration, (3.11)
holds. Thus, by Lemma 3.28, if at the end of the current iteration Di,j < j−3h
for all 0 ≤ i < h, 0 < j ≤ h − i, then the next iteration is good.
At the beginning of Step 2, Di,j = −j, due to (3.10). From Lemma 3.29 we
have that after each good iteration, Di,j increases by 2j. Thus, all iterations
will be good, as long as Di,j < j − 3h. Since
3h 3h
(dN − e − 1) · 2j < (N − ) · 2j = 2j − 3jh ≤ 2j − 3h,
2 2
This holds due to the fact that at the beginning of Step 2, the WFA has
h servers in R, and from Observation 3.25 we know that the WFA does not
move a server from L to R during good iterations.
Work function values for good iterations. Now we proceed to the cha-
racterization of the work function during good iterations. Since we want to
estimate the cost of the WFA during iterations when it has h servers at R,
we focus on configurations (Lh , Rh ). Specifically, we need the corresponding
versions of Lemmata 3.19, 3.20 and 3.21. Recall that, by definition of a good
iteration, the local changes in the values of w(Lh , Rh ), define the work function
values of all configurations (Lh , Rh ).
We begin with the corresponding versions of Lemmata 3.19 and 3.20 for
good iterations of Step 2.
Lemma 3.32. Consider a good iteration of Step 2. Let t1 be the time when
S(R2 , `, 2) ends, for 1 ≤ ` ≤ h and t2 the time when S(R2 , h, 2) ends. At
any time t ∈ [t1 , t2 ], we have that w(Lh , h − ` + 1, ` − 1) = w(Lh , h − `, `) + .
Proof. The proof is same as proof of Lemma 3.19 with replacing (Lk−i , Ri )
by (Lh , h − i, i), scaling distances by and noting that by (3.11), any optimal
schedule for configurations (Lh , Rh ) starts the iteration from a configuration
(Lh , h, 0).
54 3. The (h, k)-Server Problem on Bounded Depth Trees
Lemma 3.33. Consider a good iteration of Step 2. Let t1 be the time when
S(R2 , `, 2) ends, for 1 ≤ ` ≤ h and t2 the time when S(R2 , h, 2) ends. At
any time t ∈ [t1 , t2 ], we have that, for any 1 ≤ i < `, w(Lh , h − i, i) =
w(Lh , h − `, `) + (` − i).
The proof of this lemma is same as the proof of Lemma 3.20, i.e. by
backwards induction on i. We just need to replace (Lk−i , Ri ) by (Lh , h − i, i)
and scale all distances by .
The next two lemmata are the analogues of Lemma 3.21 for good iterations
of Step 2, and characterize the structure of the work function at the end of
S(R2 , `, 2) and S(R1 , `, 2), for 1 ≤ ` ≤ h.
Lemma 3.34. Consider a good iteration during Step 2. At the moment when
the execution of S(R2 , `, 2) ends, for 1 ≤ ` ≤ h, the following two things hold:
Proof. For 0 ≤ i < `, the lemma follows from Lemma 3.33. For i ≥ ` the proof
is same as proof of Lemma 3.21 by replacing w(Lk−i , Ri ) by w(Lh , h − i, i)
and using the fact that at the beginning of the iteration w(Lh , h − i, i) =
w(Lh , h, 0) + · i.
Lemma 3.35. Consider a good iteration during Step 2. At the moment when
an execution of S(R1 , `, 2) ends, for 1 ≤ ` ≤ h, the following two things hold:
Proof. The proof is completely symmetric to the proof of Lemma 3.34. Note
that, due to Lemma 3.34, after S(R2 , h, 2) ends, i.e at the beginning of
S(R1 , 1, 2), we have that w(Lh , Rh ) = w(Lh , 0, h) and that w(Lh , h − i, i) =
w(Lh , 0, h) + (h − i), or equivalently
End of the phase: We now show that at the end of the phase the work
function has the desired structure and that the WFA has all its 2h servers in
R, so a new right-to-left phase may start.
3.5. Lower Bounds 55
Bounding Costs
We now bound the online and offline costs. We begin with Step 1.
Lemma 3.37. During the time when the WFA uses ` < h servers in R, it
incurs a cost of at least (2 − 20 ) · `.
Proof. By construction of the phase, when the execution of S(R1 , ` + 1, 2)
starts, the WFA has ` servers in R. We evaluate the cost of the WFA during
the part of S(R1 , ` + 1, 2) when it has ` servers in R. Let t be the time when
the WFA moves its (` + 1)th server to R. Let w and w0 be the work functions
at the beginning of S(R1 , ` + 1, 2) and at time t respectively. We have that,
where the first equality comes from the fact that there are exactly ` + 1 points
of R requested since the beginning of the phase and the second by Lemma 3.21.
Let C be the configuration of the WFA at time t0 − 1. At time t, the WFA
moves a server by a distance of 1, thus by basic properties of work functions,
we have that w0 (C) = w0 (Lk−`−1 , R`+1 ) + 1. This combined with (3.17) gives
that
w0 (C) = w(Lk−` , R` ) + 2. (3.18)
Let X ∈ (Lk−` , R` ) be a configuration such that (i) w0 (X) = w0 (Lk−` , R` )
and (ii) X, C have their k − ` servers of L at the same points. Note that
X, C ∈ (Lk−` , `, 0), since R1 is the only subtree of R where requests have been
issued. Since both X and C have ` servers in R1 , and only ` + 1 leaves of R1
have been requested, we get that X and C can differ in at most one point. In
other words, d(X, C) ≤ 0 . By basic properties of work functions we get that
Let S` be the optimal schedule to serve all requests from the beginning of
S(R2 , ` + 1, 2) until time t, using ` servers starting at t1 , . . . , t` . From (3.20)
we have that cost(S` ) ≥ 2 − 0 . All requests are located in ` + 1 leaves of an
elementary subtree (which is equivalent to the paging problem) in an adver-
sarial way. It is well known (see e.g. [19]) that the competitive ratio of any
online algorithm for the paging problem for such a sequence is at least `, i.e. it
has cost at least cost(S` ) − ` · 0 , where ` · 0 is the allowed additive term. This
implies that the cost incurred by the WFA is at least
Lemma 3.17 (restated) During Step 1, ALG ≥ h2 −0 ·h(h−1) and ADV= h.
Proof. Clearly, ADV= h; the adversary moves h servers by distance 1 and then
serves all requests
Ph−1 at zero cost. By lemma 3.37 we get that WFA incurs a cost
0
of at least `=1 (2 − 2 ) · ` inside R. Moreover, it pays a movement cost of h
to move its h servers
Ph−1from L to R. Overall, we get
Ph−1 P that the 2online cost during
Step 1 is (2−20 ) `=1 `+h = 2 `=1 `+h−20 h−1 `=1 ` = h − 0 ·h(h−1).
We now focus on Step 2. We charge the WFA only for the first dN −
3h
2 e
iterations (when it uses h servers in R, due to Corollary 3.31), plus the
movement cost of the extra servers from L to R.
Lemma 3.38. Consider a good iteration of Step 2 such that the WFA uses
only h servers in R. During the time interval that WFA serves requests in
subtree R1 or R2 using ` servers, it incurs a cost of at least 2( − 0 )`.
Proof. The proof is similar to the proof of Lemma 3.37, with the following
modifications. We scale distances by , since now the servers move from R1 to
R2 (distance ) instead of moving from L to R1 (distance 1). We charge the
WFA for serving requests in R2 using ` servers during executions of S(R2 , ` +
1, 2), using Lemma 3.34 (instead of Lemma 3.21) and replacing (Lk−i , Ri ) by
(Lh , h − i, i). Similarly, we charge the WFA for serving requests in R1 using `
servers during executions of S(R1 , ` + 1, 2) using Lemma 3.35.
Lemma 3.39. Consider a good iteration of Step 2 such that the WFA uses
only h servers in R to serve the requests. The cost of the WFA in such an
iteration is at least 2 · h2 − 20 · (h − 1) · h.
0
Lemma 3.18 (restated) During Step 2, ALG ≥ 2h2 + h − 3h3 − 2 · (h − 1) · h
and ADV = (2 + )h.
Let us now count the online cost during Step 2. By Corollary 3.31, there
are at least dN − 3h 2 e iterations such that the WFA has h servers in R. By
lemma 3.39 we get that during each one of those iterations, the online cost is
at least 2 · h2 − 20 · (h − 1) · h. For the rest of Step 2, the WFA incurs a cost
of at least h, as it moves h servers from L to R. We get that overall, during
Step 2, the cost of WFA is at least
3h
(N − ) · (2 · h2 − 20 · (h − 1) · h) + h
2
=2N · h2 − 2N 0 · (h − 1) · h − 3h3 + 30 h2 (h − 1) + h
0
≥2h2 + h − 3h3 − 2 · (h − 1) · h.
Remaining Proofs
We now prove Lemma 3.19, whose proof was omitted earlier. First, we state an
observation which follows directly from the definition of the left-to-right phase.
Observation 3.40. Let t be any time during a left-to-right phase with work
function w. If w(Lk−i , Ri ) = w(Lk−j , Rj ) + (j − i) for some 0 ≤ i < j ≤ k,
0 0
then for all j 0 such that i ≤ j 0 ≤ j we have that w(Lk−j , Rj ) = w(Lk−j , Rj ) +
(j − j 0 ).
0 0
To see why this is true, note that by basic properties w(Lk−j , Rj ) ≤
w(Lk−j , Rj ) + (j − j 0 ). Moreover, if strict inequality holds, we have that
0 0
w(Lk−j , Rj ) + (j 0 − i) < w(Lk−j , Rj ) + (j − j 0 ) + (j 0 − i) = w(Lk−i , Ri ).
0 0
We get that w(Lk−i , Ri ) − w(Lk−j , Rj ) > j 0 − i, a contradiction.
Lemma 3.19 (restated) Consider a left-to-right phase. At any time after the
end of strategy S(R1 , `, 2), for 1 ≤ ` ≤ h, we have that w(Lk−`+1 , R`−1 ) =
w(Lk−` , R` ) + 1.
Proof. We prove the lemma by induction. For the base case ` = 1, the lemma
is clearly true since any schedule serving requests uses at least one server at
R. We prove the lemma for 2 ≤ ` ≤ h, assuming that it is true for all values
1, . . . , ` − 1.
Let t be any time after the end of strategy S(R1 , `, 2), for 1 < ` ≤ h with
work function w. By basic properties of work functions, w(Lk−`+1 , R`−1 ) ≤
w(Lk−` , R` ) + 1. We will assume that w(Lk−`+1 , R`−1 ) < w(Lk−` , R` ) + 1 and
obtain a contradiction. The lemma then follows.
Assume that w(Lk−`+1 , R`−1 ) < w(Lk−` , R` ) + 1. Let S`−1 and S` be
the schedules that define the values of w(Lk−`+1 , R`−1 ) and w(Lk−` , R` )
respectively. Let C be a configuration (Lk−`+1 , R`−1 ) such that w(C) =
w(Lk−`+1 , R`−1 ). By Observation 3.40, C is not supported by any configura-
tion (Lk−i , Ri ), for i ≥ `. Also, by the inductive hypothesis, C is not supported
3.6. Tight Bounds for WFA on the Line 59
Lower Bound. The lower bound strategy is the same as the one described
for depth-3 HSTs, we just need to replace subtrees by line segments. More
precisely, the lower bound strategy is applied in an interval I of length 1. Let
L and R be the leftmost and rightmost regions of I, of length /2, for 1.
Similarly, L1 , L2 and R1 , R2 are smaller regions inside L and R respectively.
Again, the distance between L1 and L2 (R1 and R2 resp.) is much larger
than their length. In each of those regions we focus on h points, where the
distance between 2 consecutive points is 0 . Whenever the adversary moves
to such a region, it places its servers those h equally spaced points inside it.
Similarly to the proof of Theorem 3.2, we can get a lower bound h + 1/3 on
the competitive ratio of the WFA on the line when k = 2h (the changes affect
only the dependence on terms involving and 0 , which are negligible).
Upper Bound We now show an upper bound on the cost of WFA for the
(h, k)-server problem in the line, which is implied by combining results of [17,
51].
60 3. The (h, k)-Server Problem on Bounded Depth Trees
Most known upper bounds for the WFA do not bound the algorithm’s
actual cost directly. Instead, they bound its extended cost, defined as the
maximum increase of the work function value for any single configuration. To
define it formally, let w and w0 be the work functions before and after serving
the request at time t. Then, if M denotes the metric space, the extended cost
at time t is defined as follows:
For a given sequence of requests, let WFAi and OPTi denote the overall cost
incurred by WFA and OPT using i servers respectively. Similarly, let ExtCosti
denote the total extended cost over configurations of i servers. Chrobak and
Larmore [31] showed that the extended cost satisfies the following inequality:
In [17] it was shown that WFA with h servers is h-competitive in the line
by proving the following inequality:
for all request sequences. Putting (3.21), (3.22) and (3.23) together, we get
Matching Bounds. We now show that the lower and upper bounds above
are matching for k = 2h. In particular, it suffices to show that for our lower
bound instance (h + 1/3)OPTh goes arbitrary close to (h + 1)OPTh − OPTk ,
or equivalently
3.7. Concluding Remarks 61
2OPTh
→ OPTk (3.24)
3
As we showed in the proof of theorem 3.2, for every phase of the lower
bound strategy, OPTh = (3 + 2) · h. Moreover it is clear that OPTk = 2h;
during a phase the minimum work function value using k = 2h servers increases
by exactly 2h. We get that
2OPTh 2 · (3 + 2) · h 3 + 2
= = 2h → 2h = OPTk .
3 3 3
While Theorem 3.4 gives a separation between depth-1 and depth-2 trees,
it is unclear whether a lower bound which increases substantially with depth
is possible. Note that a lower bound of g(d) for depth d, where g(d) → ∞ as
d → ∞ (provided that h is large enough), would be very surprising. This would
imply that there is no O(1)-competitive algorithm for general metric spaces.
Open Problem 3.2. Can we get an o(h)-competitive algorithm for other me-
tric spaces?
4.1 Introduction
In the generalized k-server problem, we are given k-servers s1 , . . . , sk , where
server si lies in a metric space Mi with distance function di . At each time step
a request r = (r1 , r2 , . . . , rk ) ∈ M1 × . . . × Mk arrives and must be served by
moving some server si to the point ri ∈ Mi . The goal is to minimize the total
distance traveled by the servers.
The generalized k-server problem is a substantial generalization of the stan-
dard k-server problem. In particular, the k-server problem corresponds to the
to the special case when all the metrics are identical, M1 = . . . = Mk = M ,
and the requests are of the form (r, r, . . . , r), i.e., the k-tuple is identical in
each coordinate.
The generalized k-server problem can model a rich class of online problems,
for which the techniques developed for the standard k-server problem do not
apply, see e.g. [55]. For that reason, it is widely believed that a deeper under-
standing of this problem should lead to powerful new techniques for designing
online algorithms [55, 63]. According to Koutsoupias and Taylor [55], this pro-
blem “may act as a stepping stone towards building a robust (and less ad hoc)
theory of online computation”.
Previous Work
In their seminal paper, Koutsoupias and Taylor [55] studied the special case
where k = 2 and both the metrics M1 and M2 are lines. This is called the CNN
63
64 4. Competitive Algorithms for Generalized k-Server in Uniform Metrics
problem and it has attracted a lot of attention [4, 28, 48, 47]. They showed
that, even for this special case, the problem is qualitatively very different from
the standard k-server problem. In particular they showed that many successful
k-server algorithms or their natural generalizations are not competitive. They
also showed that no memoryless randomized algorithm is competitive, while it
is well-known that for the standard k-server problem in the line there exists
a k-competitive (against adaptive online adversaries) randomized memoryless
algorithm [35]. A similar result with a simpler analysis was discovered inde-
pendently by Chrobak and Sgall [33].
Lower Bounds: For the CNN problem, Koutsoupias and Taylor [55] showed
that the competitive ratio of any deterministic algorithm is at least 10.12. For
uniform metrics and arbitrary k, they showed that even when each Mi contains
n = 2 points, the competitive ratio is at least 2k − 1. For general metrics, the
Ω(k)
best known lower bound is 22 [12], and comes from the weighted k-server
problem (the weighted variant of the standard k-server problem). This problem
corresponds to generalized-k-server where the metric spaces are scaled copies
of each other, i.e. Mi = wi · M for some fixed M , and the requests have the
form (r, . . . , r).
Our Results
We consider the generalized k-server problem on uniform metrics and obtain
the first f (k)-competitive algorithms for general k, whose competitive ratios
almost match the known lower bounds.
Perhaps surprisingly, there turn out to be two very different settings for
uniform metrics:
1. When all the metric spaces M1 , . . . , Mk are uniform (possibly with dif-
ferent number of points) with identical pairwise distance, say 1. We call
this the uniform metric case.
1
We focus on algorithms with competitive ratio f (k) that only depends on k. Note that
an nk − 1 competitive algorithm follows trivially, as the problem can be viewed as metrical
service system (MSS) on nk states, where n = maxki=1 |Mi |.
4.1. Introduction 65
2. When the metric spaces Mi are all uniform, but have different scales,
i.e. all pairwise distances in Mi are wi . We call this the weighted uniform
metric case.
This almost matches the 2k − 1 lower bound due to [55] (we describe this
instructive and simple lower bound instance in Section 4.5 for completeness).
To prove Theorem 4.1, we divide the execution of the algorithm in phases,
and consider the beginning of a phase when all the MSS states are feasible
(e.g. the cost is 0 and not ∞). As requests arrive, the set of states that
remain feasible for all requests during this phase can only reduce. The proof is
based on a general combinatorial argument about how the set of feasible states
evolves as requests arrive. In particular, for this problem we show that any
sequence of requests that causes the set of feasible states to strictly reduce at
each step, can have length at most 2k until all states become infeasible.
Interestingly, this argument is based on a novel application of the poly-
nomial or the rank method from linear algebra [49, 58, 45]. While the rank
method has led to some spectacular recent successes in combinatorics and com-
puter science [36, 37], we are not aware of any previous applications to online
algorithms. We feel that our approach could be useful for other online problems
that can be modeled as metrical service systems by analyzing the combinatorial
structure in a similar way.
Next, we consider randomized algorithms against oblivious adversaries.
The rank method above does not seem to be useful in the randomized set-
ting as it only bounds the number of requests until the set of feasible states
becomes empty, and does not give any structural information about how the
set of states evolves over time. As we observe in Section 4.3, a o(2k ) gua-
rantee cannot be obtained without using such structural information. So we
explore the properties of this evolution more carefully and use it to design the
randomized algorithm in Theorem 4.2.
In Section 4.5, we also give a related lower bound. In particular, we note
that an Ω(k/ log2 k) lower bound on the competitive ratio of any randomized
algorithm follows directly by combining the lower bound instance of [55] with
the results of [16].
Finally, we consider the weighted uniform metric case.
66 4. Competitive Algorithms for Generalized k-Server in Uniform Metrics
k+3
Theorem 4.3. There is a 22 competitive algorithm for generalized k-server
on weighted uniform metrics.
Definition 4.4. A state q t satisfies (or is feasible for) the request rt if qit = rit
for some i ∈ [k].
Moreover, if the state changes from q t to q t+1 , the algorithm pays the
Hamming distance
d(q t+1 , q t ) = |{i : qit+1 6= qit }|,
between q t and q t+1 .
We describe a generic algorithm below that works in phases in Algorithm 2.
Each phase is independent of all other phases. For convenience we reset the
time at the beginning of each phase, i.e. we assume that the first request of
the phase is at time 1.
We will show that during each phase the offline optimum moves at least
once and hence pays at least 1, while the online algorithm changes its state at
most 2k times and hence pays at most k2k (as the Hamming distance between
any two states is at most k). It follows that for the whole request sequence,
4k
2
It was first pointed out to us by Chiplunkar [26] that the competitive ratio 22 claimed
k+O(1)
in [43] can be improved to 22 .
4.2. Deterministic Algorithm for Uniform Metrics 67
our algorithm pays at most c∗ · k2k + k2k , where c∗ denotes the optimal cost.
Here the additive term k2k accounts for the last (possibly unfinished) phase.
We call this algorithm generic as it can pick any arbitrary point q as long
as it is feasible for all requests of the current phase r1 , . . . , rt . Note that this
algorithm captures a wide variety of natural algorithms including (variants) of
the Work Function Algorithm.
Fix some phase that we wish to analyze, and let ` denote its length. Wit-
hout loss of generality, we can assume that any request rt causes the algorithm
to move, i.e. q t is not feasible for rt (removing requests where q t is feasible
does not affect the online cost, and can only help the offline adversary). So the
online algorithm moves exactly ` times. Moreover, the adversary must move at
least once during the phase as no location exists that satisfies all the requests
r1 , . . . , r` that arrive during the phase.
It suffices to show the following.
Theorem 4.5. For any phase as defined above, its length satisfies ` ≤ 2k .
Proof. We use the rank method. Let x = (x1 , . . . , xk ), y = (y1 , . . . , yk ) be
points in Rk , and consider the 2k-variate degree k polynomial p : R2k → R,
Y
p(x, y) := (xi − yi ).
i∈[k]
The key property of p is that a state q ∈ [n]k satisfies a request r ∈ [n]k iff
p(q, r) = 0.
We now construct a matrix M that captures the dynamics of the online
algorithm during a phase. Let M ∈ R`×` be an `×` matrix, where columns cor-
0
respond to the requests and rows to the states, with entries M [t, t0 ] = p(q t , rt ),
0
i.e., the [t, t0 ] entry of M corresponds to the evaluation of p on q t and rt
68 4. Competitive Algorithms for Generalized k-Server in Uniform Metrics
k
( )
Y
S(v) := c∈ Ui ci = vi ∀i s.t. vi 6= ∗ .
i=1
Lemma 4.7. Let S be a d-dimensional space and let r be a request which makes
some configuration c ∈ S infeasible. Then, there exist d subspaces S1 , . . . , Sd ,
each of dimension d − 1, such that we have S ∩ F (r) = S1 ∪ · · · ∪ Sd .
Note that |S| = nd and |Si | = nd−1 , i.e |Si | = n1 |S| for each i = 1, . . . , d.
Proof. By reordering the coordinates, we can assume that the first d coordi-
nates of S are free and S corresponds to the vector (∗, . . . , ∗, sd+1 , . . . , sk ), for
some sd+1 , . . . , sk . Let r = (r1 , . . . , rk ).
Consider the subspaces S(v1 ), . . . , S(vd ), where
v1 = (r1 , ∗, . . . , ∗, sd+1 , . . . , sk ),
..
.
vd = (∗, . . . , ∗, rd , sd+1 , . . . , sk ).
Clearly, any configuration contained in S(v1 ) ∪ . . . ∪ S(vd ), is feasible for r.
Conversely, as there exists c ∈ S infeasible for r, we have si = ci 6= ri for each
i = d + 1, . . . , k. This already implies that each configuration from S feasible
for r must belong to S(v1 ) ∪ . . . ∪ S(vd ): whenever c0 ∈ S is feasible for r, it
needs to have c0i = ri for some i ∈ {1, . . . , d} and therefore c0 ∈ S(vi ).
else
choose arbitrary Qt ∈ F t and move to an arbitrary q t ∈ Qt
The following lemma bounds the maximum number of distinct spaces which
can appear in F t during one phase.
Lemma 4.9. Let us consider a phase with requests rt1 , . . . , rt` . Then tt=t Ft
S`
1
contains at most k!/d! spaces of dimension d.
Note that this lemma implies that the competitive ratio of Algorithm 3 is
Pk−1 1
at most k · k! · d=0 d! ≤ 3kk! ≤ 3(k + 1)!, where the first factor k comes for
the fact that at each request the algorithm moves, it incurs a cost of at most
k.
Lemma 4.10. At each time t, the probability of Qt being equal to some fixed
S ∈ Mt is 1/|Mt |.
Proof. We prove the lemma by induction on t. For the base case t = 1, at the
first request the algorithm chooses a space Q1 from M1 uniformly at random
and the lemma follows.
Assume that the lemma is true for time t − 1. We will show that it holds
for time t. If ALG moved at time t, the statement follows trivially, since Qt
was chosen from Mt uniformly at random. It remains to consider the case that
Qt = Qt−1 .
Now, the algorithm does not change state if and only if Qt−1 ∈ Mt . More-
over, in this case mt does not change, and Mt ⊂ Mt−1 . By induction, Qt−1 is
distributed uniformly within Mt−1 , and hence conditioned on Qt−1 ∈ Mt , Qt
is uniformly distributed within Mt .
Proof of Theorem 4.2. Let cost(ALG) and cost(OPT) denote the cost of
the algorithm and the optimal solution respectively. At the end of each phase
(except possibly for the last unfinished phase), the set of feasible states F t = ∅,
and hence OPT must pay at least 1 during each of those phases. Denoting N
the number of phases needed to serve the entire request sequence, we have
cost(OPT) ≥ (N − 1). On the other hand, the expected online cost is at most,
E[cost(ALG)] ≤ c(N − 1) + c ≤ c cost(OPT) + c,
where c denotes the expected cost of ALG in one phase. This implies that
ALG is c-competitive.
Now we prove that c is at most O(k 3 log k). To show this, we use a potential
function
m
X t −1
t
Φ(t) = H(|M |) + H(k!/d!),
d=0
where H(n) denotes the nth harmonic number. At the beginning of the phase,
Φ(1) ≤ kH(k!) ≤ k(log k! + 1) = O(k 2 log k) as |M1 | ≤ k! and m1 ≤ k − 1.
Moreover the phase ends whenever Φ(t) decreases to 0. Therefore, it is enough
to show that, at each time t, the expected cost incurred by the algorithm is at
most k times the decrease of the potential. We distinguish two cases.
(i) If mt = mt−1 , let us denote b = |Mt−1 | − |Mt |. If b > 0, the potential
decreases, and its change can be bounded as
∆Φ ≤ H(|Mt |) − H(|Mt−1 |) =
1 1 1
=− t
− t
− ··· − t
|M | + 1 |M | + 2 |M | + b
1 1
≤ −b · = −b · .
|Mt | + b |Mt−1 |
74 4. Competitive Algorithms for Generalized k-Server in Uniform Metrics
On the other hand, the expected cost of ALG is at most k times the
probability that it has to move, which is exactly P [Qt−1 ∈ Mt−1 \ Mt ] =
b/|Mt−1 | using Lemma 4.10. Thus the expected cost of the algorithm is
at most k · b/|Mt−1 |, which is at most k · (−∆Φ).
(ii) In the second case, we have mt < mt−1 . By Lemma 4.9, we know that
|Mt | ≤ k!/mt ! and hence
We assume (by rounding the weights if necessary) that w1 = 1 and that for
2 ≤ i ≤ k, wi is an integral multiple of 2(1 + c(i − 1)) · wi−1 . Let mi denote
the ratio wi /(2(1 + c(i − 1)) · wi−1 ).
The rounding can increase the weight of each server at most by a factor of
4k−1 c(k−1)·. . .·c(1) ≤ Rk−1 . So, proving a competitive ratio Rk for an instance
k+3
with rounded weights will imply a competitive ratio Rk · Rk−1 < (Rk )2 = 22
for arbitrary weights.
Finally, we assume that in every request ALG needs to move a server. This
is without loss of generality: requests served by the algorithm without moving
a server do not affect its cost and can only increase the optimal cost. This
assumption will play an important role in the algorithm below.
Phase of ALG1 :
for j = 1 to 2(c(1) + 1) do
Request arrives to point p: Move s1 to p.
Terminate Phase
Phase of ALGi , i ≥ 2:
Move si to an arbitrary point of Mi ;
Run ALGi−1 until cost incurred equals wi ; // Learning subphase
For p ∈ Mi , m(p) ← # of requests such that r(i) = p; // Assume
m(p1 ) ≥ . . . ≥ m(pn )
P ← {p1 , . . . , pc(i) };
for j = 1 to c(i) do
Move si to an arbitrary point p ∈ P ;
P ← P − p;
Run ALGi−1 until cost incurred equals wi ; // (j + 1)th subphase
Terminate Phase
For the rest of the phase ALGi repeats the following c(i) times: it moves si
to a point p ∈ P that it has not visited during this phase, and starts the next
subphase (i.e. it calls ALGi−1 until its cost reaches wi ).
4.4.2 Analysis
We first note some basic properties that follow directly by the construction of
the algorithm. Call a phase of ALGi , i ≥ 2 complete, if all its subphases are
finished. Similarly, a phase of ALG1 is complete if it served exactly 6 requests.
Observation 4.11. For i ≥ 2, a complete phase of ALGi consists of (c(i) + 1)
subphases.
Observation 4.12. For i ≥ 2, the cost incurred to serve all the requests of a
subphase of ALGi is wi .
These observations give the following corollary.
Corollary 4.13. For i ≥ 1, the cost incurred by ALGi to serve requests of a
complete phase is 2(c(i) + 1)wi .
Proof. For i = 1 this holds by definition of the phase. For i ≥ 2, a phase
consists of (c(i) + 1) subphases. Before each subphase ALGi moves server si ,
which costs wi , and moreover ALGi−1 incurs a cost of wi .
Proof. The first property uses the rounding of the weights. By Corollary 4.13,
each phase of ALGi−1 costs 2(c(i − 1) + 1)wi−1 and, in each subphase of ALGi ,
the cost incurred by ALGi−1 is wi . So there are exactly wi /(2(c(i − 1) +
1)wi−1 ) = mi phases of ALGi−1 .
The property above, combined with Observation 4.11 implies that a com-
plete phase of ALGi contains mi · (c(i) + 1) complete phases ALGi−1 . Now,
the second property follows directly by induction: each phase of ALG1 consists
of 2(c(1) + 1) = 6 requests, and each phase of ALGi consists of mi (c(i) + 1)
phases of ALGi−1 .
Consider a phase of ALGi . The next lemma shows that, for any point
p ∈ Mi , there exists a subphase where it is not requested too many times. This
crucially uses the assumption that ALGi has to move a server in every request.
Proof. Let P be the set of c(i) most requested points of Mi during the learning
subphase. We consider two cases: if p ∈ P , there exists a subphase where
sALG
i is located at p. During this subphase there are no requests such that
r(i) = p, by our assumption that the algorithm moves some server at every
request. Otherwise, if p ∈/ P , then during the learning subphase, the fraction
of requests such that r(i) = p is no more than 1/c(i).
(i) Initial Configuration of ADVi . Algorithm ALGi (for i < k), is called
several times during a phase of ALGk . As we don’t know the current con-
figuration of ADVk each time ALGi is called, we require that for every
complete phase, cost(ALGi ) ≤ Ri · cost(ADVi ), for any initial configura-
tion of ADVi .
ADVi may not give any meaningful guarantee for ALGk . To get around
this, we will require that cost(ALGi ) ≤ Ri · cost(ADVi ), even if the ADVi
ignores an f (i) := 4/c(i + 1) fraction of requests. This will allow us to
use the inductive hypothesis for the phases of ALGi where ADVk uses
servers si+1 , . . . , sk to serve at most f (i) fraction of requests.
Before proving this, let us note that this directly implies Theorem 4.3.
Indeed, for any request sequence σ, all phases except possibly the last one, are
complete, so cost(ALGk ) ≤ Rk · cost(ADVk ). The cost of ALGk for the last
phase, is at most 2(c(k) + 1)wk , which is a fixed additive term independent of
the length of σ. So, ALGk (σ) ≤ Rk · ADVk (σ) + 2(c(k) + 1)wk , and ALGk
is Rk -competitive. Together with loss in rounding the weights, this gives a
k+3
competitive ratio of at mot (Rk )2 ≤ 22 for arbitrary weights.
We now prove Theorem 4.16.
First, if ADVi moves server si during the phase, its cost is already at least wi
and hence more than wi /(2Ri−1 ). So we can assume that sADV i stays fixed at
some point p ∈ Mi during the entire phase. So, ADVi is an adversary that
uses i − 1 servers and can ignore all requests with r(i) = p and the requests of
I. We will show that there is a subphase where cost(ADVi ) ≥ wi /(2Ri−1 ).
By Lemma 4.15, there exists a subphase, call it j, such that at most 1/c(i)
fraction of the requests have r(i) = p. As all c(i) + 1 subphases have the same
number of requests (by Lemma 4.14), even if all the requests of I belong to
subphase j, they make up at most (4 · (c(i) + 1))/c(i + 1) ≤ 1/c(i) fraction of its
requests, where the inequality follows from equation (4.1). So overall during
subphase j, ADVi uses servers s1 , . . . , si−1 and ignores at most 2/c(i) fraction
of requests.
We now apply the inductive hypothesis together with an averaging argu-
ment. As subphase j consists of mi phases of ALGi−1 , all of equal length, and
ADVi ignores at most 2/c(i) fraction of requests of the subphase, there are at
most mi /2 phases of ALGi−1 where it can ignore more than 4/c(i) fraction of
requests. So, for at least mi /2 phases of ALGi−1 , ADVi uses i − 1 servers and
ignores no more than 4/c(i) fraction of requests. By the inductive hypothesis,
ALGi−1 is strictly Ri−1 -competitive against ADVi in these phases. As the
cost of ALGi−1 for each phase is the same (by Corollary 4.13), overall ALGi
is strictly 2Ri−1 competitive during subphase j. As the cost of ALGi during
subphase j is wi , we get that cost(ADVi ) ≥ wi /2Ri−1 , as claimed.
[1] Dimitris Achlioptas, Marek Chrobak, and John Noga. Competitive analy-
sis of randomized paging algorithms. Theor. Comput. Sci., 234(1-2):203–
218, 2000.
[2] Susanne Albers. Improved randomized on-line algorithms for the list up-
date problem. SIAM J. Comput., 27(3):682–693, 1998.
[4] John Augustine and Nick Gravin. On the continuous CNN problem. In
ISAAC, pages 254–265, 2010.
[5] Yossi Azar, Andrei Z. Broder, and Mark S. Manasse. On-line choice of
on-line algorithms. In Proceedings of the Fourth Annual ACM/SIGACT-
SIAM Symposium on Discrete Algorithms (SODA), pages 432–440, 1993.
[6] Nikhil Bansal, Niv Buchbinder, Aleksander Madry, and Joseph Naor. A
polylogarithmic-competitive algorithm for the k -server problem. J. ACM,
62(5):40, 2015.
[7] Nikhil Bansal, Niv Buchbinder, and Joseph Naor. Towards the rando-
mized k-server conjecture: A primal-dual approach. In Proceedings of
the Twenty-First Annual ACM-SIAM Symposium on Discrete Algorithms,
SODA, pages 40–55, 2010.
[8] Nikhil Bansal, Niv Buchbinder, and Joseph Naor. A primal-dual rando-
mized algorithm for weighted paging. J. ACM, 59(4):19:1–19:24, 2012.
[9] Nikhil Bansal, Marek Eliáš, Lukasz Jeż, and Grigorios Koumoutsos. The
(h, k )-server problem on bounded depth trees. In Proceedings of the
Twenty-Eighth Annual ACM-SIAM Symposium on Discrete Algorithms
(SODA), pages 1022–1037, 2017.
83
84 Bibliography
[10] Nikhil Bansal, Marek Eliáš, Lukasz Jeż, Grigorios Koumoutsos, and Kirk
Pruhs. Tight bounds for double coverage against weak adversaries. In
Approximation and Online Algorithms - 13th International Workshop
(WAOA), pages 47–58, 2015.
[11] Nikhil Bansal, Marek Eliáš, Lukasz Jeż, Grigorios Koumoutsos, and Kirk
Pruhs. Tight bounds for double coverage against weak adversaries. Theory
Comput. Syst., 62(2):349–365, 2018.
[12] Nikhil Bansal, Marek Eliáš, and Grigorios Koumoutsos. Weighted k-server
bounds via combinatorial dichotomies. In 58th IEEE Annual Symposium
on Foundations of Computer Science (FOCS), pages 493–504, 2017.
[13] Nikhil Bansal, Marek Eliáš, Grigorios Koumoutsos, and Jesper Neder-
lof. Competitive algorithms for generalized k -server in uniform metrics.
In Proceedings of the Twenty-Ninth Annual ACM-SIAM Symposium on
Discrete Algorithms (SODA), pages 992–1001, 2018.
[14] Nikhil Bansal and Kirk Pruhs. Server scheduling to balance priorities,
fairness, and average quality of service. SIAM J. Comput., 39(7):3311–
3335, 2010.
[15] Yair Bartal. Probabilistic approximations of metric spaces and its al-
gorithmic applications. In 37th Annual Symposium on Foundations of
Computer Science (FOCS), pages 184–193, 1996.
[16] Yair Bartal, Béla Bollobás, and Manor Mendel. Ramsey-type theorems
for metric spaces with applications to online problems. J. Comput. Syst.
Sci., 72(5):890–921, 2006.
[17] Yair Bartal and Elias Koutsoupias. On the competitive ratio of the work
function algorithm for the k-server problem. Theor. Comput. Sci., 324(2–
3):337–345, 2004.
[18] Shai Ben-David, Allan Borodin, Richard M. Karp, Gábor Tardos, and
Avi Wigderson. On the power of randomization in on-line algorithms.
Algorithmica, 11(1):2–14, 1994.
[19] Allan Borodin and Ran El-Yaniv. Online computation and competitive
analysis. Cambridge University Press, 1998.
[20] Allan Borodin, Nathan Linial, and Michael E. Saks. An optimal on-line
algorithm for metrical task system. J. ACM, 39(4):745–763, 1992.
[21] Sébastien Bubeck, Michael B. Cohen, Yin Tat Lee, James R. Lee, and
Aleksander Madry. k-server via multiscale entropic regularization. In
Bibliography 85
[22] Niv Buchbinder and Joseph Naor. The design of competitive online algo-
rithms via a primal-dual approach. Foundations and Trends in Theoretical
Computer Science, 3(2-3):93–263, 2009.
[23] Niv Buchbinder and Joseph Naor. Online primal-dual algorithms for co-
vering and packing. Math. Oper. Res., 34(2):270–286, 2009.
[24] William R. Burley. Traversing layered graphs using the work function
algorithm. J. Algorithms, 20(3):479–511, 1996.
[31] Marek Chrobak and Lawrence L. Larmore. The server problem and on-line
games. In On-line Algorithms, volume 7 of DIMACS Series in Discrete
Mathematics and Theoretical Computer Science, pages 11–64. AMS/ACM,
1992.
[32] Marek Chrobak and Lawrence L Larmore. Metrical Service System: De-
terministic Strategies. Technical Report UCR-CS-93-1, Department of
Computer Science, College of Engineering, University of California, Ri-
verside, 1993.
[33] Marek Chrobak and Jiřı́ Sgall. The weighted 2-server problem. Theor.
Comput. Sci., 324(2-3):289–312, 2004.
86 Bibliography
[34] Christian Coester, Elias Koutsoupias, and Philip Lazos. The infinite server
problem. In 44th International Colloquium on Automata, Languages, and
Programming, ICALP, pages 14:1–14:14, 2017.
[35] Don Coppersmith, Peter Doyle, Prabhakar Raghavan, and Marc Snir.
Random walks on weighted graphs and applications to on-line algorithms.
J. ACM, 40(3):421–453, 1993.
[36] Z. Dvir. On the size of Kakeya sets in finite fields. J. Amer. Math. Soc.,
22:1093–1097, 2009.
[38] Yuval Emek, Pierre Fraigniaud, Amos Korman, and Adi Rosén. On the
additive constant of the k -server work function algorithm. In Approxima-
tion and Online Algorithms, 7th International Workshop (WAOA), pages
128–134, 2009.
[39] Amos Fiat, Richard M. Karp, Michael Luby, Lyle A. McGeoch, Daniel Do-
minic Sleator, and Neal E. Young. Competitive paging algorithms. J.
Algorithms, 12(4):685–699, 1991.
[40] Amos Fiat and Manor Mendel. Better algorithms for unfair metrical task
systems and applications. SIAM J. Comput., 32(6):1403–1422, 2003.
[41] Amos Fiat, Yuval Rabani, and Yiftach Ravid. Competitive k-server algo-
rithms. J. Comput. Syst. Sci., 48(3):410–428, 1994.
[42] Amos Fiat, Yuval Rabani, Yiftach Ravid, and Baruch Schieber. A deter-
ministic o(k3 )-competitive k-server algorithm for the circle. Algorithmica,
11(6):572–578, 1994.
[43] Amos Fiat and Moty Ricklin. Competitive algorithms for the weighted
server problem. Theor. Comput. Sci., 130(1):85–99, 1994.
[47] Kazuo Iwama and Kouki Yonezawa. Axis-bound CNN problem. IEICE
TRANS, pages 1–8, 2001.
[48] Kazuo Iwama and Kouki Yonezawa. The orthogonal CNN problem. Inf.
Process. Lett., 90(3):115–120, 2004.
[51] Elias Koutsoupias. Weak adversaries for the k-server problem. In Proc.
of the 40th Symp. on Foundations of Computer Science (FOCS), pages
444–449, 1999.
[55] Elias Koutsoupias and David Scot Taylor. The CNN problem and other
k-server variants. Theor. Comput. Sci., 324(2-3):347–359, 2004.
[56] James R. Lee. Fusible HSTs and the randomized k-server conjecture.
CoRR, abs/1711.01789, 2017.
[60] Lee Newberg. The k-server problem with distinguishable servers. Master’s
Thesis, Univ. of California at Berkeley, 1991.
[61] Kirk Pruhs. Competitive online scheduling for server systems. SIGME-
TRICS Performance Evaluation Review, 34(4):52–58, 2007.
88 Bibliography
[62] Nick Reingold, Jeffery Westbrook, and Daniel Dominic Sleator. Rando-
mized competitive algorithms for the list update problem. Algorithmica,
11(1):15–32, 1994.
[63] René Sitters. The generalized work function algorithm is competitive for
the generalized 2-server problem. SIAM J. Comput., 43(1):96–125, 2014.
[64] René Sitters, Leen Stougie, and Willem de Paepe. A competitive algorithm
for the general 2-server problem. In ICALP, pages 624–636, 2003.
[65] René A. Sitters and Leen Stougie. The generalized two-server problem. J.
ACM, 53(3):437–458, 2006.
[66] Daniel Dominic Sleator and Robert Endre Tarjan. Amortized efficiency
of list update and paging rules. Commun. ACM, 28(2):202–208, 1985.
[67] Daniel Dominic Sleator and Robert Endre Tarjan. Self-adjusting binary
search trees. J. ACM, 32(3):652–686, 1985.
[68] Neal E. Young. The k-server dual and loose competitiveness for paging.
Algorithmica, 11(6):525–541, 1994.
89
90 Summary
91