Algorithms for the Shortest Path Improvement Problems under Unit Hamming Distance

. In a shortest path improvement problem under unit Hamming distance (denoted by SPIUH), an edge weighted graph with a set of source-terminal pairs is given; we need to modify the lengths of edges by a minimum cost under unit Hamming distance such that the modified distances of the shortest paths are upper bounded by given values. The SPIUH problem on arborescent network is formulated as a 0-1 integer programming model. Some strongly polynomial time algorithms are designed for the problems on some special arborescent networks. Firstly, two greedy algorithms are proposed for problems on chain networks and special star-tree networks, respectively. Secondly, a strongly polynomial time algorithm is presented for the problem with a single source and constrained paths. Finally, a heuristic algorithm and its computational experiments are given for the SPIUH problem on general graphs.


Introduction
Due to theoretical and practical importance, the inverse shortest path problems and the shortest path improvement problems have been extensively studied in recent years.In such problems, an edge weighted graph with a set of sourceterminal pairs is given; we need to modify the lengths of edges by a minimum cost under a given norm.In an inverse shortest path problem, the aim is to make a set of given paths become the shortest source-terminal paths, while in a shortest path improvement problem the aim is to make the modified distances of the shortest paths upper bounded by given values.Burton and Toint [1] solved the inverse shortest path problem under  2 norm by the nonlinear programming technique.Zhang et al. [2] proposed a column generation method for the inverse shortest path problem under  1 norm.Zhang and Lin [3] showed that the shortest path improvement problem under  1 norm is NP-complete and proposed polynomial time algorithms for the case of trees and the case of single source-terminal.Guan and Zhang [4,5] studied network improvement problems for a tree-path system or a multicut by upgrading nodes in a directed tree.
For detail of inverse optimization problems, the readers may refer to the survey paper by Heuberger [6].
Since the inverse optimization problems under Hamming distance were first studied by He et al. [7], it has been investigated by many researchers (see, e.g., Zhang et al. [8][9][10], Duin and Volgenant [11], Guan and Zhang [12], Liu and Yao [13], and Jiang et al. [14]).Zhang et al. [8] showed that the shortest path improvement problem under Hamming distance (denoted by SPIH) is strongly NP-hard on general graphs and is still NP-hard even if the network is a chain network.So it is meaningful to design polynomial time algorithms for some special cases of the problems and to propose approximation and/or heuristic algorithms for the SPIH and the shortest path improvement problem under unit Hamming distance (denoted by SPIUH) on general graphs.That is the objective of this paper.
Let  = (, ) be a connected undirected network, where  is the vertex set,  = { 1 ,  2 , . . .,   } is the edge set.Let   ≥ 0 be the length of edge   and   the lower bound on the modified length of   , where  = 1, 2, . . ., .Let {(  ,   ),  = 1, 2, . . ., } be the set of source-terminal pairs of vertices.Denote by   (, V) the shortest distance connecting  to V under the length vector .Let   be the upper bound of the shortest distance connecting the source-terminal pair (  ,   ).The SPIUH problem is to find a new edge length vector  * satisfying  ≤  * ≤  such that the modified shortest distance   * (  ,   ) is upper bounded by   , and the total edge modification cost is minimized under unit Hamming distance, which can be formulated as a mathematical model shown below: where the Hamming distance ( *  ,   ) is defined as Zhang et al. show in [8] that SPIH problem can be transformed into a 0-1 knapsack problem in the special case when the given network is a chain network and  = 1.
Lemma 1 (see [8]).The SPIH problem is NP-hard even if the network is a chain network.
The shortest path improvement problems under Hamming distance have practical background.For example, a large earthquake happened in some towns.The relief supplies need to be quickly handed out to the people in the stricken area.However, many roads were badly damaged, and we have to repair the roads as soon as possible.Consider the network  = (, ) of towns, where V ∈  denotes a town,  = (, V) ∈  denotes a road connecting  to V. Let   and   be the travelling time through the road   before/after   is repaired.Note that some points of the road   are damaged (rather than every point of the road being destroyed), so the repair time for the road   may be a fixed amount   instead of   (  −   ).We need to transport the relief goods from some supplier town   to some stricken town   within the stipulated time.Our objective is to design a repair scheme satisfying the above transportation requirement such that the total repair time of repaired roads is minimized, which is just the shortest path improvement problem under Hamming distance.
The rest of this paper is organized as follows.A 0-1 integer programming model of the SPIUH problem on arborescent networks is constructed in Section 2. Some polynomial time algorithms are proposed for some special cases of the SPIUH problem on arborescent networks in Section 3. A heuristic algorithm and its computational experiment of the SPIUH problem on general graphs are given in Section 4. Conclusion and further research are given in Section 5.
For convenience, we denote by   a path from   to   and by (  ) = ∑   ∈    the length of   under .In Sections 2 and 3, we use the following useful notations.For the unique path   from   to   in , if   ,   ∈   and   appears before   in the path   , then we denote it by   <     .

The SPIUH Problems on Arborescent Networks
In this section, we construct a 0- It is easy to see that   ≤   ≤   for each  = 1, 2, . . ., .Furthermore, for each  = 1, 2, . . ., , we have and thus  is a feasible solution of problem (3).
Necessity.Suppose that  is a feasible solution of problem (3).Note that   is the unique path from   to   and  ≤ ; then we have Obviously, we have the following property on optimal solutions of (3).Lemma 3. If  * is an optimal solution of problem (3), then  defined below is also an optimal solution of problem (3): that is, For each edge   , if we define a 0-1 variable   as follows: and let As a conclusion, we have the following theorem.
Theorem 4. The SPIUH-AN problem is equivalent to solving the 0-1 integer programming problem (11).An optimal solution  * of the SPIUH-AN problem can be given by (12), and the optimal objective value is , where  * is an optimal solution of problem (11):

Some Special Cases of the SPIUH-AN Problem
In this section, we consider some special cases of SPIUH problem on arborescent networks.In Section 3.1, we design greedy algorithms for the SPIUH problems on chain networks and special star-tree networks.In Section 3.2, we present a strongly polynomial time algorithm for the SPIUH problem with a single source and a special constraint on paths.

The SPIUH Problem on Special Star-Tree Networks.
In this subsection, we first study the SPIUH problem on a chain network, where  is a chain network and ( 1 ,  1 ) is the only source-terminal pair.We design a greedy algorithm for the SPIUH problem on a chain network.The main idea is to reduce the length of the edge with the current largest value  0  to   in each iteration.
Input: A chain  with a source-terminal pair ( 1 ,  1 ), two edge length vectors ,  and a value  1 .
Step 5: Output an optimal solution  * defined below: It is easy to see that the main computation is to sort the values of  0 , and hence the time complexity of Algorithm 5 is ( log ).
Next, we consider the SPIUH problem on a special startree network , where any two source-terminal paths of  have no common edges.Such a problem is denoted by SPIUH-ST.See Figure 1 for example; there are three sourceterminal paths ( 1 ,  1 ), ( 2 ,  2 ), and ( 3 ,  3 ).
Obviously, the set of source-terminal paths is the union of edge-disjoint chains in the SPIUH-ST problem.Now we extend the greedy algorithm for SPIUH problem on a chain network to the SPIUH-ST problem.
Algorithm 9. Consider the following.
Step 2: For  = Proof.Suppose  = ( 1 ,  2 , . . .,   ) is an optimal solution of the SPIUH-SSCP problem.By Lemma 3,  = ( 1 ,  2 , . . .,   ) defined below is also an optimal solution of the SPIUH-SSCP problem:  |  | ≥ |  | and reducing the weight of   first is better, or at least not worse, than reducing that of   , then we can get that  is also an optimal solution of the SPIUH-SSCP problem, where (2) If there exists a path   ,   ∈   and   ∈   , such that   <     , 0 <  0  <  0  ,   =   , and   =   , because by (16) we know that |  | = |  | and reducing the weight of   first is better, or at least not worse, than reducing that of   , then we can get that  is also an optimal solution of the SPIUH-SSCP problem, where Thus repeating the above operations, we can get an optimal solution  of the SPIUH-SSCP problem that satisfies the property in Lemma 10.

Theorem 11. If the SPIUH-SSCP problem is feasible, then
Algorithm 9 outputs an optimal solution  * of the SPIUH-SSCP problem in (( + log )) time.
Proof.If the SPIUH-SSCP problem is feasible, then it is not difficult to show that the solution  * obtained by Algorithm 6 is a feasible solution of the SPIUH-SSCP problem.
Next we show that  * obtained by Algorithm 9 satisfies properties (1) and ( 2) in Lemma 10.Note that we run Step 2 of Algorithm 5 for the path   by using stable sorting method in the th iteration of for-loop in Algorithm 9 for any 0 ≤  ≤ .When   is added to  in the th iteration of for-loop in Algorithm 9, we consider the following two cases.
(1) If there is an   satisfying   <     and 0 <  Hence,  * obtained by Algorithm 9 is a feasible solution of the SPIUH-SSCP problem that satisfies properties ( 1) and ( 2) in Lemma 10.
Suppose that  is the optimal solution of the SPIUH-SSCP problem which satisfies the property (1) and ( 2) in Lemma 10.Now we show that for each   ∈ , if  0  > 0 and  *  =   , then   =   .Suppose  *  =   (i.e.,   ∈ ); we consider the following three cases.
Case 1.If there exist a path   and an edge   ∈   such that   <     , 0 <  0  ≤  0  , and   =   , then because the optimal solution  of the SPIUH-SSCP problem satisfies property (1) in Lemma 10, we can get that   =   .Case 2. If there exist a path   and an edge   ∈   such that   <     , 0 <  0  <  0  , and   =   , then because the optimal solution  of the SPIUH-SSCP problem satisfies property (2) in Lemma 10, we can get that   =   .Case 3. If for each   and for each   ∈   such that (1) . Note that we have the assumption that This contradicts that  is an optimal solution of the SPIUH-SSCP problem, so   =   .
Hence, for each   ∈ , if  0  > 0 and  *  =   , then   =   .That is, the objective value of  * is not greater than the objective value of .Note that  is an optimal solution of the SPIUH-SSCP problem, so  * is an optimal solution of the SPIUH-SSCP problem.
The time complexity analysis is similar to that of Theorem 7.
So it is meaningful to design efficient algorithms for the SPIUH-SS problem.We guess that the SPIUH-SS problem has strongly polynomial time algorithms.

A Heuristic Algorithm for the General SPIUH Problem
In this section, we design a heuristic algorithm to solve the general SPIUH problem (1) and give computational experiments to test effectiveness of the algorithm.
Lemma 14 (see [8]).The SPIUH problem is strongly NP-hard even if   = 0 for each edge of the network.Next we first give an example to explain detailed computation process of the heuristic Algorithm 16, and then we present its computational experiments.
Note that when Algorithm 16 is applied to solve the SPIUH-SSCP problem, similar to the proof of Theorem 11, it is not difficult to show that Algorithm 16 can obtain an optimal solution of the SPIUH-SSCP problem.
The heuristic Algorithm 16 is coded in Matlab 7.0 and run on a PC Pentium D, 2.8 GHz, under Windows XP.We have tested the heuristic algorithm on ten classes of network configurations which differ from the number  of nodes, varying from 30 to 100, and the number  of sourceterminal pairs, being 5 or 15.There are 50 or 100 random

Figure 1 :
Figure 1: An example of a star tree for the SPIUH-ST problem.

Figure 2 :
Figure 2: Examples of arborescent networks with a single source.

Figure 3 :
Figure 3: An example of the SPIUH problem.
Problem (3) is feasible if and only if (  ) ≤   for each  = 1, 2, . . ., .Suppose that (  ) ≤   for each  = 1, 2, . . ., .Denote by Γ = ⋃  =1   the union of given paths.Define a vector  :  →   as follows: output that the instance is infeasible, stop.Else run Steps 3, 4, 5 in Algorithm 5 to solve the problem on the chain network   .Denote the optimal solution on   by {  |   ∈   }, and let  =  ∪ {  |   ∈   ,   =   , and  0 Output the optimal solution  * and the optimal objective value || of the SPIUH-ST problem, where Now we analyze the time complexity of Algorithm 6. Sorting the values of  0 in Step 1 can be done in ( log ) operations.In Step 2, there are  iterations and there are (|  |) operations in each iteration.Let  = max 1≤≤ |  |.     and           <             , Theorem 7. The shortest path improvement problems on startree networks under unit Hamming distance can be solved by Algorithm 6 in (( + log )) time, where  is the number of source-terminal pairs.Remark 8.There is a special case of the SPIUH-ST problem in which  is a star-tree network with a central vertex   such that there are no common edges on the paths from   to all leaves of the tree, and the central vertex   is the common source of all the source-terminal pairs; that is,   =   for each  = 1, 2, ..., .Hence, we only need to call Algorithm 5 in  times to solve the problem, and its time complexity is also (( + log )).3.2.The SPIUH Problem with a Single Source and ConstrainedPaths.In this subsection, we consider the SPIUH problem with a single source and a special constraint on paths, where   =  for each  = 1, 2, . . ., , and the path   satisfies the following constraint: if   < 1 to  do If (  ) >   , then output that the instance is infeasible, stop.Else let   =   − 0 (  ∩) and let    =   if   ∈   ∩ and    =   if   ∈   \.Call Algorithm 5 to solve the problem on the chain network   with respect to the length vector   and   .In Step 2 of Algorithm 5, we let  0 =   − , then for all   ∈   , rearrange the values  0  =    −   in a non-increasing order, and if there are two values are equal (let's say  0  and  0  ), and   appears before   in the direct path   from  to   , then  0  will always appear before  0  in the non-increasing order.(This sorting method is called stable sorting method).by  the optimal solution to the problem on   .Put  =  ∪ {  |   ∈   ,   =   , and    ̸ =   }.If there exists path   ,   ∈   and   ∈   , such that   <     , 0 <  0  ≤  0  , and   =   , then we have   =   .(2) If there exists path   ,   ∈   , and   ∈   such that   <     , 0 <  0  <  0  , and   =   , then we have   =   .

Table 2 :
11IN: the number of iterations;   : edge obtained in step 3;   (  ): the distance of the shortest path   under   ; LW: can    be changed to   ?Computational results of the Algorithm 16 and that of implicit enumeration algorithm.: the number of source-terminal pairs; VC: average approximation objective value by using Algorithm 16; VC1: average objective value by using implicit enumeration algorithm; TC: average running time in CPU-seconds by using Algorithm 16; TC1: average running time in CPU-seconds by using implicit enumeration algorithm.
NI: the number of instances; : the number of nodes; : the number of edges;