Competitive Algorithms for the On-line Traveling Salesman

11

Transcript of Competitive Algorithms for the On-line Traveling Salesman

Competitive Algorithms for the On-line Traveling Salesman �Giorgio Ausielloy Esteban Feuersteiny Stefano Leonardiy Leen StougiezMaurizio TalamoyAugust 18, 1995AbstractIn this paper the problem of e�ciently serving a sequence of requests that are presentedin a metric space in an on-line fashion and then returning back to the departure point isconsidered. The problem, that is the on-line version of a variant of the Traveling SalesmanProblem (namely the Vehicle Routing Problem with release times), and that for the sake ofintuition we call On-Line Traveling Salesman Problem (OLTSP), has a variety of relevantapplications in logistics and robotics.After proving a � 1:64 lower bound on the competitive ratio that can be achieved byon-line algorithms for OLTSP, two competitive algorithms are shown, one of which is 2-competitive and works for any metric space. The second one allows to achieve a nearlyoptimal competitive ratio of 1.75 on the real line.1 IntroductionThe Traveling Salesman Problem (TSP) and in general vehicle routing and scheduling problemshave been widely studied for more than three decades. A common characteristic of almost allthis research e�ort is the o�-line point of view. The whole instance of the problem is knownbefore an algorithm computes a route that visits a set of locations in a space (possibly subjectto various constraints) with the goal of minimizing the distance traveled or the completion time.However in many routing and scheduling applications the instance is only known in an on-line fashion. In other words, the input of the problem is communicated in successive steps, andmoreover, in general it is not possible to determine which is the last request, i.e. when theinstance is completely known. Actually, if the goal is to minimize the completion time, evenif we knew which is the last request, waiting till all the information is available could imply acostly loss of time.In this paper we consider the following on-line variation of TSP in a metric space: while thesalesman is traveling, new sites to visit may be communicated to him. His goal is to visit all thesites and turn back to the departure point, minimizing the completion time.This setting models many natural applications. Think for example of a salesman or of arepairman with a cellular phone, of a robot that has to service locations of its working space�This work was partly supported by ESPRIT BRA Alcom II under contract No.7141, and by Italian Ministryof Scienti�c Research Project 40% \Algoritmi, Modelli di Calcolo e Strutture Informative".yDipartimento di Informatica e Sistemistica, Universit�a di Roma \La Sapienza",via Salaria 113, 00198-Roma,Italia. e-mail: fausiello,esteban,leon,[email protected] of Operations Research, University of Amsterdam, Roetersstraat 11, 1018WB Amsterdam, TheNetherlands. e-mail: [email protected]. Supported by a grant from the SCIENCE project \Algorithmic Approachesto Large and Complex Combinatorial Optimization Problems"1

(for example in the Euclidean plane) and of many other routing and scheduling problems ona transportation network modeled with a graph. We will refer to this problem as the On-lineTraveling Salesman Problem (OLTSP).As the input to the salesman (from now on we will refer to him as the server) is communicatedin an on-line way, the scheduled route will have to be updated also in an on-line way duringthe trip. Therefore, the �nal solution will not be optimal in general. The fact of dealingwith incomplete information introduces an additional source of di�culty unrelated to that ofcomputational complexity. In other words, in general it is not possible to compute the optimalsolution on all instances even using non polynomial time algorithms.The most widely accepted way of measuring the performance of on-line algorithms is com-petitive analysis. The quality of a certain on-line strategy is measured by the worst-case ratiobetween the time needed by the on-line algorithm for a sequence of requests and the optimaltime needed to serve it by an algorithm who knows the entire sequence in advance. This ratiois called the competitive ratio of the on-line algorithm. Therefore, an algorithm is �-competitiveif for every input its completion time is at most � times the optimal completion time for thesame input. Competitive analysis has been introduced in [10], and since then has been used foranalyzing the performance of on-line strategies for a great variety of on-line problems, rangingfrom scheduling to �nancial decision making, and for many data structure problems (among thewide literature on the subject, see for example [3, 7, 11, 9]).We will therefore compare the performance of on-line algorithms with the optimal solution ofthe corresponding o�-line problem, namely the Vehicle Routing Problem with release times [8].In that problem, each site must be visited at or after a given release time. The release time of arequest corresponds to the time in which the request is communicated to the on-line server. Thisproblem is part of a family of o�-line variants of TSP generally called routing and schedulingwith time window constraints [5, 8, 12, 13], that may associate to each request also a deadlineor a handling time.A similar problem has already been studied by the authors in [2]. In that work the casein which the server has to visit the requested sites following a path rather than a tour wasconsidered. The added constraint of ending the trip at the departure point changes the natureof the problem (and henceforth the kind of applications). Besides, lower bounds and algorithmsfor the two problems are qualitatively and quantitatively di�erent.Another related work [6] considers the problem of visiting the whole set of vertices of anunknown graph, when the set of edges leaving a node is revealed only once the node is visited.In our case, the metric space is completely known from the beginning, but what is revealed inan on-line way is the set of locations that must be visited.It is important to note that OLTSP is di�erent from the famous k-server problem [7]. Inthat problem the requests have to be served in the order in which they are presented, with thegoal of minimizing the total distance traveled by the k servers. On the contrary, in OLTSP thetask is precisely to decide the order in which the requests will be served.In this work we propose competitive on-line algorithms for OLTSP. In particular, we give:� a lower bound of 9+p178 � 1:64 on the competitive ratio achievable by any on-line algorithm(Section 3);� a 2-competitive algorithm for any metric space (Section 4);� a 7=4-competitive algorithm for the case in which the metric space is isomorphic to thereal line (Section 5). 2

The lower bound is obtained on the real line, and hence the existing gap is particularly smallin that case (�1:64 vs 1.75).Our 2-competitive algorithm for arbitrary metric spaces is not polynomial, but we also showhow to obtain a 3-competitive polynomial time algorithm. As we mentioned before, the on-linenature of the problem is a source of di�culty independent of its computational complexity, andtherefore on-line algorithms achieving good competitive ratios are of interest also if their timeor space requirements are not polynomially bounded.Our setting can be naturally applied to situations in which the server moves along the edgesof a graph, and serves requests that are presented on the nodes. If a distance or a traversing timeis associated to each edge of the graph, the notions of distance and path can be extended to pairsof points that lie on the edges. This allows us to model also transportation problems on roadnetworks (for some of our algorithms, U-turns must be always allowed). It is important to notethat our de�nition allows any kind of metric space even in�nite ones. The on-line server doesnot need to know the whole metric space. However, an oracle is available to answer questionson the distances and paths between any known pair of points in the space.2 PreliminariesIn this paper we consider the on-line traveling salesman problem (OLTSP). The input of OLTSPconsists in a metric space M with a distinguished point o (the origin), and a sequence of pairs< ti; pi > where pi is a point of M and ti is a real number, 0 � ti � tj for every i < j. tirepresents the moment in which the request is known. A server located at point o at time 0 thatmoves not faster than unit speed must serve all the requests and go back to o with the goal ofminimizing the total completion time.An on-line algorithm for OLTSP determines the behavior of the server in a certain momentt as a function of all requests < ti; pi > such that ti � t.We will denote the completion time of the solution produced by an on-line algorithm OLby ZOL and that of the optimal (o�-line) solution by Z�. An on-line algorithm for OLTSP is�-competitive if for any sequence of requests ZOL � �Z�. With pOL(t) and p�(t) we denoterespectively the position of OL's server and the optimal o�-line server at time t.For every pair of points x; y in the metric space M , d(x; y) indicates the distance between xand y in M . Let T be a path in the metric space; with jT j we will denote the length of T .3 A lower boundFirst of all let us prove a lower bound on the competitive ratio � for any on-line algorithm forOLTSP. In the proof an adversary will play the advocate of the devil, by providing, given a�-competitive on-line algorithm, a sequence of requests for which � must be at least the claimedvalue.The proof is constructed on a particular metric space, namely the real line with the origin oat point 0.Theorem 3.1 If an on-line algorithm is �-competitive, then � � (9 +p17)=8.Proof: Both the adversary and the on-line algorithm OL start at 0 at time t = 0. Thus,pOL(0) = p�(0) = 0.Before time t = 1 no requests are presented. At that moment, the position pOL(1) of theserver of any �-competitive on-line algorithm must be inside the interval [�(2�� 3); (2�� 3)].3

In fact, if pOL(1) > (2�� 3) the �rst (and unique) request of the sequence could be at point -1,giving ZOL > 1 + (2�� 3) + 2 = 2�, because OL has to travel from its current position to -1and back to 0. On the other hand, for this sequence Z� = 2, and therefore the algorithm wouldnot be �-competitive. The case in which pOL(1) < �(2�� 3) is symmetric.Then, pOL(1) 2 [�(2�� 3); (2�� 3)]. Now the adversary presents two simultaneous requestsat points -1 and 1 at time t = 1. At time t = 3, the on-line server can not have served bothrequests. Suppose, without loss of generality, that it has not served the request in -1. If it hasserved the request in 1 it must be to the right of �(2�� 3) since it has started to move towards+1 after time 1 from a position not to the right of (2�� 3).We now show that if �(7 � 4�) < pOL(3) < (7 � 4�) then OL can not be �-competitive.In this case the adversary could be in p�(3) = 1, present a new request in +1 and go back tothe origin with a total cost Z� = 4. OL, however, would still have to serve requests in bothextremes, and hence ZOL > 3+ 1� (7� 4�)+ 3 = 4�, since starting at time t = 3 it would haveto go to one of the extremes and then to the other and back to 0.Note that if � � (9 + p17)=8 the thesis follows, otherwise if � < (9 + p17)=8 the interval[�(7� 4�); (7� 4�)] strictly contains the interval [�(2�� 3); (2�� 3)].Thus, we are left with two cases to be considered.1. At time t = 3 the on-line server has not served +1, and �1 � pOL(3) � �(7 � 4�) or(7� 4�) � pOL(3) � 1.2. At time t = 3 the on-line server has served +1. Hence (7� 4�) � pOL(3) � 1, because wehave already shown that �(2�� 3) � pOL(3).We notice that in both cases the following situation occurs: the on-line server is withindistance 1 � (7 � 4�) of the extreme on one side and has not served the extreme on the otherside. This property is su�cient for the rest of the proof, where we will suppose that the on-lineserver is near 1 and has not served the request in -1 (the other case is symmetric).In this case the optimal algorithm on the requests presented so far has served -1, is at positionp�(3) = +1 and �nishes with Z� = 4. Then, any �-competitive on-line algorithm has to passpoint 0 at some time within 4� � 2. Let's denote the time at which the on-line server crossesthe origin as 3 + q. Therefore we have q � 4�� 5 (1)At time (3 + q) the adversary can be in position (1 + q) and it can then place one requestat that point and go back to 0. For this sequence we have that ZOL = 7+ 3q and Z� = 4+ 2q,and therefore ZOLZ� = 7+3q4+2q . By hypothesis OL is �-competitive, then� � 7 + 3q4 + 2qThis is a monotonically decreasing function of the value q, and by equation (1) we get� � 7 + 3(4�� 5)4 + 2(4�� 5) (2)The least value of � that satis�es inequality (2) is the value that achieves equality, that is� = 9+p178 . 24

4 A 2-competitive algorithmLet us now turn to the search of a competitive algorithm for OLTSP. The most intuitive algorithmone can think of is the \greedy" algorithm that follows at every time the shortest path that startsin its current position, visits all the points that still have to be served, and ends at the origin. Itis easy to see that this strategy is 2.5-competitive. In this section we will show that it is possibleto do better. We present an algorithm that achieves a competitive ratio of 2 for any metricspace. We call the algorithm PAH (for Plan-At-Home). We abbreviate with p the positionpPAH(t). PAH works as follows:1. Any moment t the server is at the origin, it starts to follow an optimal route that servesall the requests and goes back to the origin.2. If at time t a new request is presented at point x, then it takes one of two actions dependingon its current position p:2a. If d(x; o) > d(p; o), then the server goes back to the origin (following the shortestpath) where it appears in Case 1.2b. If d(x; o) � d(p; o) then the server ignores it until it arrives at the origin, where againit reenters Case 1.Note that all requests that are presented between an occurrence of case 2a and the arrivalto the origin do not make it deviate from its current route.Theorem 4.1 PAH is 2-competitive.Proof: Assume that at time t a new request is presented at position x. We show that in eachof the three cases 1, 2a and 2b, PAH is 2-competitive.Let T � be the optimal tour that starts at the origin, serves all the requests presented so far,and ends at the origin. Clearly Z� � t since no algorithm can �nish before the last request ispresented and Z� � jT �j.In case 1 PAH's server is at the origin at time t. Then it starts an optimal tour thatserves all the unserved requests and goes back to the origin. The time needed by PAH isZPAH � t + jT �j � 2 Z�.If, when the new request arrives, PAH's server is not at the origin, we can distinguish twocases, corresponding to cases 2a and 2b.2a. d(o; x)> d(o; p). Then the server goes back to o, where it will arrive before time t+d(o; x).At that moment, we read from the description of the algorithm, that PAH will computeand follow an optimal tour through all the unserved requests. Therefore, ZPAH < t +d(o; x) + jT �j.Notice �rst that Z� � t + d(o; x), since from the time t the request is presented everyalgorithm has to travel at least the distance from the request to the origin, and secondlythat, as before, Z� � jT �j. Thus, ZPAH < 2 Z�.2b. d(o; x)� d(o; p). We have two cases:{ PAH's server is going back to o due to a previous occurrence of case 2a. As in case2a, PAH will arrive to the origin before the adversary can �nish and hence it is2-competitive. 5

{ PAH is following a route R that has been computed the last time the server was at theorigin. Let S be the set of requests that have been temporarily ignored since the lasttime the server left the origin. Let s be the location of the �rst request in S servedby the adversary, and ts the time at which s was presented. Let P �S be the shortestpath that starts at s, visits all the points in S and ends at o. Clearly, Z� � ts + jP �S j.At time ts, the distance that the server still has to travel on the route R beforearriving at o is at most jRj � d(o; s). In fact d(o; p(ts)) � d(o; s) implies that PAHhas traveled on the route R a distance not less than d(o; p(ts)). Therefore, it willarrive to o before time ts + jRj � d(o; s). After that it will follow an optimal tour T �Sthat covers the set of yet unserved requests that is S. Therefore the total time forcompletion will be ZPAH � ts + jRj � d(o; s) + jT �S j. Because jT �S j � d(o; s) + jP �S j,we have ZPAH � ts + jRj� d(o; s)+ d(o; s)+ jP �S j = ts + jRj+ jP �S j. Since, obviously,Z� � jRj and, as established before, Z� � ts + jP �S j we have that ZPAH � 2 Z�. 2Note that we could have added another condition to the algorithm stating that wheneverthe new request would not have changed the tour followed so far by the on-line server, then it isincluded in the current tour. However, this extra condition would not decrease the competitiveratio achieved by the algorithm, as is shown in the following example, which proofs tightness ofthe worst-case bound.For this we consider an instance in which the metric space is the real line with the origin oat point 0.The sequence of requests starts with a request at time 1 at position +1. PAH remains atthe origin until time 1 when it leaves towards 1. Each time the on-line server arrives to point+�, a new request is presented \slightly" to the left of ��, in such a way that the server alwaysturns back to 0. The optimal strategy consists in serving �rst the request in +1 and then all therequests to the left of 0 with a total cost arbitrarily close to 2 + 2�, while the on-line algorithmwill be to the left of +� at least until time 2 + �, with a total cost of at least 4. Making �arbitrarily small yields a ratio of 2.Step 1 of PAH requires to solve an NP-hard problem. A polynomial time competitive algo-rithm can be obtained from PAH by replacing the optimal tour with a 3/2-approximate tourcalculated using Christo�des' polynomial algorithm [4] for TSP on metric spaces. This algorithmis 3-competitive as can be proved with arguments similar to those of the previous proof.5 A 7/4-competitive algorithm on the lineBoth the greedy algorithm described at the beginning of the previous section and PAH can beapplied in the particular case in which the metric space is the real line. However, even on theline, none of these two algorithms achieves a ratio better than 2. In this section we present analgorithm whose competitive ratio is 7/4, which is fairly close to the lower bound presented insection 3 that has been achieved precisely on the real line. We call this algorithm PWT (forPlan-While-Traveling)PWT works in phases. The �rst phase starts with the �rst request, and each successivephase starts when a new request that is not on the currently scheduled tour and whose abscissa'sabsolute value is bigger than that of any other unserved request is presented.At the beginning of a phase, say at time t, PWT schedules the shortest route that, startingfrom the current position pPWT (t) of the server, serves all the unserved requests and goes back to6

the origin. Requests may be presented during the phase. Some of them may call for computationof a new tour, while others are ignored temporarily and served after the server has returned tothe origin.Let us �rst de�ne some auxiliary notation and de�nitions. At any moment in time we de�neR as the current route followed by PWT, i.e., the part of the most recently computed route thatis still to be traversed. We call greedy route the shortest route that starts at the current positionof the on-line server, serves all the unserved requests and goes back to the origin.During a phase, we refer to the long side as the half line from 0 on which the (furthest)request is located, whose presentation caused the start of the phase. The other side is thenreferred to as the short side.Let Q be the set of temporarily ignored requests. When a phase starts the set Q is empty.It contains only requests on the short side, and requests are removed from Q when served. Thecurrent route will consist in general of a greedy route concatenated with a tour that serves allthe requests in Q and goes back to the origin.PWT is described completely by its behavior at the moment a new request is presented, saytime t.1. If the new request is on the current route R then just proceed following R and serve therequest when it is passed; else2. If the new request is the furthest request from the origin among the requests not yet servedthen start a new phase, empty the set Q and let the current route be the greedy route;else3. If the new request is on the long side then empty the set Q and let the current route bethe greedy route; else4. If the new request is on the short side then insert it in Q and let the current route be theremainder of the last computed greedy route concatenated with the route that, startingat the origin, serves all the requests in Q and returns to the origin.The current route will consist in general of a greedy route concatenated with a tour thatserves all the requests in Q and goes back to the origin.Intuitively, to be 7/4-competitive it is su�cient to start following a shortest tour beforethe optimal algorithm leaves the furthest extreme towards the origin, after having visited therequests on the short side. It is with this goal that PWT temporarily ignores the requests onthe short side that are relatively close to the origin.Without loss of generality, we will suppose that the long side is the right side, and the shortside is the left side. Therefore, we will denote the requests on the long side by positive numbersand those on the short side by negative numbers. Let �x and X be respectively the leftmostand rightmost requests not yet served at the beginning of the current phase, so that X � x. Ifthere is no unserved request to the left of the origin then we set x = 0.Let �x0 and X 0 be respectively the leftmost and the rightmost points not yet served by PWTwhen the greedy route was computed for the last time (i.e. after the occurrence of cases 2 or 3of the algorithm), and let I = [�x0; X 0].Finally, let �Y and X be, respectively, the leftmost and the rightmost requests ever pre-sented.We state four lemmas preliminary to the competitiveness proof, that are trivial or almosttrivial to prove. 7

Lemma 5.1 The position of PWT is always inside the interval [�Y ;X ].Lemma 5.2 The distance to the origin of any request presented in a phase is at most X.Lemma 5.3 If a request leads to the occurrence of Case 3 then it is the rightmost request notyet served.Proof: Case 3 occurs if the request presented is on the right (long) side and it is not on thecurrent route. 2Lemma 5.4 If Case 3 occurs then the request is on the long side at position X 0, and x0 � X 0.Proof: When the new request at position X 0 is presented, by Lemma 5.3 it is the rightmostrequest not yet served. Therefore, as it does not initiate a new phase, the leftmost request notyet served has distance from the origin greater or equal than X 0. 2Theorem 5.5 PWT is 7/4-competitive.Proof: We prove the claim by showing that if the algorithm is 7/4-competitive before a newrequest is presented at time t, which is obviously true for t = 0, then the algorithm has thesame competitive ratio after it has taken any of the actions described upon presentation of thenew request. We prove it for each of the four cases that have been speci�ed. When the time tis clear from the context we abbreviate pPWT (t) with p.1. In the �rst case, the new request is on the current route and the route is not changed.Since ZPWT does not increase and the algorithm was 7/4 competitive before the requestis presented, the claim still holds.2. In the second case a new phase starts. Then the presented request is at position X . p cannot be to the right of X , otherwise X would have been on the current route. Two casesare distinguished:� p is within the interval I at time t. Since, the on-line algorithm follows the newlycomputed current route starting at time t from p, we have that ZOL � t+2x+2X . Forthe optimal algorithm it holds Z� � t+X because the request in X has been presentedat time t and after that the algorithm has to reach the origin. Also Z� � 2x + 2X .Thus, since x � X ,ZPWTZ� � t+ 2x+ 2XZ� = t +XZ� + 2x+XZ� � 1 + 2x+X2x+ 2X � 74 :� p is outside the interval I at time t. Then p must be to the left of �x. By Lemma 5.1jpj � Y . The time needed by PWT to serve all the requests is then ZPWT � t+jpj+2Xwhile for the optimal solution Z� � t+X and Z� � 2jpj+2X . Then, the ratio betweenthe on-line and the optimal solution isZPWTZ� � t + jpj+ 2XZ� = t +XZ� + jpj+XZ� � 1 + jpj+X2jpj+ 2X � 32 :8

3. X 0 is the position of the new request on the long side. By Lemma5.2 X 0 � X and x0 � X ;and by Lemma5.4 X 0 � x0. For the same reason as in case 2, if p is outside I then it mustbe to the left of �x0. Also in this case we consider two subcases:� p is within the interval I at time t. For the on-line algorithm we have ZPWT � t +2x0+2X 0, while for the optimal solution we have Z� � t+X 0 and Z� � 2x0+2X � 4x0.Hence the ratio isZPWTZ� � t + 2x0 + 2X 0Z� = t +X 0Z� + 2x0 +X 0Z� � 1 + 2x0 +X 02x0 + 2X � 1 + 3x04x0 = 74 :� p is outside the interval I , and hence to the left of �x0. By Lemma 5.1 jpj � Y . Thetime needed by the on-line algorithm to serve all the requests is therefore ZOL �t+ jpj+ 2X 0 while for the optimal solution Z� � t +X 0 and Z� � 2jpj+ 2X 0. Then,the ratio between the on-line and the optimal solution isZPWTZ� � t+ jpj+ 2X 0Z� = t+X 0Z� + jpj+X 0Z� � 1 + jpj+X 02jpj+ 2X 0 � 32 :4. Let �x00 be the position of the new request that is inserted in Q. Clearly the new requestis the leftmost request in Q since otherwise it falls inside the current route.We consider two subcases:� The optimal solution serves X 0 before �x00. Let t0 be the time at which the request inX 0 was presented, that is the time at which the current greedy route was computed.For the optimal solution we get Z� � t0 +X 0 + 2x00.Again, two subcases are distinguished, depending on the position pPWT (t0) of PWT'sserver at time t0, relative to the interval I = [�x0; X 0]:{ The on-line server was inside I at time t0. Then ZPWT � t0 + 2x0 + 2X 0 + 2x00while for the adversary Z� � 2x0 + 2X . In this case the ratio isZPWTZ� � t0 + 2x0 + 2X 0 + 2x00Z� = t0 +X 0 + 2x00Z� + 2x0 +X 0Z� � 1+ 2x0 +X 02x0 + 2X � 74 ;since either X 0 = X , in which case by Lemmas 5.2 and 5.4 x0 = x � X , orX 0 < X , which implies by Lemma 5.4 that X 0 � x0.{ PWT was outside I at time t0. Since the request in X 0 was not on the previ-ous route, PWT's server was to the left of �x0 at some position pPWT (t0). ByLemma 5.1, jpPWT (t0)j � jYj. This implies that ZPWT � t0+ jpPWT (t0)j+2X 0+2x00. On the other hand, Z� � 2jpPWT (t0)j+ 2X , and thenZPWTZ� � t0 + jpPWT (t0)j+ 2X 0 + 2x00Z� = t0 +X 0 + 2x00Z� + jpPWT (t0)j+X 0Z� �� 1 + jpPWT (t0)j+X 02jpPWT (t0)j+ 2X � 32 :� The optimal algorithm serves �x00 before X 0. Then, for the optimal solution we haveZ� � t + x00 + 2X 0. Again, two more subcases:9

{ PWT is within the interval I at time t. We consider two more subcases:� x0 < x00. Then ZPWT � t+ 2x0 + 2X 0 + 2x00 while for the adversary we haveZ� � 2x00 + 2X . In this case the ratio isZPWTZ� � t+ 2x0 + 2X 0+ 2x00Z� = t + 2X 0 + x00Z� +2x0 + x00Z� � 1+ 2x0 + x002x00 + 2X � 74 ;since by Lemma 5.2 x00 � X .� x0 � x00. Since the request in �x00 is not visited with the current route, theon-line server has already visited x0 at time t and p > �x00. Then, ZPWT <t + x00 + 2X 0 + 2x00 while for the optimal solution it holds Z� � 2x00 + 2X .The ratio isZPWTZ� � t+ x00 + 2X 0 + 2x00Z� = t + 2X 0 + x00Z� + 2x00Z� � 1+ 2x002x00 + 2X � 3=2;since x0 � X .{ PWT is outside the interval I at time t. This can happen either because i) it isto the right of X 0 or ii) it is to the left of �x0. We �rst show that i) is impossible:if PWT had been to the right of X 0 when X 0 was presented, then that requestwould have not produced the re-computation of a greedy route, and if PWT wasto the left of X 0 at that moment, then it had no reason to go to the right of it.It remains to show what happens in case ii). p can not be also to the left of �x00because in that case �x00 would be on the current route, and therefore we havethat x0 < x00 and p is inside the interval [�x00;�x0]. For the optimal solution itholds Z� � t+ x00+ 2X 0 and Z� � 2x00+ 2X , while ZPWT � t+ x00+ 2X 0+ 2x00.Then ZPWTZ� � t+ x00 + 2X 0 + 2x00Z� = t+ 2X 0 + x00Z� + 2x00Z� � 32 ;since, by Lemma 5.2, x00 � X . 2The competitive ratio of 7=4 is tight for PWT. This is proved by providing a sequence thatachieves the ratio indeed. At time 1 two requests are presented in +1 and �1. PWT is at theorigin until time 1, when it starts a greedy tour that without loss of generality serves +1 at time2, �1 at time 4 and returns at the origin at time 5. At time 3, when the on-line server crossesthe origin, a new request is presented at position 1 + �. This new request starts a new phasesince it is the furthest request not yet served. Then a new greedy route is computed that startsfrom the origin at time 3, serves the two requests in �1 and 1 + � and goes back to the originat time 7 + 2 �. For the optimal, it serves �1 at time 1, +1 at time 3, 1 + � at time 3 + � andreturns to the origin at time 4 + 2�. Making � arbitrarily small, the ratio is arbitrarily close to7=4.6 Conclusions and open problemsThe obvious open problem is to close the gaps between lower and upper bounds. It would bealso interesting to study other particular metric spaces (such as trees, cycles, half-lines, etc.) tosee if better bounds can be obtained (as we did for the real line).10

All our lower and upper bounds hold also if we change the problem by allowing a release timedi�erent from the time in which the request is presented. Then the i-th request is speci�ed bya triple < ti; pi; ri >, and the relation ti � ri holds for every i, with the meaning that requestsmay be presented at any moment not later than their release times. In that case our algorithmswill simply ignore the requests till their release times arrive, obtaining the same upper bounds.An interesting extension of OLTSP is to the case in which more than one server are used.In that case, it is easy to obtain a 2.5 competitive ratio, but improvements should be possible.References[1] M. Atallah and S. Kosaraju, \E�cient solutions for some transportation problems withapplication to minimizing robot arm travel", SIAM J. on Computing, 17 (1988), pp. 849-869.[2] G. Ausiello, E. Feuerstein, S. Leonardi, L. Stougie, M. Talamo, \Serving requests withon-line routing", Proc. of the 4th Scandinavian Workshop on Algorithm Theory, LNCS824.[3] R. El-Yaniv, A. Fiat, R.M. Karp and G. Turpin, \Competitive analysis of �nancial games",Proc. 33rd Annual Symposium on Foundations of Computer Science (1992), pp. 327-333.[4] M. Garey, and D. Johnson, Computers and intractability: a guide to the theory of NP-completeness, Freeman, San Francisco (1979).[5] Y. Karuno, H. Nagamochi and T. Ibaraki, \Vehicle scheduling on a tree with release timesand handling times", Proc. 4th. International Symposium on Algorithms and ComputationISAAC'93, LNCS 762 (1993), Springer-Verlag, pp. 486-495.[6] B. Kalyanasundaram and K.R. Pruhs, \Constructing competitive tours from local infor-mation", Proc. 20th International Colloquium on Automata, Languages and Programming,LNCS 700 (1993), Springer-Verlag.[7] M. Manasse, L.A. McGeoch and D. Sleator, \Competitive algorithms for server problems",Journal of Algorithms 11 (1990), pp. 208-230.[8] H. Psaraftis, M. Solomon, T. Magnanti and T. Kim, \Routing and scheduling on a shore-line with release times", Management Science 36-2 (1990), pp. 212-223.[9] D.B. Shmoys, J. Wein, D.P. Williamson, \Scheduling parallel machines on-line", Proc. ofthe 32nd Annual Symposium on Foundations of Computer Science, 1991.[10] D. Sleator, R. Tarjan, \Amortized e�ciency of list update and paging algorithms", Comm.ACM 28 (1985), pp. 202-208.[11] D. Sleator, R. Tarjan, \Self-adjusting binary search trees", Journal of the ACM, 32 (1985),pp. 652-686.[12] M. Solomon, \Algorithms for the vehicle routing and scheduling problem with time windowconstraints", Operations Research, 35-2 (1987), pp. 254-265.[13] M. Solomon and J. Desrosiers, \Time window constrained routing and scheduling prob-lems: a survey", Transportation Science, 22 (1988), pp. 1-13.11