4 *^^ HD28 M4 1 . no.2.o>4f- ALFRED P. WORKING PAPER SLOAN SCHOOL OF MANAGEMENT FINDING MINIMUM-COST FLOWS HY DOUBLE SCALING Ravindra K. Ahuja Andrew V. Goldberg James B. Orlin Robert E. Tarjan Sloan W.P. No. 2047-88 August, 1988 MASSACHUSETTS INSTITUTE OF TECHNOLOGY 50 MEMORIAL DRIVE CAMBRIDGE, MASSACHUSETTS 02139 FINDING MINIMUM-COST FLOWS I$Y DOUBLE SCALING Ravindra K. Ahuja Andrew V. Goldberg James B. Orlin Robert E. Tarjan Sloan W.P. No. 2047-88 August, 1988 Finding Minimum-Cost Flows by Double Scaling Ravindra K. Ahuja Andrciv V. '"^ Goldberg James B. Orlin ' ' Robert E. Tarjan June. 1988 ABSTRACT Several researchers have recendy develof)ed new aJgorithms for the minimuin-cost flow problem. several 0{nm of log log these techniques U log(nC)) arc capacity U, and yield to an techniques that give fast In this paper algorithm time on networks with n vertices, maximum arc cost are the capacity-scaling approach of m we combine running arcs, in ma.ximum magnitude C. TTie major techniques used Edmonds and Karp, the excess-scaling approach of Ahuja and Orlin, the cost-scaling approach of Goldberg and Tarjan, and the dynamic with large We tree data structure of Sleator maximum also obtain a slightly better problem. In we arc capacity, addition, we obtain a similar but slightly better bound. bound discuss and Tarjan. For nonsparse graphs a for the (uncapaciiated) transportation capacity-bounding approach to the minimum-cost flow problem. Son Yjxmg ReseanA, On MA Managemem, MJ.T., Cambridge, 02139. Reward) p»iti»Uy fupported by an NSF Presidcntia] FeUowihip. Cooiraa M51517ECS, gram AFORS-88-0088 from the Aii Force Office of Scientific granu from Analog Devices, Apple Computer IiK, and Prirae Computer. Scbool of Irrvesiigaior aixJ leave from Ijylian Institute of Technology, Kanpur, India. Department of Computer Science, Stanford University, Stanford, Presidential NJ Young Investigator Grant CCR-8g58097 and an IBM CA 94305 Research partially lupporled by NSF Faculty Development Award. Department of Computer Science, Princeton University, Princeton, NJ 08544 and ATAT Bell Laboratories, Murray Hill, 07974. Research partially fupponed by National Science Foundabon Grant DCR-8605962 and Office of Naval Research Coniraci N00014-87-K-0467. Finding Minimum-Cost Flows by Double Scaling Ravindra K. Ahuja Andrew V. 2 1 ' Goldberg ' James B. Orlin Robert E. Tarjan June. 1988 Introduction 1. The minimum-cost circulation problem calls for finding a circulation network whose arcs have flow capacities and costs this problem V and tex set assume Graph that G is arc set E. G arc capacity, and C are integral. For ease f/ ^ 4. e.g. [9,1 1,13.18,22]. maximum Let absolute value of an arc cost, respectively. are subject to the assumption that in stating time bounds, a network all (without loss of generality) that two unless an G is a real-valued Time bounds con- arc capacities, or all arc costs, respectively, we assume All logarithms in this paper are base A pseudoflowfon two See We require that the cost function be antisymmetric, i.e. c(v,w) = —c(w,v) for We denote by n, m, U, and C the number of vertices, number of arcs, max- taining t/ or and for studying a network if each arc (v.w) has a rwnnegative real-valued capacity u(v,w) and a real- arcs (v.w) e E. imum Our framework contains no multiple arcs; our algorithms easily extend to allow multiple arcs. valued cost c(v,H'). all unit of flow. in a G = (V,£) be a directed graph with verWe require G to be symmetric, i.e. (v,>v) € E if and only if (w, v) € E. We as follows. is p)er of minimum cost C ^2 explicit base is given. function on the arcs satisfying the following constraints: f(v,w) ^ u (v,w) for Sloui School Young (rf MiiMjeraent, M.I.T., Cambridge, Invertig«x» FdJowihip, Re»carcfi, and gTxnU from On lave from all MA Contna 8451517ECS. (v.w) e AFCMiS 88-008S from Inc., b)' the Air Force ui (1) NSF Pretidentiil Of6oe of Scientific aod Prime Compoier. Indiui Institute of Technology, Kjuipur. India. Department of Computer Science, Stanford University, Stanford, Presidential (capacity constiainl) 02139. Rete*rcl) p»rti*lly fupported grant AnaJog Devica, Apple Computer E Young Investigator Grant CCR-8858097 and an IBM CA 94305. Research partially nipported by Faculty Development Department of Computer Science, Princeton University, PriiKCtoo, NJ 08544 and N3 07974. Research pairiaDy supported by National Science Foundation Grant Research Contract N00014-87-K-O467. NSF Award AT4T BeU Laboratoiies. Murray Hill, DCR-8605962 and Office of Naval -2- f(y,w) = -f(w,v) For a pseudoflow /and for all (v.h-) £ € balance bjiv) a vertex v, the ¥v)= I (2) the net flow into v: at v. is /(u.v). ii:(u,v)€ The (antisymmetry constraint). (3) £ cost of a pseudoflow /is defined as follows; cost if) £ = C(V.H')/(V,H') (4) /(v,»')>0 A pseudoflow /is a circulation if the bf{\) The minimum-cost circulation foIJowing constraint = is satisfied: for every vertex v. problem is (5) that of finding a circulation of minimum cost in a given network.. The minimum-cost circulation Among See e.g [9,11,13,18^2]. the the best worst-case time bounds. parameters n. [6], the (m log/i) strongly polynomial One known thirty years. algorithms for this problem, there are three that have Each of these algorithms is best for a different range of the m, U, and C. The algorithms are the 0((,m log (/)(m Edmonds and Karp and the (9((m problem has been intensively studied for over +n logn))-time method of 0(,nm log(n^/m) log (nC))-time method of Goldberg and Tarjan -t-n logn))-time method of Oiiin [16]. The last [11], of these methods is *. important idea is common to all three of these algorithms, that of scaling or successive approximation. Scaling methods work by solving a sequence of more -and -more accurate approximations to the original problem. The approximations are obtained either by relaxing some of the numerical constraints or by igrxjring some of the precision of the numeric parameters. Scaling was introduced by Edmonds and Karp, whose algorithm refinement of that of A network aJgorilhm is Edmonds and Karp strongly polynomial if its metic oj>erations take unit lime, and also polynomial that /» , Oriin's algorithm combines capacity scaling with repeated running time in scales capacities. m, is polynomia] logt/, aixJ logC, lake time polyiwmial in the number of bits of the operands. See [21). in n and m, assuming arith- assuming arithmetic operations is a arc- shrinking. The algorithm of Goldberg and Tarjan scales costs. It relies cojcially by Tardos (21] and independently by Bertsekas e-optiraality, intnxluced on the notion of [3,4]. Consideration of these algorithms suggests the question of whether capacity scaling and combined cost scaling can be any algorithm obtainable using to yield an algorithm faster than A cither technique alone, at least for a suitable range of n, m, U, and C. was obtained by Gabow and Tarjan lines algorithm. Although this time bound [8], who developed an 0(nm first result along these logn logt/ log(nC))-time never less than that of Goldberg and Tarjan [11], the is algorithm does not require sophisticated data structures, whereas the Goldberg -Tarjan algorithm uses both dynamic trees [19,20.22] and finger trees [14,23]. Our 0(nm work of in efforts We direction. this obtain log logt/ log (nC))-time algorithm for the minimum-cost circulation problem. combines four known Himinalion of (1) continuation a is an Our result by transforming the minimum-cost ciroilation problem into a ideas: arc capacities transportation problem. (2) Cost scaling within the e-optimality framework as proposed by Goldberg and Tarjaa (3) A variant (4) The dynamic A Oinm of the Edmonds-Kaip approach rel>'ing on excess scaling, as developed by Oriin. tree data structure of Sleator and Tarjan. simpler version of our algorithm that does not use the dynamic tree data structure runs in + log(nC)/log logt/ (1 We obtain logt/)) time. with very large arc capacities. We also obtain slightly better improved bounds bounds for nonsparse graphs for the (uncapacitated) transpor- tation problem. The eliminauon of tive approach suggested by is to arc capacities is crucial to the efficiency of our algorithms. bound the Gabow arc capacities and Tarjan [8]. by adding an interest. Our Our explorations of this approach results using this lead to algorithms with the transportation problem and discuss In Section 3 we develop scaling and e-opUmality. we are of that uses a classical net- inside a scaling loc^. This paper consists of six sections lem. we develop approach are described toward the end of the paper. For example, we obtain a polynomial-time algorithm for the problem work simplex algorithm alterna- extra outer capadty-scaling loop, as time bounds worse than those mentioned above, but the analytical methods independent An its a generic In Section 4 in addition to the introduction. relationship with the In Section 2 minimum-cost we define circulation prob- algorithm for the transportation problem based on cost we refine the generic algorithm to use excess scaling, analyze the resulting method. In Section 5 we add the use of dynamic trees. In Section 6 and we 4- way of c»nsider the use of capacity bounding as an alternative Section 7 we summarize our results, comment on dealing with arc capacities. In the possible practicality of our algorithms, and mention some open problems. The Transportation Problem 2. The minimum-cost circulation algorithms we develop in Sections 3-5 will be stated in terms of a related problem, the transportation problem. In order to discuss We terminology. (5 u r = V, tices in We nr= 5 4») call a bipartite if V € T sinix, we in (d(v) numbers such demand the is demand). Given an uncapacitated sportation problem is can be denote by n network uncapacitated to the real T V if for each arc (v,w) with v € 7. mapping from V ^ bipartite partitioned two into such that every arc has exactly one vertex in 5 and one S sources and those u(v,w) = d(v) G call problem, we need some this at A and «2 i if «(v.h') = oo for sizes < if vertex v), and network G v e 5 We call ver- each arc (y,w) with v e S and (-d(,v) J^ d(v) V6 V = a bipartite is network is a the supply at vertex v), (total supply equals and a supply-demand vector minimum-cost pseudoflow /satisfying that of finding a in T. S and T of S and T, respectively. supply-demand vector d on that div) bipartite ^^ sets total d, the tran- the following con- straint: bj (v) We it call a = d(y) for all V pseudoflow /<?aj»fe/e if it e V (supply-demand satisfies (6). We call constraint) (6) a transportation ptxMtm feasible if has some feasible pseudoflow. Checking the feasibility of a trarisportation problem can be done using any maximum There tion is a flow algorithm, e.g. [1,2,9,10]. well-known, simple transformation that will convert any minimum-cost problem into an equivalent transportation problem [18^4]. Given a network construct another network G' = (V u£,i4), where A The reversals for every arc (v.w) e E. reversals have zero capacity. Arc define a supply-demand vector rf has cost ={V,E) we contains arcs ((v,h'),v), ((v,h'),h') and their arcs ((v,h'),v) ((v,m'),v) G circula- and ((v,h'),h') have infinite capacity; their zerc> aiMl arc {(y,w),yv) has cost c(v,h'). We on G' by <'((v,h')) diy) = = -u(v,h') u{v,w) for 5^ u:(v,w)i for all (v.w) E all e E, V G V. (7) , -5- Any circulation cost(f), given /on G corresponds pseudoflow to a feasible f onG' is of sources of G' and Vas being the set 3. A minimum-cost circulation we regard E as being the set i4 has size arcs.) bounds for the transportation problem and shall derive time for the if of sinks, G' has n\ = m, and 02 =n; arc 4m. (Each source has two incoming and two outgoing bounds problem on G' gives a invertible. TTius a solution to the transportation solution to the minimum-cost circulation problem on G. Observe that We = by f((.v,w),w) = f(v,w), f(iv,w),v) = u(y,w)-fiv,w) for each arc (v.w) g E. This correspondence set such that cost{f) translate them into time problem based on the above transformation. Generic Algorithm for the Transportation Problem We obtain a generic algorithm for the transportation problem by translating the minimum- cost circulation algorithm of Goldberg and Tarjan [9.11] into the setting of the transportation problem. We depend on modify the algorithm We this modification. to be an augmenting path method; the time bounds omit proofs of many of we derive the basic results, since they are direct translations of the proofs of Goldberg and Tarjan. Let sink set V, i.e., max 7" G=(V = 5ur, i4)bean of size n2, arc nj + «2. by [-d(.v) I n, uncapacitated bipartite network with source set A of size m, and supply-demand set and rain [rtx.ni) by V e 5), and by riQ. C the maximum We \tciOT d. denote by We S of denote the U the maximum total size supply, absolute value of an arc cost Note that size n i.e., 1 of U= U and C are defined so that the transformation of Section 2 from a minimum-cost circulation problem to a transportation problem preserves the values of For a pseudoflow /on G, we define tation a pseudoflow problem Given is to be solved is feasible, i.e., is by = fr/v)^(v). feasible if every vertex has zero excess. there is some (8) We shall assume that the transpor- feasible pseudoflow. a pseudoflow /. the residual capacity of an arc (v.h') with respect to /is «/(v,w) Arc (y,w) C. the excess ey(y) of a vertex v e/(v) Thus U and unsaturated if Uf(v,w) A price function /? on G is the reduced cost of an arc (v,^) > = u(v,w) -f(y,w). and jafura/erf otherwise. a real-valued function is (9) on the vertices. Given a price function p, -6 Cp(v,w) Let e > 0, let /be a pseudoflow, and let with respect to price function p Cp (v,w) ^ -e p be (10) a price function. Pseudoflow /is e-optimal if for every unsaturated arc (v,w) (e-oplimality constraint). Pseudoflow fis cptimal with re^ct classical result = c(v,w)+p(,v)-p(w). to p if e-optimal for e is it of iietwork flow theory and follows from flie = 0. The (1 1) following theorem is a duality theorem of linear program- ming. Theorem 3.1 [11]. respect to As some A feasible pseudoflow is of minimum cost if and only if is optimal with price function p. Bertsekas [4] discovered, a weaker condition suffices Theorem 32. it If all arc costs are integers - and e < — if all arc costs are integers: then a feasible flow , is of minimum cost if IriQ and only if it is e-optimal with respea to some price furKtionp. Proof. Analogous to the proof of Theorem 2.3 of any simple cycle contains at most 2«o shall assume It and hence some of the concluding remarks of Section applies cost scaling based maintains a price function cally zero. G is bipartite 7), we that all arc costs are integers; thus TTieorem 3.2 applies. Our algorithm k'Z.l. using the faa that D vertices. In the remainder of this paper (except in [1 1], The algorithm p and an on Theorem 3.2. error parameter e. It uses a cost-scaling factor Irutially t-C and p is identi- consists of repeating the following step until the termination condition is satisfied. Cost-Scaling Step. Let ble pseudoflow — e<- .stop. 2/1 replace e by tik. f /be the identically zero pseudoflow. and a price function p' such Otherwise, let p that f is By modifying /and p, find a feasi- e-optimal with respect to p'. be defined by p(v)=p'(v) + e if V G 5, p(v) = p'(v) if v e If 7"; -7 Note is reset that only the price function p is carried over from iteration to iteration; the j)seudoflow to zero after each iteration. Lemma 33. At the beginning of a cost-scaling step, /(the zero pseudoflow) is e-oplimum with respect to p. Proof. Any arc (v.h-) that cunent cost-scaling step hand the is first. Then (v.w) in the previous step. but any pseudoflow has all Ixif 3.4. e Suppose T. arc flows finite. Thus CpCv.w) = TTie transportation algorithm Cp-{v,M>) + jte f the other , since u(y,M') ^ -kt ^-kttO, = <=°, since / D /te,p(>v)=p'(H'). correct and terminates after is thai the be the pseudoflow and p' the price function unsaturated with respect lo is optimal with resf)ecttop',andp(v)=p'(v) + Theorem w /has v e S and Then Cp(y,w) = c(y,w)'^-C = -t. SuRX)se on that the cost scaling step is not the first computed is /te unsaturated with respect to is O (1 + logi(no C)) iterations. Proof. ous. Correctness follows from TTieorem 3.2. The bound on the number of iterations is obvi- D The heart of the algorithm is the conversion of an e-optimal pseudoflow into an e-opiimal feasible p)seudoflow and the corresponding modification of the price function. We call this the refinement computation. Our generic refinement algorithm consists of a sequence of two kinds of local transformations, price function. active if cj (v) To > 0. one of which modifies the pseudoflow and the other of which modifies the define the transformations, An unsaturated arc (v.h-) we is use the following terminology. eligible if Cp (v.w) < 0. consists of repjeating the following steps, in any order, until no vertex is A vertex v is The refinement algorithm active, and then defining push (y,w): Applicability: Vertex v Action: Push up lo 5 is active, u/ (v.w) = min by an amount up { > e/ (v), m^ (v.w) 0, } and Cp (v,^) units £ e. of flow fiom v to w by increasing / (v.w) to 6. relabel (v). Applicability: Vertex v is reachable from some active vertex by a path of eligible arcs, and there no is eligible arc (v.w). Action: Replace p(v) by Lemma Any pushing 3.5. decreasesp(v) by max { p(w) -c(v,w) -e). The 3.6. relabeling of a vertex v at least e. Proof. Analogous to the pnx)fs of Lemmas 5.2 and 5.3 of [ 11 Lemma A or relabeling step preserves e-optimality. price of a vertex v decreases O by D ]. {biQC) during refinement. Hence v is rela- beled Oikno) times. Proof. Analogous to the proof of in Lemma 5.7 of [11] O is Lemmas where the cost scaling (ne), to include a cost scaling factor of k yields an ment and hence that any simple path Now we in each arc out of V first One such along it. During To ^cs, reduces the bound list is /(v) for each vertex The algorithm repeatedly attempts When based on the idea of finding of Step } (start V and push it empty and repeating the following to be new such a path is found, flow is pushed onto 5. Go to Step 2. by the next onto S and repeat Step v, arc on /(v). If the an eligible arc (v,w) 2; if not, Step 3 (relabel). Relabel /(v). If V is not the If 1. Otherwise, select some active vertex replace the current arc to Step 3. S. consists of steps until termination occurs in Step If there are tk) active vertices, stop. path). The algorithm Let v be the top vertex on S. While the current arc of v go con- Initially the current arc Step 2 (extend path). gible arc, list such paths, the algorithm uses depth-first search, implemented using a stack find 5 v. This v. to find a path of eligible arcs a search, vertices are relabeled as necessary to extend the path. initializing G is bipartite, to O (hjoz). D {knt) bound. Observing that a fixed incidence from an active vertex to a vertex of negative excess. price changes by a factor of two. Revising the argu- are is designated the current arc out arc on /(v). The bound on [11). describe a version of the refinement algorithm that (v.h-). the is O is G contains at most 2«o augmenting paths. The algorithm uses tains and 5.9 of 5.7, 5.8, go is end of /(v) is is not eligible, reached without finding an found, test whether e/yv) 1 0. If so, eli- push w to Step 4. the top vertex only vertex on 5, pop it on 5. from Reset the current arc of v to be the S. Go to Step 2. first arc on Step 4 (augment). Let and min [uj{x,y) that X on is We at I is 6 on S, method by quantity not the current arc out is Empty 5 and go 5. short. The augmenting 3.7. positive more than minimum the of ej (v) of x). For each current arc {x,y) such to Step 1. augmenting path version of the refinement algorithm, or the aug- the menting path algorithm for Lemma and {x,y) 5, increase /(j.y) cal] this any be We caU an execution of Step 4 an augmentation. path algorithm maintains the invariant that there is no cycle of eli- gible arcs. Proof. Analogous to the proof of Corollary 5.6 of [11]. Remark. The proof of Lemma 3.7 uses the Lemma 3.8. Proof. The ple. The The maximum vertices fact that Theorem 3.9. size of S G is bipartite a pushes take place only along eligible fact that arcs. D most 2no. is at on S always define D path of eligible arcs. By Lemma O(knom) time correct and runs in is sim- is D gives the claimed bound on the size of 5. The augmenting path algorithm 3.7 such a path plus 0(«o) time per augmentation. Correctness follows from Proof. Lemma We 3.5. bound number of additions to pcT augmentation by Lemma 0( also the time spent in Step 2 changing current arcs of v I /(v) which I), By Lemma tices, is The time for (he 3.8 plus at most one per Observe to we that there are first relabeling. The time changing current is O(nQ) to relabel a vertex v is between summed arcs, relabelings. over ver- all 0(no). The claimed time bound follows. D derive time bounds for various versions of the augmenting path algo- augmenting paths Let us is The number of pops from S does not change the current arc of v causes an that do an augmentation 5. Augmenting Path Algorithm In this secti'on tices for number of pops from Oiknom). An execution of Step 2 Bounds rithm. the 3.6, the relabeling time and time spent addition to S. 4. is S equals The the running time as follows. two kinds of freedom in Step 1, and in the in this algorithm, in ihe amount by which the flow is analyze the simple method in which each augmentation as large as possible; that is, in Step 4, S is selected as follows: 5 choice of starting ver- = min { is augmented in by an amount ej(,v), min Step 4. that is {uj{x,y) I x is -\0- onS,x * w, and (x,y) Lemma saturates an arc. 5.10 of 0{nlm) or k if maximum the With ). active vertices by one, reduces the number of Lemma a current arc) is [1 1]); is number of hence the problem total arc saturations O(knQm) is (see running time of the augmenting path algorithm is O(knlm), analogous to Dinic's bound of O (n^m) to two. TTiis [5]; by one, or vertices of negative excess number of 3.6 implies that the total chosen equal flovt' method, each augmentation either reduces the this bound is for indeed, the augmenting path algorithm itself can be viewed as an analogue of Ahuja and Orlin's variant [17] of Dinic's algorithm. We obtain a better bound scaling. This method Edmonds and Karp maximum all is arc capacities are integral and not loo large) (if all based on Orlin's variant [16] of the capacity-scaling algorithm of [6] for the flow algorithm of minimum-cost circulation problem and Gabow also analogous to the is Henceforth (except in Section 7) [7]. we shall assume that arc capacities are integral. The excess-scaling algorithm maintains an is by using excess the largest estimate A of the maximum power of two not exceeding U. The algorithm maintains two 0) The sum of (ii) The all positive excesses residual capacity of any arc is at is excess. Initially A invariants: most 2nA; either infinity or an integer (possibly zero) multiple of A. In Step 1 , the algorithm always chooses a starting vertex v with ej (v) exists, the algorithm replaces units of flow along the (i) is and tries again. maintained; immediately after A invariant changes, the (ii), which no such vertex In Step 4, the algorithm always pushes We call a sum of When A = 1 A most 2nA. can actu- units of flow /2, all excesses are zero, maximal period of time during which A A that invariant positive excesses is at all in turn guarantees that be puslied each time an augmentation occurs. algorithm terminates. if augmenting path. The choice of starling vertices guarantees Augmenting by A preserves ally A by A/2 ^ A; slays constant i and the phase of the algorithm. Lemma 0{n 4.1. The total number of augmentations done by the excess-scaling algorithm is log U). Proof. Each augmentation either reduces the reduces the ing a phase. sum of positive excesses by A. The number of phases is number of By (i), vertices with negative excess the latter case can occur only 0(log U). The bound follows. D by one or 0(n) limes dur- -11- Theorem 42. The 0{nQ{hn + nlog IJ)) time. the transportation version excess-scaling Using method this augmenting of the algorithm runs in in the transportation algorithm gives a bound for problem of O(no(hn + n log U) logi (nC)) time — log U, nC m Choosing k = min {2+ ) path for any k such bounds yields the following time that l^k^nC. for the transportation problem: O(nom O(non ]ogU Proof. Immediate from transformation Lemma 4.1 Section of 0{nQ \ogU ¥ n the solve will (n logn) We bound on shall assume exchange the source set we '. If there are no call this a log Vtlmln. D the transportation algorithm minimum-cost a combined with the problem in bound of circtilation the that 2. S -£ and by a if {/grows nonpolynomi- tni, and the sink i.e. set «o = "2. which > 7nA, it suggests the possibility of obtaining some for suitable modification of the algo- without loss of generality: ifn\ is < ni, and negate the supply-demand vector. by changing Step active vertices, stop. Otherwise, if increase the flow Otherwise, replace actually a push, since ilf(v,w) Cp (h'.v) obtain (/= (o((/j/«o)'og/i), which only holds number of augmentations /ij we can slightly, an improvement on the > some some 1 to the following: active vertex v on (v.w) by ey (v) and repeat Step in detail, we make then Uf(w,v) cost antisymmetry that Cp (v,^) <e. > 0, A 1 e 5 has an outgo- and repeat Step active vertex v has ey (v) A by A/2 Before analyzing the modified algorithm is 3.4. if is special push.) Otherwise, if onto S and go to Step push log U))) shall present the result, since ing arc (v.H-) such thai f(y,w) (We (— m number of augmentations. This We modify the excess-scaling algorithm Step 1 U <2mln\ log algorithm excess-scaling 4.1 only if log ally with n. Nevertheless, rithm. (/jC)/log and Theorem log min{ n,t/)) on the bound of Lemma O 2 if log t/ (l-H log (nC)/log log U)) time. By changing an + log The excess-scaling version of Corollary 43. 0(wj (1 log (nC)) k A, push '. vertex v '. several observations. A special which implies by e-optimality special 1 that push maintains the invariant 12 that there is no cycle of Once eligible arcs. a vertex v € 5 has zero excess, zero until the end of the algorithm. The excess on any vertex v e moved by flow total special pushes tations that decrease the is at number of 2nA. The is at most 2nA. Thus the total vertices with negative excess other augmentations during a single phase moved by which thus less than is 5 total most 3n A + J^ 2nA/2' = In A. 1-0 moved from flow It is at is strictly ils excess remains less than 2A. moved during augmen- flow most nA. The is at a given time until the end of the algorithm its We call an The modified algorithm maintains (ii) Every arc ' most 2n A) and, is at (v,h') is either flow follows that once an arc (y,w) has flow exceeding In A, arc (v.w) that can never be saturated open. positive excesses total most the sum of the positive excesses, flow remains positive until the end of the algorithm, and (w.v) can never be saturated. sum of all The open or has in place of invariant a residual capacity that (ii), is invariant (i) (the the following: an integer ( possibly zero) multiple of A. We can verify invariant (ii) by induction on the number of steps taken by the algorithm, ' simultaneously showing that every augmentation in Step 4 can actually Lemma i&O 4.4. log f/ (/Jo Suppose + number of augmentations made by first Henceforth + until the to O Oogmin{ the modified excess-scaling algorithm zero by a most one augmentation is at is during phase end of the algorithm there more phases, 3 TTiere augmentation from v arc (v.w) with fiv,w) reduced units of flow. n logmin{ n,U]). that the After 2 log « some total Corisider a vertex v e S. Proof. flow. The move A is /. A' special . When push. from v per phase. This augmentation moves A units of always an arc (v.w) with /(v,w) ^ AIn. the current value of the excess estimate t%n starting such an arc exists, if Hence v can have A' = A/8«^, and there is not before, the excess at v is is positive excess n,U]) phases, and there are 0(n log min{ n,U]) augmentations only starting during from ver- tices in 5. Now consider a vertex v e 7. If v does not receive additional flow from special pushes dur- ing a phase, there can be at moves 2A push to v starting less than most one augmentation units of flow to v, from v during the phase. We starting from v during the phase. which can account for at A special most two augmentations charge such augmentations to the corresponding special push. Since there are only n special pushes, the number of augmentations starting from vertices in r, summed over all phases, is O (n + no log U). This gives the desired bound. D 13 log U = n((n/no) log CoroUary Theorem bounds time presenting In /i), for since otherwise the bounds are the same assume Theorem as those in that 4.2 and 4.3. Assume 4.5. U = n((n/«o) 'og^). that log transportation 0(nQ(km + no]ogU)logt(noC)) —m any for bound time a gives algorithm Then 0(nQ (km + of the augmenting path algorithm runs in the we method, modified the such * the modified excess-scaling version 'og U)) /Iq for the time. Using method problem transportation l^k^rtoC. that this The choice in of of "0 k = min { 2 + log U, noC] yields the following time Oinom Oinl log Corollary' 4.6. + 1/ (1 U log U = CI ( — log (noC)) log (noC)/ log if log U bounds for the transportation problem: < 2m/no\ (— log U))) m if log U ^ 2m/ no. logn), the modified excess-scaling version of the transportation n algorithm combined with the transfonmation of Section 2 will solve a minimum-cost circulation problem in O (n^ log U{\ -^ log (nC)/ log logt/)) time. Remark. Every bound derived is U* replaced =4+ by in this Section smaller aixjther parameter For the U* the number of augmentations sum of 4.4 can be reduced to bounds of Theorem in Lemma 4.1 positive excesses is initially at number of augmentations during phases O in («o logl7* which +n 4.2, Corollary 4.3, improved bounds are analogous [6]. ^ =4+ to the log A> U* can be reduced to u(v,w)/m. £ (n \ogU') by most nU', which implies is min [n.U* Theorem O 4.5, O )). (n). U problem, transportation (v,»')« observing that the algorithm . each occurrence of the parameter € S The bound on in the U' if Y, (-^(v))/n. For the minimum-cost circulation problem, V Lemma remains valid Similarly, the that the bound in Corresponding improvements and Corollary 4.6 follow. These bound EdmcHids and Karp obtained for their transportation -14- 5. Use of Dynamic Trees The algorithms discussed By complicated data structures. bounds derived in Section in Section 4 are quite simple and do not require the use of any adding the use of dynamic trees [19^0,22], 4 by almost a logarithmic factor. Our use of dynamic the trees is analo- to their use in other networic flow algorithms [2,9,10,1], 12,19^2]. gous The dynamic tree data structure allows the maintenance of a collection of vertex-disjoint rooted trees, each arc of which has an associated value. Each tree is we can improve a child of vertex w, there is a tree arc from v to w. both an ancestor and a descendant of itself. is Each vertex The data an in-iree; that is, if vertex v in a tree is regarded as being structure supports the following seven operations: fmd-root{y): Fmd find-size{v}: Find and retiim the root of the tree containing vertex and return the number of vertices in the tree find-value(vy. Find and return the value of the tree arc leaving value returned fi.nd-Tnin{\): of a tie, Fmd to choose the vertex Add real w closest to the number x Combine If v is a tree root, the *i\\i\ find-\alue(yv) minimum. tree root. to the value of every arc along the path from v V is w by making w the parent of v and gjving This operation does nothing if v and w are in the same tree or not a tree root Break the tree containing v into two trees by deleting the edge joining parent; return the value of the deleted edge. This operation breaks infinity if v is a tree A sequence of C>(/log(z We arc is its + In case the trees containing v and the arc (v.w) the value x. cutiv): v. v. find-rootiv). link(v,w,xy. if containing vertex is infinity. and return the ancestor w of v change-value(v,x)' v. 1)) / tree time ifr is v to its no edge and returns root operations, starting with an initial collection of singleton trees, takes the maximum tree size [10,19,20,22]. use this data structure to represent a subset of the eligible current arcs. The value of an residual capacity. The data structure allows flow to be moved along an entire path at 15- once, rather than along one arc at a time. In applying this data structure to the transportation problem, time bounds if we we can improve take advantage of the special structure of the problem, specifically the fact that G is bipartite, and hence so is every dynamic tree. Let us assume that We redefine the size of a dynamic tree to be the number of vertices of T the semantics of \hc find size operation, but does not aiTect also modify the data structure so that we its size. To do dynamic trees (the ones manipulated of the actual this tree child in T. maximum tree contains at it tree size / trees translates into new according to the of a dynamic find-root(y) followed by the arc (find-rootiy),w) a one-vertex (start at least new path). If A, replace to Step and repeat Step bound a stack tree. next arc on / {w). If the end of / (w) (h',x) is (2 S has a virtual virtual trees. + It 1)) time, where dynamic trees. 1 Sr $no, on that defines a path w on 5, the max- of eligible then the tree path from v to Initially 5 is consists of repeating the 1. 1. stop. Otherwise, let Otherwise, no vertex has excess if v be a vertex of excess at least A. 2. Step 4. Otherwise, while the current arc of arc S z, The algorithm Step 2 (extend path). Let v be the top vertex on 5. Compute eligible We virtual tree con- path of eligible current arcs. no vertex has positive excess, A by A/2 Push V onto S and go is a dynamic following steps until termination occurs in Step Step 1 Every the excess-scaling algorithm uses these modified current arcs as follows: if vertex v appears just below vertex empty and each vertex forms I. definition of size. The algorithm maintains tree. T I a pointer to its parent 0(1) operations on In addition to an excess estimate A, the algorithm uses a fixed size ^ which consists tree, since every virtual tree vertex in its size, I represent each of the actual operations on actual dynamic trees lakes 0(1 log The following version of imum We the value of the outgoing tree arc. most twice at S I most twice as many vertices as Each of the deleted leaves has deleted. Every operation on actual follows that a sequence of 2 is the S i.e. contains. This changes it by the operations) by a virtual dynamic and has stored with number of vertices tains a any dynamic n\ ^ ^2, implementation significantly. its introduce an extra layer of abstraction. tree with all leaves in in the actual tree, the resulting found, is test w is w = find root{v). If ej (w) < not eligible, replace the cunent arc of z. If go w by reached without finding an eligible arc, go to Step whether find-siieiy) + find-sizeix) < 0, 3. to the If an perform so. link(w,x, u(y,w)-f(v,w)). If not. push x onto 5. Repeat Step 2. Step 3 (relabel). Relabel w. For each tree arc (y,w), perform cut(y). If v only vertex on S, pop v from S. Go to Step 2. = w and v is not the 16 Add A Step 4 (augment). Go to cut (find-min(v)). Pop Step 4b. let change-value(v, -A). Perform Slep 4a. ^/w). to find-value(find-min(v)) = 0, perform Step 4b. V from S. If 5 X = V and replace v by the and go While is empty, subtract new A from ej (v) and top vertex on 5. Let go to Step w = frnd-rootiy). Otherwise, 1. Add A to / (w.x) Step 4a. to This algorithm stores flow explicitly for arcs that are not in dynamic trees and implicitly for Whenever a cut tree arcs. When current value. is performed, the arc cut must have the algorithm terminates, every arc its in a still flow restored lo dynamic tree its correct must have its correa flow computed. These compulations have been omitted from the description above. The that use analysis of this algorithm dynamic k=2. The Oinom log (z rithm, which + total Since with this method the time bound for the not improved by using a non-constant cost-scaling factor, number of if v links and cuts 0(.,nQm) is (see The proof of Lemma 1)). means guarantees that finds izeiv) + is algorithm excess-scaling similar lo the analysis of other r^twork flow algorithms trees, e.g. [2,9,10,11,12,19,22]. transportation problem choose is that there are 0(.n and w find-sizeiyv) z. Thus in the Lemma e.g. 7.2 dynamic of shall tree version of the [11]), time taking 4.1 is valid for this version of the excess-scaling algo- logU) augmentations. The definition of are consecutive vertices > performed we on S, and w is the algorithm not the top vertex on S , then either the tree containing v or the tre« containing >v has size exceeding zll. Since every vertex on 5 is O(no/z), and the time per augmentation in a different is dynamic Oi(nofz) log (z + tree, the 1)). maximum Thus we obtain height of S is the following result. Theorem 0(no {m-¥ sportation 2 = min { 1 5.1. The dynamic vereion tree of — \ogU) log (z + 1)) time, for any z satisfying algorithm + runs — \ogU, no m ) O(nom in C>(fio (m + algorithm excess-scaling the 1 ^ z^ no. With this — logt/)log(z + l)log(/zoC)) runs method, the tran- time. Choosing gives the follovting time bounds for the transportation problem: log (2 + -^ m logt/) log (noC)) if log U <nom/n: in 17 0(n ]ogU logno Remark. The bound better in Theorem log (noC)) if U 5.1 for the case log U log S rtom/n. ^riQm/nis not an interesting one, since a bound of O(nom log no log ("oC)) can be obtained by implementing ing path algorithm (without excess scaling) using dynamic trees. the generic augment- D Corollary 52. The dynamic tree implemenution of excess scaling can be used to solve the minimum-cost circulation problem Oijvn log logf/ log (jiqC)) time in a bound of 0(jim \ogn log (jiqC)) OiriQlogU can -^ reduce U <n. If log t/ > n, scaling. bound the log obtainable with a dynamic tre« implementation of the aug- is menting path algorithm without excess We if on number the augmentations of to n logmin{n,t/)} by modifying the excess-scaling method as in Section 4. This leads to the following results. Theorem S3. Assume that \ogU = 0. (in/ no) logn). Then the — dynamic no the modified excess scaling algorithm runs in l<z<no- satisfying OiriQ Oino (m + — «o log With U) log (z + method, this 1) log O(no (m + log U) log tree Choos (noC)) time. Choosing z = min Ume bounds log (2 0{no 0{nm log (2 -•- If log t/ =n I/*, log m is in log U, no] gives —m U U) log (/loC)) if log t/ log «o log (/»oC)) if log 1/ < m; ^ m. minimum-cost circulation problem can be solved in time, in this Section as defined in the corresponding improvements log n -^ log V) log (nC)) where U' ^- (— k)gn), the Remark. Every bound derived by runs z for the transportation problem: O(nom Corollary 5.4. —m any "0 { 1 -^ 2 the following 1)) time, for algorithm transportation the -^ (z implementation of in the remains valid remark at if each occurrence of the end of Section 4. bounds of Lemmas 4.1 V is replaced This follows from the and 4.4 discussed in that remaiic. D - 6, 18- The Capacity Bounding Technique depend cnjcially on the elimination of TT»e results derived in Sections 3-5 the transformation to a transporution problem discussed in Section 2. there is some more direct, turns out to be related at least alternative, wih way One may ask whether A question that to deal with arc capacities. maximum whether the Ahuja-Orlin excess-scaling algorithm for the is [1,2] generalizes in a natural problem analogy or arc capacities via way minimum-cost flow problem via cost maximum Bow the generalization of other we show to the flow scaling, in algorithms to this problem [9,10]. We answer to both of these questions is a qualified "yes." consider the minimum-cost circulation problem as defined in Section 1, with integer capacities In this section and We propose costs. effect is a that the way of solving to convert the original problem into a sequence of a standard "vertex-splitting" transformation. bounded problems, we propose +nm) \ogU problems in To each of which The [8]. The solve the resulting capacity- a modification of the Ahuja-Oriin excess-scaling algorithm nested inside an e-scaling loop. Oi{n^\ogm OQog U) by m. This idea was used by Gabow and Taijan the arc capacities are integers bounded method requires problem using an outer capacity-scaling loop whose this resulting triple scaling maximum algorithm log(nC)) time using no fancy data stnictures. Although flow mns in algorithm this has an inferior complexity bound as compared to the bounds obtained in previous sections, the method and its Now we lation analysis have independent interest give details. problems each at The outer capacity-scaling loop constructs iteration, a target First, the as follows. to the arc capacities by doubling the current capacity and adding The target problem The restricted is (Cu'.c), where problem is is 1. cost c(vi,V2) c'(v2,wi) = = for each V e € two into V, and Vand More The restricted lem inner and a vertex V2 Observe that problem outer, one is added to the capacity of each arc denote the restilting capacity function by «'. graph and c is the original cost function. we formally, the restriaed problem to obtain the graph £' contains an C= arc (vj.vj) is call Networic (G',m",c')- is (V',£'), where obtained by V contains of capacity «(vi,V2) = an arc (v2,h'i) of capacity «"(v2,h'i) c(y,w) for each arc (v.w) e £. capacity zero. next bit of precision obtained from the target problem by bounding the flow through each vertex v of G = (V.£) vertices vj and V2 for each v We G is the original every vertex of the target problem by m. splitting circu- problem and a restricted (capacity-bounded) problem. These are obtained from the current network (v,w) such that the current bit of u(v,w) two minimum-cost = m'(v,h') m and and cost G' also contains opposite-direaed arcs of We call a vertex v; in the restricted prob- an arc (vi,V2) a split arc. every ciroilation /* in the restricted netwoiic corresponds to a circulation /in the target network given by /(v.w) =/'(v2,h'i). By construction, the costs of same. Conversely, for every circulation /in the target network, there tion/ given by /(v2,h',)=/(v,w), /'(v,,V2)= £ (X.V)6£ /(x.v). is /and /* are the a corresponding arc func- Function/is a circulation if and -19 only if /'(v We i.e.. i , V2) < /n for every assume (without split arc (v u" ,V2). loss of generality) that the original the identically zero arc function initializing /aixl i to be zero on all At a circulatioa is problem has no negative capacities; a high level, the algorithm consists of arcs and repeating the following steps for each bit of preci- sion in the capacities, proceeding left-to-right through the bits: Step (Construct the I. new target problem by introducing the next capacity (v.H')e E. replace «'(v.h') by 2u'(v,h') current bit of «(v,h') is if the current bit of tt(v,H') is zero, For each bit.) by 2u'(y,w)+ 1 if the one. Step 2. Construct the restricted problem {G\u" ,c'). Step 3. Find an optimal solution /* to the problem {G' ,u" ,c'). Step4. Construct the circulation /in (G,«',c') corresponding to /*. Step 5. (Modify the target problem so that the zero circulation is optimal.) For each (v,^) e £, replace u\v,yv) by m'(v,h') -/(v.w). The algorithm maintains for the old target Gabow and Lemma problem Tarjan 6.1. The the invariant that on entry to Step 1, The following (as modified in Step 5). the zero circulation result is similar to a is optimal lemma of [8]. circulation /computed in Step 4 is an optimal solution to the target problem (G.m'.c'). Proof. By culation is induction on the number of iterations. On optimal for the old target problem. This tialization, the is most recent entry to Step 1 , the zero cir- true for the initial entry because of the ini- and true for each subsequent entry by the induction hypothesis. Thus there price function p for old target problem. which By is some the reduced costs of all positive -capadty arcs are non-negative in the the construction in Step problem have capacity one or zero. 1. all negative-reduced-cost arcs in the Let/* be an optimal solution to the new target new target problem such that/* contains no zero-cost cycle of positive flow (any such cycle can be eliminated by reducing its flow). Grculation /* can be (There is at restricted decomposed most one such cycle network into at most m simple cycles, each of flow value one. for each negative reduced-cost arc). that corresponds to/* thus hdsf(y\,V2)<m The arc function f on the for each split arc (vi,v2). x.t.f -20- is a circulation. lem. Since f is optimal for the target problem, f optimal for the restricted prob- is follows that any optimal solution to the rcstriaed problem corresponds to an optimal It lemma solution to the target problem, and the We shall describe an is true. implementation of Step 4 and Tarjan [9,11] (already discussed D that uses the e-scaling in Section 3 in the context approach of Goldberg of the transportation problem) maximum [1,2]. The £-scaIing loop starts with a zero circulation and a zero price function; the zero circulation is e- with an inner loop thai is a modification of the Ahuja-Oriin optimal with respect to the zero price function for e = C. Then refinement subroutine that halves e and pnoduces a circtilation f is e-optimal with respect top. When (Recall that the restriaed network has e In < — , the vertices.) the f flow algorithm method iteratively applies a and a price function p such method terminates with an optimal The formal that solution. definition of the e-scaling loop is as follows: Step 4.1. Let/=0. e = C. and p=0. Step42. Foreachoutervertex V2.1etp(v2) = max {c'(v2.h'j) (v2,h',)€ £'). I Step 43. While E t — . perform (t,f,p) <- refine {t,f ,p). 2n The special structure of the restriaed network allows the maintenance of the following invariant in Step 4.3: for any residual arc (v.w) having negative reduced cost, v We is an inner vertex. say that a pseudoflow/has the inner vertex property with respect to a price function invariant holds. Step 4.2 guarantees that this invariant holds The correctness of the e-scaling loop and the fact that tions of refine follow from the results of The following implementation of described by Goldberg and Tarjan [9,1 maximum on entry Goldberg and Tarjan refine is 1], it p if this to Step 4.3. terminates after OOog(nC)) itera- [9,11]. based on the generic implementation of refine specialized to use excess scaling as in the Ahuja-Orlin flow algorithm [1^]. refine it,f.p). Step R.l. (Saturate negative-cost arcs.) C';,(^1,V2)<0, let/(Vi,V2) = «"(Vl.V2). For each split arc (v,,V2) such that -21- SiepR.2. Gnitialize A,e.) Let A = 2* where Step R.3. (Inner loop.) While A1 Step R.3.1. While there is a 1 it = flog ml . Replace e by e/2. repeat the following steps: push or relabel operatiOT that applies, perform such an operation. Step R J. 2. A by A/2. Replace Step R.4. (Restore the inner vertex property.) For each inner vertex vi. replace p(vi) by p(vi)-€/2. Step R J. The push and (cf ,p). Return relabel operations are defined as follows: push(v,w). ApplicabiliTy: Cfiv) > A/2. <^'(h')< A/2, u'/' (v.w) > 0, and Cp(v,w) < -e/4. Action: Send min {A/2.uy-'' (v.w)) units of flow from v to w. relabel(v). Applicability: C/'(v) > Action: Replace p(v) by Some remarks making moves the is Cp(v,w) t -e/4 for each residual arc (v.w). max {p(w)-c'(v,w)-e/2]. are in order here. Step R.1 saturates all negative reduced-cost arcs, thereby f into an optimal pseudoflow but introducing excesses and deficits at vertices. the excess flow new arxl value of amounts Step R.3 to the vertices with deficits while maintaining e/2-optimality (for Step R.4 restores the inner vertex property by changing p; after this e). step, f no longer E/2-optijna] but only £-optimal. Step 4.3 maintains a value exceeds A/2. A is A that is an upper bouiyJ on the largest excess. halved. All excesses are integers; by the time A< 1, aD When no deficits excess have been can- celed. Each pushing step moves excess from a vertex with excess exceeding A/2 to a vertex with excess not exceeding A/2, and through an edge of cost between -e/2 and -e/4. Thus each push is either by saturating or at least Ae/8. it moves We shall at least A/2 units of flow; in the latter case use this cost reduction to bound the it reduces the cost off number of nonsaturating pushes. 22 We implied. have omitted a description of These can be found details how push and relabel operations to determine in [2]; the that can be implementation uses the analogue to the stack- push/relabel step described there. The total time spent in such overhead in a single execution of refine 0(nm). is The proofs of the following lemmas are easy modifications of proofs of analogous lemmas in[9,!0]: Lemma 62. The push and re/a^e/ operations preserve e-optimality. Lemma op»eration relabel(v) decreases 63. 0) Each tion of refine, the The number of total Lemma We push. 6.3 implies that the running time of refine bound of 0(n^ log shall establish a To bound the + nm) log X costp(f')= is p to / - + nm) on 0(nm) the During an execuv. (iii) O(n^), taking 0(nm) is is 0(nm). plus 0(1) per nonsaturating number of nonsaturating pushes, triple scaling algorithm. define the cost of a pseudoflow f with be £ c;(v,w)/'(v,w)= X c'(v.>v)/(v,w)- does not depend on p, c'(y,w) f(y,w) (as defined in Section ef'(y)p(y). v€V /'(v,w)>0 is a circulation its cost 21 is (ii) 6en, for every vertex refine U log(nC)) bound on the /'(>,»')> that if m number of nonsaturating pushes, we respect to a price function costif) can decrease relabel operations during an execution of refine thereby obtaining an Oi(n^ logm Observe at least e/4. The number of saturating pushes during an execution of (iv) time, maximum amount by which p{v) p(v) by i.e. cost^C/") = cost(/') where 1). /'(v,>»')>0 As noted above, a nonsaturating vertex V that decreases p»(v) by an We by want to study push decreases costpif) by how much 6.4. Let / be a circulation, capacity and cost functions u and A relabeling of a costp(f) can vary during an execution of refine. states a general result about circulations Lemma Ae/8. amounts increases cost^CT) by «/'(v). relating cosXpif) to the cost of an optimal circulation. which at least c, f We do this This requires the following lemma, and pseudoflows. a pseudoflow, respectively. and p a price function on a network with Then -23 C0Stp(f)-COSl(f)< -Cp(v,H')Uy'(v,H'). 5; < (v.w): Cf(y,w) Proof. Lei f be f the pseudoflow obtained from by saturating all negauve reduced-cost arcs. Then costp(f) £ = costp(f')+ -Cp(y,w)uf'(v,w). (v.w): e,(v,H') < But /can be obtained from /" by increasing flow along a coUeciion of paths and cycles of arcs in Cf„, each of which has nonnegative reduced cost Thus cost(f) ^ costp(f"), and the lemma fol- D lows. Consider a time during the execution of function p, we define a potential <!> by <I> = (cosipif) The following lemma bounding circulation. For the current pseudoflow refine. is <I> - cost (/*)) /(Ae), where f is f and price any optimal the heart of the analysis of nonsaturating pushes. Lemma 65. -^Sn^ <'^<6nm/A. Proof. we We note e/2, we shall first that prove that -48A£/»^ < cosip(f) f is - cost(/*) e/2-optimal with respect to p. By obtain a price function p' with respect to which ^ 6cnm. To obtain the upper bound, decreasing prices on inner vertices by f is e-opiimal and such that inner vertex property with respect top'. Since no vertex has excess exceeding ^cosip(f) + tnm. By Lemma £ of all of all positive excesses is at Hence the total nm + 4nm = 5nm. By vertex. Hence if) residual <0 most 2n A ^ 4nm; hence so negative excesses. For any inner vertex m-€f(v). cosip- -C^' (V,H')U/'(V.H'). (y,w):<:^'(v,w) sura has the 6.4, COStp' (f)- cost (/)< The A < 2m, f v, is the negative of the the total residual capacity of capacity of all all sum arcs leaving arcs leaving inner vertices is at is most the inner vertex property, every negative reduced-cost arc leaves an inner 24 -c'p- J^ (v,w): c^' (y.w) Combining To inequalities gives costp obtain the lower bound, with respect to which/* is we (v.w) uf < Sam. (v.w) < - cost(J*) < 6tnm. {f) note first thai we can assume optimal and such that lp(v) -f *(v) I that there is a price function < \2tn since the repeated executions of refine in Step 4.3 of the e-scaLng optimal circulation /* and a final price change of any vertex over total price function p* such that/* the iterations all of have costif) -costp-i/) <0, since /* can be converted arcs of Gy , all / method will v. This is produce an optimal with respect to p*; the is refine is at into for every vertex p* most ^ 6nt/2' = Men. We by increasing flow on residual of which have nonnegative reduced cost. But costp-if) - costp(f) < X Ip'(v) -p(v) 1 1 e/(v) ^ 48 Aen^ I vev sum of the since the excesses. Lemma positive excesses Combining 6.7. 0(ji} log/« The is at most 2nA, as inequalities gives cost(f*) A — costp(f) ^ 48A£«^. number of nonsaturating pushes during an D execution <I> by at least 1/8. relabeling that decreases the price of a vertex There are at pose that during most log m + 1 iterations Any by x increases of Step R.3 in refine. saturating <I> by at most phases and applying A between two Lemma 6.5, iterations Consider the = Oin\ it can increase <I> by at j'* iteration. <, follows that J^p, tnm + 48n^ + n^Oog = 0(n^ log m+ m + nm). D Sup- number of non<1) of at least most n^. Summing over we have 5;(p,/8-Xi) J^i is x. this iteration the total decrease in vertex prices is x,. If p, is the Pil%-Xi. Changing ^ refine push also decreases saturating pushes during this iteration, then the iteration causes a net decrease in Since of + nm). Proof. Each nonsaturating push decreases <I>. the negative of the stmi of the negative is 1). all -25- Theorem The 6.8. m 0((n^ log + nm) for finding a minimum-cost circulation runs in logt/ log(nC)) time. Using dynamic way scaling algorithm triple trees in the inner they are used in loop of the triple scaling algorithm, reduces the time bound to [2], 0(nm log (1 + — m Further minor improvemenls might be possible using additional id&as in analogously to the \ogU log/n) We [2]. log (nC)). shall not pursue however, since in any case the approach of Sections 3-5 produces better this possibility further, bounds. We conclude restricted by noting this section problems generated way that there is an alternative minimum (mUC)) on log capacity-scaling 0{nm^ U log log number of pivot the method with Step (mC)) time, if in the time to G. This time bound is obtained a bound of U = m, and the implemented using the network simplex method runs 3 do one pivot step necessary to transform the graph by splitting vertices; on every arc who In a restriaed problem, steps. a simple reduced-cost pivot rule with lexicography to avoid cycling. This rule was studied by Oriin [15], 0(nmU sequence of Namely, we can use in the outer capacity-scaling loop. version of the network simplex rule, specifically DanLzig's to solve the it not noteworthy; is 0(jn). In this algorithm, suffices to more impose interesting is a capacity the mere it is in not bound of m fact that com- bining one scaling loop with a standard version of the network simplex algorithm gives a polynomial-time algorithm. Without the scaling loop, the same version of the r^rwork simplex algorithm can take exponentially 7. many pivot steps [24]. Remarks We have 0(jnm log log log 1/ = n ( shown U log («C)) —n log n). the that We time, minimum-cost even and in problem circulation 0(nm log (2 -• can — log U) log m be solved (/»C)) time in if have derived analogous bounds for the transportation problem. Our algorithms use scaling of both costs and capacities, combined with an augmenting path method and an implementation based on d>Tiamic the minimum-cost Oin^ log t/ (7], (1 circulation » log (rtC)/ 0{nm log/j loglogn), problem log log t/)) namely \o%U = 0(\o%n) and trees. if log log£/ If is dynamic 0{nm = fJ( —n C = 0(log«), trees are not used, the time bourxl for log t/ (1 logn). + log (nC)/ log log (/)). Under the similarity assumption our time bound with dynamic trees which beats the best previous bound of 0(,nm logn log( for very dense graphs (/n = Q (,- logn )). or —m is n} )) [11] except 26 We tice expect that some version of our algorithm, probably without dynamic be competitive with or superior to previously existing algorithms. required experiments to confirm or refute this hypothesis. We trees, will in prac- have no{ yet done the Our experiments with rithms (see e.g. [9]) suggest thai periodic scans to tighten prices may similar algo- increase the practical, though not the theoretical, speed of the algorithm. We have discussed the Ahuja-Orlin A The flow algorithm in the inner loop of the Goldberg-Tarjan makes open question minimum-cost minimum- analysis of this technique uses the cost of the current jjseudoflow as a quality. This tantalizing for the capacity-bounding technique, which allows us to use a modification of maximum cost flow method. measure of its a the analysis very intuitive. whether there is circulation problem. is We an O (nm log logn log (r»C))-time algorithm believe that the answer is yes and that a modification of our methods will lead to such a bound. Such a result would probably give a time bound of (.run over known results. 8. [1] log logn) for the maximum flow problem, which would also be an improvement (See [2,10].) References R. K. Ahuja and J. B. Orlin, "A fast and simple algorithm for the maximum flow prob- lem." Technical Report 1905-87. Sloan School of Management. M.I.T., Cambridge. MA, 1987; Operations Research, to appear. 12] R.K. Ahuja, J.B. Oriin. and R.E. Taijan, "Improved time bounds for the problem." [3] to "A distributed algorithm working paper. Laboratory [4] flow ^pear. D.P. Bertsekas, MA, maximum for Information problem." unpublished for the assignment and EJecision Sciences, M.I.T., Cambridge, 1979. D.P. Bertsekas, "Distributed asynchrorwus relaxation methods for linear network flow problems," Technical Repon LIDS-P-1606, Laboratory for Information and Decision Sciences. M.I.T.. 1986. [5] E.A. Dinic, "Algorithm for solution of a problem of maximum flow in networlcs with l)OweT estimation," Soviet Math. Dokl. 11 (1970). 1277-1280. [6] J. Edmonds and R.M. Karp. "Theoretical improvements in algorithmic efficiency for net- woric flow problems." y. Assoc. Comput. I?] Mack. 19 (1972). 248-264. H.N. Gabow. "Scaling algorithms for network problems." (1985). 148-168. J. Comput. System Sci. 31 27- [8] H.N. Gabow and R.E. Tarjan. "Faster scaling algorithms fornetworic problems," SIAM J. Comput., submitted. [9] A.V. Goldberg, "Efficient graph algorithms for sequential and parallel computers," Ph.D. maximum flow problem," J. Thesis, M.I.T.. 1987. [10] "A new A.V. Goldberg and R.E. Tarjan, approach to the Assoc. Comput. Mach., to appear. [11] A.V. Goldberg and R.E. Tarjan, "Fmding minimum-cost circulations by successive approximation," [12] A/ar/i. qfOper. Res., to appear. A.V. Goldberg and R.E. Tarjan, "Finding minimum-cost circulations by canceling negative cycles," J. Assoc. Comput. Mach., submitted; also Proc. Twentieth Annual ACM Symp. on Theory of Computing (1988), 388-397. [13] E.L. Lawler, Combinatorial Optimization: Networks Winston. [14] New Yorlc, NY, Mehlhom, Data R. and Matroids, Holt, Reinhart, and 1976. Structures and Algorithms. Volume 1: Sorting and Searching, Springer- Veriag, Berlin, 1984. [15] J. B. Orlin, "On Programming 24 [16] J. B. Orlin, tieth [17] J. (1985), 166-178. faster strongly B. Orlin and R. K. Ahuja, maximum Steiglitz, Twen- maximum flow and 1988. Combinatorial Optimization: Algorithms and Com- Englewood Oiffs, NJ. 1982. D.D. Sleator and R.E. Tarjan, "A data structure for dynamic trees," J. Comput. System 26 (1983). 362-391. D.D. Sleator and R.E. Tarjan, "Self-adjusting binary search trees," J. Assoc. Comput. (1985), 652-686. E. Tardos, ica. [22] cost flow algorithm," Proc. flow problems," Technical Report No. 192, Operations Research C.H. Papadimitriou and K. Mach. 32 [21] minimum distance-directed algorithms for MA, 5ci. [20] "New Center, M.I.T., Cambridge, plexity, Prentice-Hall. [19] polynomial Annual ACM Symp. on Theory of Computing (1988), 377-387. parametric [18] "A the simplex algorithm for networks and generalized networks," Math. "A strongly polynomial minimum cost circulation algorithm," Combinator- 5 (1985), 247-255. R.E. Tarjan, Data Structures and Network Algorithms, Society for Industrial and Applied Mathematics, Philadelphia, PA 1983. 28- [23] R.E. Tarjan and C.J. van simple polygon." [24] Wyk. "An SIAMJ. Comput., H.M. Wagner, "On O (n loglogn)-time algorithm for triangulating a 17 (1988). 143-178. a class of capacitated transportation problems." Management Science 5(1959). 304-318. (25] N. Zadeh. "A bad network flow problem for the simplex method and other flow algorithms." Math. Programming 5 (1973). 255-266. b / ob Ubb minimum cost Date Due Ub-26-67 3 TDflQ DOS 37t. bST