Locating a service facility and a rapid transit line
Abstract
In this paper we study a facility location problem in the plane in which a single point (facility) and a rapid transit line (highway) are simultaneously located in order to minimize the total travel time of the clients to the facility, using the or Manhattan metric. The rapid transit line is represented by a line segment with fixed length and arbitrary orientation. The highway is an alternative transportation system that can be used by the clients to reduce their travel time to the facility. This problem was introduced by Espejo and RodríguezChía in [8]. They gave both a characterization of the optimal solutions and an algorithm running in time, where represents the number of clients. In this paper we show that Espejo and RodríguezChía’s algorithm does not always work correctly. At the same time, we provide a proper characterization of the solutions and give an algorithm solving the problem in time.
Keywords: Geometric optimization; Facility location; Transportation; Time distance.
1 Introduction
Suppose that we have a set of clients represented as a set of points in the plane, and a service facility represented as a point to which all clients have to move. Every client can reach the facility directly or by using an alternative rapid transit line or highway, represented by a straight line segment of fixed length and arbitrary orientation, in order to reduce the travel time. Whenever a client moves directly to the facility, it moves at unit speed and the distance traveled is the Manhattan or distance to the facility. In the case where a client uses the highway, it travels the distance at unit speed to one endpoint of the highway, traverses the entire highway with a speed greater than one, and finally travels the distance from the other endpoint to the facility at unit speed. All clients traverse the highway at the same speed. Given the set of points representing the clients, the facility location problem consists in determining at the same time the facility point and the highway in order to minimize the total weighted travel time from the clients to the facility. The weighted travel time of a client is its travel time multiplied by a weight representing the intensity of its demand. This problem was introduced by Espejo and RodríguezChía [8]. We refer to [8] and references therein to review both the state of the art and applications of this problem.
Geometric problems related to transportation networks have been recently considered in computational geometry. Abellanas et. al. introduced the time metric model in [1]: Given an underlying metric, the user can travel at speed when moving along a highway or unit speed elsewhere. The particular case in which the underlying metric is the metric and all highways are axisparallel segments of the same speed, is called the city metric [3]. The optimal positioning of transportation systems that minimize the maximum travel time among a set of points has been investigated in detail in recent papers [2, 6, 4]. Other more general models are studied in [9]. The variant introduced by Espejo and RodríguezChía aims to minimize the sum of the travel times (transportation cost) from the demand points to the new facility service, which has to be located simultaneously with a highway. The highway is used by a demand point whenever it saves time to reach the facility.
Notation to formulate the problem is as follows. Let be the set of client points; the service facility point; the highway; the length of ; and the endpoints of ; and the speed in which the points move along . Let be the weight (or demand) of a client point . Given a point of the plane, let and denote the  and coordinates of respectively. The distance or travel time (see Figure 1), between a point and the service facility is given by the function
Then the problem can be formulated as follows:
The Facility and Highway Location problem (FHLproblem): Given a set of points, a weight associated with each point of , a fixed highway length , and a fixed speed , locate a point (facility) and a line segment (highway) of length with endpoints and such that the function is minimized.
Espejo and RodríguezChía [8] studied the FHLproblem and gave the following characterization of the solutions. Consider the grid defined by the set of all axisparallel lines passing through the elements of . They stated that there always exists an optimal highway having one endpoint at a vertex of . Based on this, they proposed an time algorithm to solve the problem. In this paper we show that the characterization given by Espejo and RodríguezChía is not true in general, hence their algorithm does not always give the optimal solution.
Addendum
An anonymous referee pointed out that the authors of [8] published a corrigendum to their paper the 19th of January 2012, and that our result was not novel. In here we provide a chronological order of the events so that the reader can reach his/her own conclusions. The first version of this paper appeared the 5th of April 2011 on arXiv (and a preliminary version also appeared in the proceedings of the Spanish Meeting on Computational Geometry the 27th of June 2011). We contacted the authors of [8], and provided them with a copy of our paper, including the counterexample. Naturally, they were interested in our research, and wanted to know where had they done a mistake. The 29th of October 2011, the authors of [8] contacted us claiming that they had found the error in their paper. They provided us a writeup containing the corrected version of their proof, and suggested we combine our results. Given the difference in notation and the fact that this paper subsumes their result, we declined. From the conversation we can only deduce that the authors of [8] submitted their corrigendum sometime in early November 2011.
As of now (16th March 2012), our paper is currently under supervision for journal publication, whereas the corrigendum has already appeared at COR. Although we would love if the submission, correction and publication process takes less than three months (as it appears to have happened with corrigendum at Computers and Operations Research journal), we understand that this is not possible in highend journals. Regardless of our personal opinion of the actions of Espejo and RodriguezChia, we believe that the date in which the result was found (and not published in a journal) is the relevant one. Thus, we claim that our paper is the first one to claim the error of [8].
On a side note, we note that the corrigendum of Espejo and RodriguezChia is also wrong, since they claim that our characterization is weaker. They specifically say that “The description given by [this paper] means an infinite many number of candidates to be one of the endpoints of an optimal segment”. Although Lemma 2.1 does not explicitly say so, the algorithm of Section 3 only considers cases (in particular a finite amount).
Paper Organization
In Section 2 we first provide a proper characterization of the solutions. After that we give a counterexample to the Espejo and RodríguezChía’s characterization. We provide a set of five points, all having weight equal to one, and prove that no optimal highway has one endpoint in a vertex of . In Section 3 we present an improved algorithm running in time that correctly solves the FHLproblem. Finally, in Section 5, we state our conclusions and proposal for further research.
2 Properties of an optimal solution
A primary observation (also stated in [8]) is that the service facility can be located at one of the endpoints of the rapid transit line. From now on, we assume throughout the paper. This assumption simplifies the distance from a point to the facility to the following expression,
Using this observation, the expression of our objective function to minimize is . We call this value the total transportation cost associated with and (or simply the cost of and ).
We say that a point uses the highway if , and that does not use it (or goes directly to the facility) otherwise. Given and , we call travel bisector of and (or bisector for short) as the set of points such that , see Figure 2. A geometrical description of such a bisector can be found in [8], as the boundary of the socalled captation region.
Lemma 2.1
There exists an optimal solution to the FHLproblem satisfying one of the next conditions:

One of the endpoints of the highway is a vertex of .

One endpoint of the highway is on a horizontal line of , and the other endpoint is on a vertical line of .
Proof.
Let and be the endpoints of an optimal highway and assume neither of conditions and is satisfied. Using local perturbation we will transform this solution into one that satisfies one of these conditions. Assume neither nor is on any vertical line of . Let (resp. ) be the smallest value such that if we translate with vector (resp. ) then either one endpoint of touches a vertical line of or a demand point hits the bisector of and . Given , let , , and be , , and translated with vector , respectively. It is easy to see that for all points . Given a real number , let denote the sign of . We partition into three sets , and as follows:
Observe that points of are in the bisector of and ; contains the demand points that travel rightwards to reach directly or by using the highway, and contains the points that travel leftwards.
Theoretically, one could consider the case in which a point belongs to set . Geometrically speaking, the points of this set are those that, when translating the highway in either directions, the distance between them and the entry point of the highway increases. This situation can only happen when the point is aligned with the entry point. That is, point if and only if either uses the highway to reach the facility and it is vertically aligned with , or walks to the facility and it is vertically aligned with . However, by definition of and , no point of can belong to (or enter) during the whole translation.
By the linearity of the metric, whenever we translate the highway units to the right (for some arbitrarily small , ), the highway will be units closer for points in , but units further away for points of . Analogously, the distance to the facility decreases for points in and increases for points of when translating leftwards. Let and . Thus, for any vector , , the change of the objective function when we translate the highway with vector is equal to the following expression:
Since we initially assumed that the location of is optimal, we must have both (otherwise translating rightwards or leftwards would result in a decrease of the objective fuction). In particular, we can translate in either direction so that the cost of the objective function is unchanged.
More importantly, observe that the value of must remain on the whole translation: if at some point it becomes positive we can find a translation from that point that reduces the cost of the objective function. In particular, the set must remain empty during the whole translation. Any point that changes from set to (or vice versa) must first enter . Since the latter set remains empty during the whole translation, no point can change between sets , or until either or is vertically aligned with a point of .
We perform the same operations on the coordinates and obtain that one of the two endpoints is on a horizontal line of , hence satisfying one of the two conditions of the Lemma. ∎
When the highway’s length is equal to zero, the FHLproblem is the weighted 1median problem in metric [7], and in this case the item (a) of Lemma 2.1 holds. Espejo and RodríguezChía [8] claimed that there always exists an optimal solution of the FHLproblem that satisfies Lemma 2.1 (a). Unfortunately, this claim is not true in general and their algorithm may miss some highway locations; indeed, it may miss the optimal location and thus fail. We provide here one counterexample and the following result.
Lemma 2.2
There exists a set of unweighted points in which no optimal solution to the FHLproblem satisfies Lemma 2.1 (a).
Proof.
Consider the problem instance with five points whose coordinates are , , , , and , respectively (see Figure 3). In the problem instance, we give unit weight to all points, and set the length of the highway as . For simplicity in the calculations, we also set , but any other large number works as well. The cost associated to the highway of endpoints and is . We claim that this location is better than any other solution with an endpoint at a vertex of .
If one endpoint of is a vertex of in the line , then the other endpoint is located to the left of the line because . In that case we can translate rightwards with vector improving the objective function. The same holds if one endpoint of is a vertex in the line . Similarly, if one endpoint is a vertex in the line , then we can translate leftwards with vector and the objective function decreases.
Consider now locating one of the highway endpoints at coordinates or . Observe that the walking time (i.e., the traveling time when the highway is not used) from the points and takes at least units of time, which is more than the cost associated with our solution. The same happens to the sum of the traveling times of the three other points. Hence, if is located at one of the two vertices, the five points must use highway (otherwise the travel time is higher than our solution). Analogously, if is located at grid points or , no point of will use the highway. In either case, the corresponding solution is at least as high as the sum of distances from all points of to the geometric median, which is higher than the cost associated with our solution.
Consider now the cases in which one of the endpoints has coordinates for some . We start by showing that, in any of the three cases, the optimal position of the other endpoint of the highway (denoted by ) must lie on the line . Since the highway’s length is equal to , the possible positions of lie both in circle of radius centered at and to the left of line . Observe that the clients that walk to are points and , located always to the left of . Hence, we are interested in minimizing the expression . Let denote respectively the closest points to and with the metric, which verify and . Observe that if then and implying
(see Figure 4 a)). Similarly, if , then
Therefore, must satisfy (see Figure 4 b)). In this case we have
Then is minimized when is minimum, and it happens when .
If , then can be translated downwards with vector and the value of the objective function decreases. Thus point is discarded. It remains to show that there is a solution better than the one having an endpoint at either or , and the other endpoint on the line . Observe that if and belong to the lines and , respectively, then by exchanging and the value of the objective function reduces in . Then consider the case where and .
Let and . Given a value , let be the point with coordinates and be the point in the line such that and the Euclidean distance between and is equal to (see Figure 5). Let , , be the maximallength interval such that for all . Note and . Then .
The variation of the objective function’s value when and are moved to and , respectively, is equal to
In the following we will show that , for all . In particular, we will have (except when ), implying that our highway location is optimal. First observe that . Since then and , which implies . Thus and the highway with endpoints and gives a better solution than that having an endpoint at or . This completes the proof. ∎
In the next section we provide a correct algorithm that solves the problem in time. We assume general position, that is, there are no two points on a same line having slope in the set .
3 The algorithm
Lemma 2.1 can be used to find an optimal solution to the FHLproblem. Although the method is quite similar for both cases in Lemma 2.1, we address the two cases independently for the sake of clarity. By VertexFHLproblem we will denote the FHLproblem for the cases in which Lemma 2.1 a) holds, and by EdgeFHLproblem the FHLproblem for the cases in which Lemma 2.1 b) holds. In the next subsections we give an time algorithm for each variant of the problem. In both of them we assume w.l.o.g. that highway’s length is equal to one.
In the following will denote the positive angle of the highway with respect to the positive direction of the axis. For the sake of clarity, we will assume that . When belongs to the interval , , both the Vertex and EdgeFHLproblem can be solved in a similar way.
Given a point and an angle , let be the point with coordinates . There exists an angle such that the bisector of the endpoints and has the shape in Figure 2 a) for all , and has the shape in Figure 2 b) for all . Such an angle verifies . Furthermore, and unless is infinite. Refer to [8] for a detailed description of this situation.
Let , , and denote the point set sorted according to the , , and order, respectively.
3.1 Solving the VertexFHLproblem
For each vertex of we can solve the problem subject to or . We show how to obtain a solution if . The case where can be solved analogously.
Suppose w.l.o.g. that the vertex is the origin of the coordinate system and the highway angle is , for . Then . and the distance between a point and the facility has the expression , where are constants satisfying . When goes from to , this expression changes at the values of such that:

The point switches from using the highway to going directly to the facility (or vice versa). We call these changes bisector events. A bisector event occurs when the bisector between the highway’s endpoints and , contains . At most two bisector events are obtained for each point .

The highway endpoint crosses the vertical or horizontal line passing through . We call this event grid event. Again, each point of generates at most two grid events.

. We call it the event.
We refer the interested reader to [8] for a detailed description of the above events^{1}^{1}1Although their events are very similar to the ones we described, the authors of [8] refer to them as projection and limit points. We prefer to use the term “event”, since “point” is reserved for the elements of . The cost of their algorithm is dominated by the time spent sorting the order in which events take place. In order to avoid this time, we use the following result:
Lemma 3.1
After an time preprocessing, the angular order of all the events associated with a given vertex of can be obtained in linear time.
Proof.
The preprocessing consists in computing , , and , which can be done in time. Now, let be a vertex of . It is straightforward to see that they are grid events and that we can obtain their angular order in linear time by using both and . Let us show how to obtain the bisector events in time.
The bisector of and consists of two axisaligned halflines and a line segment with slope 1 connecting their endpoints (see Figure 2 and [8] for further details). Given a point , when goes from to the bisector between and passes through at most twice, that is, when belongs to one of the halflines of the bisector and when belongs to the line segment. If belongs to the line segment of the bisector then the event is denoted by (see Figure 6 b)). If belongs to the leftmost halfline of the bisector, which is always vertical, we denote that event by (see Figure 6 a)). Otherwise, if belongs to the rightmost halfline which can be either vertical or horizontal we denote that event by (see Figure 6 c) and d)). Observe that if the rightmost halfline is vertical then , otherwise . Refer to [8] for a characterization to identify whether a point generates a bisector event for some angle .
Let be the subsequence of containing all elements such that , be the subsequence of containing all elements such that , and be the subsequence of that contains all elements such that and , concatenated with the subsequence of that contains all elements such that and . Given a point , the corresponding events of in can be found in constant time, thus , , and can be built in linear time.
The following statements are true for any point :

for all points in .

for all points in .

for all points in such that .

for all points in such that .
Let (resp. , ) be the sequence obtained by replacing each element in (resp. , ) by (resp. , ). Therefore, from statements and the monotonicity of the functions , , and in the interval , we obtain that , , and are sorted sequences. Using a standard method for merging sorted lists, we can merge in linear time , , , the grid events, and the event. Therefore, the angular order of all events associated with a vertex can be obtained in time and the result follows. ∎
Theorem 3.2
The VertexFHLproblem can be solved in time.
Proof.
Let be a vertex of . Using Lemma 3.1, we obtain in linear time the angular order of the events associated with . The events induce a partition of into maximal intervals. For each of those intervals, the objective function takes the form , where are constants. This problem is of constant size in each subinterval and the minimum of can be found in time. Furthermore, the expression of can be updated in constant time when crosses an event point distinct of when going from to . In the case where crosses , can be updated in at most time. Then the problem subject to can be solved in linear time. The case in which can be addressed in a similar way. It gives an overall time complexity because has vertices. ∎
3.2 Solving the EdgeFHLproblem
We now consider the case in which the optimal solution satisfies condition b) of Lemma 2.1. Namely, we consider a horizontal line of and each vertical line of . For every pair of such lines, we consider eight different subcases, depending on whether is located above/below , rightwards/leftwards of , and and (or vice versa). For a fixed subcase, we parametrize the location of the highway by the angle that the highway forms with . As in the VertexFHL case, we assume that , , and .
We implicitly redefine the coordinate system so that and intersect at the origin . Let be the positive angle of the highway with respect to the positive direction of the axis and , be the highway endpoints, see Figure 7.
First notice that, since we are again doing a continuous translation of , the events that affect the value of the objective function are exactly the same as those that happen in the VertexFHLproblem: bisector, grid and  events. We start by showing that the equivalent of Lemma 3.1 also holds:
Lemma 3.3
After an time preprocessing, the angular order of all the events associated with a pair of perpendicular lines of can be obtained in linear time.
Proof.
We can follow the arguments of Lemma 3.1. Firstly, we note that there are grid events and their angular order can be obtained in linear time by using both and .
Given a point , let the events , , and be defined as in the VertexFHL case. Refer to Figure 6. Let be the subsequence of containing all elements such that , be the subsequence of containing all elements such that , and be the subsequence of that contains all elements such that and , concatenated with the subsequence of that contains all elements such that and . Note that , , and can be built in linear time.
Given a point , the following statements are true:

for all points in .

for all points in .

for all points in such that .

for all points in such that .
Let (resp. , ) be the sequence obtained by replacing each element in (resp. , ) by (resp. , ). Therefore, by using similar arguments to those used in Lemma 3.1 the angular order of all events can be obtained in time, once the lists , and have been precomputed. ∎
Consider now a small interval in which no event occurs. Observe that, after the coordinate system redefinition, we have , and . Let be a point that uses the highway to reach the facility; since only the coordinate of changes, its distance to can be expressed as for some . Analogously, if walks to , its distance is of the form for some . That is, the distance between a point of and in any interval is of the form for some constants and .
Theorem 3.4
The EdgeFHLproblem can be solved in time.
Proof.
We can use a method similar to the one used in the VertexFHLproblem. Let be a horizontal line of and be a vertical line of .
Using Lemma 3.3, we obtain in linear time the angular order of the events associated with and . The events induce a partition of into maximal intervals. For each of those intervals the objective function has the form , where , and are constants. This problem has constant size, hence the minimum of can be found in time. Furthermore, the expression of can be updated in constant time when crosses an event point distinct of when it goes from to . In the case where crosses , can be updated in at most time. Then the problem subject to and can be solved in linear time. It gives an overall time complexity because has pairs consisting of a horizontal and a vertical line. ∎
4 Experimental results
Similar to [8], we explore examples of solutions to the FHLproblem for different values of the length of the line segment. The problem instance is given by the unweighted points with coordinates , , , , and as in Lemma 2.2 and we consider locating a highway for different values of length and speed. Given a fixed value of speed, say , Figure 8 shows the location of the optimal highways for some values of . Note that the case is the FermatWeber problem for the metric. The highway’s length and the associated total transportation cost for each of these solutions can be seen in Table 1. The optimal solution for each of the cases (and its associated cost) has been obtained with the help of a computer.
Observe that, for some values of , the optimal solution satisfies condition of Lemma 2.1, but in other situations condition is satisfied instead (see Figure 8 d), where the highway’s length has been set to ). Experimentally we observed that increasing the highway’s length decreases the total transportation cost until , in which a total cost of is obtained (see Figure 8 e)). Afterwards the cost gradually increases until we locate a highway so long that no point of uses it to reach . We also note that for this demand point set the highway’s speed has a small impact on the optimal solution. Indeed, increasing the highway’s speed changes the total cost but the location of the highway in the above instance is unaffected by the highway’s speed (provided that ). The fourth column in Table 1 gives the small variation of the total cost with respect to the speed. This suggests the following open problem: given an instance of the FHLproblem, can we efficiently compute the highway’s length that minimizes the total transportation cost?
Figure 8  Cost  Ratio  

a)  0    49  1 
b)  1  2  46  0.93 
4  45.5  0.92  
45  0.91  
c)  7.07  2  34.07  0.7 
4  30.54  0.62  
27  0.55  
d)  13.41  2  27.41  0.56 
4  20.71  0.42  
14  0.29  
e)  16.55  2  9  0.18 
4  8.5  0.17  
8  0.16 
5 Concluding remarks
As further research, it would be worth studying the same problem in other metrics or using different optimization criteria. Another interesting variant would be to consider the problem when the length of the highway is not given in advance and it is a variable in the problem. Additionally, we could consider a similar distance model in which the clients can enter and exit the highway at any point (called freeway in [5]).
Motivated from the experimental results of Section 4, we can deduce that the highway’s length has a strong impact on the optimal solution. As one would expect, when the highway’s length is small, the total cost barely changes. We obtain a similar effect when the highway to locate is very long, since traveling to the opposite endpoint takes more time than walking directly to the facility. Hence, it would be interesting to consider a variation of the problem in which we can also adjust the highway’s length. Specially, one would like to find a balance between the cost of constructing a longer highway and the improvement in the total transportation cost.
References
 [1] M. Abellanas, F. Hurtado, C. Icking, R. Klein, E. Langetepe, L. Ma, B. Palop, and V. Sacristán. Voronoi diagram for services neighboring a highway. Information Processing Letters, 86:283–288, 2003.
 [2] H.K. Ahn, H. Alt, T. Asano, S. W. Bae, P. Brass, O. Cheong, C. Knauer, H.S. Na, C.S. Shin, and A. Wolff. Constructing optimal highways. In Proceedings of the 13th Computing: The Australasian Theory Symposium (CATS’07), pages 7–14, 2007.
 [3] O. Aichholzer, F. Aurenhammer, and B. Palop. Quickest paths, straight skeletons, and the city Voronoi diagram. Discrete & Computational Geometry, 31:17–35, 2004.
 [4] G. Aloupis, J. Cardinal, S. Collette, F. Hurtado, S. Langerman, J. O’Rourke, and B. Palop. Highway hull revisited. Computational Geometry: Theory and Applications, 43:115–130, 2010.
 [5] S. W. Bae, M. Korman, and T. Tokuyama. All farthest neighbors in the presence of highways and obstacles. In Proceedings of the 3rd International Workshop on Algorithms and Computation (WALCOM’09), LNCS, pages 71–82, 2009.
 [6] J. Cardinal, S. Collette, F. Hurtado, S. Langerman, and B. Palop. Optimal location of transportation devices. Computational Geometry: Theory and Applications, 41:219–229, 2008.
 [7] R. Durier and C. Michelot. Geometrical properties of the fermatweber problem. European Journal of Operational Research, 20(3):332–343, 1985.
 [8] I. Espejo and A. M. RodríguezChía. Simultaneous location of a service facility and a rapid transit line. Computers and Operations Research, 38:525–538, February 2011.
 [9] M. Korman and T. Tokuyama. Optimal insertion of a segment highway in a city metric. In Proceedings of the 14th international conference on Computing and Combinatorics (COCOON’08), LNCS, pages 611–620, 2008.