shortest path simplex algorithm

16
Asia-Pacific Journal of Operational Research Vol. 27, No. 6 (2010) 677–691 c World Scientific Publishing Co. & Operational Research Society of Singapore DOI: 10.1142/S0217595910002946 SHORTEST PATH SIMPLEX ALGORITHM WITH A MULTIPLE PIVOT RULE: A COMPARATIVE STUDY A. SEDE ˜ NO-NODA and C. GONZ ´ ALEZ-MART ´ IN Departamento de Estad´ ıstica Investigaci´ on Operativa y Computaci´ on (DEIOC) Universidad de La Laguna 38205- La Laguna, Tenerife (Espa˜ na) Received 16 May 2008 Accepted 13 June 2009 This paper introduces a new multiple pivot shortest path simplex method by choosing a subset of non-basic arcs to simultaneously enter into the basis. It is shown that the proposed shortest path simplex method requires O(n) multiple pivots and its running time is O(nm). Results from a computational study comparing the proposed method from previously known methods are reported. The experimental show that the proposed rule is more efficient than the considered shortest path simplex pivot rules. Keywords : Shortest path problem; simplex shortest path algorithms; multiple pivot rule; experimental analysis. 1. Introduction The shortest path (SP) problem consists of finding shortest length paths from a source node to all other nodes or to detect a cycle of negative length in a directed network with arbitrary lengths. There are many important real cases where this problem appears, including: applications in route generation for delivery operations, and even in map and route algorithms within applications such as Google. There are numerous algorithms to solve it (see, for example, Ahuja et al., 1993). The Bellman-Ford-Moore (Bellman, 1958; Ford, 1956; and Moore, 1957) label- correcting algorithm achieves the best strongly polynomial running time of O(nm) for solving the SP problem on a network of n nodes and m arcs. There are also sev- eral variants of the shortest path simplex (SPS) algorithm (Dantzig, 1957; Minty, 1958; Cunningham, 1979; Orlin, 1985; Akg¨ ul, 1986; Goldfarb et al., 1990a, 1990b; Goldfarb and Jin, 1999; Sede˜ no-Noda and Gonz´ alez-Mart´ ın, 2007). In particu- lar, Goldfarb and Jin, 1999; introduce the first SPS algorithm running in O(nm) time. Recently, in Sede˜ no-Noda and Gonz´ alez-Mart´ ın (2010) obtain an O(nm) time algorithm using the idea of pseudo permanent labels. 677

Upload: faaizz-d-zul

Post on 30-Jul-2015

72 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Shortest Path Simplex Algorithm

December 17, 2010 11:2 WSPC/S0217-5959 APJOR S0217595910002946.tex

Asia-Pacific Journal of Operational ResearchVol. 27, No. 6 (2010) 677–691c© World Scientific Publishing Co. & Operational Research Society of SingaporeDOI: 10.1142/S0217595910002946

SHORTEST PATH SIMPLEX ALGORITHMWITH A MULTIPLE PIVOT RULE:

A COMPARATIVE STUDY

A. SEDENO-NODA∗ and C. GONZALEZ-MARTIN

Departamento de EstadısticaInvestigacion Operativa y Computacion (DEIOC)

Universidad de La Laguna38205- La Laguna, Tenerife (Espana)

Received 16 May 2008Accepted 13 June 2009

This paper introduces a new multiple pivot shortest path simplex method by choosinga subset of non-basic arcs to simultaneously enter into the basis. It is shown that theproposed shortest path simplex method requires O(n) multiple pivots and its runningtime is O(nm). Results from a computational study comparing the proposed methodfrom previously known methods are reported. The experimental show that the proposedrule is more efficient than the considered shortest path simplex pivot rules.

Keywords: Shortest path problem; simplex shortest path algorithms; multiple pivot rule;experimental analysis.

1. Introduction

The shortest path (SP) problem consists of finding shortest length paths from asource node to all other nodes or to detect a cycle of negative length in a directednetwork with arbitrary lengths. There are many important real cases where thisproblem appears, including: applications in route generation for delivery operations,and even in map and route algorithms within applications such as Google. Thereare numerous algorithms to solve it (see, for example, Ahuja et al., 1993).

The Bellman-Ford-Moore (Bellman, 1958; Ford, 1956; and Moore, 1957) label-correcting algorithm achieves the best strongly polynomial running time of O(nm)for solving the SP problem on a network of n nodes and m arcs. There are also sev-eral variants of the shortest path simplex (SPS) algorithm (Dantzig, 1957; Minty,1958; Cunningham, 1979; Orlin, 1985; Akgul, 1986; Goldfarb et al., 1990a, 1990b;Goldfarb and Jin, 1999; Sedeno-Noda and Gonzalez-Martın, 2007). In particu-lar, Goldfarb and Jin, 1999; introduce the first SPS algorithm running in O(nm)time. Recently, in Sedeno-Noda and Gonzalez-Martın (2010) obtain an O(nm) timealgorithm using the idea of pseudo permanent labels.

677

Page 2: Shortest Path Simplex Algorithm

December 17, 2010 11:2 WSPC/S0217-5959 APJOR S0217595910002946.tex

678 A. Sedeno-Noda & C. Gonzalez-Martın

Given the simplicity of the bases for the SP problem in the SPS algorithm, it ispossible to simultaneously enter several non-basic arcs into the basis. This operationis termed a multiple pivot. This idea is essential to develop new algorithms for theK best shortest path and multiobjective shortest path problems and this notionis formalized for the SPS algorithm in this paper. Moreover, this concept can beadapted with major or minor efforts to others combinatorial optimization problemslike are the Assignment problem, Minimum Spanning Tree problem, etc.

Section 2 describes the linear programming formulation of the SP problem andthe property related with the concept of the multiple pivot is introduced. This prop-erty is used to design a generic SPS algorithm with multiple pivots. In Sec. 3, a newmultiple pivot simplex rule to devise an SPS algorithm that makes O(n) multiplepivots and runs in O(nm) time is given. In Sec. 4, a comparison of the computerresults of our method with the methods of Goldfarb and Jin (1999) and Sedeno-Nodaand Gonzalez-Martın (2010) are presented, along with some comments. Finally, inSec. 5, a discussion of the significance of the results is given.

2. Linear Programming Formulation and a Generic SPSAlgorithm with Multiple Pivots

Given a directed network G = (V, A), let V = {1, . . . , n} be the set of n nodes andlet A be the set of m arcs. The node adjacency set of any node i ∈ V is definedas Γ−

i = {j ∈ V |(j, i) ∈ A}. For each arc (i, j) ∈ A, let cij ∈ R be its length. Thelength of a directed path is the sum of the arc lengths in the path. The networkhas a distinguished node s (the source node). The SP problem consists of findinga shortest length path from node s to every non-source node i ∈ V \{s} or indetermining a negative cycle, that is, a directed cycle of negative length.

If a flow xij is associated with each arc (i, j), and a supply bs = (n − 1) withnode s, and demands bi = −1 for all other nodes i �= s, then the following linearprogramming problem represents the SP problem (see Ahuja et al., 1993):

Minimize c(x) =∑

(i,j)∈A

cijxij (1)

subject to∑

{j:(i,j)∈A}xij −

{j:(j,i)∈A}xji = bi, ∀ i ∈ V (2)

xij ≥ 0, ∀ (i, j) ∈ A (3)

Let X be the convex polyhedron defined by constraints (2)–(3). The aboveproblem is a special case of the minimum cost network flow (MCNF) problem.Any basic solution of the MCNF problem is a spanning tree T ⊆ A of G satisfyingxij > 0, ∀ (i, j) ∈ T . Therefore, any simplex algorithm will never perform degeneratepivots for the SP problem. In addition, all feasible spanning trees are trees rootedat node ssuch that the unique path in the tree from root node s to every other nodeis a directed path. We refer to these spanning trees as directed out-spanning trees.

Page 3: Shortest Path Simplex Algorithm

December 17, 2010 11:2 WSPC/S0217-5959 APJOR S0217595910002946.tex

Shortest Path Simplex Algorithm with a Multiple Pivot Rule 679

It is well-known that any feasible solution of the SP problem is associated with onlyone directed out-spanning tree (see, for example, Ahuja et al., 1993; Goldfarb et al.,1990a). In the rest of paper, a directed out-spanning tree is referred to simply asa tree (or basis tree). In this kind of tree, any node i ∈ V \{s} has only one nodepredecessor in the tree (predi(T )), that is, the in-degree of any non-root node ina directed out-spanning tree is one. Also, we define T +

i = {j ∈ V |(i, j) ∈ T}. LetDi(T ) be the set of descendants of node i in the tree T , that is, the set of nodesin the subtree rooted at i, including node i. Note that |Di(T )| ≥ 1. Let C(T ) =∑

(i,j)∈T cijxij be the value of the objective function associated with the tree T .The distance labels corresponding to a tree T are obtained from the system of

equations cij + di(T ) − dj(T ) = 0 ∀ (i, j) ∈ T by setting ds(T ) = 0. The distancelabel of node i, di(T ), represents the tree path length from node s to node i. Thus,given a tree T , we define the reduced cost cij(T ) = cij + di(T ) − dj(T ) ∀ (i, j) ∈ A.

In a simplex pivot, an arc (i, j) ∈ A\T satisfying i /∈ Dj(T ) with reducedcost cij(T ) < 0 is added to T and (predj(T ), j) is deleted from T yielding a newbasis tree T ′. Note that if i ∈ Dj(T ) then T ∪ {(i, j)} contains a negative directedcycle of length cij(T ) and the SPS algorithm stops. Thus, the simplex algorithmfor the SP problem need not maintain arc flows x(xij = |Dj(T )|∀ (i, j) ∈ T andC(T ) =

∑(i,j)∈T cij |Dj(T )|). The distance labels in T ′ are updated in the following

way: dk(T ′) = dk(T )+cij(T ) ∀ k ∈ Dj(T ). Furthermore, the objective function valueis C(T ′) = C(T )+ cij(T )|Dj(T )|. The operations of updating the set of descendentsof all nodes as well as the detection of a negative cycle can be performed using severaltree indices (see for example Ahuja et al., 1993; Dial et al., 1979).

Assumption 1. The network contains a directed path from source node s to anynon-source node i ∈ V . When this condition is not true, we add artificial arcs (s, i)with infinite length, for any non-source node i ∈ V . Note that these arcs appear inthe optimal solution if and only if the SP problem instance does not have a solution.

We now present definition 1 and property 1 from Goldfarb et al. (1990a). Theseresults are stated without proof:

Definition 1. Given a tree T , a node i ∈ V is said to be permanently labeled in T

if di(T ) = di(T ∗).

Property 1. If i is permanently labeled in T but j is not, and (i, j) ∈ T ∗, then:(1) cij(T ) < 0 and (2) Moreover, if G has no negative cycles then cij(T ) ≤ ckj(T )for all k ∈ Γ−

j .

Property 1 means that if a node j ∈ V is not permanently labeled in T

and if the arc (i, j) ∈ T ∗ and if G has not negative cycles, then cij(T ) =min{ck,j(T )|k ∈ Γ−

j } < 0. Consider the following definitions and results dealingwith the concept of adjacency between trees:

Definition 2. Two trees T and T ′ are adjacent if and only if both have n− 2 arcsin common, that is, both trees differ in only one arc.

Page 4: Shortest Path Simplex Algorithm

December 17, 2010 11:2 WSPC/S0217-5959 APJOR S0217595910002946.tex

680 A. Sedeno-Noda & C. Gonzalez-Martın

The previous definition implies that the tree T ′ can be reached from the treeT by a simplex pivot where the entering arc is just the arc (i, j) ∈ T ′\T and(p, q) ∈ T \T ′ is the leaving arc. Moreover, let T and T ′ be two trees that differ inp < n arcs. Then the following property holds:

Proposition 1. If T and T ′ differ in p < n arcs, where (i1, j1), . . . , (ip, jp) are thearcs in T ′ that are not in T, then: (1) E = {(i1, j1), . . . , (ip, jp)} does not containa directed cycle; (2) ju �= jv holds for all u, v ∈ {1, . . . , p} with u �= v; (3) Thesearcs define the smallest simplex pivot sequence to obtain T ′ from T, and the orderin which these simplex pivots are performed is irrelevant.

Proof. (1) Since T ′ is a directed spanning tree containing the arcs(i1, j1), . . . , (ip, jp), these arcs can not contain a directed cycle. (2) Since in alldirected spanning trees, every node i ∈ V has only one node predecessor, in theset of arcs (i1, j1), . . . , (ip, jp) belonging to T ′ two arcs does not exist such thatju = jv for all u, v ∈ {1, . . . , p} with u �= v, otherwise T ′ is not a tree. (3) Notethat, to obtain T ′ from T , the p arcs (i1, j1), . . . , (ip, jp) must be entered in the treeT . Furthermore, in each one of these non-degenerate simplex pivots, when the arc(ir, jr) enters into the tree, the leaving arc is the arc (predjr (T ), jr). We know fromproperty (2) of this proposition that simplex pivots with two or more of the aboveentering arcs do not imply that the leaving arc will be the same. For this reason,the set of the minimum number of arcs to obtain T ′ from T is exactly the set of arcs{(i1, j1), . . . , (ip, jp)}, because additional exchanges to build up T ′ from T are notnecessary. In addition, T ′ is always obtained independently of the order in whichthe simplex pivots are performed.

Proposition 1 indicates that to obtain an optimal tree T ∗ from any tree T ,we must choose a set of p < n arcs, (i1, j1), . . . , (ip, jp), satisfying ju �= jv for allu, v ∈ {1, . . . , p} with u �= v. But, what are the p < n arcs to enter into any treeT in order to obtain the optimal tree T ∗? The answer to this question requiresthe solution to the SP problem itself. Thus, any multiple pivot rule for the SPSalgorithm must select a subset of non-tree arcs E ∈ A/T satisfying Proposition 1and improving the objective function value C(T ). Since the set of trees is finite andthe objective function of the SP problem is bounded when there are no negativelength cycles in G, the next generic SPS algorithm for the SP problem with a simplexmultiple pivot rule ends with an optimal tree T ∗ or identifies a negative length cycle.

Generic SPS with Multiple Pivot Algorithm;Let T be an initial feasible tree;Compute distance labels di(T ), ∀ i ∈ V ;While ((T is not optimal) and (there is no negative length cycle in G)) do

Select a subset of non-tree arcs E ∈ A\T satisfying Property 1improving C(T );For all (i, j) ∈ E do T = T ∪ {(i, j)}\{(predj, j)};Compute distance labels di(T ), ∀ i ∈ V ;

Page 5: Shortest Path Simplex Algorithm

December 17, 2010 11:2 WSPC/S0217-5959 APJOR S0217595910002946.tex

Shortest Path Simplex Algorithm with a Multiple Pivot Rule 681

In the above algorithm, the distance labels are updated once all of the non-treearcs in E are entered in T . In the next section, a multiple pivot rule satisfyingProposition 1 is given.

3. A SPS Algorithm with O(n) Multiple Pivots

The generic scheme of the last section emphasizes the importance of the selectionof the set of non-tree arcs E. An alternative consist in using local information fromthe tree T , to investigate which p < n arcs satisfying Proposition 1 lead to thegreatest decrease in the objective function value of the SP problem. An analysis ofthe value of objective function induced by a multiple pivot on tree T is required toidentify this set of arcs.

Let j1, j2, . . . , jn be an arbitrary order of the set of nodes. Define (ik, jk) =arg min{cijk

(T )|i ∈ Γ−jk}, ∀ k ∈ {1, . . . , n}. For simplicity consider a multiple pivot

with the arcs {(i1, j1), (i2, j2)} with j1 �= j2 in tree T is made obtaining tree T ′.The question now is: when is it preferred to simultaneously perform both simplexpivots instead of exchanging only one arc of the last set? The answer is whereverthe obtained tree making only one simplex pivot with the arc (i1, j1) or with the arc(i2, j2) has an objective function value greater than C(T ′). To make the analysis,without a loss of generality, assume that j1 /∈ Dj2(T ) (note that if j1 ∈ Dj2(T )then j2 /∈ Dj1(T ) and we can interchange j1 by j2 and vice versa in the followingarguments). Now, the objective function value of the tree T ′ as a function of C(T )must be considered. Take into account the following cases:

Case (A) If j1 /∈ Dj2(T ) and j1 /∈ Dj2(T ′) then the next subcases must beconsidered:

(A1). j2 /∈ Dj1(T ) and j2 /∈ Dj1(T ′) ⇒ C(T ′) = C(T ) + ci1j1(T )|Dj1(T )|+ ci2j2(T )|Dj2(T )|

j1 j2i1 i2

s

Both simplex pivots are made when ci1j1(T ) < 0 and ci2j2(T ) < 0.

(A2). j2 ∈ Dj1(T ) and j2 /∈ Dj1(T ′) ⇒ C(T ′) = C(T ) + ci1j1(T )|Dj1(T )|+ (ci2j2(T ) − ci1j1(T ))|Dj2(T )|

j1

j2

i1 i2

s

Page 6: Shortest Path Simplex Algorithm

December 17, 2010 11:2 WSPC/S0217-5959 APJOR S0217595910002946.tex

682 A. Sedeno-Noda & C. Gonzalez-Martın

Since Dj2(T ) ⊂ Dj1(T ), both simplex pivots are made when ci1j1(T ) < 0 andci2j2(T ) < ci1j1(T )

(A3). j2 /∈ Dj1(T ) and j2 ∈ Dj1(T ′) ⇒ C(T ′) = C(T ) + ci1j1(T )|Dj1(T )|+ (ci2j2(T ) + ci1j1(T ))|Dj2(T )|

j1 j2i1

i2

s

Both simplex pivots are made when ci1j1(T ) < 0 and ci1j1(T ) + ci2j2(T ) < 0

(A4). j2 ∈ Dj1(T ) and j2 ∈ Dj1(T ′) ⇒ C(T ′) = C(T ) + ci1j1(T )|Dj1(T )|+ ci2j2(T )|Dj2(T )|

j1

j2

i1

i2

s

Both simplex pivots are made when ci1j1(T ) < 0 and ci2j2(T ) < 0

Case (B). If j1 /∈ Dj2(T ) and j1 ∈ Dj2(T ′)(j2 /∈ Dj1(T ′)) then, the following sub-cases must be considered:

(B1). j2 /∈ Dj1(T ) and j2 /∈ Dj1(T′) ⇒ C(T ′) = C(T ) + ci2j2 (T )|Dj2(T )|

+ (ci1j1(T )+ ci2j2(T ))|Dj1(T )|

j1 j2

i1

i2

s

Both simplex pivots are made when ci2j2(T ) < 0 and ci1j1(T ) + ci1j2(T ) < 0

Page 7: Shortest Path Simplex Algorithm

December 17, 2010 11:2 WSPC/S0217-5959 APJOR S0217595910002946.tex

Shortest Path Simplex Algorithm with a Multiple Pivot Rule 683

(B2). j2 ∈ Dj1(T ) and j2 /∈ Dj1(T ′) ⇒ C(T ′) = C(T ) − ci1j1(T )|Dj2(T )|+(ci1j1(T ) + ci2j2(T ))|Dj1(T )|

j1

j2 i1

i2

s

Since T ∪ {(i1, j1)} contains a cycle with length equal to ci1j1(T ) ⇒ for exis-tence of an optimal paths tree ci1j1(T ) ≥ 0. Both simplex pivots are made whenci1j1(T ) ≥ 0 and ci1j1(T ) + ci1j2(T ) < 0.

In the above arguments, ci1j1(T ) and ci2j2(T ) are the lowest reduced costs ofthe incoming arcs of nodes j1 and j2, respectively. That is, we do not consider theincoming arcs of nodes j1 and j2 with reduced costs are greater than ci1j1(T ) andci2j2(T ), respectively. The reason for this selection is stated in property 2. Now,we need to determine the greatest decrease on the value of the objective functionC(T ) that can be obtained considering the set of non-basic arcs {(i1, j1), (i2, j2)}with j1 /∈ Dj2(T ) using the local information given by T (that is, we do not knowthe relationship between nodes j1 and j2 in T ′). If ci1j1(T ) < 0 and ci2j2(T ) < 0then, in all preceding subcases, with the exception of subcases (A2) and (B2), it ispreferred to make a simplex pivots with these two arcs. Note that case B2 impliesthat a negative cycle exists in G. Thus, this situation is not considered in our rule,because the proposed algorithm must incorporate tools to detect the existence ofthis negative length cycle. In subcase (A2), it is necessary to compare ci1j1(T ) withci2j2(T ) to make a decision. Note that in the subcase (A2), if ci2j2(T ) < ci1j1(T ) < 0then, the greatest improvement in the objective function value is obtained by piv-oting with both arcs. However, if ci1j1(T ) ≤ ci2j2(T ) < 0 then, the current solutiononly improves by making a pivot with the arc (i1, j1). Note that information aboutof tree T ′is required to check all of the above cases. For example, case (A3) (B1))requires to check if j2 ∈ Dj1(T ′) (j1 ∈ Dj2(T ′)) to make the decision of pivotwith both arcs when ci1j1(T ) < 0 and ci1j1(T ) + ci2j2(T ) < 0 (ci2j2(T ) < 0 andci1j1(T )+ ci1j2(T ) < 0). However, we need a multiple pivot rule that only uses localinformation from tree T . Thus, given the set of non-basic arcs {(i1, j1), (i2, j2)} withj1 /∈ Dj2(T ) and with ci1j1(T ) < 0 and ci2j2(T ) < 0, the pivot rule is:

(1) If (j2 /∈ Dj1(T ) and ci1j1(T ) < 0 and ci2j2(T ) < 0) or (j2 ∈ Dj1(T ) andci2j2 (T ) < ci1j1(T ) < 0) then, make a pivot with both arcs ;

(2) If j2 ∈ Dj1(T ) and ci1j1(T ) ≤ ci2j2(T ) and ci1j1 (T ) < 0 then, make a pivotwith arc (i1, j1);

(3) If j2 ∈ Dj1(T ) and ci2j2(T ) < 0 and ci1j1(T ) ≥ 0 then, make a pivot with arc(i2, j2);

Page 8: Shortest Path Simplex Algorithm

December 17, 2010 11:2 WSPC/S0217-5959 APJOR S0217595910002946.tex

684 A. Sedeno-Noda & C. Gonzalez-Martın

Note that the previous rule “fails” in subcase A4, that is, when j2 ∈ Dj1(T ), j2 ∈Dj1(T

′) and ci1j1(T ) ≤ ci2j2(T ) < 0 both arcs must enter into the tree. However,the above rule implies that the pivot only be made with the arc (i1, j1). But, sincej2 ∈ Dj1(T ) and j2 ∈ Dj1(T ′), we have i2 ∈ Dj1(T ) and j2 ∈ Dj1(T ) and therefore,when the above rule is applied, di2 (T ′) = di2(T ) + ci1j1(T ) obtaining ci2j2(T ′) =ci2j2(T ) < 0. Thus, node j2 will not be permanently labeled until node j1 becomespermanently labeled. Similarly, the rule also “fails” in subcase B2”, that is, whenj2 ∈ Dj1(T ), j1 ∈ Dj2(T ′), ci1j1(T ) + ci1j2(T ) < 0 and ci1j1(T ) ≥ 0 then, both arcsmust enter into the basis tree. However, the above rule implies that the pivot onlybe made with the arc (i2, j2). But, since j2 ∈ Dj1(T ) and j1 ∈ Dj2(T ′), we havei1 ∈ Dj2(T ) and therefore, when the above rule is applied, di1(T ′) = di1(T )+ci2j2(T )obtaining ci1j1(T ′) = ci1j1(T )+ ci1j2(T ) < 0. Thus, node j1 will not be permanentlylabeled until node j2 becomes permanently labeled.

Now, we must extend the rule for each node jk with k = 1, . . . , n. For all jk ∈ V ,let Bjk

(T ) be the set of nodes in the directed path tree from node s to jk in T ,excluding node jk. We propose the next rule when choosing the arc (ik, jk) for anode jk.

If cikjk(T ) < min

jk′∈Bjk(T )

{0, cik′jk′ (T )} then the arc (ik, jk) is selected (∗)

that is, the arc (ik, jk) is chosen to enter in the basis tree T , if and only if, itsreduced cost is negative and less than the reduced cost of any chosen incoming arcof node jk′ with jk′ ∈ Bjk

(T ). Note that this rule extends the previous ideas sincenode jk ∈ Djk′ (T ) for all jk′ ∈ Bjk

(T ). For example, suppose that j2 ∈ Dj1(T ) andj3 ∈ Dj2(T ) (and also j3 ∈ Dj1(T )) with ci1j1(T ) < 0. Arc (i1, j1) is always chosen.If ci2j2(T ) < ci1j1(T ) then, the arc (i2, j2) is chosen. Now, if arc (i2, j2) has beenselected then, ci3j3(T ) is compared with ci2j2(T ) to make a decision on arc (i3, j3).If (i2, j2) has not been selected then, a comparison between ci3j3(T ) and ci1j1(T )is made to decide on arc (i3, j3). In this sense, this rule generalizes the last ruleconsidering only two arcs. One way to easily implement this new rule consists ofchoosing the incoming arcs of the nodes j1, j2, . . . , jn in the preorder ordering ofthe nodes in the basis tree T , that is, applying the following recursive procedure:

Procedure Searching Entering Arcs (SEA)(i, C, var visited);visited = visited + 1;Besti = Null;Mini = C;For all j ∈ Γ−

i doIf cji(T ) < Mini then

Mini = cji(T );Besti = j;

For all j ∈ T +i do

Searching Entering Arcs (j, Mini, visited)

Page 9: Shortest Path Simplex Algorithm

December 17, 2010 11:2 WSPC/S0217-5959 APJOR S0217595910002946.tex

Shortest Path Simplex Algorithm with a Multiple Pivot Rule 685

The procedure SEA (i, C) is called in each iteration of the simplex algorithmwith parameters i = s, C = 0 and the variable visited = 0. This procedure returnsthe array of pointers Best, where Besti point to the incoming arc of node i, (Besti, i),to enter into the tree. If Besti equals Null then, there is no arc associated with nodei to enter into the tree. Note that this recursive procedure reproduces the rule (*).If T is a tree then, each node j ∈ V is reached exactly one time when this procedureis called from node s. The arc (Besti, i) is selected to enter into the tree if and onlyif cBestii(T ) < C, where C equals minj∈Bi(T ){0, cBestjj(T )}.

The previous rule becomes as a modified version of the inward most negative(IMN) pivot rule analyzed by Cunningham (1979) and Goldfarb et al. (1990a).Moreover, in Goldfarb and Jin (1990b), a modified version of IMN pivot rule is alsointroduced that scans the nodes in a reverse preorder. However, note that in reversepreorder, the label distance of a node j hanging from a node i in a tree T is modifiedfirst. Thus, when the distance label of node i changes, the distance label of nodej could be improved. That is, if G has no negative cycle then, node j cannot bepermanently labeled until node i is permanently labeled. This situation is avoidedby using the rule introduced in this paper.

Sedeno-Noda and Gonzalez-Martın (2010) introduce a simplex pivot rule basedon the concept of pseudo permanent labels. This pivot rule reduces the number ofsimplex pivots performed by a SPS algorithm. However, an additional computa-tional cost is added to the algorithm because it needs to identify the nodes havingpseudo permanent labels. A SPS algorithm using the proposed rule in this paperdoes not incur this additional computational cost. Instead, in each application ofthe proposed rule all nodes of V are scanned.

Multiple Pivots Shortest Path Simplex (MPSPS) Algorithm;Let T be an initial feasible tree;Compute label distances di(T ) for all i ∈ V ;Optimal = false; k = 2;While (k < n) and not (Optimal) do

visited = 0; Searching Entering Arcs(s, 0, visited);If (visited < n) then Stop, G contains a negative cycleElse

Pivots = 0;For all i ∈ V do

If Besti �= Null thenT = T + {(Besti, i)} − {predi, i}; Pivots = Pivots + 1;If (i == s) or (Pivots > n − k) then Stop, G containsa negative cycle

If (Pivots == 0) then Optimal = true;Compute label distances di(T ) for all i ∈ V ;k = k + 1;

Page 10: Shortest Path Simplex Algorithm

December 17, 2010 11:2 WSPC/S0217-5959 APJOR S0217595910002946.tex

686 A. Sedeno-Noda & C. Gonzalez-Martın

Given a tree T, we use the term stage to describe the operation making themultiple pivots with the arcs (Besti, i), ∀ i ∈ V such that Besti �= Null. As inGoldfarb and Jin (1990b), when G has no negative cycles, it is easily proved byinduction that at the end of the kth stage one additional node becomes permanentlylabeled (see also Ahuja et al. (1993, p. 142)). Now, we present the SPS algorithmwith multiple pivots.

Let T0 be an initial basis tree consisting of the arcs (s, i), ∀ i ∈ V − {s}. Notethat the number of nodes permanently labeled in T0 is at least k = 2. Therefore,the proposed rule implies at most n − 2 stages. In addition, during stage k, therule selects at most n − k arcs to enter into the basis. Thus, if in the kth stageof the procedure SEA more than n − k arcs are selected (counted by pivots), thenG contains a negative cycle. The algorithm allows that T becomes cyclic after amultiple pivot is made, because when an arc (i, j) enters into the basis, the algorithmdoes not check if i ∈ Dj(T ) (with the trivial exception of j = s). Our procedureSEA counts the number of nodes visited (flag visited). Thus, if visited < n then, wehave detected a negative cycle in G.

Theorem 1. Starting from an initial basis feasible tree T0, the SPS algorithm solvesthe SP problem in at most n − 2 multiple pivots and O(nm) time.

Proof. The initial basis tree T0 can be obtained in O(n) time. In each stage k, theprocedure SEA requires O(

∑i∈V |Γ−

i |+n+∑

i∈V |T +i |) = (n + m) time. Performing

the multiple pivots requires O(n − k) time (each simplex pivot can be done in O(1)using an appropriate data structure) and computing the distance labels needs O(n)time. Therefore, each stage k is performed using O(n + m) time. If G has no negativecycles then, a simplex algorithm using the multiple pivot rule makes permanent thedistance label of at least one node in each stage. Since the number of permanentlabeled nodes in T0 is at least 2, our rule implies at most n − 2 multiple pivots.Therefore, since in the worse case there are n − 2 stages, the above algorithm runsin O(nm) time.

4. Computational Results

This section offers comments on a computational experiment that we carried out.The Multiple Pivots Shortest Path Simplex (MPSPS) algorithm, the Goldfarb andJin (G&J) algorithm (1999) and the Sedeno-Noda and Gonzalez-Martın (NPPLN)algorithm (2010) were implemented using C++ and were tested on a CentrinoPentium with 2GHz processor running Red Hat Linux. The test problems weregenerated by using the SPRAND and the SPGRID generators due to Cherkasskyet al. (1996).

For the experiment using the SPRAND generator, the parameters were thefollowings: n ∈ {1000, 2000, . . . , 10000}, m ∈ {5n, 15n, 25n, 35n, 45n, 50n, 150n,

250n, 350n, 450n} and the length of the arcs uniformly at random from the interval[0, l] with l ∈{10, 100, 10000, 100000000}. For each combination of the previously

Page 11: Shortest Path Simplex Algorithm

December 17, 2010 11:2 WSPC/S0217-5959 APJOR S0217595910002946.tex

Shortest Path Simplex Algorithm with a Multiple Pivot Rule 687

Table 1. The CPU time and the number of pivots for 5 ≤ m/n ≤ 25.

n MPSPS G&J NPPLN

CPU Pivots CPU Pivots CPU Pivots

1000 0.03 2246.6 0.03 2413.8 0.03 2591.6

2000 0.05 4615.0 0.08 5193.9 0.08 5394.73000 0.10 7079.9 0.19 8212.8 0.15 8260.54000 0.16 9492.1 0.32 11249.5 0.25 11118.85000 0.23 12117.2 0.51 14472.5 0.39 14222.56000 0.32 14668.0 0.74 17681.0 0.54 17269.87000 0.41 17516.8 1.02 21841.4 0.73 20777.78000 0.50 20158.3 1.30 24499.6 0.93 24031.69000 0.60 22295.4 1.59 27199.3 1.11 26399.2

10000 0.71 25256.6 2.02 31886.5 1.38 30230.1

networks parameters (400), we generated ten replications by using the followingsseeds: 12345678, 36581249, 23456183, 46545174, 35826749, 43657679, 378484689,23434767, 56563897 and 78656756. Therefore, there were 4000 instances for theproblem in the experiment. In Tables 1, 2 and 3, the number of nodes (n), the

Table 2. The CPU time and the number of pivots for 35 ≤ m/n ≤ 50.

n MPSPS G&J NPPLN

CPU Pivots CPU Pivots CPU Pivots

1000 0.05 2726.7 0.05 2320.3 0.06 3219.12000 0.15 5591.1 0.16 5047.1 0.20 6750.13000 0.29 8524.6 0.32 7969.3 0.40 10384.24000 0.44 11383.3 0.52 10693.2 0.64 13952.75000 0.62 14570.0 0.77 13879.3 0.92 17973.06000 0.82 17616.7 1.05 16768.8 1.22 21715.27000 1.03 20939.5 1.42 20822.5 1.60 26156.68000 1.24 24531.1 1.79 24210.0 1.97 30831.79000 1.44 27250.5 2.10 26535.4 2.33 33995.0

10000 1.66 30973.5 2.59 31267.4 2.79 39003.3

Table 3. The CPU time and the number of pivots for 150 ≤ m/n ≤ 450.

n MPSPS G&J NPPLN

CPU Pivots CPU Pivots CPU Pivots

1000 0.53 2535.0 0.43 2078.0 0.64 3074.72000 1.23 5522.2 1.02 4474.8 1.55 6791.53000 1.98 8659.5 1.67 6909.9 2.46 10666.74000 2.78 11955.3 2.37 9531.0 3.46 14725.65000 3.63 15337.8 3.09 12142.2 4.54 18871.96000 4.57 18936.9 3.89 15228.0 5.72 23475.57000 5.43 22318.8 4.69 17788.7 6.88 27654.48000 6.43 26111.4 5.63 20820.8 8.18 32425.79000 7.32 29363.5 6.41 23362.8 9.29 36327.6

10000 8.32 33042.5 7.48 26085.4 10.65 40954.4

Page 12: Shortest Path Simplex Algorithm

December 17, 2010 11:2 WSPC/S0217-5959 APJOR S0217595910002946.tex

688 A. Sedeno-Noda & C. Gonzalez-Martın

(average) CPU time in seconds and the (average) number of pivots for bothalgorithms grouped by m/n are shown. Note that the CPU time and the num-ber of simplex pivots made by MPSPS algorithm for sparse networks with m ≤ 25n

(Table 1) is less than the CPU time and the number of pivots made by G&J andNPPLN algorithms. In particular, the number of pivots made by NPPLN algo-rithm is 1.09 times the number of simplex pivots made by MPSPS algorithm. Fornetworks with 35n ≤ m ≤ 50n (Table 2), MPSPS algorithm makes more pivotsthan the G&J algorithm, but the MPSPS algorithm employs less CPU time thanG&J algorithm. In this case, NPPLN algorithm makes more number of pivots andit requires more CPU time than MPSPS and G&J algorithms. For example, thenumber of pivots made by NPPLN algorithm is 1.25 times the number of simplexpivots made by MPSPS algorithm. For networks with m ≥ 150n (Table 3), thebest algorithm taking into account the number of pivots and the CPU time is G&J,next MPSPS algorithm and, finally, NPPLN algorithm. The number of pivots madeby NPPLN algorithm is 1.24 times the number of simplex pivots made by MPSPSalgorithm. Therefore, the explanation of the observed difference between the CPUtimes of the NPPLN and MPSPS algorithms lies on the observed number of simplexpivots and on the additional computational effort performed by NPPLN algorithmto determine the pseudo permanent labeled nodes.

However, the problems obtained with SPRAND generator were easily solved forall the codes as in Cherkassky et al. (1996). This fact is observed when the aboveCPU times are compared with the CPU times needed by the algorithms to solvethe instances from the SPGRID generator.

In the SPGRID generator, the instance is specified by the parameters X, Y ,maximum length of the arcs, l, and a seed. As in Cherkassky et al. (1996), weconsidered square grids with X = Y ∈ {32, 64, 128, 256, 512}, wide grids withX = 32 fixed and Y ∈ {64, 128, 256, 512} and long grids with Y = 32 fixed andX ∈ {64, 128, 256, 512}. In all cases, the length of the arcs uniformly at randomfrom the interval [0, l] with l ∈ {10, 100, 10000, 100000000}. For each combinationof the previously networks (20, 16 and 16), we generated ten replications by using thelater seeds. Therefore, the number of instances of the problem in the experiment was200 square grids and 160 wide and long grids. That is, this experiment reproducesthe experiment developed by Cherkassky et al. (1996) with the SPGRID generator.The average CPU times in seconds and the number of simplex pivots made for bothalgorithms are shown in the next three tables. This last experiment confirms thatMPSPS algorithm has high-quality behaviour in practice when is compared withthe G&J algorithm.

In these tables, the average of the number of simplex pivots made by the MPSPSalgorithm is always at least 1.12 times less than the number of simplex pivots madeby G&L algorithm. Moreover, with the exception of the case of small networks(X = 64 in Table 6), the average of the CPU time used by MPSPS algorithm isalways less than the G&J algorithm. The difference between the practical behaviourof both algorithms is specially noted in Tables 4 and 5. That is, generally, for grid

Page 13: Shortest Path Simplex Algorithm

December 17, 2010 11:2 WSPC/S0217-5959 APJOR S0217595910002946.tex

Shortest Path Simplex Algorithm with a Multiple Pivot Rule 689

Table 4. Average CPU times and number of pivots for square grids.

X Y MPSPS G&J NPPLN

CPU Pivots CPU Pivots CPU Pivots

32 32 0.02 1434.35 0.02 1667.28 0.04 1368.3064 64 0.17 5873.85 0.34 7554.15 0.25 5636.08

128 128 1.36 23781.80 6.68 33638.48 2.08 23003.45256 256 11.28 95622.50 134.04 149408.38 17.73 92926.08512 512 83.93 349712.59 745.22 589390.38 130.89 340980.82

Table 5. Average CPU times and number of pivots for wide grids.

Y MPSPS G&J NPPLN

CPU Pivots CPU Pivots CPU Pivots

64 0.04 2889.88 0.06 3290.98 0.06 2754.20128 0.09 5783.60 0.29 6527.48 0.13 5534.10256 0.19 11536.15 1.15 12899.60 0.28 11065.73512 0.40 23114.53 4.92 25772.98 0.63 22055.58

Table 6. Average CPU times and number of for long grids.

X MPSPS G&J NPPLN

CPU Pivots CPU Pivots CPU Pivots

64 0.08 2938.75 0.07 3949.05 0.12 2826.68128 0.32 5934.63 0.38 9606.95 0.46 5706.40

256 1.27 11898.58 1.88 23923.45 1.87 11500.13512 4.80 21500.10 8.23 50878.38 7.18 20797.20

networks the MPSPS algorithm requires a fewer number of simplex pivots and,therefore, uses less CPU time than the G&J algorithm. In the worst case the G&Jalgorithm is 12 times slower than MPSPS algorithm.

When MPSPS algorithm is compared with NPPLN algorithm, we observe thatthe number of pivot made by NPPLN algorithm is at least 1.02 times and at most1.05 times less than the number of simplex pivots made by MPSPS algorithm.However, the average of the CPU time used by MPSPS algorithm is always lessthan the NPPLN algorithm. In the worst case the NPPLN algorithm is 1.5 timesslower than MPSPS algorithm. Clearly, NPPLN algorithm makes a fewer number ofsimplex pivots than MPSPS algorithm, but the computational effort to determinethe nodes having pseudo permanent labels is not compensated with the saved timein the simplex pivots.

5. Conclusions

This paper introduces a multi-pivot shortest path simplex method and studies theproperties a multiple pivot must satisfy. The paper also contains a study of theeffect on the value of the objective function for the shortest path problem when

Page 14: Shortest Path Simplex Algorithm

December 17, 2010 11:2 WSPC/S0217-5959 APJOR S0217595910002946.tex

690 A. Sedeno-Noda & C. Gonzalez-Martın

a multiple pivot with two arcs is performed. Moreover, it is proved that a SPSalgorithm using this rule runs in O(nm) time. The algorithm is competitive inpractice when is compared with other SPS algorithms. In other words, the SPSalgorithm incorporating the new rule performs fewer simplex pivots and requiresless CPU time than the previously most efficient SPS algorithm due to Goldfarb andJin (1999) and it is slightly better than Sedeno-Noda and Gonzalez-Martın (2010)algorithm taking into account only the CPU time. Finally, the proposed simplexmultiple pivot rule can be used to derive a new label correcting algorithm runningin O(nm) time without major effort.

Acknowledgments

This work has been partially supported by Spanish Government Research ProjectMTM2009-08830, and also received contributions from European Funds of RegionalDevelopment.

References

Ahuja, R, T Magnanti and JB Orlin (1993). Network Flows. NY: Prentice-Hall.Akgul, M (1986). Shortest Paths and the Simplex Method. Technichal Report, Depart-

ment of Computer Sciences and Operations Research Program, North Carolina StateUniversity, Raleigh, N.C.

Bellman, R (1958). On a route problem. Quart. of Appl. Math., 16, 87–90.Cherkassky, BV, AV Goldberg and T Radzik (1996). Shortest paths algorithms: theory

and experimental evaluation. Mathematical Programming, 73, 129–174.Cunningham, WH (1979). Theoretical properties of the network simplex method. Math-

ematical Programming, 4, 196–208.Dantzig, GB (1957). Discrete-variable extremum principles. Operations Research, 5,

266–277.Dial, R, F Glover, D Karney and D Klingman (1979). A computational analysis of alter-

native algorithms and labeling techniques for finding shortest path trees. Networks,9, 215–248.

Ford, LR (1956). Network Flow Theory. The Rand Corporation Report P-923, SantaMonica, Calif.

Goldfarb, D, J Hao and SR Kai (1990a). Efficient shortest path simplex algorithms. Oper-ations Research, 38(4), 624–628.

Goldfarb, D, J Hao and SR Kai (1990b). Anti-stalling pivot rules for the network simplexalgorithm. Networks, 20, 79–91.

Goldfarb, D and Z Jin (1999). An O(nm)-time network simplex algorithm for the shortestpath problem. Operations Research, 47(3), 445–448.

Minty, GJ (1958). A variant on the shortest route problem. Operations Research, 6, 882.Moore, ZF (1957). The shortest path through a maze. In Proceedings of the International

Symposium on Theory of Switching, Part II, 285–292.Orlin, B (1985). On the simplex algorithm for networks and generalized networks.

Mathematical Programming Study, 25, 166–178.Sedeno-Noda, A and C Gonzalez-Martın (2010). New efficient shortest path simplex

algorithm: Pseudo permanent labels instead of permanent labels. ComputationalOptimization and Applications, 47(2), 289–305.

Page 15: Shortest Path Simplex Algorithm

December 17, 2010 11:2 WSPC/S0217-5959 APJOR S0217595910002946.tex

Shortest Path Simplex Algorithm with a Multiple Pivot Rule 691

Antonio Sedeno-Noda received the B.Sc. Degree in Physics with electronic spe-cialization from the Santiago de Compostela University (Spain) in 1992 and thePh.D. degree in Mathematics from La Laguna University (Spain) in 2001.

He is currently an Associate Professor of the Department of Statistics, Oper-ations Research and Computation (La Laguna University). He is interested inresearch areas related to design of algorithms, Combinatorial Programming, Multi-objective Optimization and Logistic problems. He is author or coauthor of articlespublished in Spanish journals and international journals (Naval Research Logistics,European Journal of Operational Research, Computers & Operations Research,Networks, Asia Pacific Journal of Operations Research and ComputationalOptimization and Applications).

Carlos Gonzalez-Martın received the B.Sc. Degree in Mathematics (with Statis-tic and Operations Research specialization) from the La Laguna University (Spain)in 1978 and the Ph.D. degree in Mathematics from La Laguna University (Spain)in 1984.

He is currently a Full Professor of the Department of Statistics, OperationsResearch and Computation (La Laguna University). He is interested in researchareas related to Linear, Combinatorial or Multiobjective Programming and Logisticproblems. He is author or coauthor of articles published in Spanish journals andinternational journals (Naval Research Logistics, European Journal of OperationalResearch, Computers & Operations Research, Networks, Asia Pacific Journal ofOperations Research and Computational Optimization and Applications).

Page 16: Shortest Path Simplex Algorithm

Copyright of Asia-Pacific Journal of Operational Research is the property of World Scientific Publishing

Company and its content may not be copied or emailed to multiple sites or posted to a listserv without the

copyright holder's express written permission. However, users may print, download, or email articles for

individual use.