Solution Approaches for the Elementary Shortest Path Problem Luigi Di Puglia Pugliese ∗ Francesca Guerriero Department of Electronics, Computer Science and Systems, University of Calabria, Rende, Italy. Abstract In this paper, the elementary single-source all-destinations shortest path problem is considered. Given a directed graph, containing negative cost cycles, the aim is to find the paths with minimum cost from a source node to each other node, that do not contain repeated nodes. Three different solution strategies are proposed to solve the problem under investigation and their theoretical properties are investigated. The first is a dynamic programming approach, the second method is based on the solution of the k shortest paths problem, where k is considered as a variable. The last solution strategy is an enumerative approach based on a tree structure, constructed with a cycle elimination rule. Theoretical aspects related to the innovative proposed strategies to solve the problem at hand are investigated. The practical behaviour of the defined algorithms is also evaluated by considering a meaningful number of test problems. Keywords: shortest path; negative cost cycles; dynamic programming; k shortest paths; enumerative method. 1 Introduction The Shortest Path Problem (SPP) is one of the most studied problems in network optimization [16, 23, 28]. The problem comes up in practice and arises as subproblem in many network optimization algorithms. Solution approaches for the SPP have been studied for a long time (e.g., [7, 22, 23, 29, 46, 47]). More recently, some improvements and computational study have been presented by Ahuja et al. [1], Gabow and Tarjan [31] and Goldberg [35]. The reader is referred to the works of Cherkassky et al. [11] and Gallo and Pallottino [32] for detailed surveys. In its basic formulation, the objective is to determine the minimum cost path through a network from a given source node to a destination node. Several polynomial time solution approaches have been developed in the scientific literature to ∗ Corresponding Author, e-mail: [email protected] 1 address the SPP in the case there are no negative cost cycles (e.g., see [17, 23, 43]). On a network with negative arc costs, but with non-negative cost cycles, the best currently known time bound O(nm) is achieved by the Bellman-Ford-Moore algorithm [7, 29, 46], where n and m denote the number of nodes and arcs in the network, respectively. If the arc costs are non-negative, implementations of Dijkstra’s algorithm [23] achieve better bounds. In particular, an implementation presented by Fredman and Tarjan [30] runs in O(m + n log n) time. A trivial extension of the SPP is to find the shortest path tree rooted at a source node, by considering as destination all the nodes of the network (SPT P). This problem can be easily solved by the label-correcting methods used to address the SPP (e.g., see [11, 32]). An interesting extension of the SPP is the problem to find the first k shortest paths (kSPP). A set of k shortest paths have to be determined for each node by considering the first, the second and so on up to the k-th shortest path. This problem arises in many real-life applications, e.g., in telecommunication and transportation fields. In these contexts, alternative solutions should be available when the current best is forbidden for various reasons, e.g., link interruption in telecommunication network or street closed in transportation plant. Many solution approaches have been defined to solve the kSPP. The scientific literature takes into account two variants of the kSPP: 1) the pure kSPP and 2) the so-called loopless kSPP. In the first case, a node can appear more than once in the solution paths, whereas, in the latter we are interested in finding the first k shortest paths such that they contain a node only once. A wide number of papers address the kSPP (e.g., see [4, 12, 24, 25, 38, 45, 51]). Solution approaches for the loopless kSP P have been defined by Martins et al. [44] and Yen [62]. Dreyfus [24] and Yen [62] cite several additional papers on this subject going back as far as 1957. When negative cost cycles are present in the network, the SPP is not well defined, that is, a finite optimal solution does not exist. In this case, the problem is to check whether a simple cycle, whose arc costs sum up to a negative number, is present in the network. This problem is known as Negative Cost Cycle Detection Problem (N CCDP). It is worth noting that the N CCDP is polynomial. Several procedures have been defined for the N CCDP, see, e.g.,[15, 54]. The Bellman-Ford algorithm is one of the earliest and to date asymptotically fastest algorithm for the N CCDP [11, 34]. Recently, Subramani [53] has introduced a new approach for the N CCDP; the proposed solution strategy is based on exploiting the connections between the N CCDP and the problem of checking whether a system of difference constraints is feasible. It is important to point out that the scientific literature provides several works dealing with algorithms that list up all cycles in directed as well as undirected graphs in which arc costs are not considered [10, 48, 56, 57, 59, 60]. Yamada and Kinoshita [61] addressed the problem of finding all cycles in a directed graph with negative costs and they proposed a recursive algorithm. It is worth observing that all the 2 cited references do not solve the SPP in presence of negative cost cycles, rather they enumerate all the cycles in the network or check whether a negative cost cycle exists. The problem to find a shortest path in a network with negative cost cycles is still a very challenging problem. To the best of our knowledge, no solution approaches have been defined up to now to solve the elementary shortest path problem (ESPP). It is, of course, well known that computing shortest paths in the presence of negative cost cycles is a strongly N P-hard problem [33]. When constraints on the consumption of resource along the path are introduced, the problem is referred to as the Resource Constrained Elementary Shortest Path Problem (RCESPP). This problem has attracted the attention of many researchers in the last years. Starting with the seminal work of Beasley and Christofides [6], a variety of solution approaches have been developed to solve to optimality the RCESPP (see, e.g., [19, 39, 40]). The single-source single-destination version of the ESPP can be viewed as a particular instance of the RCESPP, where the resource consumption constraints are removed. In addition, it is possible to relax the elementarity constraints from the ESPP introducing a new resource that takes into account the number of visited nodes. Thus, the relaxed ESPP can be modeled as a RCSPP. This issue is explained in more detail in the following. In this paper, we deal with the more general case in which an elementary shortest path must be found for all nodes. In other words, we address the single-source all-destinations version of the ESPP. In order to solve to optimality the singlesource all-destinations ESPP, we apply the concepts proposed by Boland et al. [9] and Righini and Salani [49]. Beside the solution approach derived from the optimal strategies developed for the RCESPP, innovative methods are also presented. In particular, we have designed a dynamic k shortest paths algorithm, in which k is a variable and may assume an arbitrary value for each node of the network. An enumerative solution approach is also presented. In addition, an in depth analysis is carried out to evaluate the theoretical complexity of the proposed solution approaches and an extensive computational phase is conducted in order to asses the efficiency of the defined optimal strategies. In the context of the RCSPP, the single-source all-destinations SPP is applied in order to perform network reduction procedure based on the cost, to determine lower bounds on the optimal cost and to solve the dual Lagrangean problem when the resource constraints are relaxed in a Lagrangean objective function. When the RCESPP is considered, the aforementioned elements cannot be applied because of the negative cost cycles. Thus, the solution approaches for the ESPP proposed in this paper, can be used to determine lower bounds on the optimal cost and to solve the dual Lagrangean problem associated with the RCESPP. This information can be used to improve the performance of the state-of-the-art methods. In addition, it is worth observing that the ESPP can be used to model the 3 currency conversion problem [50]. When the nodes represent currencies and the arcs the transactions with costs equal to exchange rate, the problem is to find the maximum product path, that is, the best exchange sequence. The problem can be easily transformed in the SPP and, since the graph can contain negative cost cycles, it can be viewed as an instance of the ESPP. The proposed methods are able to solve also the single-source single-destination ESPP. However, it is worth observing that well-tailored solution approaches for the single-source single-destination version can be devised but this topic is out of the scope of this work. The paper is organized as follows. In Section 2 we give some notations and definitions used in the paper. The proposed solution approaches, along with their theoretical analysis are presented in Section 3. Section 4 is devoted to the discussion of the computational results. Section 5 presents our conclusions. The appendix reports the results of the computational experiments. 2 Notations and Definitions Let G = (N , A) be a directed graph where N is the set of n nodes, whereas A denotes the set of m ≤ |N × N | arcs. N contains also the source node s. A cost cij is associated with each arc (i, j) ∈ A. A cycle on node i is defined as an ordered sequence of nodes Ci = (i, j1 , . . . , jg , i), where ji 6= jk for all pairs i, k ∈ {1, . . . , g} such that i 6= k. It can also be viewed as a sequence of g + 1 arcs {(i, j1 ), . . . , (jg−1 , jg ), (jg , i)}. It is worth observing, as shown by Allender [2], that P n!(ρ−1)! the maximum number of cycles in a complete graph is equal to C̃ = nρ=1 ρ!(n−ρ)! . Let πsi be a path from node s to node i. It is a sequence of nodes πsi = (s = i1 , . . . , il = i), l ≥ 2 and a corresponding sequence of l − 1 arcs such that the h-th arc in the sequence is (ih , ih+1 ) ∈ A for h = 1, . . . , l − 1. Thus, each path contains at least one arc. Let Mπ (j) be the multiplicity of node j in path π, that is Mπ (j) = |{v : 0 ≤ v ≤ |π|, iv = j}|. The path π is said to be an elementary path if Mπ (j) = 1, for all j ∈Pπ. A cycle Ci on node i ∈ N is said to be a negative cost cycle (N CC) if c(Ci ) = (h,k)∈Ci chk < 0. Let πsj be an elementary path from node s to node j such that i ∈ πsj for some i ∈ N \ {s}. Let πsi = πsj ∪ {(j, i)} be the path obtained by extending path πsj to node i through arc (j, i). Since i ∈ πsj , a cycle Ci = πij ∪ {j, i} is created. Proposition 1. Given a path πsj and its sub-path πsi , Ci is a N CC if c(πsi ) > c(πsj ) + cji . Proof. The cost of the path πsj can be viewed as the sum of the cost of the sub-path πsi and the sub-path from i to j, that is c(πsj ) = c(πsi ) + c(πij ). It follows that c(πsi ) > c(πsj ) + cji ⇔ c(πsi ) > c(πsi ) + c(πij ) + cji ⇔ 0 > c(πij ) + cji = c(Ci ). This concludes the proof. 4 Since the directed graph G is not assumed to be acyclic and the arc costs are not constrained in sign, there may be N CCs in G. The ESPP, from the source s to all other nodes, consists in finding the paths πsi , ∀i ∈ N \ {s} such that c(πsi ) is minimized and Mπsi (j) = 1, ∀j ∈ πsi . It is well known that the Bellman’s optimality principle is not verified for this problem, indeed sub-paths of the optimal path for some node cannot be optimal. In what ∗ , u ∈ N , u 6= s, represents follows, we formalize this property. Let us assume that πsu the path with minimum cost and no repeated nodes in a graph with N CCs. The following consideration can be formulated. ∗ from node s to node u is composed by subObservation 1. The optimal path πsu ∗ that are not guaranteed to be optimal paths πsi from node s to each other node i ∈ πsu for node i. ∗ = Proof. We prove the result by contradiction. Let us suppose that a sub-path πsj ∗ ∗ ∗ πsi ∪ πij is part of the optimal solution πsu , and, for the purpose of contradiction, we ∗ is the optimal path from s to i. It follows that c(π ∗ ) = c(π ∗ )+c(π ∗ ). assume that πsi sj si ij Let us suppose that another path π̄sj : i 6∈ π̄sj exists to reach node j. Since π̄sj is ∗ , we have that c(π̄ ) ≥ c(π ∗ ). different from πsj sj sj Let us suppose that a path π̄ji exists. If the path π̄sj is extended to node i through ∗ ∪ π̄ = C path π̄ji , then we have that c(π̄si ) = c(π̄sj ) + c(π̄ji ). We assume that πij ji i ∗ is a N CC. Since we assume that πsi is the optimal path from node s to node i, it ∗ ). This means that c(π̄ ) + c(π̄ ) ≥ c(π ∗ ) − c(π ∗ ), thus follows that c(π̄si ) ≥ c(πsi sj ji sj ij ∗ c(π̄sj ) − c(πsj ) ≥ −c(Ci ). Since c(Ci ) < 0, for a sufficiently low cost c(π̄sj ), that ∗ ) − c(C ), the relation c(π̄ ) − c(π ∗ ) ≥ −c(C ) is not verified, is, for c(π̄sj ) < c(πsj i sj i sj ∗. contradicting the optimality hypothesis on path πsi In order to better explain Observation 1, let us consider the directed graph of Figure 1. Figure 1: Directed graph example. ∗ = {s, 1, 2, 3} of cost 0. The cost The optimal path from node s to node 3 is πs3 ∗ ∗ of sub-path πs1 is equal to 1 but c(πs1 ) is not the least cost from s to 1. Indeed, the path π̄s1 = {s, 2, 1} is the optimal path of cost 0 to node 1. 5 Observation 1 suggests that it should be necessary to keep more than one path for some node. It follows that the optimal solution of the ESPP is not guaranteed to be a spanning tree. Under this respect, it is possible to devise a modified label-correcting scheme for the SPP in order to obtain valid upper bounds for the ESPP. Let yi be the label that stores the value of the dual price for each node i ∈ N and L denote the list of nodes, that have to be processed. We indicate with pred ∈ <|N | the vector of predecessors, that is predi = j is the predecessor of node i in the path πsi . A set F S(i) of successor nodes is associated with each node i ∈ N , that is defined as follows: F S(i) = {j : (i, j) ∈ A}. A general scheme of a label-correcting method to obtain upper bounds for the ESPP is reported in Algorithm 1. Algorithm 1 : Label Correcting Scheme 1: Step 1 (Initialization phase) 2: ys = 0; yi = +∞, ∀i ∈ N \ {s}; predi = i, ∀i ∈ N ; L = {s}. 3: 4: Step 2 (Node selection) 5: Select a node i from the list L and remove it from L. 6: 7: Step 3 (Label extension) 8: for all j ∈ F S(i) do 9: if yj > yi + cij then 10: if j 6∈ πsi then 11: yj = yi + cij ; 12: predj = i; 13: add node j to L if it does not already belong to it. 14: end if 15: end if 16: end for 17: 18: Step 4 (Termination check) 19: if L = ∅ then 20: STOP. yi , ∀i ∈ N , is an upper bound on the optimal cost of the path from node s to node i. 21: else 22: Go to Step 2. 23: end if Algorithm 1 is a classical label-correcting method where the elementarity constraints are taken into account. The combination of conditions introduced in line 10 and line 19 ensures that the built paths do not contain repeated nodes and that the algorithm terminates in a finite number of iterations. Since the procedure is based on Bellman’s optimality conditions, at the end of Algorithm 1, the label yi , ∀i ∈ N , represents an upper bound on the elementary shortest path cost from node s to node i. 6 3 Proposed Solution Approaches The solution approaches proposed in this paper are based on the idea to compute for each node the minimum set of paths such that the elementary shortest path is found for all nodes. Three strategies have been developed. The first one can be viewed as an application of the methods proposed to solve the RCESPP. A multi-dimensional labeling procedure is devised and the dimension of the label is updated dynamically. The second strategy is based on a labeling approach to solve the kSPP. In our case, k is considered as a variable that can take different values for each node. In the last solution approach, a tree structure is defined and an enumerative procedure is devised in order to exploit the defined tree. It is worth observing that, while the first solution approach can be viewed as an extension of the algorithms for solving the RCESPP well-tailored to the ESPP, the last two strategies are proposed for the first time to solve instances of the SPP in presence of N CCs. 3.1 Dynamic Multi-Dimensional Labeling Approach The approaches, presented in this section, use the concept of critical node introduced by Kohl [42]. In particular, a node i is said to be critical if there exists a cycle Ci that is a N CC. A binary variable is introduced for each critical node in order to keep track of whether the node is visited. This binary variable can be viewed as a resource associated with node i, bounded to be less than or equal to one (see [6]). Let S = {i1 , i2 , . . . , i|S| }, be the set of critical nodes and r[p], p = 1, . . . , |S| be the binary variable associated with node ip ∈ S. We denote as yi = (c(πsi ), ri ) the label that contains the cost and the resource consumptions vector of the path πsi from node s to node i. The resource consumptions vector ri has the following form: ri [p] = 1, ∀p : jp ∈ πsi and ri [p] = 0, ∀p : jp 6∈ πsi . In other words, the vector ri keeps trace of the nodes j ∈ S that are visited along the path πsi . 1 ), r 1 ) and y 2 = (c(π 2 ), r 2 ) be two labels associated Definition 1. Let yi1 = (c(πsi i i si i 2 1 ) ≤ c(π 2 ), r 1 [p] ≤ r 2 [p] with node i. The label yi is dominated by the label yi1 if c(πsi si i i for p = 1, . . . , |S| and at least one inequality is strict. Definition 2. A label yi = (c(πsi ), ri ) associated with node i is said to be efficient or Pareto-optimal if there does not exist a label ȳi that dominates it. Definition 3. A label yi = (c(πsi ), ri ) associated with node i is said to be feasible if ri [p] ≤ 1, ∀p = 1, . . . , |S|. A set D(i), containing all the efficient labels, is associated with each node i ∈ N . The procedure defined by Desrochers [18] can be applied to solve the ESPP. It is worth observing that the Desrochers’ algorithm is an extension of Algorithm 1, 7 without line 10, to the constrained case. In Algorithm 2, we report the steps of the label-correcting method extended to the constrained case. Algorithm 2 : Label-Correcting Scheme for the ESPP 1: Step 1 (Initialization phase) 2: ys1 = (0, 0); D(s) = {ys1 }; D(j) = ∅, ∀j ∈ N \ {s}; L = {s}. 3: 4: Step 2 (Node selection) 5: Select a node i from the list L and remove it from L. 6: 7: Step 3 (Label extention) 8: for all yiξ ∈ D(i) do 9: for all j ∈ F S(i), j 6= s do ξ 10: Set: c(π̄sj ) = c(πsi ) + cij ; r̄j [p] = riξ [p], p = 1, . . . , |S|; 11: if j ∈ S then 12: r̄j [p̂] + 1 with ip̂ = j. 13: end if 14: if r̄i [p] ≤ 1, p = 1, . . . , |S| then 15: if ȳj = (c(π̄sj ), r̄j ) is not dominated by any label in D(j) then 16: D(j) = D(j) ∪ {ȳj }; 17: remove from D(j) all the labels that are dominated by ȳj ; 18: add node j to L if it does not already belong to it. 19: end if 20: end if 21: end for 22: end for 23: 24: Step 4 (Termination check) 25: if L = ∅ then 26: STOP. The label yi = minȳ∈D(i) {c(π̄)si } is associated with the optimal elementary path from s to i, ∀i ∈ N . 27: else 28: Go to Step 2. 29: end if It is possible to devise also a label-setting algorithm by slightly modifying Algorithm 2. Indeed, the set L stores all the efficient and feasible labels and it is initialized by the label ys . At Step 2, from the list L, the lexicographically minimal label is selected. This label is used to generate feasible and efficient labels to each successor node. This procedure is the same as the one proposed by Boland et al. [9] called general label-setting algorithm. The main drawback of the procedure is that the set S of critical nodes must be known in advance. The enumerative procedure of Yamada and Kinoshita [61] could be executed to determine the entire set of negative cost cycles. The nodes belonging to each negative cost cycle can be used to initialize set S and the Algorithm 2 can be performed. However, this strategy could be inefficient, since only a sub-set of all nodes belonging to all negative cost cycles need to be considered. In addition, the procedure defined by Yamada and Kinoshita [61] is not polynomial. If the set S is not known in advance, then we can relax the elementarity constraints and introduce a surrogate resource γ that counts the number of nodes in the path to get the relaxed ESPP (ESPP R ). This idea was proposed by Feillet et al. 8 [26] and applied by Righini and Salani [49] for solving the RCESPP. The ESPP R is a RCSPP where the resource γ is bounded to be less than or equal to the number of nodes n. The optimal solution to the ESPP R may not be an elementary path. The nodes that appear more than once in the optimal paths πsi , ∀i ∈ N \ {s}, are marked as critical nodes and the RCSPP is run again until an elementary path is found. The approach to augment the set S is the same of that proposed by Boland et al. [9] and by Righini and Salani [49]. The difference is that in the latters only one path has to be found. For more detail, the reader is referred to [20]. Very recently, in [37] the authors proposed a new state-space reduction technique combined with the strategies defined in [49]. This strategy cannot be extended to the single-source all-destinations version of the ESPP. The solution approaches presented in [49, 9] can be modified in order to define well-tailored procedure for the ESPP. In particular, starting from S = ∅, the labelsetting algorithm is executed. The search is stopped when a N CC, named Ci , is detected. The set S is incremented by adding node i and the label-setting algorithm is run again. The procedure terminates when no N CC is detected. This approach is similar to the general state-space augmenting algorithm proposed in [9] with the difference that the label-setting algorithm is stopped when a negative cost cycle is detected. In this case, the surrogate resource γ is not necessary. In Algorithm 3, we describe the steps of the aforementioned procedure, whereas the truncated label-setting algorithm is depicted in Algorithm 4 Algorithm 3 : Dynamic Multi-Dimensional Labeling Approach 1: Step 1 (Initialization phase) 2: Set: ζ = 0; S ζ = ∅ 3: 4: Step 2 (Run the truncated label-setting algorithm) 5: Run Algorithm 4 with critical node restricted to S ζ and get C. 6: 7: Step 3 (Cycle detection) 8: if C 6= ∅ then 9: S ζ+1 = S ζ ∪ {j}, j : M (j)C = 2; 10: ζ + +; 11: Go to Step 2. 12: else 13: STOP. 14: end if The defined solution approach is quite different from those proposed by Boland et al. [9] and Righini and Salani [49]. For this reason and for the sake of completeness, in the next Section we prove its correctness. 3.1.1 Correctness of the Dynamic Multi-Dimensional Labeling Approach In this section, we prove the correctness of the proposed solution approach. In particular, at the end of Algorithm 3, the label yi with the smallest cost among 9 Algorithm 4 : Truncated label-setting algorithm with S ζ 1: Step 1 (Initialization phase) 2: Set: ys1 = (0, 0); D(s) = {ys1 }; D(j) = ∅, ∀j ∈ N \ {s}; L = {ys1 }; C = ∅. 3: 4: Step 2 (Label selection) 5: Select the lexicografically minimal label yiξ from the list L and remove it from L. 6: 7: Step 3 (Label extension) 8: for all j ∈ F S(i), j 6= s do ξ 9: Set: c(π̄sj ) = c(πsi ) + cij ; r̄j [p] = riξ [p], p = 1, . . . , |S ζ |; 10: if j ∈ S ζ then 11: r̄j [p̂] + 1 with ip̂ = j. 12: end if ξ ξ 13: if j 6∈ S ζ and j ∈ πsi and c(π̄sj ) < c(πsj ) then 14: STOP. A N CC C is detected. 15: Return C. 16: else 17: if r̄i [p] ≤ 1, p = 1, . . . , |S ζ | then 18: if ȳj = (c(π̄sj ), r̄j ) is not dominated by any label in D(j) then 19: D(j) = D(j) ∪ {ȳj }; L = L ∪ {ȳj }; 20: remove from D(j) and L all the labels that are dominated by ȳj . 21: end if 22: end if 23: end if 24: end for 25: 26: Step 4 (Termination check) 27: if L = ∅ then 28: STOP. The label yi = min{ȳ∈D(i)} {c(π̄)si } is associated with the optimal elementary path from s to i, ∀i ∈ N . 29: Return C. 30: else 31: Go to Step 2. 32: end if those belonging to the set D(i) is associated with the least cost elementary path from s to i. Proposition 2. At the end of Algorithm 4, two situations can occur: 1. a N CC is detected, that is, the stop conditions of line 13 are verified; 2. if the procedure is stopped by condition of line 27, then all the efficient and feasible paths from s to each other node i ∈ N \ {s} are determined. (a) At the end of each iteration, the following conditions hold: i. D(s) = {ys1 } = {(0, 0)}; ii. ∀j ∈ N , if D(j) 6= ∅ [i.e.: D(j) = {yj1 , yj2 , . . . , yjl }] and j 6= s, then yjξ , ξ = 1, . . . , l is a label related to a feasible path from node s to node j and D(j) is an efficient set. 10 (b) Upon termination of the algorithm, if D(j) 6= ∅, j ∈ N and j 6= s, then D(j) contains the labels of all efficient and feasible paths from node s to node j. Proof. Let us consider case 1. The conditions of line 13 derive from Proposition 1. Thus, if they are verified, then a N CC is detected. If case 1 does not occur, then all N CCs have been detected and the algorithm terminates when the list L is found empty, that is, case 2. In what follows, we prove case 2. Let us consider case 2a. Condition 2(a)i holds because, initially, D(s) = {ys1 } = {(0, 0)} and, by the rules of the algorithm, D(s) cannot change. We prove condition 2(a)ii by induction on the iteration count. Indeed, initially, condition 2(a)ii holds, since node s is the only node for which the set D(s) is nonempty. Suppose that 2(a)ii holds for some node j at the beginning of some iteration. Let yiδ be the label removed from L. If i = s (which only occurs at the first iteration) and δ = 1, then at the end of this iteration, we have D(j) = yj1 for all successor nodes j of s such that the corresponding path πsj is feasible, D(j) = ∅ for all other nodes j 6= s, j ∈ / F S(i). Thus, the set of labels has the required property. δ starting from s and ending If i 6= s, then yiδ is the label of some feasible path πsi to i that is not dominated by the other paths in D(i), by the induction hypothesis. If the set D(j) changes, for some node j, such that j ∈ F S(i), as a result of the iteration, a new feasible label ȳj = (c(π̄sj ), r̄j ) is obtained for node j. The created δ followed by the arc label is related to the feasible path πsj consisting of path πsi (i, j). Finally, note that, by the rules of the algorithm, the newly created label is added to D(j) only if it is an efficient label. This completes the induction proof of 2(a)ii. Let now consider condition 2b. Using part 2(a)ii, we have that, at each iteration, ∀j ∈ N such that D(j) 6= ∅, D(j) is an efficient set. Thus, the property mentioned is also satisfied when the algorithm terminates. In addition, the way in which the candidate list L is updated and the termination condition (i.e., the algorithm terminates when there are no more labels left to be scanned) guarantee that all the labels with the potential to determine a new label for at least one node are scanned during the execution of the algorithm. Proposition 3. (Correctness of Algorithm 3). At the end of Algorithm 3, the label yi with the smallest cost among those belonging to the set D(i) is associated with the least cost elementary path from s to i, ∀i ∈ N . Proof. From Proposition 2, it follows that all the efficient and feasible labels yi , ∀i ∈ N , are determined. Since the set D(i) is an efficient set, the path 11 π̄si = arg min{y∈D(i)} {c(πsi )} has the cost as low as possible among all the feasible paths from s to i, that is π̄si is the optimal solution ∀i ∈ N . 3.1.2 Complexity Analysis As far as the complexity analysis of the proposed dynamic multi-dimensional labeling approach for the ESPP is concerned, let D be the set of efficient andP feasible labels with the highest cardinality. The complexity of Algorithm 3 is O(n2 nτ=1 τ 22τ ), in the worst case. This result is formally stated in the following lemma. Lemma 1. In the worst case, the complexity of Algorithm 3 is O(4n n3 ). Proof. Let |D| be the maximum number of labels at a node. The operations executed in lines 9 - 23 of Algorithm 4 are |S||D|, that is, the test of dominance. Since the F S can contain at most n − 1 elements, the total number of operations executed in lines 8 - 24 is n|S||D|. Since the for-loop of line 8 is invoked n|D| times, that is an upper bound on the total number of generated labels, thus Algorithm 4 takes O(n2 |S||D|2 ) operations. In the worst case, the number of efficient labels stored at each node is equal to 2|S| . It follows that Algorithm 4 takes O(n2 |S|4|S| ) operations. Starting from S = ∅, the set of critical nodes is incremented by one at each iteration. In the worst case, set S contains all nodes. In other words, the operations executed by Algorithm 3 are n2 × 1 × 4 + n2 × 2 × 42 + . . . + n2 × n × 4n = 94 n2 [4n (3n − 1) + 1]. Consequently, the complexity of Algorithm 3 is O(4n n3 ), in the worst case. In order to better explain how Algorithm 3 works, let us consider the example of Figure 2. In Table 1, we report set S, the labels at the last iteration of Algorithm 4, the last selected label and the detected cycle C. The labels reported in Table 1 have the following form: < π(y) >. The superscript reported next to the labels indicates that the related label is dominated. Figure 2: Toy example. At the first iteration (see column 1st iteration of Table 1), the label < s, 2, 5, 4(−8) > is selected. When we try to extend the label to node 2 a N CC is detected. Indeed, path πs2 = {s, 2, 5, 4} ∪ {2} has a cost equal to −5 that is less than the cost of path πs2 = {s, 2} associated with label < s, 2(−4) >. The dummy resource is introduced to node 2. At the 2nd iteration, the N CC {1, 2, 3, 1} is detected and node 1 is inserted 12 S s 1 1st iteration ∅ < s(0) > < s, 1(2) > 2 < s, 2(−4) > 3 < s, 2, 3(−2) > 4 < s, 2, 5, 4(−8) > 5 < s, 2, 5(−6) > 6 < s, 2, 5, 6(−4) > last extracted label C < s, 2, 5, 4(−8) > {2, 5, 4, 2} 2nd iteration {2} < s(0, 0) > < s, 1(2, 0) > < s, 2, 1(−1, 1) > < s, 2(−4, 1) >D < s, 1, 2(−5, 1) > < s, 2, 3(−2, 1) >D < s, 1, 2, 3(−3, 1) > < s, 2, 3, 1, 4(4, 1) >D < s, 2, 5, 4(−8, 1) >D < s, 1, 4(7, 0) > < s, 1, 2, 5, 4(−9, 1) > < s, 2, 5(−6, 1) > < s, 1, 2, 5(−7, 1) > < s, 2, 5, 6(−4, 1) >D < s, 2, 5, 4, 6(−5, 1) >D < s, 1, 2, 5, 4, 6(−6, 1) > < s, 1, 2, 3(−3, 1) > {1, 2, 3, 1} 3rd iteration {2, 1} < s(0, 0, 0) > < s, 1(2, 0, 1) > < s, 2, 1(−1, 1, 1) > < s, 2(−4, 1, 0) > < s, 1, 2(−5, 1, 1) > < s, 2, 3(−2, 1, 0) > < s, 1, 2, 3(−3, 1, 1) > < s, 2, 3, 1, 4(4, 1, 1) >D < s, 2, 5, 4(−8, 1, 0) > < s, 1, 4(7, 0, 1) > < s, 1, 2, 5, 4(−9, 1, 1) > < s, 2, 5(−6, 1, 0) > < s, 1, 2, 5(−7, 1, 1) > < s, 2, 5, 6(−4, 1, 0) >D < s, 2, 5, 4, 6(−5, 1, 0) > < s, 1, 2, 5, 4, 6(−6, 1, 1) > < s, 1, 2, 5, 6(−5, 1, 1) >D < s, 1, 4, 6(10, 0, 1) > < s, 1, 4(7, 0, 1) > ∅ Table 1: Labels associated with each node at the end of the corresponding iteration of Algorithm 4. in the set S. The introduction of the resource at node 2 and to node 1 avoids the generation of N CCs and the optimal solution is found at the 3rd iteration. 3.2 Labeling Approach based on the k Shortest Paths Problem In this Section we describe a labeling approach in which the first k paths are determined for each node i ∈ N . The aim of the procedure is to determine the smallest set of paths for each node i. Under this respect, k is a variable and it can take different values for each node. The main idea is to start with k = 1 for each node, whenever a N CC is detected, k is incremented for a specific node and the labeling algorithm is run again. When no N CC is detected, from the set of paths associated with each node, the optimal solution is chosen. It is worth observing that when the kSPP is solved, the paths are ranked by nondecreasing cost. In our context, it is necessary to store equivalent paths. This is necessary because paths with the same cost can have a different structure, that is, they can contain different nodes. Let Ki be the number of best paths from node s to node i. The set Πi contains the k ) ≤ c(π k+1 ), ∀k = 1, . . . , K − 1 Ki paths ordered by nondecreasing cost, that is c(πsi i si k+1 k+1 k k k is the k-th and if c(πsi ) = c(πsi ), then πsi 6= πsi . In other words, Πi [k] = πsi shortest path from node s to node i. k ∈ Definition 4. Set Πi , ∀ i ∈ N is said to be path-elementary, if each path πsi Πi , k = 1, . . . , Ki does not contain repeated nodes. A vector yi ∈ <Ki is associated with each node i that stores the costs of the k ∈Π . paths belonging to the set Πi , that is, yi [k] represents the cost of path πsi i 13 Algorithm 5 : Truncated labeling algorithm for dynamic kSPP 1: Step 1 (Initialization phase) 1 = {s}, Π = {π 1 }; Π = ∅, ∀i ∈ N \ {s}; 2: Set: ys [1] = 0; yi [k] = +∞, k = 1, . . . , Ki , ∀i ∈ N \ {s}; πss s i ss L = {s}; C = ∅. 3: 4: Step 2 (Node selection) 5: Select a node i from L and delete it from L. 6: 7: Step 3 (Label extension) 8: for all j ∈ F S(i), j 6= s do k̃ AND ∃k̄ : j ∈ π k̄ , y [k̄] + c < y [1] then 9: if yik 6= +∞, ∀k ∈ {1, . . . , Ki } AND 6 ∃k̃ : j 6∈ πsi ij j si i k̄ ∪ {(i, j)} is detected. 10: STOP. A cycle C = πsi 11: Return C. 12: else k do 13: for all k = 1, . . . , Ki : yi [k] 6= +∞, j 6∈ πsi 14: for all ξ = 1, . . . , Kj do k ∪ {(i, j)} 6= π ξ ) then 15: if yi [k] + cij < yj [ξ] OR (yi [k] + cij = yj [ξ] AND πsi sj 16: yj [δ + 1] = yj [δ], δ = ξ, . . . , Kj ; δ+1 δ , δ = ξ, . . . , K ; 17: πsj = πsj j 18: yj [ξ] = yi [k] + cij ; ξ k ∪ {j}; 19: πsj = πsi 20: add node j to L if it does not already belong to it. 21: BREAK 22: end if 23: end for 24: end for 25: end if 26: end for 27: 28: Step 4 (termination check) 29: if L = ∅ then 1 . 30: STOP. yi [1] is the cost of the optimal elementary path πsi 31: Return C. 32: else 33: Go to Step 2. 34: end if Every time a N CC C is detected, the number of paths that have to be found for each node i ∈ C is increased, that is, Ki = Ki + 1, ∀i ∈ C, and the labeling algorithm is executed again. When no N CC is detected, yi [1] is the cost of the optimal elementary shortest path from node s to node i ∈ N . The proposed solution approach iteratively solves the kSPP for a fixed value of Ki , ∀i ∈ N . The steps of the labeling procedure are depicted in Algorithm 5. In the proposed strategy, Algorithm 5 is iteratively run after that Ki , ∀i ∈ N , is coherently updated. The dynamic labeling solution strategy is reported in Algorithm 6. 3.2.1 Correctness of the Dynamic Labeling Approach In this section, we prove the correctness of the proposed solution approach. In 1 is the least cost elementary path from s particular, at the end of Algorithm 5, πsi 14 Algorithm 6 : Dynamic Labeling Approach 1: Step 1 (Initialization phase) 2: Set: ζ = 0; Ks = 1; Kiζ = 1 ∀i ∈ N \ {s}. 3: 4: Step 2 (Run the truncated labeling algorithm) 5: Run Algorithm 5 with Kiζ , i ∈ N and get C. 6: 7: Step 3 (Cycle detection) 8: if C 6= ∅ then 9: Kiζ+1 + 1, ∀i ∈ C, Kiζ+1 = Kiζ , ∀i ∈ N \ C; 10: ζ + +; 11: Go to Step 2. 12: else 13: STOP. 14: end if to i. Proposition 4. At the end of Algorithm 5 we have that: 1. a N CC is detected, that is, conditions of line 9 are verified; 2. if condition of line 29 is verified, then all the first Ki elementary paths are determined for each node i ∈ N , that is, sets Πi , ∀i ∈ N , are path-elementary. (a) At the end of each iteration, the following conditions hold: i. ys [1] = 0; k is an elementary path. ii. ∀i ∈ N \ {s}, if yi [k] 6= +∞, then πsi (b) Upon termination of the algorithm, Πi , ∀i ∈ N , is path-elementary. Proof. Let us consider case 1: The first part of conditions in line 9, that is, yik 6= +∞, ∀k ∈ {1, . . . , Ki }, checks whether all the Ki paths to node i are determined. The second part derives from Proposition 1, thus if it is verified for some k̄, a N CC is found and the algorithm terminates. It follows that the presence of a N CC is verified only if the entire set of paths from node s to the considered node i are determined. If case 1 does not occur, then all N CCs have been detected and the algorithm terminates when the list L is found empty, that is, case 2. Case 2: Let us consider case 2a. Condition 2(a)i holds because, initially, ys [1] = 0 and, by the rules of the algorithm, ys [1] cannot change. We prove condition 2(a)ii by induction on the iteration count. Indeed, initially, condition 2(a)ii holds, since node s is the only node for which the cost is not equal to +∞. Suppose that 2(a)ii holds for some node j at the beginning of some iteration. Let i be the node removed from L. If i = s (which only occurs at the first iteration), then at the end of this iteration, we have yj [1] 6= +∞ for all successor nodes j of s and the corresponding path 15 πsj = {(s, j)} is elementary, yj [k] = +∞, k 6= 1 and yj [k] = +∞ for all other nodes j 6= s, j ∈ / F S(i). Thus, the set of paths has the required property. k starting from s and ending to i If i 6= s, then yi [k] is the cost of the k-th path πsi that does not contain repeated nodes, by the induction hypothesis. If yj [k] changes, for some node j ∈ F S(i) and k, then a new path is obtained for node j. The created k consists of path π k followed by the arc (i, j). Finally, note that, by the path πsj si k . This rules of the algorithm, the newly created path is elementary because j 6∈ πsi completes the induction proof of 2(a)ii. Let now consider condition 2b. Using part 2(a)ii, we have that, at each iteration, k , ∀j ∈ N such that y [k] 6= +∞ is an elementary path. Thus, the property πsj j mentioned is also satisfied when the algorithm terminates. In addition, the way in which the candidate list L is updated and the termination condition (i.e., the algorithm terminates when there are no more nodes left to be scanned) guarantee that all the nodes with the potential to determine a new path for at least one node are scanned during the execution of the algorithm. 1 is the Proposition 5. (Correctness of Algorithm 6). At the end of Algorithm 6, πsi optimal path from node s to node i, ∀i ∈ N . Proof. The algorithm terminates when no cycle is detected. From Proposition 4, we know that if no cycles are detected, then Algorithm 5 provides a path-elementary set Πi , ∀i ∈ N . Since the paths are ordered in nondecreasing order of the cost, the first path of each set represents the least cost path. In addition, being Πi path1 is the optimal path. elementary, πsi 3.2.2 Complexity Analysis The complexity of Algorithm 6 is derived in the following lemma. Lemma 2. In the worst case, the complexity of the proposed solution approach is O(n9 C̃ 7 ). Proof. Let K be the highest number of paths that have to be found. The operations executed in lines 15 - 21 are 2K + 3. Since the forloops of line 13 and 14 take K 2 , the number of iterations in lines 12 - 22 is 2K 3 + 3K 2 . The F S contains at most n − 1 elements. The for-loop of line 8 is invoked nK times. Consequently, Algorithm 5 takes O(n2 (2K 4 + 3K 3 )). Since each node can be part of each cycle, the iterations executed by Algorithm 6 are nC̃ in the worst case. This means that the proposed approach executes n2 (2×14 +3×13 )+n2 (2×24 +3×23 )+. . .+n2 (2×nC̃ 4 +3×nC̃ 3 ) = 2 8 2 6 4 2 3 2 15 (nC̃) (6nC̃ + 15) + 12 (nC̃) (nC̃ + 1) + 15 (nC̃) (10(nC̃) − 1) operations, thus 9 7 the complexity of Algorithm 6 is O(n C̃ ). 16 k (y [k]) >) at the In Table 2, we report the paths and the related cost (< πsi i end of each iteration of Algorithm 6 when solving the ESPP on the network of Figure 2. At the 1st iteration, node 3 is selected. Since all the conditions of line 9 are verified, Algorithm 5 terminates and the cycle {1, 2, 3, 1} is returned. The value of Ki , i = 1, 2, 3 is incremented of one and Algorithm 5 is executed again. 1 = {s, 1, 2, 5, 4} is extended to Node 4 is selected (see 2nd iteration). When path πs4 node 2, conditions of line 9 are satisfied, thus the N CC {2, 5, 4, 2} is detected and Algorithm 5 is stopped. The number of paths that need to be found for nodes 2, 5 and 4 is increased. After other three iterations, see 3rd , 4th and 5th iteration of Table 2, condition of line 29 is verified. Since C = ∅, Algorithm 6 terminates and yi [1], ∀i ∈ N , is the optimal cost. 17 1st iteration yi < s(0) > < s, 1(2) > 18 s 1 Ki 1 1 Ki 1 2 2 1 < s, 1, 2(−5) > 2 3 1 < s, 1, 2, 3(−3) > 2 4 1 < s, 1, 4(7) > 5 1 6 last extracted node C 1 2nd iteration yi < s(0) > < s, 2, 3, 1(−1) > < s, 1(2) > < s, 1, 2(−5) > < s, 2(−4) > Ki 1 2 3 2 1 < s, 1, 2, 3(−3) > < s, 2, 3(−2) > < s, 1, 2, 5, 4(−9) > < s, 1, 2, 5(−7) > 1 < s, 1, 2, 5(−7) > +∞ 3 {1, 2, 3, 1} 1 < s, 1, 2, 5, 4, 6(−6) > 4 {2, 5, 4, 2} 3rd iteration yi < s(0) > < s, 2, 3, 1(−1) > < s, 1(2) > < s, 1, 2(−5) > < s, 2(−4) > < s, 1, 4, 2(10) > Ki 1 2 4 < s, 1, 2, 3(−3) > < s, 2, 3(−2) > < s, 1, 2, 5, 4(−9) > < s, 2, 5, 4(−8) > 2 2 < s, 1, 2, 5(−7) > < s, 2, 5(−6) > 1 < s, 1, 2, 5, 4, 6(−6) > 4 {2, 5, 4, 2} 2 4th iteration yi < s(0) > < s, 2, 3, 1(−1) > < s, 1(2) > < s, 1, 2(−5) > < s, 2(−4) > < s, 1, 4, 2(10) > +∞ Ki 1 2 5 < s, 1, 2, 3(−3) > < s, 2, 3(−2) > < s, 1, 2, 5, 4(−9) > < s, 2, 5, 4(−8) > < s, 2, 3, 1, 4(4) > 2 3 < s, 1, 2, 5(−7) > < s, 2, 5(−6) > +∞ 4 1 < s, 1, 2, 5, 4, 6(−6) > 4 {2, 5, 4, 2} 1 3 Table 2: Paths and costs that are found for each node at the end of Algorithm 5. 4 5th iteration yi < s(0) > < s, 2, 3, 1(−1) > < s, 1(2) > < s, 1, 2(−5) > < s, 2(−4) > < s, 1, 4, 2(10) > +∞ +∞ < s, 1, 2, 3(−3) > < s, 2, 3(−2) > < s, 1, 2, 5, 4(−9) > < s, 2, 5, 4(−8) > < s, 2, 3, 1, 4(4) > < s, 1, 4(7) > < s, 1, 2, 5(−7) > < s, 2, 5(−6) > < s, 1, 4, 2, 5(8) > +∞ < s, 1, 2, 5, 4, 6(−6) > 5 ∅ 3.3 Enumerative Strategy The proposed approach looks for the optimal solution through a tree structure. Each node is associated with a sub-graph of G excluding the root node that represents the graph G. The nodes at a certain level are associated with sub-graphs in which at least one N CC is removed. Given a father node, all child nodes are associated with sub-graphs in which the same N CCs are removed. Figure 3 shows the structure of the aforementioned tree. Figure 3: The Figure represents the tree structure of a graph with two negative cost cycles, that is < u, v, u > and < j, u, v, j >. Each node is associated with a graph. The root node is the graph G(N , A). Under each node is reported the detected cycle, whereas, the set of arcs is reported over each node. From both graphs G 1 and G 2 the cycle < u, v, u > is removed. Both cycles < u, v, u > and < j, u, v, j > are removed from graphs G 3 , G 4 and G 5 . In what follows we formalize the search process in the tree. Let G(N , A) be a graph associated with a generic node of the tree. The truncated labeling approach, that is, Algorithm 5 with Ki = 1, ∀i ∈ N , is run on G(N , A). If a N CC Ci is detected, then δ = |Ci | − 1 sub-graphs are generated starting from G(N , A) by removing the δ-th arc of Ci . In other words, the graph G δ (N , Aδ ), δ = 1, . . . , |Ci | − 1 are generated where Aδ = A \ {(uδ , vδ )}, with (uδ , vδ ) ∈ Ci . Since at least one arc of the detected N CC Ci is removed, the related sub-graph does not contain this cycle. When the truncated labeling algorithm is run on this sub-graph, if a N CC C̄i , for some node i ∈ N is detected, we are sure that Ci 6= C̄i . This means that at a certain level σ of the tree exactly σ N CCs have been detected. Consequently, in all the sub-graphs at level σ, at least σ N CCs are removed (the same arc can be part of many N CCs). 19 3.3.1 Algorithm Let y ζ ∈ <|N | be the vector that stores the best solutions for each node i ∈ N , determined so far, and y ∗ ∈ <|N | be the vector of the optimal solutions for each node i ∈ N . The value ζ is the iterations counter. At the last iteration ζ̄, y ζ̄ = y ∗ , that is yi∗ is the cost of the optimal path from node s to node i. Let yi (G) be the cost of the path from node s to node i obtained applying the truncated labeling algorithm on graph G. If a N CC Cj is detected when the truncated labeling algorithm is executed on G, then we have that yi (G) is a valid upper bound for all nodes i ∈ N̄ , where N̄ = {u ∈ N : v 6∈ πsu , ∀v ∈ Cj }. This means that yi (G), ∀i ∈ N̄ can be used to initialize the cost of node i for the sub-graph G δ . In other words, yi (G δ ) = yi (G), ∀i ∈ N̄ . In addition, if yi (G) < yiζ for some i ∈ N̄ , then yiζ = yi (G). Let L be the list containing the nodes of the tree that have to be processed. The steps of the proposed enumerative approach are reported in Algorithm 7. Algorithm 7 : Enumerative Algorithm 1: Step 1 (Initialization phase) 2: Set: ζ = 0; y ζ [s] = 0; y ζ [i] = +∞, ∀i ∈ N \ {s}; L0 = {G}, G = (N , A); yG [s] = 0; yG [i] = +∞, ∀i ∈ N . 3: 4: Step 2 (Selection phase) 5: Select a graph Ḡ = (N , Ā) from Lζ and remove it from Lζ . 6: 7: Step 3 (Search process) 8: Apply the truncated labeling algorithm to Ḡ. 9: if a N CC Cj is detected then 10: Generate δ = |Cj | − 1 sub-graphs G δ = (N , Ā − {(uδ , vδ )}) and add them to Lζ ; 11: set: yG δ [i] = yḠ [i], ∀i ∈ N̄ . 12: if yḠ [i] < y ζ [i] for some i ∈ N̄ then 13: y ζ [i] = yḠ [i]. 14: end if 15: y ζ+1 = y ζ ; 16: Lζ+1 = Lζ ; 17: ζ + +; 18: go to Step 4. 19: else 20: if yḠ [i] < y ζ [i] for some i ∈ N then 21: y ζ [i] = yḠ [i]. 22: end if 23: y ζ+1 = y ζ ; 24: Lζ+1 = Lζ ; 25: ζ + +; 26: go to Step 4 27: end if 28: 29: Step 4 (Termination check) 30: if Lζ = ∅ then 31: STOP. y ζ−1 [i] is the cost of the optimal path from node s to node i. 32: else 33: Go to Step 2. 34: end if 20 3.3.2 Correctness of the Enumerative Algorithm The correctness of the method follows from the search procedure. As mentioned above, the nodes represent sub-graphs for which the detected cycle in the father graph is excluded. Each sub-graph is defined by removing at most one arc of the detected cycle. In the sub-graphs of the last level all the cycles are removed, thus for each node i we have a path for each sub-graph that is an elementary path. The path with the smallest cost among those obtained in the sub-graphs is the optimal one. 3.3.3 Complexity Analysis Let M be the maximum cardinality among those of the N CCs in the graph, that is M = n. We know that the maximum number of N CCs in the graph is C̃. In addition, for each level σ of the tree exactly σ N CCs have been removed from the graphs at level σ. Thus the maximum number of levels in the tree is C̃. P τ The complexity of the proposed approach is O(n2 C̃ τ =0 n ). This result is formally stated in the following lemma. Lemma 3. In the worst case, the complexity of the proposed method for the ESPP P τ is O(n2 C̃ τ =0 n ). Proof. In the worst case, the original graph associated with the first node of the tree is solved and a N CC is detected. The branching procedure is applied and δ = n − 1 sub-graphs are generated. When each of these sub-graph is solved, another N CC is detected and n − 1 graphs of the next level are generated. This means that the number of graphs that have to be solved at level σ is (n − 1)σ ≈ nσ . Since we know that the levels are bounded above by C̃, thus the total number of node is PC̃ τ τ =0 n . In addition, the complexity to solve each graph associated with a node with Algorithm 5 where K = 1 takes O(n2 ) (see Lemma 2). It follows that the worst P τ case complexity of the proposed method is O(n2 C̃ τ =0 n ). In Table 3, we show the tree structure explored by Algorithm 7 when solving the network of Figure 2. We report the graph associated with each node of the tree. In Table 4, we report for each iteration, the selected node/graph, the cost associated with each node after Algorithm 5 with Ki = 1 is run, the label y ζ and the detected cycle. 21 G 1 (N , A \ {(1, 2)}) G 0 (N , A) G 2 (N , A \ {(2, 3)}) G 3 (N , A \ {(3, 1)}) G 4 (N , A \ {(1, 2); (2, 5)}) G 5 (N , A \ {(1, 2); (5, 4)}) G 6 (N , A \ {(1, 2); (4, 2)}) G 7 (N , A \ {(2, 3); (2, 5)}) G 8 (N , A \ {(2, 3); (5, 4)}) G 9 (N , A \ {(2, 3); (4, 2)}) G 10 (N , A \ {(3, 1); (2, 5)}) G 11 (N , A \ {(3, 1); (5, 4)}) G 12 (N , A \ {(3, 1); (4, 2)}) Table 3: Graph associated with the nodes of the tree structure. 22 yζ y(G) 23 ζ Selected node 0 1 2 3 4 5 6 7 8 9 10 11 12 G 0 (N , A) G (N , A \ {(1, 2)}) G 2 (N , A \ {(2, 3)}) G 3 (N , A \ {(3, 1)}) 4 G (N , A \ {(1, 2); (2, 5)}) G 5 (N , A \ {(1, 2); (5, 4)}) G 6 (N , A \ {(1, 2); (4, 2)}) G 7 (N , A \ {(2, 3); (2, 5)}) G 8 (N , A \ {(2, 3); (5, 4)}) G 9 (N , A \ {(2, 3); (4, 2)}) G 10 (N , A \ {(3, 1); (2, 5)}) G 11 (N , A \ {(3, 1); (5, 4)}) G 12 (N , A \ {(3, 1); (4, 2)}) 1 1 2 -1 2 2 -1 -1 -1 2 2 2 2 2 2 2 -5 -4 -5 -5 -4 -4 -4 -5 -5 -5 -5 -5 -5 3 -3 -2 +∞ -3 -2 -2 -2 +∞ +∞ +∞ -3 -3 -3 4 7 -8 -9 -9 4 4 -8 7 7 -9 7 7 -9 5 -7 -6 -7 -7 +∞ -6 -6 +∞ -7 -7 +∞ -7 -7 6 +∞ -4 -5 -5 7 -4 -5 10 -5 -6 10 -5 -6 1 +∞ +∞ 2 2 -1 -1 -1 -1 -1 -1 -1 -1 -1 2 +∞ +∞ +∞ +∞ -4 -4 -4 -5 -5 -5 -5 -5 -5 3 +∞ +∞ +∞ +∞ -2 -2 -2 -2 -2 -2 -3 -3 -3 4 +∞ +∞ +∞ +∞ 4 4 -8 -8 -8 -9 -9 -9 -9 5 +∞ +∞ +∞ +∞ +∞ -6 -6 -6 -7 -7 -7 -7 -7 6 +∞ +∞ +∞ +∞ 7 -4 -5 -5 -5 -6 -6 -6 -6 C < 1, 2, 3, 1 > < 2, 5, 4, 2 > < 2, 5, 4, 2 > < 2, 5, 4, 2 > ∅ ∅ ∅ ∅ ∅ ∅ ∅ ∅ ∅ Table 4: Information available at the end of each iteration. Under column y(G) we report, for each node i ∈ N \ {s}, the cost as output of Algorithm 5 with Ki = 1. Column y ζ shows the potential optimal cost for each node i ∈ N \ {s}. C indicates the cycle returned by Algorithm 5. 4 Computational Experiments The aim of this Section is to evaluate the behaviour of the proposed solution approaches and to compare them in terms of computational cost. The experiments have been carried out on instances generated by ourselves. Indeed, the ESPP is not addressed by the scientific literature, thus no benchmark instances are available. In the next Section, we present the considered instances and how they were generated. 4.1 Test Problems The computational results are carried out on two groups of test problems. The first one is composed of random networks, the instances belonging to the second group are derived from Vehicle Routing Problem (VRP) benchmark test problems. The test problems of the first group (i.e., fully random networks) have been generated randomly by using the Netgen generator of Klinglman et al. [41]. Table 5 shows the characteristics of the considered fully random networks, where the number of nodes, the number of arcs and the density, that is the ratio between the number of arcs and the number of nodes are highlighted. The cost cij , ∀(i, j) ∈ A is randomly generated from the interval [0, 100]. test R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 R11 R12 R13 R14 R15 nodes 300 300 300 350 350 350 400 400 400 450 450 450 500 500 500 arcs 3000 9000 15000 3500 10500 17500 4000 12000 20000 4500 13500 22500 5000 15000 25000 density 10 30 50 10 30 50 10 30 50 10 30 50 10 30 50 Table 5: Characteristic of the fully random networks. For each network, a given number of instances has been generated, in such a way that at least a fixed number of negative cost cycles is present. The procedure used to build the test problems is detailed in what follows. Let #c be the number of negative cost cycles and let leng be the number of arcs belonging to a given cycle. For each 24 set F A-A A-B A-P CE S B CM T T GW KC paper |set| [27] [3] [3] [3] [13] [52] [58] [14] [55] [36] 3 27 23 24 13 6 60 14 13 20 nodes min max 45 135 32 80 31 78 16 101 13 101 50 100 100 100 50 199 75 385 200 483 Table 6: Characteristic of the CVRP benchmark instances. fully random network, we have generated 30 instances by letting #c = 1, . . . , 30. In other words, each instance has a number of cycles equal to #c. The value leng has been randomly chosen in the interval [2, 5]. The procedure used to build the test instances relies on the solution of the shortest path problem for each fully random network, obtaining a tree T . Let πij be the path from node i to node j in T . Exactly #c cycles are chosen by selecting #c arcs (j, i) ∈ A \ T . Each cycle Ci#c , #c = 1, . . . , 30 is composed by the arcs belonging to the path πij and by the arc (j, i). Starting from each leaf node and exploring the related branch, the first path πij , from which it is possible to generate a cycle with leng nodes is selected. In other words, the number of arcs of each selected path πij is equal to leng-1. The cost of the arcs belonging to each obtained cycle Ci#c , #c = 1, . . . , 30 is modified in order to have a negative cost cycle that is c(Ci#c ) < 0. It is worth observing that the procedure described above does not ensure that exactly #c negative cost cycles are introduced, but the value #c indicates the minimum number of negative cost cycles present in the network. The second group of instances are derived from Capacited VRP (CVRP) test problems taken from the scientific literature. We have considered ten sets of test problems. Each set is associated with the scientific contribution in which the corresponding test problems have been introduced for the first time. Table 6 shows the name of each set, the paper in which the related test problems have been introduced, the number of problems and the characteristics of the instances in terms of number of nodes (i.e., the maximum and the minimum number of nodes over the networks belonging to the considered set are reported). In order to test the algorithm for the ESPP on the CVRP test problems, we have considered the related RCESPP, that is the pricing problem obtained when 25 a column-generation approach is used to solve the CVRP. First, we have modified the CVRP test problems by adding a prize at each node. As described in [49], the value of each prize can be chosen in the range [1, 20]. The cost of a path is the sum of the cost associated with the arcs minus the prizes collected at the nodes. Second, we get the ESPP instances by considering the Lagrangean relaxation of the RCESPP. Indeed, given a Lagrangean multiplier, the problem is an instance of the ESPP. For each RCESPP test problem we have considered 20 ESPP instances by chosing several values for the Lagrangean multiplier. These values are selected in a such way that instances with different degree of complexity are obtained:the lower the value of the Lagrangean multiplier, the more difficult the ESPP instances. As suggested in [6], the Lagrangean multiplier is set equal to 0.1, 0.2, . . . , 2 for the 1st , the 2nd , . . . , the 20th ESPP instances. Thus we have tested 4060 ESPP instances. 4.2 Test Codes The codes considered in this work are named DM LA, implementing Algorithm 3 described in Section 3.1; the code DLA is related to Algorithm 6, defined in Section 3.2; the enumerative approach, that is Algorithm 7, described in Section 3.3 is implemented with the code EN . Considering DLA, at each iteration, the costs for each node are inizialized by considering the partial solutions obtained in the previous iteration. In particular, the set L contains all nodes such that at least one path has been determined in the previous iteration and the labels are those available at the end of the previous iteration. Of course, for the nodes belonging to the detected cycle, the dimension of the associated label is incremented by one. This type of initialization speeds-up the search process at each iteration. The same type of initializzation is not possible for DM LA. Indeed, at each iteration, an additional resource is introduced, augmenting the dimension of each label. Since the efficiency of a solution is affected by the dimension of the associated label, a solution that in the previous iteration was dominated, with the new definition of the label could represent an efficiet sub-path. For this reason, in DM LA the initialization is that reported in Algorithm 4. 4.3 Computational Results In this Section, we analyze the behaviour of the proposed solution approaches. In the next Section we focus on the results collected when solving the first group of instances, that is, the fully random networks. In Section 4.3.2, the resulting best performing algorithm on the first group of instances is tested on the second one. 26 4.3.1 Computational Results on the Fully Random Networks In what follows, we show the computational results obtained with DM LA, DLA and EN when solving the first group of instances. The collected results are grouped in three classes. The first one is related to the instances with #c ∈ [1, 10], the second class to the networks with #c ∈ [11, 20] and the results obtained on the instances with #c ∈ [21, 30] belong to the third class. They are collected in Tables A.1 A.3 of Appendix. Each table reports, for each fully random network, the average computational cost in ms and the average number of iterations over 10 instances, that is those with #c ∈ [1, 10], #c ∈ [11, 20] and #c ∈ [21, 30], respectively. Results for DM LA. As expected, the computational results underline that the higher the number of negative cost cycles, the higher the execution time. Table 7 shows that the computational cost for solving the second and the third class of instances is 15.77 and 197.54 times higher than the execution time required to solve the instances of the first class. #c 1 2 3 4 5 6 7 8 9 10 AVG time 68.64 127.92 217.36 434.72 582.40 885.05 1215.77 1886.57 2338.98 3063.86 1082.13 iter 1.07 2.27 3.67 5.80 7.40 9.33 11.00 13.20 14.60 17.00 8.53 #c 11 12 13 14 15 16 17 18 19 20 DM LA time 3411.22 4501.15 6140.20 7985.17 11858.16 14540.33 20057.57 26119.77 33535.01 42470.75 17061.93 iter 18.00 20.07 22.40 24.67 27.53 29.93 32.53 34.93 36.93 39.47 28.65 #c 21 22 23 24 25 26 27 28 29 30 time 49217.28 57689.17 73947.59 93819.00 117422.99 148047.03 208258.21 351173.85 438542.73 599554.48 213767.23 iter 39.33 41.53 43.60 45.13 46.93 48.47 50.73 53.93 55.47 57.87 48.30 Table 7: Execution time in ms and number of iterations obtained by DM LA when solving the first, the second and the third class of test problems. This behaviour can be justified by considering the number of iterations. Indeed, DM LA performs, on average, 8.53, 28.65 and 48.30 iterations, for the instances belonging to the first, the second and the third class, respectively. Figure 4 shows the trend of the computational cost and the number of iterations with respect to the number of negative cost cycles. From Figure 4, it is clear that the computational cost grows exponentially with respect to the increase of the number of negative cost cycles, whereas, a linear trend is observed for the number of iterations. This behaviour is due to the fact that the higher the number of negative cost cycles, the higher the execution time per 27 Figure 4: Execution time and number of iterations of DM LA as a function of the number of negative cost cycles. iteration. In particular, the time per iteration is exponential with respect to the number of negative cost cycles. This trend is shown in Figure 5. Figure 5: Execution time per iteration of DM LA as a function of the number of negative cost cycles. A possible explanation of this trend can be found by considering the dimension of the state-space induced by the definition of the labels. Indeed, the state-space is composed by states associated with efficient partial solutions. The number of Paretooptimal solutions is strongly related to the dimension of the labels. Indeed, the higher the number of negative cost cycles, the higher the dimension of the labels due to the fact that an higher number of additional node resources must be introduced. In addition, as shown in [5, 8, 21], the number of non-dominated solutions increases in an exponential way with the size of the labels. As a conseguence, the state-space grows exponentially with the increase of the number of the negative cost cycles. Results for DLA. In Table 8, we report the average computational cost for each value of #c derived from Table A.1 - A.3 of Appendix. As expected, the higher the number of negative cost cycles the higher the execution time. Indeed, the computational cost for solving the instances belonging to the second and the third class is 3.63 and 7.05 times higher than that required for the instances of the first class. This 28 behaviour is justified by the number of iterations executed by DLA. In particular, DLA performs 3.81 and 8.59 times higher number of iterations for the second and the third class of instances, respectively, than that executed by the algorithm for solving the instances belonging to the first class. #c 1 2 3 4 5 6 7 8 9 10 AVG time 98.80 133.12 151.84 166.40 197.60 210.08 234.00 276.64 372.32 392.08 223.29 iter 3.27 4.87 6.73 8.93 11.13 12.47 15.87 18.67 22.47 25.00 12.94 #c 11 12 13 14 15 16 17 18 19 20 DLA time 573.04 635.44 659.36 693.68 747.77 887.13 957.85 975.53 925.61 1054.57 811.00 iter 33.20 36.33 38.60 40.73 46.07 54.00 57.73 60.67 59.60 66.27 49.32 #c 21 22 23 24 25 26 27 28 29 30 time 1045.21 1128.41 1210.57 1290.65 1278.17 1361.37 1551.69 1982.25 2415.94 2482.50 1574.67 iter 71.13 76.87 85.73 92.07 95.00 102.87 113.07 135.87 162.07 176.40 111.11 Table 8: Execution time in ms and number of iterations obtained by DLA when solving the first, the second and the third class of test problems. Figure 6 shows the trend of the computational cost and the number of iterations executed by DLA. Figure 6: Execution time and number of iterations of DLA as a function of the number of negative cost cycles. From Figure 6, it is evident that both the execution time and the number of iterations present the same trend: they grow exponentially with respect to the increase of the number of negative cost cycles. Results for EN . The computational results underline that EN is not able to solve all the instances considered in this paper. As shown in Table 9, only some instances 29 #c 1 2 3 4 5 6 7 8 9 10 AVG EN time 252.72 781.05 2119.53 6428.36(1) 19172.52(1) 58197.29(1) 181989.65(1) 532805.82(2) 1115989.03(6) 2358009.72(13) 427574.57 nodes 4.00 12.60 37.60 116.50 344.71 1047.36 3464.71 12513.77 38617.60 76373.50 13253.24 Table 9: Execution time in ms and number of nodes generated by EN when solving the first class of test problems. The superscript near the time indicates the number of instances that are not solved. EN is not able to solve the instances of both the second and the third class. belonging to the first class are solved. In particular, the 93.33%, the 86.67%, the 60% and the 13.33% of instances with a number of negative cost cycles #c ∈ [4, 7], #c = 8, #c = 9 and #c = 10, respectively, are solved. EN runs out of memory for all the instances belonging to the second and the third class. In addition, the computational cost grows very fast with respect to the increase of the number of negative cost cycles. This behaviour can be justified by considering the generated number of nodes. This trend is clearly underlined in Figure 7. Figure 7: Execution time and number of nodes of EN as a function of the number of negative cost cycles. Comparison. From the considerations reported above, it is clear that EN is very inefficient for solving the instances considered in this paper. In what follows, we focus 30 on the other two proposed algorithms (that is DM LA and DLA) and we compare their behaviour. The results collected in Tables A.1 - A.3 of Appendix, underline that DLA behaves the best. Indeed, on average, DM LA is 88.89 times slower than DLA. However, it is worth observing that the number of iterations performed by DLA is 2.03 times higher than that of DM LA. The worst performance in terms of computational cost of DM LA is due to the average time per iteration. Indeed, the time per iteration obtained with DLA is 93.87 times lower than than of DM LA. The reasons of the poor performance of DM LA in terms of time per iteration has explained in Section 4.3.1. From Figure 8, it is possible to observe that the higher the number of negative cost cycles, the higher the difference, in terms of execution time, between DLA and DM LA. More specifically, DLA is 4.85, 21.04 and 135.75 times faster than DM LA for the instances belonging to the first, the second and the third class, respectively. Figure 8: Execution time of DM LA and DLA as a function of the number of negative cost cycles. 4.3.2 Computational Results on CVRP Benchmark Instances In this section, we evaluate the behaviour of the best performing algorithm, that is, DLA by considering the CVRP benchmark instances. An execution time limit of one hour per run has been imposed. The results collected on the corresponding ESPP instances are summarized in Table A.4 of the Appendix. We report the name of the set under the first column, the column min λ reports the minimum value of the Lagrangean multiplier such that at least one instance is solved, the last three columns show the numerical results obtained. In particular, for each set, we have considered average results for each value of the Lagrangean multiplier. Under column min, we report the minimum values related to the time (in seconds), number of iterations (iter), number of cycles (cycles) and the percentage (%) of the instances solved, evaluated over all the average results, obtained for each value of the multiplier. Under column max the maximum values and under column mdm the medium values on all the instances associated 31 with each set. It is worth observing that the first six sets, that is, F , A-A, A-B, A-P , CE, and S contain instances associated with CVRP test problems for which the optimal solution is known. The remaining four sets are composed of instances for which the related CVRP test problems are not solved to optimality. The average results reported in Table A.4 (see row AVG) underline that on all the considered test problems, in the medium case, the 60% of instances are solved within the time limit of one hour. In the worst case, only the 21% of instances is solved, whereas 95% of instances are solved in the best case (see row AVG, column max of Table A.4). It is worth observing that for the first six sets, at least one instances with the Lagrangean multiplier equal to 0.1 is solved (see column min λ of Table A.4). For the remaining sets, DLA is able to solve at least one instance with the Lagrangean multiplier equal to 0.7, 0.6, 0.6, and 0.3 for set B, CM T , T , and GW KC, respectively. In addition, even though the best performance is observed for the first six sets of instances, the results collected on the other sets can be considered satisfactory. Indeed, the average percentage of solved problem is of 17%, 44% and 87% in the worst, medium and best case, respectively. 5 Conclusions In this paper we have investigated the shortest path problem in presence of negative cost cycles. This study is the first attempt to provide solution methods for the singlesource all-destinations shortest path problem with negative cost cycles. The scientific literature provides strategies that are able to determine the presence of negative cost cycles, but no work considers the resolution of the shortest path problem with negative cost cycles. Three different strategies have been devised to optimally solve the problem under investigation. The main idea behind the proposed solution approaches is to compute, for each node, the minimum number of paths such that the shortest paths from the source node to all others nodes are determined. In addition, all the methods dynamically increase the number of paths that have to be found for some node. The main difference among the proposed approaches is related to the way in which the number of paths is incremented. In the first method, the number of paths that have to be found is determined by considering a dummy node resource that keeps trace about the visiting at the node. This results in a constrained multi-objective shortest path in which the node associated with the dummy resource can be visited only once along the paths. The second proposed approach is based on the idea behind the k shortest path methods. In particular, the value of k is different per node and it is incremented each time a further path that passes through such a node is needed in order to avoid the negative cost cycle. The last strategy increases the number of paths by considering an enumerative approach that makes use of a tree built by a 32 cycle elimination procedure. The theoretical complexity of the proposed solution approaches in the worst case is derived. The proposed solution approaches have been evaluated enpirically on a large set of test problems. In particular, we have considered two groups of instances. The first one refers to fully random networks, the second group contains the instances derived from Vehicle Routing Problem benchmarks. Referring to the first group of instances, we have considered instances with up to 500 nodes and 25000 arcs with 30 negative cost cycles at least present in the networks. The computational results show that the solution approach based on the k shortest paths problem and the optimal dynamic programming strategy derived from well-known procedures for addressing the resource constrained elementary shortest path problem are very efficient. Instead the enumerative approach shows very poor performance. In particular, it solves only instances with up to 10 negative cost cycles. The experiments underline the superiority of the innovative strategy based on the k shortest paths problem. Indeed, it outperforms the dynamic programming based approach and the enumerative strategy. In particular, the best performing algorithm is able to solve the instances based on fully random networks with 500 nodes, 25000 arcs and 30 negative cost cycles in about 5 seconds. The proposed method based on the k shortest paths problem has been tested on instances derived from the Vehicle Routing Problem benchmarks. In particular, we have considered two class of test problems: the first one refers to those that the literature solve to optimality, the second class constains the test problems for which only near optimal solutions are known. Starting from the Vehicle Routing Problem benchmarks we have derived several instances of the elementary shortest path problem with a different degree of difficulty. The computational results suggest that the best performing algorithm solves to optimality near to all the more difficult instances belonging to the first class within a reasonable amount of time. For the instances of the second class, the solution approach based on the k shortest paths probelm does not solve the more difficult instances. However, despite to the N P hard complexity of the problem, the numerical results are satisfactory. From the computational results, we can conclude that the solution approach based on the k shortest paths problem is very efficient for solving the elementary shortest path problem on medium-large size fully random networks. In addition, the proposed method is able to solve in a reasonable amount of time instances derived from the Vehicle Routing Problem benchmarks. References [1] R.K. Ahuja, K. Mehlhorn, J.B. Orlin, and R.E. Tarjan. Faster algorithms for the shortest path problem. Technical Report CS-TR-154-88, Departement of Computer Science, Princeton University, 1988. 33 [2] E. W. Allender. On the number of cycles possible in digraphs with large girth. Discrete Applied Mathematics, 10:211–225, 1985. [3] P. Augerat, J. M. Belenguer, E. Benavent, A. Corberan, D. Naddef, and G. Rinaldi. Computational results with a branch and cut code for the capacitated vehicle routing problem. Technical Report 949-M, Universite Joseph Fourier, Grenoble, France. [4] J. A. Azevedo, J. Madeira, M. Costa, E. Q. V. Martins, and F. Pires. A computational improvement for a shortest paths ranking algorithm. European Journal of Operational Research, 73:188–191, 1994. [5] O. Barndorff-Nielsen and M. Sobel. On the distribution of the number of admissible points in a vector random sample. Theory of Propability and its Applications, 11(2):283–305, 1966. [6] J. E. Beasley and N. Christofides. An algorithm for the resource constrained shortest path problem. Networks, 19(4):379–394, 1989. [7] R. E. Bellman. On a routing problem. Quarterly of Applied Mathematics, 16(1):87–90, 1958. [8] J. L. Bentley, H. T. Kung, M. Schkolnick, and C. D. Thompson. On the average number of maxima in a set of vectors and applications. Journal of ACM, 25(4):536–543, 1978. [9] N. Boland, J. Dethridge, and I. Dumitrescu. Accelerated label setting algorithms for the elementary resource constrained shortest path problem. Operations Research Letters, 34(1):58–68, 2006. [10] S. Chen and D.R. Ryan. A comparison of three algoritms for finding fundamental cycles in a directed graph. Networks, 11:1–12, 1981. [11] B. V. Cherkassky, A. V. Goldberg, and T. Radzik. Shortest paths algorithms: Theory and experimental evaluation. Mathematical Programming, 73(2):129– 174, 1996. [12] E. I. Chong, S. R. Maddila, and S. T. Morley. On finding single-source singledestination k shortest paths. In 7th International Conference Computing and Information, July 1995. [13] N. Christofides and S. Eilon. An algorithm for the vehicle dispatching problems. Operational Research Quarterly, 20(3):309–318, 1969. [14] N. Christofides, A. Mingozzi, and P. Toth. The vehicle routing problem. In N. Christofides, A. Mingozzi, P. Toth, and C. Sandi, editors, Combinatorial Optimization, chapter 11. John Wiley, Chichester, 1979. 34 [15] T. H. Cormen, C. E. Leiserson, and R. L. Rivest. Introduction to Algorithms. MIT Press/McGraw-Hill Book Company, Boston, MA, second ed. edition, 1992. [16] G. B. Dantzig. On the shortest route through a network. Management Science, pages 187–190, 1960. [17] M. S. Daskin. Network and Discrete Location. John Wiley and Sons, New York, 1995. [18] M. Desrochers. An algorithm for the shortest path problem with resource constraints. Technical Report G-88-27, Les Cahiers du GERAD, 1988. [19] L. Di Puglia Pugliese and F. Guerriero. Survey on resource constrained shortest path problems. Technical Report 1/11, University of Calabria, 2011. [20] L. Di Puglia Pugliese and F. Guerriero. A computational study of solution approaches for the resource constrained elementary shortest path problem. Annals of Operations Research, 201(1):131–157, 2012. [21] L. Di Puglia Pugliese and F. Guerriero. Shortest path problem with forbidden paths: the elementary version. European Journal of Operational Research, 2013. DOI: 10.1016/j.ejor.2012.11.010. [22] R. B. Dial. Algorithm 360: Shortest path forest with topological ordering. Communications of the ACM, 12(11):632–633, 1969. [23] E. W. Dijkstra. A note on two problems in connexion with graphs. Numerische Mathematik, 1(1):269–271, 1959. [24] S. E. Dreyfus. An appraisal of some shortest path algorithms. Operations Research, 17:395–412, 1969. [25] D. Eppstein. Finding the k shortest paths. SIAM Journal on Computing, 28(2):652–673, 1998. [26] D. Feillet, P. Dejax, M. Gendreau, and C. Gueguen. An exact algorithm for the elementary shortest path problem with resource constraints: application to some vehicle routing problems. Networks, 44(3):216–229, 2004. [27] M. L. Fisher. Optimal solution of vehicle routing problems using minimum k-trees. Operations Research, 42:626–642, 1994. [28] R. W. Floyd. Algorithm 97: shortest path. Communications of the ACM, 5(6):345, 1962. [29] L. R. Ford and D. R. Fulkerson. Flows in Networks. Princeton University Press, Princeton, NJ, 1962. 35 [30] M. L. Fredman and R. E. Tarjan. Fibonacci heaps and their uses in improved network optimization algorithms. Journal of the ACM, 34(3):596–615, 1987. [31] H. N. Gabow and R. E. Tarjan. Faster scaling algorithm for network problems. SIAM Journal on Computing, 18(5):1013–1036, 1989. [32] G. Gallo and S. Pallottino. Shortest path algorithms. Annals of Operations Research, 13(1):1–79, 1988. [33] M. R. Garey and D. S. Johnson. Computers and Intractability: A Guide to the Theory of NP-Completeness. W. H. Freeman & Co, New York, NY, USA, 1990. [34] A. Goldberg. Shortest path algorithms: Engineering aspects. In ISAAC: 12th International Symposium on Algorithms and Computation, pages 502–513, 2001. [35] A. V. Goldberg. Scaling algorithms for the shortest path problem. In 4th ACM-SIAM Symposium on Discrete Algorithms, pages 222–231, 1993. [36] B. L. Golden, E. A. Wasil, J. P. Kelly, and I-M. Chao. Metaheuristics in vehicle routing. In T. G. Crainic and G. Laporte, editors, Fleet Management and Logistics, pages 33–56. Kluwer, Boston, 1998. [37] F. Guerriero and L. Di Puglia Pugliese. Multi-dimensional labelling approaches to solve the linear fractional elementary shortest path problem with time windows. Optimization Methods & Software, 26(2):295–340, 2011. [38] F. Guerriero, R. Musmanno, V. Lacagnina, and A. Pecorella. A class of labelcorrecting methods for the k shortest paths problem. Operations Research, 49(3):423–429, 2001. [39] S. Irnich. Resource extension functions: properties, inversion and generalization to segments. OR Spectrum, 30(1):113–148, 2008. [40] S. Irnich and G. Desaulniers. Shortest path problems with resource constraints. In G. Desaulniers, J. Desrosiers, and M. M. Solomon, editors, Column Generation, chapter 2, pages 33–65. Springer US, 2005. [41] D. Klingman, A. Napier, , and J. Stutz. Netgen: A program for generating large-scale (un)capacitated assignment, transportation, and minimum cost flow network problems. Management Science, 20, 1974. [42] N. Kohl. Exact methods for time constrained routing and related scheduling problems. PhD thesis, Informatics and Mathematical Modelling, Technical University of Denmark, DTU, Richard Petersens Plads, Building 321, DK-2800 Kgs. Lyngby, 1995. 36 [43] T .L. Magnanti and R. T. Wong. Network design and transportation planning: models and algorithms. Transportation Science, 18:1–55, 1984. [44] E. Q. Martins, M. M. Pascoal, and J. L. Santos. Deviation algorithms for ranking shortest paths. International Journal of Foundations of Computer Science, 10(3):247–261, 1999. [45] E. Q. V. Martins. An algorithm for ranking paths that may contain cycles. European Journal of Operational Research, 18(1):123–130, 1984. [46] E. F. Moore. The shortest path through a maze. In Interantional Symposium on the Theory of Switching, pages 285–292. Harvard University Press, 1959. [47] U. Pape. Implementation and efficiency of Moore-algorithm for the shortest path problem. Mathematical Programming, 7:212–222, 1974. [48] R. C. Read and R. E. Tarjan. Bounds on backtrack algorithms for listing cycles, paths, and spanning trees. Networks, 5:237–252, 1975. [49] G. Righini and M. Salani. New dynamic programming algorithms for the resource constrained elementary shortest path problem. Networks, 51(3):155–170, 2008. [50] R. Sedgewick and K. Wayne. http://www.cs.princeton.edu/ rs/AlgsDS07/, 2007. Shortest paths. [51] D. R. Shier. On algorithms for finding the k shortest paths in a network. Networks, 9(3):195–214, 1979. [52] M. M. Solomon. Vehicle routing and scheduling with time window constraints: Models and Algorithms. PhD thesis, Department of Decision Science, University of Pennsylvania, 1983. [53] K. Subramani. A zero-space algorithm for negative cost cycle detection in networks. Journal of Discrete Algorithms, 5:408–421, 2007. [54] K. Subramani and L. Kovalchick. A greedy strategy for detecting negative cost cycles in networks. Future Generation Computer Systems, 21(4):607–623, 2005. [55] D. Taillard. Parallel iterative search methods for vehicle routing problems. Networks, 23:661–673, 1993. [56] R. E. Tarjan. Enumeration of elementary circuits of a directed graph. SIAM Journal on Computing, 2:211–216, 1974. [57] J. C. Tiernan. An efficient search algorithm to find the elementary circuits of a graph. Communication of the ACM, 13:722–726, 1970. 37 [58] A. Van Bredam. An Analysis of the Behavior of Heuristics for the Vehicle Routing Problem for a Selection of Problems with Vehicle-Related. CustomerRelated, and Time-Related Constraints. PhD thesis, University of Antwerp, 1994. [59] H. Weinblatt. A new search algorithm for finding the simple cycles of a finite directed graph. Journal of the ACM, 19:43–56, 1973. [60] J. T. Welch. A mechanical analysis of teh cyclic structure of undirected linear graph. Journal of the ACM, 13:205–210, 1966. [61] T. Yamada and H. Kinoshita. Finding all the nagative cycles in a directed graph. Discrete Applied Mathematics, 118:279–291, 2002. [62] J. Y. Yen. Finding the k-shortest loopless paths in a network. Management Science, 17:711–715, 1971. 38 Appendix: Computational Results test R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 R11 R12 R13 R14 R15 AVG DM LA time iter 0.24 8.00 0.26 6.30 1.83 13.20 0.17 7.00 1.44 8.80 1.05 8.20 0.23 7.80 1.01 8.90 1.73 9.50 0.16 7.80 1.67 9.10 1.72 7.20 0.57 9.10 2.13 8.90 2.02 8.20 1.08 8.53 DLA time iter 0.04 8.40 0.12 16.30 0.38 22.70 0.04 8.80 0.12 10.80 0.48 22.00 0.07 11.00 0.14 7.50 0.30 15.40 0.06 8.70 0.22 11.30 0.50 17.60 0.07 8.40 0.26 12.60 0.55 12.60 0.22 12.94 EN time nodes 156.20 17417.80 123.73(1) 4920.00 0.74(7) 16.00 67.09(1) 4920.00 138.39(1) 3826.67 346.94(1) 3831.00 272.98(1) 18324.67 221.90(1) 3948.00 153.41(2) 1844.50 92.15(1) 4920.00 264.18(2) 3641.13 72.52(3) 702.14 238.83(1) 10164.33 161.84(2) 1844.50 634.52 4056.70 196.36 5625.16 Table A.1: Results obtained on the first class of instances. The superscript near the time indicate the number of instances that are not solved. test R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 R11 R12 R13 R14 R15 AVG DM LA time final S 8.75 29.30 6.66 26.40 12.90 22.70 5.89 33.10 28.32 25.60 43.87 33.50 8.42 30.10 44.44 28.10 15.45 28.30 2.42 27.60 17.23 32.50 13.35 27.60 9.37 27.90 25.79 31.70 13.07 25.30 17.06 28.65 DLA time iter 0.09 27.80 0.39 34.00 0.71 43.70 0.16 41.20 0.48 48.60 4.26 146.70 0.23 43.20 0.73 76.60 0.84 37.90 0.21 37.20 0.54 28.80 0.78 30.70 0.39 47.20 0.74 39.60 1.59 56.60 0.81 49.32 Table A.2: Results obtained on the second class of instances. EN is not able to solve these instances. 39 test R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 R11 R12 R13 R14 R15 AVG DM LA time final S 36.68 40.00 308.04 57.40 132.59 40.80 86.58 54.90 232.17 42.10 351.16 40.90 86.98 45.20 440.89 51.70 336.15 53.50 279.45 49.50 21.39 44.20 110.73 57.50 316.13 46.20 252.83 47.60 214.74 53.00 213.77 48.30 DLA time iter 0.38 88.20 1.20 103.10 2.08 122.50 0.46 108.40 1.58 140.90 2.41 167.70 0.65 106.80 0.87 95.50 1.64 76.30 0.26 62.80 0.97 60.80 4.47 146.20 1.45 179.60 1.18 72.00 4.02 135.80 1.57 111.11 Table A.3: Results obtained on the third class of instances. EN is not able to solve these instances. 40 set F min λ 0.1 A-A 0.1 A-B 0.1 A-P 0.1 CE 0.1 S 0.1 B 0.7 CM T 0.6 T 0.6 GW KC 0.3 AVG time iter cycles % solved time iter cycles % solved time iter cycles % solved time iter cycles % solved time iter cycles % solved time iter cycles % solved time iter cycles % solved time iter cycles % solved time iter cycles % solved time iter cycles % solved time iter cycles % solved min mdm max 0.00 1.00 0.00 33% 0.04 11.81 2.04 7% 0.00 1.00 0.00 4% 0.00 1.00 0.00 4% 0.00 1.00 0.00 38% 0.10 11.33 0.33 50% 0.03 4.12 0.95 2% 0.19 61.25 3.75 14% 11.31 195.83 11.67 38% 0.27 1.00 0.00 15% 1.19 28.93 1.87 21% 0.61 50.35 2.73 83% 74.88 458.45 13.29 79% 146.92 948.93 14.56 35% 29.38 171.47 4.28 73% 19.85 103.89 2.64 76% 11.28 173.58 3.15 78% 168.22 997.60 18.77 35% 305.52 1092.18 11.79 29% 208.41 1248.68 25.18 49% 18.34 96.94 4.73 64% 98.34 534.20 10.11 60% 3.57 269.00 13.00 100% 828.83 2262.09 33.50 100% 1015.13 3227.60 36.60 96% 360.37 1273.20 15.83 100% 380.31 1028.00 8.80 100% 111.27 816.00 17.00 100% 941.88 3134.00 33.00 100% 906.53 4975.75 27.50 57% 892.76 2775.00 51.60 92% 221.11 926.50 17.67 100% 566.18 2068.71 25.45 95% Table A.4: Results obtained on the instances derived from CVRP benchmark test problems. The time is given in seconds. 41
© Copyright 2026 Paperzz