The Inverse 1-Median Problem on Tree Networks with Variable Real Edge

Location problems exist in the real world and they mainly deal with finding optimal locations for facilities in a network, such as net servers, hospitals, and shopping centers. The inverse location problem is also often met in practice and has been intensively investigated in the literature. As a typical inverse location problem, the inverse 1-median problem on tree networks with variable real edge lengths is discussed in this paper, which is to modify the edge lengths at minimum total cost such that a given vertex becomes a 1-median of the tree network with respect to the new edge lengths. First, this problem is shown to be solvable in linear time with variable nonnegative edge lengths. For the case when negative edge lengths are allowable, the NP-hardness is proved under Hamming distance, and strongly polynomial time algorithms are presented under l 1 and l ∞ norms, respectively.


Introduction
Location problems have found important applications in operations research, computer science, and logistics management.The -median problem is a typical location problem and has been intensively considered in the literature.The -median problem on an undirected graph is to locate  facilities on edges or vertices of the graph such that the sum of the weighted distances of the vertices to the closest facility is minimized.This problem possesses the vertex optimality property which asserts that there exists an optimal solution such that all facilities are located at the vertices of the graph.Kariv and Hakimi [1] showed that the -median problem is NP-hard even if the graph  is a planar graph of maximum degree 3. Therefore, many investigations are dedicated to special graph classes which allow a more efficient algorithm.In the case of tree networks, the 1-median problem is solvable in linear time by Hua [2] and Goldman [3].
However, in an established network, the locations of facilities have already been fixed.The changing environment might make the existing facilities deviate from the median places of the network.Instead of finding optimal locations, the task is to modify parameters at minimum cost such that the prespecified locations become optimal.This arises what we call the inverse -median problem.In recent years, inverse -median problem found an increasing interest [4][5][6][7][8].
Burkard et al. [9] considered inverse -median problems with variable vertex weights and showed that discrete inverse -median problems with real weights can be solved in polynomial time, if  is fixed and not an input parameter.Burkard et al. [9,10] investigated the inverse 1-median problem with variable vertex weights and showed that the problem is solvable by a greedy-type algorithm in ( log ) time if the underlying network is a tree or the location problem is defined in the plane (if the distances between the points are measured in the Manhattan or maximum metric) and in ( 2 ) time on cycles.The inverse Fermat-Weber problem was studied by Burkard et al. [11].They derived a combinatorial approach which solves the problem in ( log ) time for unit cost and under the assumption that the prespecified point that should become a 1-median does not coincide with a given point in the plane.Galavii [12] proposed linear time algorithms for the inverse 1-median problem with variable vertex weights on trees (with nonnegative weights) and on paths (with negative weights while the weights of endpoints are arbitrary).Under weighted Hamming distance, Guan and Zhang [13] presented polynomial time algorithm for the inverse 1-median problem with variable vertex weights on trees.Bonab et al. [14] showed that the inverse -median problem with variable edge lengths is strongly NP-hard on general graphs and weakly NP-hard on series-parallel graphs.In [14], the authors also presented a polynomial time algorithm for the inverse 2-median problem with positive variable edge lengths on trees and a linear time algorithm for the special case of star graphs.In this paper, we first provide a linear time algorithm to solve the inverse 1-median problem on tree networks with variable nonnegative edge lengths.For the case when negative edge lengths are allowable, we show that this problem is NP-hard under Hamming distance and we propose strongly polynomial time algorithms under  1 and  ∞ norms, respectively.
The paper is organized as follows.In Section 2, we define the inverse 1-median problem on trees with variable edge lengths, then we show some properties of this problem.Based on these properties, a linear time algorithm for variable nonnegative edge lengths is presented; when negative edge lengths are allowable, the NP-hardness of the problem under Hamming distance is proved and the strongly polynomial time algorithms of the problem under  1 and  ∞ norms are proposed in Section 3. Some final remarks are given in Section 4.

Preliminaries
Let  = (, ) be an undirected tree graph with vertex set  = {V 1 , . . ., V  } and edge set  with || =  − 1.The weight of a vertex V ∈  is denoted by  V ≥ 0, and the length of each edge  ∈  is denoted by   > 0. The 1-median problem on trees is to locate a facility on  such that the sum of the weighted distances of the vertices to this facility is minimized.
Let () :   →  be a criterion function (having length vectors as argument) such that (0) = 0 and () ≤ () if  ≤ .(For ,  ∈   ,  ≤  means that   ≤   , for all  ∈ .) Suppose that the unique path from  ∈  to  ∈  is denoted by (, ).Let V 0 be a specific vertex in .Denote the adjusted edge length vector by .Let   (, ) denote the length of (, ) with respect to .The lower bound of   is denoted by   ≤ 0 for each  ∈ .Readers can refer to [15] for other graph theory terms not defined here.The inverse 1-median problem on tree networks with variable real edge lengths can be formally described as follows: min  (| − |) If we delete an edge  from , the tree  will be partitioned into two subtrees, one of which containing the prespecified vertex V 0 is denoted by    = ( and the first constraint of ( 1) can be changed to So, we can simplify (1) as min  (| − |) For any V  ∈  \ {V 0 }, without loss of generality, suppose the sequence of vertices and edges in (5) Therefore, Then, for  = 1, 2, . . ., , by (2), we have According to (7), we further obtain the following two formulas: From the above analysis, we have the following.
Proof.By contradiction.If    > 0, then from (9) we have Based on the above properties, we will present some algorithms of the problem under different norms and analyses their complexities in the next section.

The Problem with Variable Nonnegative Edge Lengths (I1MT-N).
In this section, we consider the following problem: I1MT-N.When   = 0 for each  ∈ , we call (4) Problem I1MT-N, which is the inverse 1-median problem on trees with variable nonnegative edge lengths.
Denote the optimal solution of Problem I1MT-N by  * .We present Algorithm 2 to solve this problem.particulary, Algorithm 2 can solve Problem I1MT-N under all kinds of norms only by edge length reduction.
Theorem 3. Algorithm 2 correctly finds the optimal solution  * of Problem I1MT-N in linear time.
Proof.First, we show that  * obtained by Algorithm 2 is a feasible solution of Problem I1MT-N.It is clear that  *  = 0 or  *  =   ; so it satisfies  *  ≥ 0 for each  ∈ .For each vertex V ∈  \ {V 0 } and  ∈ (V 0 , V), from Step 2 of Algorithm 2, when   > 0,  *  = 0; and when Suppose  * is not the optimal solution of Problem I1MT-N and suppose that the optimal solution is   .Then under   there exists at least one edge  ∈  satisfying one of the following two cases: By (9),    ≥   > 0 for  = 1, . . .,  − 1.Notice that    ≥ 0 for each  ∈ .We have ∑  =1        > 0, which contradicts the feasibility of   .
Case 2 (  ≤ 0 and    ≥ 0,    ̸ =   ).We define a new vector   ∈   such that From the result of Case 1, we know that when   > 0,    =    = 0.And it is easy to see that    ≥ 0 for each  ∈ .Then, we have The main computation of Algorithm 2 is to compute   for each edge  ∈ , then to modify the corresponding edge length of  according to   from Step 2. Notice that where ∑ V∈  V is a constant.Let V 0 be the root vertex and conduct the breadth-first method to .We can compute   iteratively from the edges incident with the leaves at the bottom layer up to V 0 in the rooted tree.So Problem I1MT-N can be solved in (||) time by using Algorithm 2.
From Algorithm 2, we know that for Problem I1MT-N it is not necessary to increase the edge lengths of the tree network.So to solve Problem I1MT-N is equivalent to solving the following program: min  ( − )

The Model Under 𝑙 1 Norm with Variable Real Edge
Lengths (I1MT-R- 1 ).In this section, we consider the following inverse 1-median problem on trees with variable real edge lengths under  1 norm when edge length increase is forbidden.
I1MT-R- 1 .When   < 0 for each  ∈  and the criterion function () :   →  is a function such that () = , where  is the cost vector and   > 0 is the cost of decreasing   by one unit for each  ∈ , we call (4) Problem I1MT-R- 1 , which is the inverse 1-median problem on trees with variable real edge lengths under  1 norm.
Problem I1MT-R- 1 can be formally described as follows: For a path , and therefore ( −   ) < ( −  opt ), a contradiction to the fact that  opt is the optimal solution of Problem I1MT-R- 1 .This completes the proof.
From Theorem 4, we only need to determine the optimal adjusted edge lengths  opt  with   > 0. We construct the subtree   = (  ,   ) of  with   = { |   > 0,  ∈ },   = [  ], and   = (  ).Clearly, V 0 ∈   .Regard   as a directed tree with the orientation from the root V 0 to all leaves (e.g., by conducting the breadth-first method).For each V ∈   , let (V) denote the path from V 0 to V on the tree   .We can simplify (13) as In [16,17], the authors considered the shortest path improvement problem, which is how to shorten the lengths of edges with as less cost as possible such that the distances between specified sources and terminals are reduced to the required bounds.It is not difficult to see that ( 14) is in fact a shortest path improvement problem for tree networks with single source V 0 and the required bound 0 under  1 norm.Let   =   (  −   ) ≥ 0,   =   (  −   ) > 0, and   =   /  > 0 for each  ∈   .Let  V = ∑ ∈(V)     > 0 for each V ∈   .Equation ( 14) can be formulated as the following linear program: Equation ( 15) is a combinatorial linear program and can be solved by a strongly polynomial time algorithm [18].Moreover, (15) can be solved much faster [16,17].In [16], the authors presented a steepest descent-type combinatorial algorithm to solve this problem, which runs in (|| 2 ) time.
In [17], the authors formulated the dual problem of (15) as a minimum cost flow problem on a two-terminal serialparallel graph and then gave an algorithm to obtain the primal optimal solution of ( 15), with the whole procedure running in (|| log ||) time.
From the above analysis, we have the following theorem.

The Model under Hamming Distance with Variable Real
Edge Lengths (I1MT-R-H).Now we consider the model under Hamming distance.The definition of Hamming distance will be given in this section.
I1MT-R-H.When   < 0 for each  ∈  and   > 0 is the cost of decreasing   for each  ∈ , we call the following program ( 16) Problem I1MT-R-H, which is the inverse 1-median problem on trees with variable real edge lengths under Hamming distance: where the Hamming distance (  ,   ) is defined as From a similar discussion in the former Section 3.2.1,Problem I1MT-R-H can be formulated as follows: Equation ( 18) is a shortest path improvement problem for tree networks with single source V 0 and the required bound 0 under Hamming distance [19].In [19], the authors proved that even if the network is a chain network, the problem is still NP-hard.So, we have the following.
As the procedure in [20], first we sort the edges by their lengths in an increasing order.Beginning with the shortest edge, say   , set    =   −    for each  ∈   , and check if max{   ((V)) − (V) | V ∈   \ {V 0 }} < 0. If yes, we know that the lengths are overreduced and Hence, the complexity of this procedure is (|| 2 ).
In the following, we assume that  * <    , which means that the preliminary procedure is finished while the optimality has not been reached.Because the path between any two vertices on tree network is unique, let  denotes the set of vertices which does not satisfy the upper bound demand.Let || be the number of edges of path .Let then  * =  is the optimal reduction.

Mathematical Problems in Engineering
Remark 7. Note that when ℎ  ̸ = 1 for each  ∈   , (20) can be formulated as the following program: min max In this case, we denote  * = ‖ℎ( −  * )‖ ∞ ; then for any edge  ∈   , we have  *  = max{  −  * /ℎ  , 0}.We sort the edges by   ℎ  ( ∈   ) in an increasing order to conduct the preliminary procedure to ensure that  * <    ℎ   , where   is the edge satisfying    ℎ   = min{  ℎ  |  ∈   }.Let then  * =  is the optimal reduction.Similar discussions show that the above procedure correctly solves program (22), and its computational complexity is (|| 2 ).
From the above analysis, we have the following theorem.

Conclusion
In this paper, we discussed the inverse 1-median problem with variable edge lengths on tree networks.We showed that this problem is solvable in linear time with variable nonnegative edge lengths under all kinds of norms.For the case when negative edge lengths are allowable, by formulating this problem to some known combinatorial optimization problems, we showed that this problem is NP-hard under Hamming distance and we proposed strongly polynomial time algorithms under  1 and  ∞ norms, respectively.As a future research topic, it will be meaningful to consider the problem on other networks such as the interval graph, the cactus graph, and the block graph, especially under the Hamming distance.We know that Algorithm 2 can solve Problem I1MT-N under all kinds of norms.But when negative edge lengths are allowable, we only dealt with the problems under the constraint that the edge length increase is forbidden.So we can further study the complexity of the problems such that the edge lengths can either be reduced or increased.In addition, for the inverse -median problems for  ≥ 2, designing the optimal or approximation algorithms and analysing their computational complexities are also promising.
and in this case we contract the edges  with    = 0 into vertices and repeat the process on the resulted network with respect to   .Since at least one vertex disappears in each contraction, the procedure has at most || iterations.For the time complexity, to find the shortest edge   can be completed in (||) time, and in each iteration, the time for checking if max{