It is well-known that the Ford–Fulkerson algorithm for finding a maximum flow in a network need not terminate if we allow the arc capacities to take irrational values. Every non-terminating example converges to a limit flow, but this limit flow need not be a maximum flow. Hence, one may pass to the limit and begin the algorithm again. In this way, we may view the Ford–Fulkerson algorithm as a transfinite algorithm.
We analyze the transfinite running-time of the Ford–Fulkerson algorithm using ordinal numbers, and prove that the worst case running-time is . An upper bound of is established via induction on . For the lower bound, we first show that we can model the Euclidean algorithm via Ford–Fulkerson on a certain network. By running this example on a pair of incommensurable numbers, we obtain a new robust non-terminating example. We then describe how to carefully glue k copies of our Euclidean example in parallel and describe a run of the Ford–Fulkerson algorithm that requires at least steps. This run includes an infinite number of “recharging” steps that reinitialize the k copies of our Euclidean example.
The Ford–Fulkerson algorithm [12] is a classic algorithm for computing the maximum flow in a network. At each step, the algorithm chooses an augmenting path P from the source vertex s to the sink vertex t and then pushes as much flow as possible along P. This procedure is then iterated, until no such augmenting path exists. It is well-known that in certain networks with irrational capacities, the Ford–Fulkerson algorithm does not necessarily terminate if the augmenting paths are not chosen carefully. The smallest non-terminating example is due to Zwick [19].
Dinits [9] and Edmonds and Karp [10] independently showed that if one always chooses an augmenting path of minimum length, then the Ford–Fulkerson algorithm will necessarily terminate. We emphasize that whenever we refer to the Ford–Fulkerson algorithm, we mean the original version where augmenting paths are chosen arbitrarily.
It is fairly easy to show that if the Ford–Fulkerson algorithm does not terminate, then it will converge to a (not necessarily maximum) flow f. Thus, after ω steps, we may begin the algorithm anew, starting with the limit flow f. By iterating this procedure, we can view the Ford–Fulkerson algorithm as a transfinite algorithm and ask what its worst case running-time is in terms of ordinal numbers. Note that the notion of using ordinals in computability theory dates back at least to the work of Turing [18].
The following theorem, which is the main result of this paper, determines this worst case ordinal running-time up to a constant factor in the exponent.
The worst case running-time of the Ford–Fulkerson algorithm is.
This theorem is established via the following two lemmas.
For every network N, every run of the Ford–Fulkerson algorithm terminates after at moststeps.
Although we are working with ordinal numbers where transfinite induction might seem like a natural tool, the proof of Lemma 2 proceeds by finite induction on the exponent .
For every, there exists a networkon ℓ arcs and a run of the Ford–Fulkerson algorithm onwith run-time at least.
To prove Lemma 3, we first construct a new non-terminating example of Ford–Fulkerson. The main idea is to demonstrate that the Euclidean algorithm can be modelled by applying Ford–Fulkerson to a particular network. Thus, a run of the Euclidean algorithm on two incommensurable numbers gives a non-terminating example of Ford–Fulkerson. We then carefully glue k copies of our Euclidean example in parallel and describe a run of the Ford–Fulkerson algorithm that requires at least steps. This particular run includes an infinite number of “recharging” steps that reinitialize the k copies of our Euclidean example.
Paper organization. In Section 2 we define ordinal running-time. We prove our upperbound in Section 3 and our lowerbound in Section 4. We finish by giving some concluding remarks in Section 5.
Ordinal running-time
We now describe how we intend to measure running-time via ordinal numbers. For an introduction to ordinals and network flow theory, we refer the reader to [15] and [7], respectively. We use an extended notion of a Turing machine that can complete an infinite number of steps of computation, and continue computing afterwards. This matches the notion of infinite time Turing machines by Hamkins and Lewis [13]. The ordinal running-time is then quite natural; it is the worst case running-time of performing brute-force search over all choices of augmenting paths. We give the precise details below.
All networks considered will always be finite with finite arc capacities. Each step of the Ford–Fulkerson algorithm will be indexed by an ordinal α and the corresponding flow after step α will be denoted (we allow to be any valid flow). A run of the algorithm is obtained by choosing an augmenting path for (if it exists) for each successor ordinal , and setting to be the flow obtained from by pushing as much flow as possible along . If no augmenting path exists at step , we define to be . If α is a limit ordinal, we define to be a certain limit flow. Some care must be taken to ensure that this limit flow is well-defined and this is the content of Lemma 4.
The run-time of a particular run is the least ordinal α such that . For a fixed network N, the (worst case) running-time of the Ford–Fulkerson algorithm on N is the maximum of the run-times over all runs of the algorithm on N. The main result of this section is that transfinite Ford–Fulkerson is a well-defined procedure.
For every ordinal α, every run of the Ford–Fulkerson algorithm assigns a well-defined flowafter step α.
Let be a network with a source , a sink , and non-negative finite capacities for each arc . We proceed by transfinite induction. We let be any valid initial flow. Now, let α be an ordinal, and assume that is defined for all ordinals .
First suppose α is a successor ordinal, say . If there is no augmenting path for , then we set . Otherwise, if we choose the augmenting path for , then we define to be the flow obtained from by pushing as much as possible along .
If α is a limit ordinal, we proceed as follows. For each arc e and ordinal , we define a -valued variable as follows. If and we chose as the augmenting path for , then we set to be 1 if e is a forward arc of , −1 if e is a backward arc of , and 0 otherwise. We initialize . We also let be the value of the initial flow and set to be the amount of flow pushed by . If β is a limit ordinal or there is no augmenting path at step β, we set both and to be 0.
Consider . Observe that at most countably many terms are non-zero, since this sum is bounded (by the capacity of a minimum cut). Moreover, this series converges absolutely, since each term is non-negative. Therefore, this sum is independent of the order of summation and is hence well-defined. We define a flow by setting
for each . Observe that is an absolutely convergent series, since converges. Therefore, is also a well-defined sum. Evidently, for all since for all . It remains to verify that satisfies conservation of flow. Let . Observe that
where the last equality follows from conservation of flow for . □
The upperbound
Given a flow f, an arc e is a zero-arc if , is saturated if is equal to the capacity of e, and is extreme if it is saturated or a zero-arc.
For every, every network N, and every run of the Ford–Fulkerson algorithm on N, either the algorithm has already terminated aftersteps or there are at leastextreme arcs in.
We proceed by (finite) induction on k. Since some arc must be extreme after pushing as much flow along an augmenting path, the lemma clearly holds for (note ). We inductively assume that the claim holds for k. Now, for each , let be the set of extreme arcs for the flow . Since steps have passed between and , by induction we may assume that for all j. Next note that each arc can only switch between being a zero-arc and a saturated arc a finite number of times because the value of the flow is always bounded. This implies that for all sufficiently large j, there is an arc such that is extreme in . Let A be such that infinitely often and a be such that infinitely often. Since , it follows that each edge is extreme for . On the other hand, since , we conclude that a is also extreme for . Thus, has at least extreme arcs, as required. □
Using Lemma 5, we now prove our upperbound, restated for convenience.
For every network N, every run of the Ford–Fulkerson algorithm terminates after at moststeps.
If the algorithm has not terminated after steps, then Lemma 5 implies that for all , every arc of N is extreme in . Let c be the smallest non-zero capacity over all arcs of N. Since all arcs are extreme in , the flow increases by at least c at step (for all j). This is a contradiction since the value of is finite. □
The lowerbound
Let . We begin by constructing a network and a run of the Ford–Fulkerson algorithm on which simulates the Euclidean algorithm on a and b.
A network and two augmenting paths which allow for the subtraction of b from a.
Letbe the network depicted in Fig.
1
. If, then there is a run of the Ford–Fulkerson algorithm onwith run-time at least ω.
The labelled arcs of Fig. 1 (denoted and ) have capacities a and b with . The other arcs have large capacity (which we will specify later). Given a flow f and an arc e, the residual capacity of e, denoted , is defined to be . Let and be the augmenting paths given by the dashed arcs. Now, starting from the zero-flow, if we push flow along and , then becomes and is still b. We continue this process until . At this point, note that the value of the current flow is and that the roles of and b are reversed.
Let and be the reflections of and through the vertical line from s to t. By next pushing flow along the augmenting paths and , we can convert the residual capacity of to . We continue this process until . Note that the horizontal arcs are backward arcs of and . However, since , there is enough flow along the horizontal arcs to perform these augmentations. The roles of and have been reversed again and we continue inductively. Therefore, this example “computes” the greatest common divisor of a and b. If , it will have run-time at least ω, as required. However, it remains to check that the total flow is still bounded after ω steps (so that we may specify the capacities).
The total flow after ω steps of the Euclidean run onis at most.
Let be the intermediate outputs of the Euclidean algorithm. Observe that for all , and . Therefore, the total flow after ω steps is at most , as required. □
Thus, for all arcs , we can take . □
This example is quite robust in that a small perturbation of the arc capacities will almost certainly produce another non-terminating example. We will now “glue” k copies of in parallel to obtain a run of the Ford–Fulkerson algorithm with run-time at least . This proves Lemma 3. A key property of our gluing construction is that we can use one copy of the Euclidean example to “recharge” another copy.
For every, there exists a networkon ℓ arcs and a run of the Ford–Fulkerson algorithm onwith run-time at least.
For each , we define a network and show that there is a run of the Ford–Fulkerson algorithm on with run-time at least . For simplicity, we only illustrate the case ; the general case is similar. Figure 2 depicts the corresponding network for . The labelled arcs have capacities , and b respectively with incommensurate. We denote these arcs as from left to right. The remaining arcs have large capacities, which we will specify later. We denote the three middle vertical arcs as and from left to right.
Note that there are “left” and “right” copies of sitting in , depicted by dashed edges in Fig. 2.
A network (depicted twice) that admits a run of Ford–Fulkerson that takes iterations. Left and right copies of in are shown by dashed edges.
Let be the intermediate outputs of the Euclidean algorithm for . We begin by running the Euclidean algorithm on the left copy of . This takes ω steps. We then run two steps of the Euclidean algorithm on the right copy of , obtaining residual capacities for and , respectively. We next perform a recharging step (described below), and then re-run the (full) Euclidean algorithm on the left copy of . We then run another two steps of the Euclidean algorithm on the right copy of , obtaining residual capacities and proceed iteratively.
The Recharging Step. At the beginning of the nth recharging step the residual capacities of and are and , respectively. We first use the two augmenting paths in Fig. 3 (shown by dashed arcs) to recharge the residual capacity of without drastically changing the rest of the network. Observe that neither nor belong to the left or right copy of in . The arcs and will always have zero-flow except during this recharging step. By pushing flow along the two dashed augmenting paths, becomes and and are unchanged. Note that both and have zero-flow after the recharging step, as claimed. Similarly, using two augmenting paths similar to the dashed ones, we can recharge to without changing , and .
One easily checks that there is always sufficient flow along backward arcs to run the Euclidean algorithm on the right copy of and to perform the recharging steps. Furthermore, since a and b are incommensurate, and are also incommensurate for all n. Therefore, this run of Ford–Fulkerson on requires at least steps. By Claim 1, the total flow after steps is at most
where the first term corresponds to the Euclidean run on the right copy of , the second term corresponds to all the Euclidean runs on the sequence of left networks , and the third term corresponds to the total flow produced by the recharging steps.
We can therefore take for all . The proof is complete as it is straightforward to check that contains at most edges for all k. □
A sequence of two augmenting paths that recharges the far left vertical edge is shown by dashed edges.
Note that our example for the lowerbound starts with the zero-flow, while our proof for the upperbound is valid starting with any initial flow.
Conclusion
In this paper, we determined the ordinal running-time of the Ford–Fulkerson algorithm exactly, up to a constant factor c in the exponent of ω. It is an interesting open question what the correct value of c is. Our upperbound gives , while our lowerbound gives .
One possible moral of this story is that the original Ford–Fulkerson algorithm is actually correct; it simply requires transfinite time to terminate. Moreover, in some sense the running-time of is very efficient (it converges on the ω scale). For example, a priori, it is possible that the algorithm would require steps.
Of course, it is possible to define and analyze the ordinal running-time of any non-terminating algorithm which converges to a limit. As far as we know, the only other example where this has been carried out is a result by Backman [1] on chip-firing [2] in metric graphs. Indeed, this was the impetus for our work, since chip-firing on metric graphs [16] and Ford–Fulkerson are in some sense “dual” to each other. Unfortunately, we were unable to find a single theorem which proves both results simultaneously.
Footnotes
Acknowledgements
This research was supported by the European Research Council under the European Unions Seventh Framework Programme (FP7/2007-2013)/ERC Grant Agreement no. 279558. We would like to thank Matt Baker, Diane Maclagan, and Vic Reiner for each noting the similarity between the non-termination of Ford–Fulkerson and the non-termination of metric chip-firing. We also thank Marco Macchia for help with the figures.
References
1.
S.Backman, Infinite reduction of divisors on metric graphs, European Journal of Combinatorics35 (2014), 67–74. doi:10.1016/j.ejc.2013.06.024.
2.
S.Backman, Riemann–Roch theory for graph orientations, Adv. Math.309 (2017), 655–691. doi:10.1016/j.aim.2017.01.005.
M.Baker and S.Norine, Riemann–Roch and Abel–Jacobi theory on a finite graph, Advances in Mathematics215(2) (2007), 766–788. doi:10.1016/j.aim.2007.04.012.
5.
N.L.Biggs, Chip-firing and the critical group of a graph, Journal of Algebraic Combinatorics9(1) (1999), 25–45. doi:10.1023/A:1018611014097.
6.
A.Björner, L.Lovász and P.W.Shor, Chip-firing games on graphs, European Journal of Combinatorics12(4) (1991), 283–291. doi:10.1016/S0195-6698(13)80111-4.
7.
W.J.Cook, W.H.Cunningham, W.R.Pulleyblank and A.Schrijver, Combinatorial Optimization, Wiley-Interscience Series in Discrete Mathematics and Optimization, John Wiley & Sons, Inc., New York, 1998, p. 355.
8.
D.Dhar, Self-organized critical state of sandpile automaton models, Physical Review Letters64(14) (1990), 1613–1616. doi:10.1103/PhysRevLett.64.1613.
9.
E.Dinits, Algorithm of solution to problem of maximum flow in network with power estimates, Doklady Akademii Nauk SSSR194(4) (1970), 754.
10.
J.Edmonds and R.M.Karp, Theoretical improvements in algorithmic efficiency for network flow problems, in: Combinatorial Structures and Their Applications, Proc. Calgary Internat. Conf., Calgary, Alta., 1969, Gordon and Breach, New York, 1970, pp. 93–96.
11.
A.Engel, The probabilistic abacus, Educational Studies in Mathematics6(1) (1975), 1–22. doi:10.1007/BF00590021.
12.
L.R.Ford Jr. and D.R.Fulkerson, Maximal flow through a network, Canad. J. Math.8 (1956), 399–404. doi:10.4153/CJM-1956-045-5.
13.
J.D.Hamkins and A.Lewis, Infinite time Turing machines, J. Symbolic Logic65(2) (2000), 567–604. doi:10.2307/2586556.
14.
J.Hladký, D.Kráľ and S.Norine, Rank of divisors on tropical curves, J. Combin. Theory Ser. A120(7) (2013), 1521–1538. doi:10.1016/j.jcta.2013.05.002.
15.
K.Hrbacek and T.Jech, Introduction to Set Theory, 3rd edn, Monographs and Textbooks in Pure and Applied Mathematics, Vol. 220, Marcel Dekker, Inc., New York, 1999, p. 291.
16.
Y.Luo, Rank-determining sets of metric graphs, Journal of Combinatorial Theory, Series A118(6) (2011), 1775–1793. doi:10.1016/j.jcta.2011.03.002.
17.
K.Mosesian, Strongly basable graphs, in: Akad. Nauk. Armian. SSR Dokl., Vol. 54, 1972, pp. 134–138.
18.
A.M.Turing, Systems of logic based on ordinals, Proc. London Math. Soc.S2-45(1), 161. doi:10.1112/plms/s2-45.1.161.
19.
U.Zwick, The smallest networks on which the Ford–Fulkerson maximum flow procedure may fail to terminate, Theoret. Comput. Sci.148(1) (1995), 165–170. doi:10.1016/0304-3975(95)00022-O.