MIT LIBRARIES 3 9080 02238 6111 ri(j3t.^^6t^^'^' LIBRABIBS oi DEWEY HD28 .M414 SB ALFRED P. WORKING PAPER SLOAN SCHOOL OF MANAGEMENT IMPROVED PRIMAL SIMPLEX ALGORITHMS FOR SHORTEST PATH, ASSIGNMENT AND MINIMUM COST FLOW PROBLEMS Ravindra K. Ahuja and James B. Orlin Sloan W.P. No. 2090-88 November, 1988 MASSACHUSETTS INSTITUTE OF TECHNOLOGY 50 MEMORIAL DRIVE CAMBRIDGE, MASSACHUSETTS 02139 IMPROVED PRIMAL SIMPLEX ALGORITHMS FOR SHORTEST PATH, ASSIGNMENT AND MINIMUM COST FLOW PROBLEMS Ravindra K. Ahuja and James B. Orlin Sloan W.P. No. 2090-88 November, 1988 •*5s©>iSif"' OfTV.^" 4ZQ^^ UB^^ Improved Primal Simplex Algorithms for Shortest Path, Assigmnent and Minimimi Cost Flow Problems Ravindra K. Ahuja* and James B. Orlin Sloan School of Management Massachusetts Institute of Technology Cambridge, MA. 02139, U.S.A. * On leave from Indian Institute of Technology, Kanpur - 208 016, INDIA Improved Primal Simplex Algorithms for Shortest Path, Assignment and Minimum Cost Flow Problems Abstract we In this paper, present a new primal simplex pivot rule and analyse the worst-case complexity of the resulting simplex algorithm for the minivun cost flow problem, the assignment problem and the shortest path problem. We consider m arcs, integral arc capacities bovmded by an integer nimiber networks with n nodes, number C. Let L and U denote lower and upper bounds respectively, and Cj: denote U, and integral arc costs bounded by an integer the nonbasic arcs the at their reduced cost of any arc Then our pivot -A/2 or any rule is e U (i, j) feasibiUty of the basis rule then replace performs (i, j). as follows: with Cj: A be Select as ^ A/2 maintained. is A by A/2. 0(nm U Further, let ; there is that the simplex algorithm solves these to enough Cj: < 0(m^ this this rule U logC) in 0(n^ logC) pivots and These algorithms use the same data structures that are typically flexibility for fine an e L with C. and shortest path problems we problems implement the primal simplex algorithms to obtain is no nonbasic arc satisfying logC) pivots and can be implemented to run in show used (i, j) value that the simplex algorithm using Specializing these results for the assignment time. initial select the leaving arc so that the strong time. 0(nm logC) whose an entering arc any When We show a parameter 0(nm logC) for network problems and have tuning the algorithms in practice. We also use these ideas label correcting algorithm for the shortest path problem with arbitrary arc lengths, and an improved implementation of Dantzig's pivot rule. Subject Qassif ication. Networks/Graphs Keywords : Improved simplex algorithms network flow problems Network flow algorithms. Minimum Assignment problem. Shortest path problem. Matchings. for cost flow problem. Simplex algorithm. Scaling, we In this paper, new present a primal simplex pivot rule and analyze the worst-case behavior of the resulting simplex algorithm for the problem. minimum cost flow These results are also specialized for the assignment and shortest path problems. We consider a directed network G = (N, A) with node set N and arc set A. Each € A has a non-negative integer capacity uj: and an integer cost cj; We denote arc (i, j) by n, m, U, maximum incident eind C, the number of nodes, number of arcs, absolute value of an arc cost, respectively. on node the set of incoming i, i.e., denote the degree of node i for each i The primal simplex algorithm maximum We represent by and outgoing arcs at node and arc capacity, A(i) the set of arcs Let deg(i) i. = |A(i)| e N. for the minimum cost flow problem, subsequently referred to as the network simplex algorithm, has been extensively studied in the literature. Researchers have also been interested in developing polynomial time network simplex algorithms for the minimum cost flow problem and its Polynomial time special cases. primal simplex algorithms have been developed for the shortest path problem, the maximum flow problem. minimum cost flow problem is assignment problem and the simplex algorithm for the to Orlin [1984] which performs 0(n^ logn) pivots cost flow We now a dual simplex algorithm due minimum cost for the uncapacitated Developing a polynomial time primal simplex algorithm for the flow problem. miiumum The only polynomial time problem briefly is still an open problem. review the literature devoted to this area of research. Dial, Kamey and Klingman [1979] and Zadeh [1979] showed that Dantzig's pivot pivoting in the arc with minimum reduced cost) for the shortest path problem Glover, rule (i.e., with non-negative arc lengths performs 0(n) pivots Roohy-Laleh [1980] in his when started from an vmpublished Ph.D. thesis developed an alternative simplex pivot rule for the assignment problem for which the number of pivots [1983] developed a simplex method for the assigimient problem pivots is in is O(n^). Hung which the number of 0(n^ log(nC)). Orlin [1985] showed that for integer data the primal simplex algorithm maintaining strongly feasible bases performs rule all artificial basis. and 0(nm U log (mCU)) developed by Dantzig 0(nm CU) for Dantzig's pivot rule. [1983].) When pivots for any arbitrary pivot (This result was independently specialized to the shortest path problem with arbitrary arc lengths and the assignment problem, the algorithm performs 0(n^ log(nC)) pivots. Akgul developed primal simplex algorithms for the shortest path [1985a, 1985b] and assignment problems that Using simple data structures, perform O(n^) pivots. Akgul's algorithms run in O(n^) time using simple data reduced to 0(nm structvire, and this time can be + n^ logn) using Fibonacci heap data structure due to Fredman and Tarjan [1984]. Goldfarb, Hao and Kai for the shortest path problem whose number of pivots and running times are comparable to that of Among [1986] describe another primal simplex algorithm Akgul's algorithm. the polynomial time dual simplex algorithms are the algorithms by Roohy-Laleh [1980] for the shortest path problem, by Balinski [1985] and Goldfarb [1985] for the assignment problem, Recently, Goldfarb and by Orlin and Hao maximum algorithm for the [1988] [1984] for the minimum cost flow problem. developed a polynomial time primal simplex This algorithm performs flow problem. can be implemented to run in OCn^m) time. Tarjan [1988] showed trees to further improve the running time This paper is to 0(nm how Let Cj: is U by incorporating a scaling techmque Then our pivot rule is < -A/2 or any (i,j) e U with Cjj is C. feasibility of the basis is 1.1.) When use dynamic is Our analyzed. in Dantzig's pivot rule. denote the nonbasic arcs at their lower and upper bounds respectively, and denote the reduced cost of any arc value and based on the results contained in Orlin [1985] where the worst-case essentially obtained L and to pivots logn) behavior of the primal simplex algorithm with Dantzig's pivot rule rule 0(nm) there is Further, (i, j). let A be a parameter whose as follows: Select as an entering arc Cj: maintained. > A/2; ( We (i, j) e L with select the leaving arc so that the strong discuss strong feasibility in detail in Section no nonbasic arc satisfying this pivot rule the scaling pivot rule any initial this rule then replace We A by A/2. and the simplex algorithm using the scaling pivot call rule the scaling network simplex algorithm. We show 0(nm U flow problem in time. that the scaling network simplex algorithm solves the minimum logC) pivots and can be implemented to run in Specializing these results for the assignment that the scaling pivots and and shortest path problems, network simplex algorithm solves both of these problems 0(nm logC) time. 0(m2 in cost U logC) we show OCn^ logC) These results on the number of pivots are comparable to that of Orlin [1985] for Dantzig's pivot rule, but the running times here are better by a factor of n. Intuitively, the reason v^hy the scaling network simplex algorithm is good is that the algorithm selects an entering arc with "sufficiently large" violation of the optimality conditions. helps to This causes a "sufficiently large" improvement in the objective function and show that the number "sufficiently large" violation can Among other results that solves the shortest path also show we be picked up with obtain a scaling version of the label correcting algorithm problem vnth arbitrary arc lengths Dantzig's pivot rule can be implemented in The little effort. that the primal simplex algorithm for the heap operation takes 0(min results in this ©(m^ U paper self-contained, Magnanti and Orlin 1. in miriimum 0(nm logC) time. cost flow We problem with logC) heap operations where each (log n, loglog(nC)) time. paper rely on properties of the network simplex algorithm, strongly feasible bases and the "perturbation technique". this Further, the arc vfith of pivots are "sufficiently small." we Though we have tried to refer the reader to the papers of Orlin [1985] [1988] for a more thorough discussion on make and Ahuja, these topics. The Minunum Cost Flow Problem In this section, we describe a network simplex algorithm that solves the minimum cost flow problem in 0(nmU logC) pivots and can be implemented in 0(m2 U logC) time. The analysis of this algorithm, as specialized for the assigiunent problem and the shortest path problem, 1.1 is presented in Sections 2 and 3. Background We consider the followdng node-arc formulation of the minimum cost flow problem. Minimize ^^i\ (i,j)€ subject to A ^^^^ 'Si' Sxii {j: (i, j) € X - V) < In this formulation, node demand a is i < Xjj Ujj if b(i) We node. b(i), foraU i€ N, (lb) e A. (Ic) A e (j, i) {j: = Xji , for each (i, j) then node > assume i X that iG minimum cost flow cost flow problem has a a supply node is = b(i) We 0. and if < b(i) assume also then that the N feasible solution. The feasibility of the minimum problem can be ascertained by solving a maximum flow problem. The simplex algorithm maintains solution of the minimum cost flow The partition the arc set A. a bcisic feasible solution at each stage. problem B denotes set is denoted by a triple (B, L, U); the set of basic arcs, i.e., A bcisic B L and , U arcs of a spanning tree, U respectively denote the sets of nonbasic arcs at their lower and upper bounds. We refer to the triple (B, L, U) as a basis structure. A basis structure (B, L, U) is allied feasible and L and if by setting (i, j) Xj: = for each (i, j) and by L, e setting e U, the problem has a feasible solution satisfying (lb) cind A dual solution to the and a vector bcdance constraint in (lb) henceforth assume that A minimum cost flow c of reduced costs defined as is 7t(l) redundant, = Cj: we = can x^j = Ujj for each (Ic). problem is a vector n of node potentials - Jt(i) + 7t(j). Since one of the mass cj; set one node potential We arbitrarily. 0. feasible basis structure (B, L, U) is called an optimum basis structure if it is possible to obtain a set of node potentials n so that the reduced costs satisfy the following optimality conditions: = each (i, j) e B, (2a) q: > 0, for each (i, j) g L, (2b) (i, j) e U, (2c) qj Cjj < 0, for 0, for each Given a basis 7t(l) or = (2c), structure, the node potentials can be imiquely determined by setting and then using the (n-1) equations of (2a). A nonbasic arc whichever is applicable, violates its optimality condition. called the xnolation of the arc (i, j). (i, j) not satisfying (2b) In such a case, | qJ is The network simplex algorithm maintains iteration and successively modifies the basis structure optimum The basis structure. computations brief a feasible basis structure at each summary becomes an it special structure of the basis enables the simplex be performed very to via pivots until we In the following discussion, efficiently. give a and the data structure required of the network simplex algorithm to implement the algorithm. The B of the minimum basis this tree as "hanging" or are 1) node i 1. The problem stores the first has a unique path connecting i node consist of node node i i, and i itself, its descendants of a node For node . tree, i node 1 and search of the node unique path connecting any two nodes. amd the corresponding violating We refer to its optimality condition. this cycle as the basis cycle. arcs. arc. An arc which structure. If (k, * (p, q) new of a on. the is node The i in 0(| D(i) this arc (k, i set of denote the nodes of the The thread in a "top to /) | ) its indices way through bottom" and time. [1980]. path as the It starts It to the basis "left for For a detailed In the basis there is a basis path. wdth an initial basic selects a nonbcisic arc forms a unique cycle. The algorithm sends a maximum possible amount any of the lower and upper bound constraints a blocking arc, flow in the basis cycle say (p,q), is called a blocking from B, This gives a new basis then the node potentials also change. Let T^ and T2 be the two subtrees formed by deleting arc (p, q) from the previous basis In the and so in D(i). structure (B, L, U). blocks further increase of The algorithm drops say that pred(i) The thread indices can be formed as follows. Adding of flow in the bcisis cycle vdthout violating on 1. We refer to bcisis nodes and Helgason The network simplex algorithm works /) We i. stores the The thread indices provide a means node description of the tree indices see Kermington (k, We successors, its visiting tree. visiting (or finding) all descendants of a feasible flow x The predecessor index 1. The descendants an ancestor of nodes called finally returning to first node and the depth index ) node at consider and a thread index, a sequence of nodes that walks or threads the nodes of the tree, starting at and then is to pred(i). successors, successors of Node define a traversal of the by performing a depth node the successor of is i We tree. upward pointing (towards node these indices are zero. 1, induce a subtree rooted i subtree by the set D(i). to right" order, spanning associate three indices with each it path (other than node in that of arcs in the path predecessor of We 1). a a predecessor index pred(i), a depth index depth(i), Each node thread(i). is tree arcs either are downward pointing (away from node in the tree: number from node cost flow basis, potentials of all nodes in B where T^ contains node Tj remain unchanged and potentials of 1. all . potentials of lower bound all nodes in the they decrease by an in . T2 change by a constant amount. previous basis structure, then they increase by an amount amount | amount We say that a basis structure of flow from any node (B, L, in the U) An no upward pointing arc of the spanrung downward pointing arc can be at its is strongly feasible is given in Figure node to equivalent tree way cam be at 1 its basis. 1 (1,5) (0,5) An example we can send else a positive along arcs in the tree of a strongly feasible basis. is upper bound and no An example (2,2) 1. , of stating this property (3,4) Figure if lower bound. In the subsequent discussion be using both the definitions of the strongly feasible feasible basis Cj^^l | its a strongly feasible basis at every spanning tree without violating any of the flow bounds. that arc at Cj^^l Our network simplex algorithm maintains iteration. D was a nonbasic If (k, we shall of a strongly The network simplex algorithm next basis bound and node to node (k, k, the arc (k, /) , and the basis path from node node w. For example, and (7,5), in Figure and the leaving W be the basis cycle arcs the entering arc 1, is (7,5). It can be the above rule guarantees that the next basis shown is path from node node w. After updating the to unique, then is it leaves algorithm selects the leaving arcs, then the arc to be the last blocking arc encountered in traversing at / lower (k, I) is at its Let /. the blocking arc If more than one blocking there are If entering arc to the basis tree. This cycle consists of the basis /) flow, the algorithm identifies blocking arcs. the basis. that the w is the first common ancestor of nodes k and formed by adding arc w Suppose also strongly feasible. is selects the leaving arc appropriately so that the W along is (9,10), orientation starting its the blocking arcs are (2,3) (see, e.g., Cunningham We strongly feasible. [1976]) that use the following property of a strongly feasible basis. Observation node w Ln every degenerate pivot, the leaving arc lies in the basis path 1. node to k. This observation follows from the facts that the entering arc capacity and basis path that a positive flow can from node / to is that of arc (k, the same except The /). 12 / /) is at its /, / and the in a Hence no node w. to upper bound then the arc on the criteria to select the that the orientation of the cycle W is node k to node w, the cycle consists of the basis path from w to node from node w to node from node be sent from node has a positive (k, w can be blocked in a degenerate pivot. node In case the entering arc (k, leaving arc from arc (k, /). defined opposite to basis path In this case, the leaving arc lies in the basis path degenerate pivot. Scaling Pivot Rule We now The describe the network simplex algorithm with the seeding pivot rule. algorithm performs a number of scaling phases. The algorithm maintains a parameter which remains unchanged throughout a scaling phase. Hence a phase is called a A-scaling phase. integrality of A Initially, it is in the subsequent phases we let A = Z ^°SC I . arc is selected so that the next basis nonbasic arc has violation less than A/2 then A is is it strongly feasible. replaced by to maintain in the A-scaling phase, algorithm selects any nonbasic arc vdth violation at least A/2 and enters The leaving of the eilgorithm any A ^ C, but sufficient to select A/2 and a A the into the basis. When every new scaling phase ; When A phase begins. < 1, the integrality of costs am optimum flow. Hence, the algorithm performs A A/2 1 that the algorithm has obtained + flogC! scaling phases. formal description of the scaling network simplex algorithm we In the algorithm description, least shows is algorithm some node incident to is given below. define a node set S such that any arc with violation at in S. SCALING NETWORK SIMPLEX; begin U) be a let (B, L, Ji(j) Cjj A: feasible basis structure, be the corresponding node potentials and be the corresponding reduced costs; = Z^logCl whUe A > 1 do begin S : = N; while S ^ do begin select a node i in S and delete for each nonbasic arc (k, /) it from in A(i) S; with violation at least A/2 do begin add arc (k, /) to the basis creating a cycle augment mjiximum possible flow in drop the appropriate blocking W; W and arc; update the node potentials and add to S each node whose potential changes; end; end; end; end; The following observations can be made about Observation for 2. I the algorithm: The algorithm maintains the invariant which some nonbasic arc in A(i) may have that the set S contains violation at least A/2. all nodes i . This property follows inductively from the facts that at the beginning of each S = N, scaling phase and whenever the Nodes are deleted from S only when each Hence when S Observation incident arc has a violation less than A/ 2. 3. it is empty, the A-scaling phase ends. This also shows that at the end of the is The A is an upper bound on the of a scaling phase (except the a phase. to S. phase, the algorithm terminates with a last scaling node changes, added potential of a first At the beginning of the phase). first minimum maximum cost flow. arc violation at the beginning This property need not be maintained during scaling phase, the nuiximum arc violation may be as high as (n-l)A. Observation 4. The algorithm scans number Let P^(i) denote the is added S to at the deg(i) = of updates of | 7t(i) A(i) | arcs during the beginning of a phase and whenever that the total scanning time during the A-sceding phase is whenever node added to S. A-scaling phase. Since a node its i is potential changes, m + X deg(i) • it follows P^d) N ie Also observe that there are two bottleneck operations in the scaling network simplex algorithm: to augmenting flows update node potentials We is in cycles; and (ii) aire dominated by the arc scanning scanning time. The time time. next analyze the complexity of the scaling network simplex algorithm. analysis depends 13 (i) on the perturbation technique that The we discuss next. Peturbation Technique The perturbation technique is a well-known method simplex algorithm for linear programming. for avoiding cycling in the The technique right-hand-side vector so that every feasible basis is non-degenerate and an optimum solution of the perturbed problem can be easily converted to an original problem. Cuimingham [1976] showed techiuque for the network simplex method technique. is slightly perturbs the optimum solution to the that a specific variant of the perturbation equivalent to the strongly feasible basis Orlin [1985] extended Cunningham's result to allow for more general perturbations. The minimum cost flow problem can be perturbed by changing the supply/demand vector b to b + e We say that e = (e^ , £2 /•••/£„) is a feasible perturbation . if it satisfies the following conditions: 10 e^ (i) > for all n = 2 i ; n ^t^<\;and (ii) i=2 (iii) =- 2- ei i One £i = 2 possible choice for a feasible perturbation is ej = 1/n for i = 2, . . . , n (and thus e^ = -(n - l)/n positive Another choice ). is Ej = a' for i = 2, . . . , n with a chosen as a very small , number. The perturbation changes the flow on basic that perturbation of arcs. It can be easily shown b by a feasible perturbation e changes the flow on basic arcs in the following manner: Observation If 5. B and D(j) is descendants of node then the pertiirbation decreases the flow in arc (i, j) by (i, j) j, is a dov^ward pointing arc of tree the set of Ev I S^^k ^ • k € D(j) L < Since *- Ck k G D(j) Observation If 6. descendants of node (i, < Since ke Z Ev i, "^ *^^ resulting flow ^' j) is is non-integral and thus non-zero, an upward pointing arc of tree B and D(i) then the perturbation increases the flow in arc ^' *^^ resulting flow is is by (i, j) the set of e. J^ Er. I k € D(i) i) non-integral and thus non-zero, D(i) In the perturbed problem flow on every arc non-degenerate pivot and the leaving arc establishes a connection is is non-zero, hence every pivot uniquely identified. The following between a primal simplex algorithm in which strongly is a result feasible bases are maintained for the original problem, and the ordinary primal simplex algorithm for the perturbed problem. Lemma 1. minimum For any basis structure (B, L, U) of the [1985]). follamng statements are equivalent: (Cunningham [1976], Orlin cost flow problem, the (i) (B,L,U) (ii) (B, L, U) is strongly feasible. is feasible if b is replaced by b + e for any feasible perturbation e . , 11 Proof, less => (i) than Since (ii). (B, L, U) is upward pointing strongly feasible, each arc has flow upper bound and each downward pointing arc has flow greater than its decreases the flow on upward pointing the flow on The perturbation increases downward arcs by at most one unit and Hence pointing arcs by at most one vmit. zero. U) (B, L, is a feasible basis structure for the perturbed problem. (ii) => (i). Consider a feasible basis structure non -integral in the basis has a positive U) (B, L, flow. If we for the perturbed problem. consider the same Each arc basis tree for the on upward pointing arcs decrease, flows on downward pointing arcs increase and the resulting flows are integral. Consequently, x^: < Uj; for an original problem, then flows upward pointing arc Xj; (i, j), > for a downward pointing arc (i, j), and B strongly is feasible for the original problem. We algorithm. shall now analyze the worst-case complexity of the scaling network simplex Our arguments the perturbed problem. on the scaling network simplex algorithm as applied rely However, because Lemma of actually be done; maintaining strongly feasible bases same as since the pivot sequences are the 14 the perturbation need not sufficient to realize these bovmds for the perturbation technique. Complexity Analysis Let z denote the objective function value of the the begiiming of (B, L, is 1, to U) denote function value. I (i,i)€ Further, the basis structure. Cjj Xij A^' ^^ = I z - z* qj xj: (i,i)e A^' ^' (i, j) e I (i,j)6 A ' respect to the objective function ' i Xii ' + € z* denote the bovmded by mUA I - 7i(i) x^j X e A ' N I ie set of (i, j) let (i,i)GA ^ Consequently for a given is + Cji A cost flow problem Let x denote the corresponding flow and the A-scaling phase. We first show that minimum {j: (i, j) . let objective Observe that I {i,j)e e A) optimum at Jt(j) Xjj A ' {j: (i, j) € AT 7c(i)b(i). N node potentials, C:: x.: ' ' is the total improvement with equal to the total improvement vdth 12 £ respect to the objective function (i, S the objective function C:: A (i,j)e Cj: x^j Further, . the total improvement in A j)e Xj: bounded by is improvement the total in the ' ' foUow^ing relaxed problem: X minimize <Hi 'Si ' ' A (i,j)€ ^"^^ subject to < < x^: Ujj for all , (i, j) For any basis structure (B,L,U) of optimum solution of problem = by setting in B unchanged. At phase), all Xj: for each arc (3) (i, j) e A. (1) by setting e U with (3b) and a corresponding flow, we can obtain an Cj: < 0, Xj: = Uj: for each arc (i, j) e L with Cj: > 0, and by leaving the flow on other arcs the beginning of the A-scaling phase (except arc violations are no more than A; hence the objective function by at most mUA. We have this when it the is first readjustment of flows decreases thus shov«\ that at the begiiming of a scaling phase z-z» < Since in non-increasing, phase A ^ the (4) primal simplex algorithm, the objective function value remains true during the A-scaling phase as well. In the (4) C and mUA. mUC ( or - objective function value of the mU C) minimum is an upper bound ( scaling or lower bound) on the We cost flow problem. first is have thus established the foUowdng result. Lemma 2. If z is the objective function value of the beginning of the A-scaling phase, then z - z* < 2 m U A. minimum M We now these pivots. consider the non-degenerate pivots and the time needed to perform EXiring the A-scaling phase each non-degenerate pivot one imit of flow, and since the entering arc has violation decreases the objective function value by at least there are at cost flow problem at the most 4mU takes 0(n) time to augmentation time units. It A/2 at least units, the pivot follows from Lemma 2 that non -degenerate pivots during a scaling phase. Each such pivot augment in A/2 at least augments the flow O(nmU) time. and update node potentials. Hence the node is Further, since each potential total updated 13 0(mU) times, it follows from Observation 4 that the arc scanning time is 0(m^ U) per scaling phase. We number next consider the We perform these pivots. is a positive integral multiple of 1 . . /n, . and hence each pivot carries at least Lemma follows from It O(nmU) degenerate 2 that there are 1 /n for the original problem decreases the objective function value of the perturbed problem by units. on 1/n). For this perturbation, the flow^ , Thus during the A-scaling phase, each degenerate pivot units of flow. to use arguments based on analyzing the perturbed problem first with perturbation e = (-(n - l)/n, 1/n, 1/n, each arc and the time needed of degenerate pivots at least A/2n pivots during a scaling phase. We now compute we For this purpose, the time spent in the degenerate pivots. n use the perturbation defined by e = X deg(i)/2m = 2 (i deg(n)/ 2n), where deg(i) = feasible perturbation. We first | A(i) | It . can be easily verified that be handled It (k, /) is at its lower boimd. The case when arc w ( the first degenerate pivot, arc upward pointing (p, q) is a . . this perturbation is , a We (k, /) is at its assume that the upper boxmd can similarly. follows from Observation from node . determine the flow augmented in the perturbed problem corresponding to a degenerate pivot in the original problem. entering arc deg(3)/2m, deg(2)/2m, , common 1 ancestor of nodes k and (p, q) is either arc at downward its downward a lower bound. It /) to node pointing arc at k. its Since this pivot is a upper bovmd or an follows from Observations 5 and 6 that if pointing arc, then in the perturbed problem the flow in (p, q) X decreases by H(q)= that the leaving arc, say (p, q), lies in the basis path deg(k)/2m , and q) is if (p, an upward pointing arc then the k € D(q) flow in (p, q) in the X perturbed problem increases by H(p)= deg(k)/2m . In either k 6 D(p) case, the flow is either around the basis cycle node p or node q. in the perturbed problem is at least Since the entering arc has violation at least decreases the objective function value of the perturbed H(v), A/2 , problem by where v this pivot at least H(v) A/2 units. In this pivot operation, potentials of nodes in D(v) are changed are added to the set S. From Observation 4, this and these nodes pivot operation increases the scanning 14 time by at most 2mH(v) time by . We have thus shown that the pivot increases the scanning most 2mH(v) while decreasing the objective function by at Consequently, the scanning time As objective function. we is 0(m^ U) and /, or we / method described backward we until either (k, Glover and Klingman locate the first common ancestor of nodes k In the latter case, the time spent in this identify a blocking arc. In a degenerate pivot, in Barr, no flow is We We trace the predecessor indices /). be charged to updating node potentials in D(v) which time. in the objective function is at for degenerate pivots per scaling phase. an entering arc [1979] to identify the basis cycle for and improvement in the consider the time needed to identify a degenerate pivot. incorporate an additional test in the of nodes k H(v) A/Z most (4m/A) times the improvement at the total possible most 2mUA, the scanning time Finally, is at least is method can dominated by the arc scaiming augmented so we need not consider the augmentation time. We Theorem 0(nmU have thus showTi the following 1. result: The scaling network simplex algorithm solves the minimum logC) pivots and Remark. Although running time applies 0(m^ the analysis to cost flow problem in U logC) time. M carried out prinnarily is the original problem. on the perturbed problem, the The reason for this is that we require the time for a degenerate pivot to be proportional to the size of the subtree on which potentials change, and irrespective of problem, the running time per pivot we have 2. large is at least not bounded this value over all is the basic cycle. In the perturbed as large as the size of the basic cycle, and pivots. The Assignment Problem In this section, assignment problem. in how 0(nm we specialize the scaling We show that the algorithm network simplex algorithm to the performs 0(n^ logC) pivots and runs logC) time. The assignment problem G=(Nj u N2, A) such minimum that is a minimum A c Njx cost flow problem: problem on a bipartite network N2. This problem can be stated as the following cost flow 15 ^ Minimize Xj: A ' (5a) Cj: (i,j)6 subject to X =1, Xj: Z {i:aj)G A non-zero flow equal to 1 problem X ' ^i\^\ e a' (i, j) Glover and Klingman Lemma 3. the If number x in (5), a set of indices X = ' solution of the assignment problem. bound on defined by B, the set of basic arcs. is For a discussion of the graph theoretic properties of strongly . Observe that =1}. (5d) problem has 2n-l arcs out of which exactly n arcs have We associate with any feasible flow x Xjj (5c) forall(i,j)G A. feasible bases of the assignment problem, see Barr, A: (5b) AJ basis structure of the assignment basis of the assignment ie Nj, =-1, foralljeN2, Xjj Xjj>0, A for all G A) Ij: (i, j) (i, j) ^ij ''ii G x' The following of pivots performed X [1977]. defined by We denote by x* an X={(i,j) optimum ' result enables us to obtain a tighter by the scaling network simplex algorithm. the assignment solution at the beginning of the A-scaling phase, then ex is e - ex* < 2nA Proof. Let n be the node potentials corresponding to the assignment for each (i,j) Z = (i, j) 6 g X we note , Cj: Xji X ' = ^ - A ex ^ for each arc Since Cj: = that i XNj ^<i) I + e j G (i,j) g A. Therefore <6) ^^P- N2 At the beginning of the A-scaling phase (except when Cjj x. it is the first phase), 16 S (i, j) '' ' Combining ex*- = CjXj* e X» i (6) and (7) we XNj j first 6 Ji(j)^-nA. (7) N2 get ex - ex* < For the I + JtW € nA (8) . A ^ C and scaling phase, lemma the follows from the fact that an upper bound on the cost of any assignment solution and -nC cost of any assignment We now phase. is a lower nC is bound on the solution. count the number of non-degenerate and degenerate pivots in a scaling Each non-degenerate pivot in the A-scaling phase carries one unit of flow A/2 decreases the objective function value by at least Hence there are units. at and most 4n non-degenerate pivots in a seeding phase. To bound the number of degenerate pivots, we consider the perturbation e = Hn - l)/n, 1/n, . . . , 1/n). Corresponding to each degenerate pivot in the original problem in the A-scaling phase, the flow aroimd the cycle in the perturbed problem is at least 1/n units and thus the objective function value decreases by at least A/2n units. Hence there are at most 4n^ degenerate pivots per scaling phase. We next consider the time needed per scaling phase. 0(n) time takes augment flow jmd to Thus the non-degenerate pivots take a time the needed for Each non -degenerate pivot increases the arc scanning time total of degenerate by at O(irm) time in a scaling phase. we pivots, consider the most 0(m). To bound perturbation n e = Z deg(i)/2m, (i deg(2)/2m, . . . , deg(n)/2m ) . The same analysis, as done for the =2 minimum cost flow pivots also take problem together with inequality 0(nm) time in a scaling phase. We (8), shows that all degenerate have thus established the following result. Theorem 2. logC) time. The scaling network simplex algorithm solves the assignment problem in M 0(nm 17 The Shortest Path Problem 3. we In this section analyze the complexity of the scaling network simplex We show algorithm for the shortest path problem. 0{vr logC) pivots and We 0(nm takes that the algorithm performs logC) time. consider the problem of determining a shortest path from node 1 to all other nodes in the network. This problem can be stated as the following minimum cost flow problem: X Minimize (i, j) Cij^ij (9a) A e subject to ^ 2-Xii {j:(i,j)€ k] A basis structure is basis B of node i for all 1) has we earlier, The directed thread indices. arc (pred(i),i) ^ 0, foralliGN, demand g A. (i, j) and the flow on in the basis tree.) 1, i.e., (9c) is defined by B, the set of basic arcs. a spaiming tree in which every tree arc store the basis tree using predecessor, out-tree property of the basis equal to 1 this arc is (9b) ifi*l -1, a directed out-tree rooted at node is node I of the shortest path problem dowrnward pointing. As (except =i {j:(j,i)6'A) xjj The r(n-l), ifi=l ^ Lxji - and the imply that every node I D(i) Hence every I . i fact that depth and each node has exactly one incoming (Recall that D(i) is the set of descendants basis of the shortest path problem is non- degenerate. In the basis B there P(k) denote this path from basis B can be obtained by for each (i, j) g B. is a unique directed path from node node 1 setting 1 to every other node. Let node k The node potentials corresponding to the jt(l)=0 and then using the equation Cj: - 7t(i) + jt(j) = to The directed . out-tree property of the basis implies that jc(k) = - ^ (i, j) Cjj Hence . the negative of the length of the unique path rt(k) is node k 1 to in B. With this background we are ready network simplex algorithm every pivot time, we need To bound 4. Tfik)- 7c(k) the If 7t(k) represents the potential of number Here we assume Z 7t*(k) node k at the beginning of the A-scaling phase, then Zqj - ^(1) + «(k) = Cii node potentials to the € P»(V) (i, j) = 1 node k and and the lemma follows. fact that the largest is at least - (10) Ji»(k). Ji*(k) is the first seeding phase), | ^ -nA, In the first node potential (11) scaling phase, A S C and in the jilgorithm is at the lemma follows from the most nC and the smallest node -nC. In the A-scaling phase, the entering arc (k, potentials of all nodes in D(/) increase potential of represent the G P''(k) | nik) - Cj; Then jc. Jt(k) to At the beginning of the A-scaling ph<ise (except when it > - A for each arc (i, j) e P*(k). Since P*(k) < n, (10) yields number that <2nA. reduced costs wath respect potential of non-degenerate pivots k. Proof. Let P*(k) denote the shortest path from node (i, j) complexity of the scaling For the shortest path problem the following result. denotes the optimum node potential of node Lemma to analyze the for the shortest path problem. a non-degenerate pivot. is and the computational Cj: from node G P(k) any node can change at by at least /) A/2 has violation at least units. Lemma 4 implies that the most 4n times during a scaling phase. of pivots are O(n^) per scaling phase. A/2 and Hence the Observation 4 implies that the arc n scanning time 0(m X deg(i) + i (4n) ) = 0(nm) per scaling phase. We summarize our = 2 discussion below. Theorem 3. The scaling network simplex algorithms solves the shortest path problem logC) pivots and 0(nm logC) time. • in 0(n^ 19 Scaling Label Correcting Algorithm 4. label correcting algorithms for the shortest path The extensively studied. and show label correcting algorithm this section, we assume problem can be stated as follows length of d(i), label correcting algorithms d(i) + the condition below. logC) time. node qj, for The C2 may be Ahuja, Magnanti and Orlin [1988] some path from source The < 0(mn aU (i,j) In i. the optimality conditions for the shortest path (see, e.g., d(j) to satisfy condition C2. to node for all i i ): and e N; € A. always maintain condition CI and basic approach is some violated for to maintain a set arc (i,j) S of and repeat the eill iteratively nodes i try which for iterative step given Iiutially, S={1}. Label Correcting Step. from S. add to Scan each arc S ( if j is If S = (i,j) then in A(i), not already in STOP and if performing induction on the d(j) Otherwise > d(i) select a node i e S and delete + qj then update d(j)=d(i)+ Cjj, it and S). set S. The exponential time as showrn by is . of the label correcting algorithm The correctness form that this algorithm runs in CI. C2. d(i) is the incorporate a scaling technique in the generic that the set A(i) represents the set of outgoing arcs at For a set of distance labels j we In this section, problem have been is easy to establish label correcting algorithm in its Edmonds [1970] by most generic and Kershenbaum [1981]. However, algorithms with improved running times can be obtained by specifying some rules for selecting queue runs and adding nodes 0(nm) in time. are described in Glover et We now show nms in 0(mn basic idea number Several other polynomial time label correcting We call this algorithm the scaling S as a algorithms label correcting algorithm label correcting algorithm. The cause "sufficiently large" decrease during each distance update so that the of updates are "sufficiently small." aj^jj set [1985]. repeats the iterative step given below. 2 llogCl The algorithm which maintains the that a scaling version of the generic logC) time. is to al. to S. when A < 1, The scaling label correcting algorithm The algorithm uses a parameter the algorithm terminates. A. Initially, A= 20 Scaling Label Correcting Step. node i e S and delete then update d(j)= d(i)+ c,; The accuracy of S stores all property is nodes , S. S is Scan each arc and add j by adding j (i,j) is and not already in i i, to > violates d(j) violates we need d(i) + q: A = 1 set S=N. > d(i)+Cjj Select a d(j) > to this and the + A/2 S). The shown using inductive arguments. we keep S d(j) if d(i) + Cj; + A/2. Whenever property satisfied. set This a distance Observe that scan only outgoing arcs. This follows whenever distance label of node i decreases, eill Whenever a node i is deleted from S, then d(j) < In the last scaling phase, G A(i). (i,j) if ( in A(i) fact that condition C2. (i, j) S (i,j) certainly true at the begirming of each scaling phase. while scanning arcs incident to node arc to which some arc label d(i) decreases, then from the empty, then replace A by A/2 and the algorithm can be for i from it If set S stores all keep satisfying circs (k,i) + d(i) Cj: nodes i + A/2 for for all which some Thus the algorithm terminates with the shortest path . distances. We treat n(k) next come to the complexity of the scaling label correcting algorithm. = - d(k) for each k e N, decrease by at most 2nA distance label by at least A/2 Theorem 4. arc lengths in The scaling 0(nm Thus arc scarming time this result as a any node decreases is can label As each update decreases a 0(nm) per at most 4n scaling phase and theorem. label correcting algorithm solves a shortest logC) time. any distance we K path problem with arbitrary Implementing Dantzig's Pivot Rule. 5. Dantzig's rule is 4 implies that units, the distance label of We state logC) overall. Lemma units during a scaling phase. times during a scaling phase. 0{nm then If is to select the entering arc whose a special implementation of the scaling pivot rule, and 3 concerning with the the maximum number violation as much is as maximum. Thus and the botmds However, the time of pivots apply. may be violation 0(m) per pivot, to of assignment and shortest path problems. Orlin [1985]. Here we show how to 1, 2 determine an arc which would give a ruiming time of OCnm'^U logC) for the miiumvmi cost flow problem and for the Theorems it 0(n^ log C) Indeed, these are the times given by reduce the running time by nearly a factor of n. 21 we To obtain these improvements, The violations of the optimality conditions. cis the key of each arc. Changing the heap operation takes O(logn) time Hopcroft and Ullman [1974], or it if set Q violation of maximum the heap, or finding an arc with Q Q maintain a set maintained is an arc, of arcs with positive a heap with violation cis adding or deleting an arc from one heap operation. Each violation counts as maintained as a binary heap is takes 0(log log (nC)) time if Q Aho, (see, e.g., maintained using the is data structure of Johnson [1982]. The network simplex algorithm with Dantzig's pivot follows. Using a heap operation, the algorithm selects rule an arc wi\h maximvun During the pivot operation, whenever the potential of a node incident on The node are examined. that The dominant term performing heap operations corresponding to this arc scanning. same order the pivot rule. Hence minimum cost flow shortest path problems in 0(m^U in 0(nm (log n, log log (nC)}) time. 6. Conclusions some better. comparable The network simplex and the scaling logC) heap operations and the assignment and anticipate that our rule to the best other is with Dantzig's pivot rule solves the of the best implementations in practice but We computations in the have presented a variant of the network simplex algorithm in spirit to much updated and the logC) heap operations, where each heap operation takes 0(nun We violation. updated then arcs of arc scanrung for Dantzig's pivot rule the network simplex algorithm problem is violations of arcs are necessary heap operations are performed. algorithm has implemented as is that is very close whose worst-case bound wUl give miming times is in practice that are primal simplex pivot rule; however, our conjecture in this matter awaits thorough computational testing. The algorithms presented here the similarity assumption, i.e., C illustrate the = 0(n'') and power of U = ©(n*^) for scaling approaches. some k, the scaling based approaches are currently the best available in the worst -case complexity for following problems among others the assignment problem, the problem, the results in this minimum : all of the the shortest path problem vdth arbitrary arc lengths, minimum cost flow Under problem cycle mean problem, (see Ahuja, Orlin the maximum flow and Magnanti[1988]). Out paper demonstrate that the ideas of scaling are useful not only in purely combiiwtorial algorithms, but also in a more general perspective. 22 The time bounds problems are both m CXVn Ahuja logC). This time bound log(nC)) achieved by the algorithms of however, [1988]; shortest 0(nm of our algorithms for the assignment it is nearly as fast as the problem and the 0(n(m + n log is and shortest path not as attractive as the time Gabow and 0(nm) bound of Tarjan [1987] and Orlin and label correcting algorithm for the n)) successive shortest path algorithm for the assignment problem (see Engquist [1982] and Fredman and Tarjan [1984]). In addition, they dominate the runiung times of a nimiber of algorithms that are used in practice for solving the shortest path and the assignment problems (see for example. Glover [1985], Glover etal. [1986]). Perhaps the greatest advantage problems is et al. that they do not require v^ith respect to the a special assignment and shortest path purpose algorithm in order to have the advantage of a good worst-case performance. The algorithms suggested here are general purpose network simplex algorithms. The rules are simple to state implement. In addition, they allow a reasonable amount of the entering vauiable. ways without increasing the computational complexity. to flexibility in the selection of one can search the node In particular, and simple list S in several different This flexibility contrasts with the inflexibility of the existing polynomial time primal simplex algorithm for these problems, which are very restrictive in the selection of the entering Another possible ratio by which A scale factor of reduced at the our algorithms the choice of the scale factor, the However, the algorithms can use any arbitrary 2. and require 0(P is end of a scaKng phase. The algorithms as stated use a network simplex algorithm can be shown case, the number is flexibility in m^ U of pivots vciriables. logpC) time. to sccile factor p. perform 0(P nm U In this lognC) pivots For the assignment and shortest path problems, the would be 0(P n^ logpC) and the time would be 0(p nm logpC). Thus from the worst-Ceise point of view, any constant value of P is optimal; empirically the best value may be determined through computational testing. We have also provided a robust rule shortest path for the label correcting algorithm for the problem whose worst-Ceise running time is only a factor logC greater than the best other implementation. Again, the effectiveness of our approach in practice awaits computational testing. Simultaneously, we have improved the worst-case running time of implementing Dantzig's pivot rule by nearly a factor of anticipate that this result is primarily of theoretical interest, it may be n. practical implementation of the network simplex algorithm requires that the arc v^th violation is selected. While if we some maximum 23 In passing, we again mention the problem of finding a polynomial time primal network simplex algorithm. The algorithm presented here and is exponential time in the worst-case. algorithm is due is pseudo -polynomial time, The only known polynomial time simplex to Orlin [1984], but this algorithm is a dual simplex algorithm and is not a "natural" implementation. Acknowledgement This research was supported in part by the Presidential Young Investigator Grant 8451517-ECS of the National Science Foundation, by Grant AFORS-88-0088 from the Air Force Office of Scientific Research, and by grants from Analog Devices, Apple Computer, Inc., and Prime Computer. 24 References Aho, A.V., J.E. Algorithms. Hopcroft, and J.D. Ullman. Addison-Wesley, Reading, Ahuja, R.K., T. L. Magnanti, and 2059-88, Sloan School of J.B. and Management in Operations Research The Design and Analysis of Computer 1988. Network Flows. Working Paper No. MA. Orlin. Management, 1974. M.I.T., Cambridge, Science, Vol. 1. MA. (To appear in Handbooks Optimization.) Akgul, M. 1985a. Shortest Path and Simplex Method. Research Report, Department of Computer Science amd Operations Research, North Carolina State University, Raleigh, N.C. Akgul, M. A 1985b. Genuinely Polynomial Primal Simplex Algorithm for the Research Report, Department of Computer Science and Assignment Problem. Operations Research, North Carolina State University, Raleigh, N.C. Balinski, M.L. Signature Methods for the Assignment Problem. 1985. Oper. Res. 33, 527-536. Barr, R., F. Glover, and D. Klingman. 1977. The Alteniating Path Basis Algorithm for the Assignment Problem. Math. Prog. 12, 1-13. Barr, R., F. Glover, cmd D. Klingman. Procedures for Network Optimization. Cunningham, W.H. 1976. A 1979. INFOR Enhancement of Spanning Tree Labeling 17, 16-34. Network Simplex Method. Math. Dantzig, G.B. 1983. Personal Communication with Dial, R., F. Glover, D. Kamey, and D. Klingman. J. B. 1979. Prog. U, 105-116. Orlin. A Computational Analysis of Alternative Algorithms and Labeling Techniques for Finding Shortest Path Trees. Networks 9, 215-248. Edmonds, J. 1970. Exponential Growth of the Simplex Method for the Shortest Path Problem. Unpublished Paper, University of Waterloo, Ontario, Canada. Engquist, M. 1982. INFOR 20, 370-384. A Successive Shortest Path Algorithm for the Assignment Problem. 25 Fredman, M.L., and 1984. R.E. Tarjan. Network Optimization Algorithms. 338-346, also in /. SIAM J. Glover, in Improved 25th Annual IEEE Symp. on Found, of Comp. Sci., ACM 34(1987), 596-615. of Gabow, H.N., and Heaps and Their Uses Fibonacci 1987. R.E. Tarjan. Faster Scaling Algorithms for Network Problems. Comput. (submitted). F., and D. Klingman. 1986. Threshold Assignment Algorithm. Math. R. Glover, Prog. Study 26, 12-37. Glover, F., D. Klingman, N. Phillips, and R.F. Schneider. Shortest Path Algorithms Goldfarb, D. 1985. and Their Computational Attributes. Dual Simplex Algorithms Efficient New 1985. Man. Sci. 31, Polynomial 1106-1128. Assignment Problem. for the Math. Prog. 33, 187-203. Goldfarb, D., and Flow Problem in J. Hao. 1988. At Most J. Primal Simplex Algorithm that Solves the Pivots and ©(n^ m) Time. Technical Report, and Operations Research, Columbia University, Industrial Engineering Goldfarb, D., nm A Hao, and S. Kai. 1986. Efficient Shortest Path New Maximum Dept. of York, N.Y. Simplex Algorithms. Research Report, Dept. of Industrial Engineering and Operations Research, Columbia University, New Hvmg, M.S. York, N.Y. 1983. A Polynomial Simplex Method for the Assigiunent Problem. Oper. Res. 31, 595-600. Johnson, D. B. 1982. A Priority Take Odog log D) Time. Math. Kennington, J.L., Queue in Which Initialization and Queue Operations Sys. Theory 15, 295-309. and R.V. Helgason. 1980. Algorithms for Network Programming, Wiley-Interscience, N.Y. Kershenbaimi, A. 1981. A Note on Genuinely Polynomial Simplex and Non-Simplex Algorithms for the Orlin, J.B. 1984. Minimum Cost Flow Problem. Management, Finding Shortest Path Trees. Networks 11, 399-400. M.I.T., Cambridge, Technical Report No. 1615-84, Sloan School of MA. 26 On 1985. Orlin, J.B. the Simplex Algorithm for hAath. Prog. Study 24, 166-178. Orlin, and R.K. Ahuja. J.B., Minimum Cycle Mean Problems. Center, M.I.T., Cambridge, Roohy-Laleh, E. 1980. 1988. New Networks and Generalized Networks. Scaling Algorithms for the Assignment Working Paper No. OR and 178-88, Operations Research MA. Improvements in the Theoretical Efficiency of the Network Simplex Method. Unpublished Ph.D. Dissertation, Carleton University, Ottawa, Canada. Tarjan, R. E. 1988. Zadeh, N. 1979. 26, Dept. of Personal Communication. Near Equivalence of Network Flow Algorithms. Technical Report No. Operations Research, Stanford University, CA. MAR 2001' Date Due Lib-26-67 MIT LIBRARIES 3 9080 02238 6111 DUPL m^m \ ^:r^; .' uij. j' »((; ;*' \)