The Weighted 2-Server Problem

Report 1 Downloads 43 Views
The Weighted 2-Server Problem Marek Chrobak



Ji r  Sgall

y

Abstract

We consider a generalization of the 2-server problem in which servers have di erent costs. We prove that, in uniform spaces, a version of the Work Function Algorithm is 5-competitive, and that no better ratio is possible. We also give a 5-competitive randomized, memoryless algorithm for uniform spaces, and a matching lower bound. For arbitrary metric spaces, in contrast with the non-weighted case, we prove that there is no memoryless randomized algorithm with nite competitive ratio. We also propose a version of the problem in which a request speci es two points to be covered by the servers, and the algorithm must decide which server to move to which point. For this version, we show a 9-competitive algorithm and we prove that no better ratio is possible.

Keywords: online optimization problems, competitive analysis, the k-server problem

1 Introduction In the weighted k-server problem we are given k mobile servers in a metric space M , with each server si being assigned some weight i . At each time step a request r 2 M is issued, in response to which one of the servers, say si , must move to r, at a cost equal to i times the distance from its current location to r. This is an online problem, in the sense that the decision of which server to move to r must be made before the next request is issued. In general, due to the incomplete information about the input request sequence, an online algorithm cannot service it in an optimal fashion. The idea behind the competitive analysis approach is to evaluate the performance of an online algorithm by comparing its cost to the optimal (oine) cost. More speci cally, an online algorithm A is said to be C -competitive if the cost incurred by A to service each request sequence % is at most C times the optimal service cost for %, plus an additive constant independent of %. The competitive ratio of A is the smallest C for which A is C -competitive. The unweighted case, with all i = 1, has been extensively studied during the last decade. The problem was originally introduced by Manasse, McGeoch and Sleator [21], who gave a 2-competitive algorithm for k = 2 and proved that, for any k, k is a lower bound on the competitive ratio. For k  3, the best known upper bound is 2k ? 1, by Koutsoupias and Papadimitriou [17, 18]. The k-Server Conjecture is that there exists a k-competitive algorithm that works in all metric spaces, but so far this conjecture has been proven only in a number of special cases, including uniform spaces, trees, and spaces with at most k + 2 points [8, 10, 19].  Department of Computer Science, University of California, Riverside, CA 92521. Email: [email protected]. Research supported by NSF grant CCR-9503498, and an NRC COBASE grant (NSF contract INT-9522667). y Mathematical Institute, AS CR, Z  itna 25, CZ-11567 Praha 1, Czech Republic; and Dept. of Applied Mathematics, Faculty of Mathematics and Physics, Charles University, Praha. E-mail [email protected],  R, postdoctoral grant http://www.math.cas.cz/~sgall. Research partially supported by grant A1019901 of GA AV C 201/97/P038 of GA C R, and cooperative research grant INT-9600919/ME-103 from the NSF (USA) and the MSMT (Czech Republic).

1

Very little is known about randomized algorithms for k servers. For any k  2, no algorithm with ratio less than k is known for arbitrary spaces. In uniform spaces, the competitive ratio is Hk  ln k, the k-th harmonic number [1, 22]. For k = 2, when the metric space is the line, Bartal et al [4] give a 1.987-competitive algorithm. The best known lower bound for 2 servers is 1 + e?1=2  1:6065 [13]. Other lower and upper bounds for this problem can be found in [3, 6]. The weighted case of the k-server problem turns out to be substantially more dicult. Fiat and Ricklin [16] show that the competitive ratio is at least k (k) in any space with at least k + 1 points. They also give a doubly-exponential upper bound for uniform spaces. For k = 2, a more accurate lower bound has been recently given by Koutsoupias and Taylor [20], who prove that no online algorithm can be better than 10:12-competitive, even if the underlying metric space is the line. For uniform spaces, Feuerstein et al [15] gave an algorithm with competitive ratio at most 6.275. Our results. We study the case k = 2. In uniform spaces, we prove that a version of the Work Function Algorithm is 5-competitive, and that no better ratio is possible, improving the upper bound from [15]. We also give a 5-competitive randomized, memoryless algorithm for uniform spaces, as well as a matching lower bound. For arbitrary spaces, we prove that there is no memoryless randomized algorithm with nite competitive ratio. (A similar, although slightly weaker result was independently obtained by Koutsoupias and Taylor [20].) This contrasts with the non-weighted case, for which memoryless algorithms exist for any k. For example, the harmonic algorithm is competitive for any k [5, 7] and, for k = 2, a memoryless 2-competitive algorithm is known [9, 14]. Last, we propose a version of the problem in which a request is speci ed by two points, both of which must be covered by the servers, and the algorithm must decide which server to move to which point. For this version, we show a 9-competitive algorithm and we prove that no better ratio is possible. This generalizes the result from [11] for the 2-point 1-server request problem, as well as for the closely related cow-path problem [2, 23], which are both special cases when 1 = 1 and 2 = 0. Throughout the paper, without loss of generality, we assume that 1 = 1 and 2 =  1. Thus s1 and s2 denote the expensive and the cheap server of the algorithm, respectively. Similarly, by a1 and a2 we denote the expensive and the cheap server of the adversary.

2 Randomized Memoryless Algorithms In this section we consider randomized memoryless algorithms. Our model of a memoryless randomized algorithm is this: A memoryless algorithm is simply a function that receives on input the distances from each server to the request point r and the distance between the servers, and determines, for each server, what is its probability to be moved to r. In particular, the algorithm only moves one server, and only to the request point. This is a natural requirement since, in certain spaces, it may be possible to encode memory states by perturbing the other server position.

2.1 An Upper Bound for Uniform Spaces

The algorithm is as follows. If the request is on s1 or s2 , we do nothing. Otherwise serve the request by s1 with probability p = 2 =(3 + ) and by s2 otherwise. Intuitively, we move the expensive server after paying approximately 2=3 for the moves of the cheap server. As we will see in the next section, the choice of the constant 2=3 is optimal. Theorem 1 There exists an algorithm (5 ? )-competitive against an adaptive on-line adversary. 2

Proof: Consider the algorithm described above. De ne a potential function  as follows 8 > 0 if a1 = s1 and a2 = s2 , > > < 5 ? 2 if a1 = s1 and a2 6= s2 , (s1 ; s2 ; a1 ; a2 ) = > 5 ? if a 6= s and a = s , and > > : 5 + 2 =(3 ? ) if a11 6= s11 and a22 6= s22 .

If the adversary moves, it is easy to check that, in each case, the potential increases by at most (5 ? ) times the adversary cost. So it remains to prove that when the adversary requests one of the positions of his server, the expected change of the potential plus the expected cost of the move of the algorithm is at most 0. If the adversary requests a point occupied by s1 or s2 , the statement is trivial. Otherwise the expected cost of the move of the algorithm is p + (1 ? p) = (5 ? 2 )=(3 + ). Now we distinguish the cases; each of them requires some amount of routine calculations which we omit. Case 1: a1 = s1 and the request is on a2 6= s2 . The original potential is 5 ? 2 , with probability p it changes to 5 + 2 =(3 ? ) and with probability 1 ? p to 0. We have 5 ? 2 ? (5 ? 2 ) + p 5 + 2   0: 3+ 3? Case 2: a2 = s2 and the request is on a1 6= s1 . The original potential is 5 ? , with probability p it changes to 0 and with probability 1 ? p to 5 + 2 =(3 ? ). We have 5 ? 2 ? (5 ? ) + (1 ? p) 5 + 2  = 0: 3+ 3? Case 3: a1 6= s1 and the request is on a2 6= s2 . The original potential is 5+2 =(3 ? ), with probability p it stays 5 + 2 =(3 ? ) and with probability 1 ? p it changes to 5 ? . We have 5 ? 2 + (1 ? p) ? 2 ?  = 0: 3+ 3? Case 4: a2 6= s2 and the request is on a1 6= s1 . The original potential is 5+2 =(3 ? ), with probability p it changes to 5 ? 2 and with probability 1 ? p it stays 5 + 2 =(3 ? ). We have 5 ? 2 + p ?5 ? 2 + 5 ? 2   0: 3+ 3?

2

2.2 A Lower Bound for Uniform Spaces

In this section we prove that the choice of p in the previous algorithm is (asymptotically) optimal. Moreover, the lower bound holds even for the weaker oblivious adversary, while the upper bound is valid against the stronger adaptive online adversary. Theorem 2 For any memoryless randomized algorithm for two weighted servers on a uniform space of three points, the competitive ratio against an oblivious adversary is at least 5. Proof: We work in the uniform space of three points fa; b; cg. The algorithm only has one parameter, which is the probability p that a request unoccupied by a server is served by the expensive server. In each case we assume that at the beginning the expensive servers are at a and the cheap ones at b. We assume that ! 0, and all O-notation is relative to this. We prove a lower bound of 5 ? o(1), the bound of 5 follows by taking suciently small. 3

First consider what happens if we repeat requests b and c in nitely long. Eventually, the algorithm moves the expensive server to b or c and the cheap server to the other of these two points. The expected cost of the algorithm is 1 + =p, since it will take on average 1=p of moves of the cheap server. We choose k large enough so that after the sequence (cb)k , the probability that the expensive server of the algorithm does not move is o(1) and the expected cost of the algorithm is 1 + =p ? o(1). At the end, the probability that s1 = b is at most 1=2, since the rst (non-trivial) request was to the point c. Now consider a sequence of requests ((cb)k (ab)k )l for k chosen as above and l = !(1). Let us call a subsequence of requests (cb)k or (ab)k a phase. Until the algorithm moves s1 to b, it pays 1+ =p ? o(1) for each phase. It takes on average at least 2 ? o(1) phases to move s1 to b, so the total cost of the algorithm is 2(1 + =p)(1 ? o(1)). The adversary strategy depends on the probability p. If p  2 =3 then the request sequence is the above sequence ((cb)k (ab)k )l for some l satisfying l = o(1= ) and l = !(1). The adversary serves the sequence by moving a1 to b and then moving a2 between a and c 2l times, with total cost 1 + 2l = 1 + o(1). The cost of the algorithm is 2(1 + =p)(1 ? o(1))  5 ? o(1). If p  2 =3 then the request sequence is (cb)m ((ca)k (ba)k )l , where m and l are chosen such that m = o(1= ) = o(1=p), l = o(m), l = !(1). The adversary serves the whole sequence with a2 at cost 2(l + m) = 2m (1 + o(1)). The probability that the expensive server of the algorithm does not move during the rst 2m steps is q = (1 ? p)2m . The expected cost of the moves by the cheap server during the rst 2m steps is =p ? q  =p (the cost would be =p for an in nite sequence; with probability q we stop after m steps and save =p, which is the expected cost starting after 2m steps conditioned on the fact that we have at least 2m steps). If the expensive server moves, the additional cost is 1 + 2(1 + =p)(1 ? o(1)). So the total expected cost of the algorithm is at least (1 ? q)  3(1 + =p)(1 ? o(1)). Elementary calculations show that (1 ? q)=(2mp) = (1 ? o(1)). Thus the competitive ratio is at least p  3(1 + p ) 1 ? q (1 ? q)  3(1 + p )(1 ? o(1)) =  2mp  (1 ? o(1)) = 3 + 1 (1 ? o(1))  5 ? o(1): 2m (1 + o(1)) p It follows that the competitive ratio is at least 5 in both cases. 2

2.3 A Lower Bound for the Line

In this section we prove that no memoryless algorithm can achieve a nite competitive ratio, even if the underlying metric spaces is the line. A similar lower bound was obtained by Koutsoupias and Taylor [20] for the CNN problem. Our result is somewhat stronger, in two respects: the weighted 2-server problem on the line is a special case of the CNN problem and, unlike in [20], we do not assume that the algorithm is invariant with respect to scaling distances. Lemma 1 Suppose that s2 is at 0 and s1 is at x at the beginning. The adversary alternates requests to points 2x and 0, for 2t steps total. Then the probability that at the end s1 is at 0 is at most 1=2. Proof: As long as the algorithm keeps moving s2 , the situation remains identical from a viewpoint of a memoryless algorithm. The rst request is on 2x so, if s1 moves at all, it is more likely to end up at 2x than at 0, and the lemma follows. 2 Theorem 3 There is no competitive randomized memoryless algorithm for two weighted servers on the real line. Proof: The adversary repeats the same phase, doubling the scale every time. While the expected number of phases may be nite, the expected cost of the algorithm goes to in nity. More precisely, the expected cost of the algorithm will be (k), where k is the number of phases, while the optimal 4

cost is 1 + 2k , so for a small we prove an arbitrarily large lower bound on the competitive ratio. It remains to choose the parameters so that the request sequence is nite and xed in advance. Let c > 1 be an arbitrarily large integer constant. We prove that no memoryless algorithm can be better than c-competitive. Set = 2?2c . At the beginning, assume that s2 and a2 are at 0 and s1 and a1 are at 1. We continue in phases. In a phase i, we alternate requests to points 2i and 0, total of 24c requests. We continue for 2c phases. The optimal algorithm moves a1 to 0 and serves all other requests with a2 . The total cost is 1 + 22c = 2. Let Ci be expected cost of the algorithm in phases i + 1, : : : , 2c, assuming that after i phases s2 is at 0 and s1 is at 2i . We prove by backwards induction that Ci  (2c ? i)2i?1 By de nition, C2c = 0. We analyze the phase i ? 1, assuming that s2 starts at 0 and s1 at 2i?1 . If s1 stays at 2i?1 then the cost during is at least 24c  2i  22c  (2c ? (i ? 1))2i?1 in phase i ? 1 alone, by the choice of and of the number of steps in each phase. Assume now that s1 moves. If s1 moves to 2i , then the cost of this phase is at least 2i?1 + Ci  2i?1 + (2c ? i)2i . If s1 moves to 0 then the cost of this phase is at least 2i?1 . Since, by the last lemma, s1 is more likely to move to 0 than to 2i , if s1 moves at all, the expected cost will be at Ci?1  2i?1 + 21 (2c ? i)2i = (2c ? (i ? 1))2i?1 proving (1). The algorithm pays at least C0  2c, so the ratio is at least c. 2

3 Deterministic Algorithms In this section we focus on deterministic algorithms. We start by an introduction of work functions. In the next two subsections we restrict our attention to uniform spaces, where the distance between any pair of distinct points is 1. We give a 5-competitive algorithm and prove that the ratio 5 is optimal. In the last subsection we study a weaker version of the weighted 2-server problem; for this version we give a 9-competitive algorithm for an arbitrary metric space. Work Functions. By (x; y) we denote the server con guration, where x is the location of the expensive server and y is the location of the cheap server. By !%(x; y) we denote the work function on (x; y), de ned as the minimum cost of serving the request sequence % and ending in con guration (x; y). We can compute ! recursively by dynamic programming. Let % = r. If r 2 fx; yg then !% (x; y) = ! (x; y). Otherwise, !% (x; y) = min f! (r; y) + xr; ! (x; r) +  yrg (1) where, for points u; v 2 M , by uv we denote the distance from u to v. Function !% satis es the Lipschitz condition: for any x, y, u, and v, !(u; v)  !(x; y) + xu +  yv.

3.1 The Work-Function Algorithm for Uniform Spaces

For simplicity, in this section we assume that 1= = B is an integer. This is not a major restriction, since we are interested in the asymptotic behavior for ! 0. For uniform spaces, if r 2= fx; yg, formula (1) becomes !% (x; y) = min f! (r; y) + 1; ! (x; r) + g. The Lipschitz inequality can be somewhat strengthened for uniform spaces: if x; y 6= r then !% (u; v)  !% (x; y) + 1, and, for any x and y, !(y; x)  !(x; y) + 1. 5

To simplify the proofs, we de ne the work function with only one parameter, which is the position of the expensive server, by setting !% (x) = miny !% (x; y). Intuitively, as approaches 0, the position of the cheap server becomes less signi cant. Let's now examine !% (x) in more detail. Suppose rst that x 6= r. Let % = r and let q be the last request in , q 6= r. If ! (r; y) + 1  ! (x; r) + then, trivially, !% (x; y)  ! (x; r) = !% (x; r). If y 6= q and ! (r; y) + 1 < ! (x; r) + , then !% (x; y) = ! (r; y) + 1  ! (x; r) = !%(x; r). Therefore, ( ) ! ( x; r ) % !% (x) = min ! (r; q) + 1 (2) %

If 1= is integer, then !% (x) is realized by !% (r; q)+1 but not by !% (x; r) i ! (x; r) = ! (r; q)+1+ , that is when (x; r) is \coned up" from (r; q) in . Function !() satis es the following Lipschitz condition:

!% (x)  !% (y) + 1;

(3)

because if !% (y) = !% (y; z ), then !% (x)  !% (x; z )  !% (y; z ) + 1 = !% (y) + 1. Lemma 2 Let % = r and let q be the last request in . (a) If x 2= fq; rg, !% (x) < !%(r) + 1 and ! (x) < ! (q) + 1, then !% (x) = ! (x) + . (b) For < 1, if the next to last request in  is not r and ! (q) = min(! ), then !% (q) = ! (q) + . Proof: (a) We have !% (x) = !% (x; r), for otherwise we would get !% (x) = !% (r; q) + 1  !% (r) + 1. Similarly, ! (x) = ! (x; q). By the integrality of 1= , ! (q; r) + 1  ! (q) + 1  ! (x) + = ! (x; q) + . Therefore !% (x) = !% (x; r) = ! (x; q) + = ! (x) + . (b) We have !% (q) = min f!% (q; r); !% (r; q) + 1g = !% (q; r). Let p;  be the request and the work function preceding q; . If ! (q; p) = ! (q; r) then ! (q; r) = min f! (q; p) + ; ! (p; r) + 1g = ! (p; r)+1, and therefore ! (p)  ! (p; q)  ! (p; r) + = ! (q; r) ? 1 + < ! (q; r) = ! (q), contradicting the minimality of ! (q). Thus !% (q) = ! (q; r)  ! (q; p) +  ! (q) + . 2 The Work Function Algorithm (WFA) minimizes the current cost plus the optimal cost of the new con guration. Adapted to our problem, it will work as follows. Let the request sequence be ru, where r is the last served request and u is the new request we are about to serve. Let the current work function be ! = !r and let the new work function be !0 = !ru . Algorithm MWFA: If the current con guration is (r; x), move the cheap server from x. If the current con guration is (x; r), we have two subcases: if !0 (x) = !0 (u) + 1, move the expensive server from x, otherwise move the cheap server from r. Theorem 4 There is an online 5-competitive algorithm for the weighted 2-server problem in uniform spaces. Proof: For = 1, WFA is 2-competitive [21, 12], so we can assume that < 1. We show that in this case MWFA is 5-competitive. We divide the computation into phases, each phase ending when the expensive server moves. We de ne the potential function for con gurations at the beginning of each phase. Then the expensive server is always on the last request point r. Let ! be the current work function. If MWFA moved to r from q then !(q) = !(r) + 1. Thus, by (3), !() is minimized at r, that is !(r) = minx !(x).

6

Let a and b be the next two minima of !, not necessarily strict. That is, a 6= r and !(a) = minx6=r !(x), and b 2= fr; ag and !(b) = minx=2fr;ag !(x). We de ne the potential as 8 9 > > ?5  !(r) < =  = max > 2 ? !(r) ? 4  !(a) > : 4 ? !(r) ? 4  !(b) ; Consider one phase, in which we go from state (!; r) to (; s). Thus (r) = (s) + 1. Without loss of generality, we can assume that !(r) = 0 (because we can uniformly decrease ! and  by !(r)). Further, without loss of generality, we assume that the adversary does not make any requests on the points occupied by WFAs servers, for otherwise we can simply not change the current work function. Lemma 2 implies that during the phase the work function on r increases by on each request except the last (Lemma 2.a applies to the rst request in a phase, and Lemma 2.b to all intermediate requests.) Since WFA pays for each such request, cost  (r) ? !(r) + 1 = 2 + (s). Let  denote the old potential and 0 the new potential. We need to show that cost + 0  . We consider several cases. Case 1: 0 = ?5(s). Then, since s 6= r, we have cost + 0  [2 + (s)] ? 5(s) = 2 ? 4(s)  2 ? 4!(s)   Case 2: 0 = 2 ? (s) ? 4(c) for some c 6= s. Then cost + 0  [2 + (s)] + [2 ? (s) ? 4(c)] = 4 ? 4(c) We have two subcases. If c = r then cost + 0  4 ? 4(r) = 4 ? 4[(s) + 1] = ?4(s)  0   Assume now that c 6= r. All s; r; c are distinct. Reorder s; c as a; b so that !(a)  !(b). Then cost + 0  4 ? 4(c)  4 ? 4(b)  4 ? 4!(b)   Case 3: 0 = 4 ? (s) ? 4(d), for some d 6= s. There exists c 2= fd; sg such that (c)  (d). Then cost + 0 = [2 + (s)] + [4 ? (s) ? 4(d)] = 6 ? 4(d) First, we claim that, without loss of generality, we can assume that c; d 6= r. For if r 2 fc; dg, then (d) = (s) + 1, so 0 = 4 ? (s) ? 4[(s) + 1] = ?5(s), which is Case 1. Let a be the second minimum of !, that is a 6= r and !(a) = minx6=r !(x). If (d)  !(a)+1, then cost + 0  6 ? 4(d)  6 ? 4[!(a) + 1] = 2 ? 4!(a)   and we are done. Therefore, from now on, we can assume that (d) < !(a) + 1. Let b be the third minimum of !, that is !(b) = minx=2fr;ag !(x). We claim that

(d) 

1 + !(b) 2

We rst show how the theorem follows from (4). Because of the existence of a, we have i h cost + 0  6 ? 4(d)  6 ? 4 12 + !(b) = 4 ? 4!(b)   7

(4)

Now we prove (4). Consider the request sequence in the phase from (!; r) to (; s). Given any work function  in this phase, we claim that

(s) + (c) + (d)  (r) + 2!(b) (5) Note that (5) implies (4), for at the end of the phase we have  =  and 2(d)  (c) + (d)  (r) ? (s) + 2!(b) = 1 + 2!(b). It remains to show inequality (5). The proof is by induction. Initially,  = ! and !(r) = 0. Since at least two of !(c), !(d), !(s) are at least !(b), the inequality holds. Assume that (5) holds at a given step. We will show it holds in the next step. The right-hand side can increase at most by . We have two cases. Suppose rst that one of s; c; d, say s, is maxed-out after the request, that is (s) = 1+minx (x). Without loss of generality, let (c)  (d). Since (d) < !(a)+1, s can be maxed out only when  (s) =  (r)+1. But then  (s)+  (c)+  (d) =  (r)+[ (c)+1]+  (d)   (r)+2!(b). On the other hand, if the new work function is not maxed out, Lemma 2.b implies that the work function must increase on at least one of s; c; d, and we are done. 2

3.2 A Lower Bound for Deterministic Algorithms for Uniform Spaces

In this section we prove a lower bound on the competitive ratio for deterministic algorithms in uniform spaces. This lower bound increases to 5 as approaches 0. We work in the space of three points, fa; b; cg, assuming that the expensive server starts at a and the cheap one at b. Naturally, the adversary always requests the point not occupied by the algorithms server. We divide the request sequence into phases, a phase is ended by the rst request which the online algorithm serves by the expensive server. Let the position of the expensive server at the beginning of the phase i be ui and let the number of requests served by the fast server in phase i be ti . Note that the phase i consists of ti + 1 alternating requests to two points distinct from ui , ending at ui+1 6= ui . Let %i be the sequence of all requests in the rst i phases and let !i (x) = !% (x) be the modi ed work function (as de ned above) after i phases. Let X  Y mean that Y  X  Y + . By the de nition of !, for x; y the two points distinct from ui we have i

!i(ui )  min f!i?1 (x) + 1; !i?1 (y) + 1; !i?1 (ui) + ti g; !i (x)  !i?1 (x); !i(y)  !i?1 (y): The algorithm pays ti + 1 in phase i. We prove that !i approximates the optimal cost. Lemma 3 The cost of the optimal service of i phases with the expensive server ending at x is at most !i(x) + i. Proof: By induction on the number of phases we nd a service with at most the cost above. Before the rst phase, the statement holds by the de nition. If x 6= ui , then !i (x)  !i?1 (x). We serve i ? 1 phases with the expensive server ending at x, then during the ith phase we keep the expensive server on x and pay at most , the induction step follows. If x = ui , we distinguish two cases. If !i (ui )  !i?1 (ui ) + ti , we can serve i ? 1 phases with the expensive server ending at ui , during the ith phase keep the expensive server on ui and pay at most (ti + 1) . Otherwise !i(ui )  !i?1 (y) + 1, for some y 6= ui ; in which case we serve i ? 1 phases with the expensive server ending at y, during the ith phase keep the expensive server at y, move it to ui at the end, and pay at most + 1. 2 8

Now we de ne i = 2[!i (a) + !i (b) + !i(c)] ? minf!i (a); !i (b); !i (c)g: Lemma 4 For every phase i, we have i ? i?1  ti + 1 + 6 . Proof: Let U = !i?1 (ui ), and V = !i?1 (v)  !i (v), where v 2 fa; b; cg ? fui g is the point with the

smaller value of !i?1 . We distinguish three cases. Case 1: U + ti  V . Then !i (ui )  U + ti + and ui achieves the minimum of both !i?1 and !i (up to an additive term of ), so i ? i?1  (U + ti + 6 ) ? U = ti + 6  ti + 1 + 6 . Case 2: V  U . Then V is the minimum of !i?1 and an approximate minimum of !i , so i ? i?1 = [2!i (ui ) + 4 ] ? 2U  U + ti + V + 1 + 6 ? 2U  ti + 1 + 6 . Case 3: U  V  U + ti . Now U is the minimum of !i?1 and V is the approximate minimum of !i . Then i ? i?1  (2!i (ui )+ V +4 ) ? (2V + U )  (U + ti + V +1+ V +6 ) ? (2V + U ) = ti +1+6 .

2

Theorem 5 For any constant  > 0 there is for which no deterministic algorithm for two weighted servers is (5 ? )-competitive in uniform spaces.

Proof: Let k be the total number of phases, C the cost of the algorithm, and Copt the optimal cost. By summing over all phases, Lemma 4 implies that k  C + 6k . Thus, using Lemma 3 and the fact that the algorithm pays at least 1 in each phase, we get 1   C k Copt  5 + k  5 + 3k  5 + 3 C; The theorem follows. 2

3.3 The Weighted 2-Point Request Problem

In this section we study the modi cation of the weighted 2-server problem in which each request is speci ed by two points, say fr; sg. In response to this request, the algorithm must move one server to r and the other to s. The decision to be made is which server to move to which point. This problem can be viewed as a special case of the weighted 2-server problem as follows. Replace the 2-point request fr; sg by a long sequence rsrsrs:::. Any 2-server algorithm must eventually move his servers to r and s. In this way any c-competitive weighted 2-server algorithm yields a c-competitive algorithm for the weighted 2-point request problem. On the other hand, this new problem contains as its special case the cow-path problem. In the special case = 0, we obtain the 2-Point Request Problem with one server studied in [11], which in turn contains the closely related cow-path problem [2, 23]. This yields a lower bound of 9. Algorithm WFA3 minimizes the cost of the move plus three times the new work function value of the new con guration. Thus, if the current server con guration is (x; y) (the expensive server at x and the cheap server at y), and if xr + ys +3!0(r; s)  xs + yr +3!0 (s; r), then move to (r; s), else move to (s; r). In the theorem below we prove that WFA3 has competitive ratio at most 3(3 ? )=(1 + )  9, matching the lower bound. Theorem 6 Algorithm WFA3 is R-competitive, where R = 3(3 ? )=(1 + ). Proof: Let d be the distance between the servers, d = xy, and let !x, !y denote the work function values when the expensive server is at x, respectively y. We use the following potential function: +  6  = 2d + 1 + (!x ? !y ) ? R!x where [a]+ = max(a; 0). From de nition, the algorithm satis es the following invariant: (6) !x ? !y  1 +3 d 9

Suppose now that the current con guration is x; y with d = xy, and let (r; s) be the new request. Let a; b; f; g; e be the following distances: xr = a, xs = b, yr = f , ys = g, rs = e. Without loss of generality, assume that WFA3 moves the expensive server to r, that is a + g + 3!r0  b + f + 3!s0 , where !0 is the new work function. We have !r0 = min f!x + a + g; !y + f + bg, !s0 = min f!x + b + f; !y + g + ag. Case 1: (1 + )d + 3(!r ? !s)  0. Case 1.1: If !r0 = !x + a + g then cost +   a + g ? R(!x + a + g ) + R!x  0 Case 1.2: If !r0 = !y + f + b then   6 cost +   a + g ? R(!y + f + b) ? 2d + 1 + (!x ? !y ) ? R!x = a + g ? Rf ? R b ? 2d + 31?+3 (!x ? !y )  a + g ? Rf ? R b ? (1 + )d  (a ? d ? f ) + (g ? d ? b)  0 Case 2: (1 + )d + 3(!r0 ? !s0 )  0. Case 2.1: If !r0 = !x + a + g and !s0 = !x + b + f then   cost +   a + g + 2e + 1 +6 (!x + a + g ? !x ? b ? f ) ? R(!x + a + g) + R!x = 1 +2 [(e ? b ? a) + (e ? f ? g) + (a + g) ? (b + f )]  0 The last inequality follows from a + g  b + f (from the algorithm and the case condition). Case 2.2: If !r0 = !x + a + g and !s0 = !y + g + a then   6 cost +   a + g + 2e + 1 + (!x + a + g ? !y ? g ? a) ? R(!x + a + g)   6 ? 2d + 1 + (!x ? !y ) ? R!x = 2(e ? d ? a ? g) ? 4(1 ? )g  0 Case 2.3: If !r0 = !y + f + b and !s0 = !y + g + a then   cost +   a + g + 2e + 1 +6 (!y + f + b ? !y ? g ? a) ? R(!y + f + b)   ? 2d + 1 +6 (!x ? !y ) ? R!x 2 = 11?+5 a ? 6 ?1 +? g + 2e ? 2d ? 31?+3 (f + b) + 31?+3 (!x ? !y ) 2  11?+5 a ? 6 ?1 +? g + 2e ? (1 + )d ? 31?+3 (f + b) 2 g  0 = 31?+3 (e ? f ? g) + 11?+5 (a ? e) ? (1 + )d ? 3 +12+ ? because (1 ? 5 )=(1 + )  1 + and 1 ? 5  3 + 2 ? 2 . 10

Case 2.4: If !r0 = !y + f + b and !s0 = !x + b + f then     6 6 0 0 0 cost +   a + g + 2e + 1 + (!r ? !s) ? R!r ? 2d + 1 + (!x ? !y ) ? R!x = a + g + 2e ? 2d + 3(!r0 ? !s0 ) ? 1 +6 (!r0 ? !y ) ? 31?+3 (!s0 ? !x)  a + g + 2e ? 2d + (b + f ? a ? g) ? 1 +6 (f + b) ? 31?+3 (b + f ) = 2(e ? d ? b ? f ) ? 4(1 ? )f  0

2

4 Final Comments We proved some upper and lower bounds for the weighted 2-server problem in uniform spaces. Many open problems remain. No competitive algorithm for arbitrary spaces is known, and the lower bound of 10.12 from [20] can probably be improved. Another direction would be to determine the competitive ratio for uniform spaces and arbitrary k. The weighted 2-server problem is closely related to the CNN problem from [20]. In this problem, we have one server in the plane. Each request is a point (x; y), and to serve this request we need to move the server to some point with x-coordinate x or with y-coordinate y. The special case when the requests are restricted to some line ` in the plane is equivalent to a weighted 2-server problem on the real line. Since the proof from [20] uses only the real line, the lower bound of 10.12 applies to the CNN problem as well. In our paper we focussed on the asymptotic competitive ratios, with ! 0. It would be of some interest to determine the tight competitive ratios for any xed . For example, in the weighted 2point request problem from Section 3.3, for = 1 we get R = 3, although the best ratio is 1 (since both servers have the same weight, at each step we move according to the minimum matching). We conjecture that the optimal algorithm is WFA for some that converges to 3 with ! 0.

References [1] D. Achlioptas, M. Chrobak, and J. Noga. Competitive analysis of randomized paging algorithms. In Proc. 4th European Symp. on Algorithms, volume 1136 of Lecture Notes in Computer Science, pages 419{430. Springer, 1996. [2] R. A. Baeza-Yates, J. C. Culberson, and G. J. E. Rawlins. Searching with uncertainty. In Proc. 1st Scandinavian Workshop on Algorithm Theory, Lecture Notes in Computer Science, pages 176{189. Springer, 1988. [3] Y. Bartal, A. Blum, C. Burch, and A. Tomkins. A polylog(n)-competitive algorithm for metrical task systems. In Proc. 29th Symp. Theory of Computing, pages 711{719, 1997. [4] Y. Bartal, M. Chrobak, and L. L. Larmore. A randomized algorithm for two servers on the line. In Proc. 6th European Symp. on Algorithms, Lecture Notes in Computer Science, pages 247{258. Springer, 1998. [5] Y. Bartal and E. Grove. The harmonic k-server algorithm is competitive. To appear inJournal of the ACM. [6] A. Blum, H. Karlo , Y. Rabani, and M. Saks. A decomposition theorem and lower bounds for randomized server problems. In Proc. 33rd Symp. Foundations of Computer Science, pages 197{207, 1992.

11

[7] A. Borodin and R. El-Yaniv. Online Computation and Competitive Analysis. Cambridge University Press, 1998. http://www.cup.org/Titles/56/0521563925.html. [8] M. Chrobak, H. Karlo , T. H. Payne, and S. Vishwanathan. New results on server problems. SIAM Journal on Discrete Mathematics, 4:172{181, 1991. [9] M. Chrobak and L. L. Larmore. On fast algorithms for two servers. Journal of Algorithms, 12:607{614, 1991. [10] M. Chrobak and L. L. Larmore. An optimal online algorithm for k servers on trees. SIAM Journal on Computing, 20:144{148, 1991. [11] M. Chrobak and L. L. Larmore. The server problem and on-line games. In DIMACS Series in Discrete Mathematics and Theoretical Computer Science, volume 7, pages 11{64, 1992. [12] M. Chrobak and L. L. Larmore. Metrical task systems, the server problem, and the work function algorithm. In Online Algorithms: State of the Art, pages 74{94. Springer-Verlag, 1998. [13] M. Chrobak, L. L. Larmore, C. Lund, and N. Reingold. A better lower bound on the competitive ratio of the randomized 2-server problem. Information Processing Letters, 63(2):79{83, 1997. [14] D. Coppersmith, P. G. Doyle, P. Raghavan, and M. Snir. Random walks on weighted graphs and applications to on-line algorithms. Journal of the ACM, 40:421{453, 1993. [15] E. Feuerstein, S. Seiden, and A. S. de Loma. The related server problem. manuscript, 1999. [16] A. Fiat and M. Ricklin. Competitive algorithms for the weighted server problem. Theoretical Computer Science, 130:85{99, 1994. [17] E. Koutsoupias and C. Papadimitriou. On the k-server conjecture. In Proc. 26th Symp. Theory of Computing, pages 507{511, 1994. [18] E. Koutsoupias and C. Papadimitriou. On the k-server conjecture. Journal of the ACM, 42:971{983, 1995. [19] E. Koutsoupias and C. Papadimitriou. The 2-evader problem. Information Processing Letters, 57:249{252, 1996. [20] E. Koutsoupias and D. Taylor. Lower bounds for the cnn problem. manuscript, 1999. [21] M. Manasse, L. A. McGeoch, and D. Sleator. Competitive algorithms for server problems. Journal of Algorithms, 11:208{230, 1990. [22] L. McGeoch and D. Sleator. A strongly competitive randomized paging algorithm. Algorithmica, 6(6):816{ 825, 1991. [23] C. H. Papadimitriou and M. Yannakakis. Shortest paths without a map. Theoretical Computer Science, 84:127{150, 1991.

12