A survey on exact algorithms for the maximum flow and minimum-cost flow problems

Network flow problems form an important and much-studied family of combinatorial optimization problems, with a huge array of practical applications. Two network flow problems in particular have received a great deal of attention: the maximum flow and minimum-cost flow problems. We review the progress that has been made on exact solution algorithms for these two problems, with an emphasis on worst-case running times


INTRODUCTION
Network flow problems have received a great deal of attention from the Operational Research and Optimization communities, ever since Ford and Fulkerson published their influential textbook in 1962 [28]. In addition to their wealth of practical applications, network flow problems are also of great theoretical interest. For one thing, they can be viewed as "easy" combinatorial optimization problems, in the sense that they can be solved in polynomial time. For another, they can be viewed as a rather simple kind of linear program (LP), in which the constraint matrix has a special structure. We refer the reader to the excellent textbooks [1,79] for details.
Over the years, there have been many advances in exact algorithms for various network flow problems. In this article, we review the progress that has been made on exact algorithms for two problems in particular: the maximum flow problem (MF for short) and the minimum-cost flow problem (MCF for short). Although MF is a special case of MCF, a large number of exact algorithms have been devised specifically for MF. For this reason, we believe that it deserves special treatment.
The reader familiar with network flow problems will know that several other much-studied combinatorial optimization problems can also be viewed as special cases of MCF. In particular, this includes the shortest (s, t)-path, assignment, transportation and transshipment problems. We will mention some of them in Section 3.2. The reader wanting more details is referred to [1,13,55,70,79].
The article has a very simple structure. Section 2 surveys algorithm for MF, and Section 3 does the same for MCF. We use the following (standard) notation throughout the article. Let G = (V, A) be a directed graph (or digraph). If an arc a ∈ A goes from node i to node j, we write a = (i, j). We also write n = |V| and m = |A|. The set of arcs leaving node i is denoted by + (i), and the set of arcs entering node i is denoted by − (i).

THE MAXIMUM FLOW PROBLEM
In this section, we survey exact algorithms for MF. Section 2.1 gives some key definitions and notation. Section 2.2 briefly reviews the "classical" algorithms, by which we mean all algorithms that came before the landmark paper of Goldberg and Rao [40] in 1998. Section 2.3 reviews the subsequent combinatorial algorithms. Finally, Section 2.4 considers some very different algorithms based on interior-point methods.

Definitions and notation
The maximum flow problem was introduced in Ford and Fulkerson [27]. We have a directed graph G = (V, A). One node s ∈ V is called the source, and another node t ∈ V is called the sink. Each arc a ∈ A has a capacity u a ∈ Q + . The task is to send as much flow as possible from the source to the sink.
Without loss of generality, we assume that all capacities are integers. We also let U = max a∈A {u a } denote the maximum capacity. If the running time of an MF algorithm is bounded by a polynomial in m, n and log U, the algorithm is called polynomial. If the running time is bounded by a polynomial in m and n only, the algorithm is called strongly polynomial. We call a directed path from s to t in G an (s, t)-path.
The material in the remainder of this subsection comes from [28]. For a ∈ A, let x a be a non-negative variable, representing the amount of flow sent through the arc a. MF can then be formulated as the following LP: The objective function (1) is to maximize the total amount of flow leaving the source node. The constraints (2) ensure that, for each vertex apart from the source and sink, the total amount of flow entering and leaving are equal. The constraints (3) ensure that flows are non-negative and arc capacities are not exceeded. Note that the constraints (2) have a very special structure: each variable appears exactly once with a coefficient of +1, and exactly once with a coefficient of −1. For this reason, it is usually much more efficient to solve MF with a specialized algorithm, rather than using a generic LP algorithm (such as the simplex method).
A vector x satisfying (2) and (3) is called a flow. Given a flow, we can construct a digraph, called the residual graph, as follows. The vertex set is V. The arc set, which we callĀ, is defined as follows. For each arc (i, j) ∈ A such that x a < u a , we place an arc (i, j) inĀ with capacity u a − x a . For each arc (i, j) ∈ A such that x a > 0, we place an arc (j, i) inĀ with capacity x a . The two types of arcs are called forward and reverse arcs, respectively.
Any (s, t)-path in the residual graph is called an augmenting path (with respect to x). Given any augmenting path D ⊆Ā, we can increase the amount of flow in G as follows. Let be the smallest capacity among the arcs in the path. If a ∈ D is a forward arc, then increase x a by . If it is a reverse arc, then decrease x a by . A flow x is maximum if and only if there exists no augmenting path. Now consider the subgraph of the residual graph which contains only the forward arcs. If this subgraph does not contain any augmenting path, x is called a blocking flow. All maximum flows are blocking, but the reverse is not true.

Classical algorithms
As mentioned above, we call an MF algorithm "classical" if it appeared before the publication of [40]. (This is because the appearance of [40] was regarded as a major breakthrough in the field-see the next subsection.) There exist several excellent surveys on the classical algorithms (see, e.g., [1,45,70]). For this reason, we mention only deterministic algorithms here, and we include only algorithms that included fundamental new ideas, and algorithms that had a faster running time than at least one earlier algorithm. These algorithms are summarized in Table 1.

Capacity scaling:
We begin by selecting some positive constant Δ. We then run the Ford-Fulkerson algorithm, but ignore any arc in the residual graph that has capacity less than Δ. When the algorithm terminates, we halve the value of Δ, and repeat. When Δ becomes smaller than 1, we can stop. With an appropriate choice of Δ, this approach gives O(m log U) augmentations. The resulting running time is O ( m 2 log U ) time, which is (weakly) polynomial.
The next important development was due to Dinic [24]. He observed that one can construct a blocking flow directly, in O(mn) time, without any considering of augmenting paths. This led him to propose a variant of the first Edmonds-Karp algorithm which begins by constructing a blocking flow, and then iteratively searches for blocking flows in the residual graph. He proved that this variant terminates after only O(n) augmentations. Since each augmentation takes O(mn) time, his algorithm runs in O ( mn 2 ) time. Applying a similar idea to the second Edmonds-Karp algorithm, Dinic also found an algorithm that performs O(log U) augmentations, leading to a running time of O(mn log U).
After the publication of Dinic [24], several faster algorithms were found for computing blocking flows. These included the algorithms of Shiloach [72] and Galil and Naamad [36], and the O (m log n) algorithm of Sleator and Tarjan [73,74]. These improvements led to corresponding speed-ups in the Dinic algorithm. Thus, by the start of the 1980s, it was known that MF could be solved in either O ( n 3 ) or O (mn log n) time, whichever is the faster. The next significant advance was made in 1986, when Goldberg and Tarjan [41,43] proposed the preflow-push approach. This approach uses the notion of pre-flows, first defined in [50]. Roughly speaking, a pre-flow is a relaxation of a flow, in which the total flow entering a node may exceed the total flow leaving that node. The difference between the entering and leaving flows is called the "excess." Goldberg and Tarjan's algorithm begins by constructing a "blocking pre-flow," and then repeatedly tries to "push" excess flow from a node to adjacent nodes that are estimated to be closer to the sink node. Any excess flow that cannot be routed to the sink is eventually sent back to the source.
Goldberg and Tarjan showed that only O(mn) "pushes" are needed. They then showed that, with the help of a data structure from [73,74], their approach could be implemented so that each "push" takes only O ( log(n 2 ∕m) ) time. This particular implementation therefore runs in O ( mn log(n 2 ∕m) ) time. The remaining eight algorithms listed in Table 1, dated 1989-1994, are all variants of the preflow-push algorithm. Some of them use remarkably sophisticated data structures. For brevity, we do not go into details. We remark however that the algorithm of Cheriyan et al. [18,19] is rather unusual, in that it starts with a sparse subgraph and then adds the remaining edges as needed. Moreover, it was the first ever MF algorithm to run in o ( n 3 ) time on dense graphs. To close this subsection, we remark that the worst-case running time is not the only criterion by which one may evaluate an algorithm. Some algorithms are easier to implement than others, and some perform better than their worst-case bound might suggest. For thorough empirical comparisons of various classical MF algorithms, see [4,15,21].

The "O(mn) barrier"
The observant reader will have noticed that, in the 1980s and early 1990s, authors were coming closer and closer to obtaining an algorithm running in O(mn) time, but never quite achieving it. Actually, as pointed out in [40], Ω(mn) is a very natural "barrier" for MF algorithms. Indeed, every maximum flow can be expressed as a non-negative linear combination of (s, t)-paths, and each of those (s, t)-paths may contain up to n − 1 arcs. Thus, any MF algorithm that uses augmenting paths explicitly must take Ω(mn) time.
The first algorithm to break through the barrier arose in 1998, with the publication of Goldberg and Rao [40]. The algorithm exploits an earlier result, proved in [43,49], that the blocking-flow algorithm of Dinic [24] needs no more than augmentations in the unit capacity case (i.e., the case in which u a = 1 for all a ∈ A and there are no parallel arcs). Combined with capacity scaling, along with some ingenious data structures, they obtained an MF algorithm which solves a sequence of O ( log(n 2 ∕m) log U ) unit-capacity MF subproblems. This yields an overall running time of Provided that U is not extremely large, this running time breaks the O(mn) barrier. For an empirical study of the algorithm, see [46]. , using an improved version of the algorithm of Ahuja et al. [6]. This running time is very slightly better than the one of King et al. [53].
The algorithms mentioned in this subsection are summarized in Table 2.

Interior-point methods
Recently, some rather different MF algorithms have been developed, based on interior-point methods (IPMs). These algorithms are randomized, but they find the optimal solution to any specified accuracy with high probability. Moreover, as we will see, some of them can be derandomized with only a small increase in running time. For a summary of these algorithms, see Table 3. In this table, "polylog n" means log k n for some constant k ≥ 1, and "o(1)" means a constant that tends to zero as n tends to infinity. Before going into details on these algorithms, we give a bit of historical context. In 2004, Spielman and Teng [75] gave a fast randomized algorithm for finding approximate solutions to systems of linear equations that have a "symmetric and diagonally dominant" (sdd) constraint matrix. (Such linear systems, called "Laplacian" systems, have a wide range of applications.) Their algorithm runs in O(m polylogn) time, where n is the number of variables and m is the number of non-zeroes in the matrix. A series of improvements quickly followed. To our knowledge, the fastest known randomized algorithm for the problem is the one of [48], which runs in O ( m(log log n) k ) time for some positive constant k. There is also a deterministic version [22], which runs in O ( m 1+o(1) ) time.  2022 Chen et al. [16] Armed with this background, we can now make some remarks about the new MF algorithms: • Daitch and Spielman [23] devised a specialized IPM for LPs with sdd constraint matrices, which uses the algorithm of Spielman and Teng [75] as a subroutine. They then show that the max-flow LP (1)-(3) can be converted into an LP of the desired form, using a certain linear transformation. Note that the running time of the Daitch-Spielman algorithm is comparable to that of the one by Goldberg and Rao [40] mentioned above. • Lee and Sidford [57] presented an improved IPM for LPs with sdd constraint matrices, which uses random sampling to sparsify the constraint matrix. The IPM requires only O( √ rL) major iterations, where r is the rank of the constraint matrix and L is its bit complexity. When specialized to MF, their algorithm obtains the running time stated in the table.
• The approach of Lee and Sidford was improved by Van den Brand et al. [11,12] and Gao et al. [39].
• Madry [59] presented a rather different approach, based on three main observations: (i) the max-flow problem is similar to the problem of sending electrical current through a network of resistors while consuming the minimum amount of energy (although the latter has a quadratic objective function instead of a linear one); (ii) this electrical flow problem can be solved quickly via a reduction to a series of Laplacian system solves; and (iii) one can construct a maximum flow via a series of electrical flow problems, rather than by a series of blocking flow problems as in the classical algorithms. We remark that Madry's algorithm runs in pseudo-polynomial time. • Variants of Madry's algorithm can be found in Liu and Sidford [58] and Kathuria et al. [51]. These algorithms are pseudo-polynomial as well. • Finally, and most recently, Chen et al. [16] found a randomized MF algorithm that runs in only O ( m 1+o(1) log U ) time. The algorithm is however extremely complex, using concepts and data structures from traditional MF algorithms, Laplacian systems and IPMs simultaneously.
To close this section, we remark that the Daitch-Spielman and Madry algorithms can be de-randomized, using the deterministic Laplacian system solver mentioned above. This comes at the cost of an additional factor of n o (1) in the running time. An interesting open question is whether any of the other IPM algorithms can be de-randomized, without incurring a significant increase in running time.

THE MINIMUM-COST FLOW PROBLEM
Next, we look at exact algorithms for MCF. Section 3.1 gives some key definitions and notation. Section 3.2 mentions some key problems that often arise as subproblems when solving MCF. Section 3.3 recalls some of the earliest MCF algorithms, which run in pseudo-polynomial time. Finally, Section 3.4 covers polynomial-time algorithms.

Definitions and notation
In MCF, we have a digraph G = (V, A). Associated with each node i ∈ V is an integer b i . If b i > 0, i is called a supply node. If b i < 0, i is called a demand node. It is assumed that ∑ i∈V b i = 0. Each arc a ∈ A has a cost c ij ∈ Z and a capacity u a ∈ Z + . (Note that arc costs are usually permitted to be negative.) The task is to send flow through the network in such a way that the flow leaving each supply node i is equal to b i , the flow arriving at each demand node i is equal to b i , and the amount of flow through any given arc a does not exceed the capacity.
In the standard LP formulation of MCF, one uses a non-negative variable x a for each arc a ∈ A, just as in the case of MF. The LP is then: 0 ≤ x a ≤ u a (a ∈ A).
The objective function (4) is to minimize the total cost. The constraints (5) ensure that the supplies and demands are met. The constraints (6) bound the flow through each arc. As in the previous section, we let U denote the maximum arc capacity. We will also find it helpful to let C denote max a∈A {|c a |}.

Key subproblems
It turns out that many of the MCF algorithms in the literature call on subroutines for other simpler problems, such as (a) the maximum flow problem, (b) the shortest (s, t)-path problem, (c) the transshipment problem, and (d) the problem of detecting negative-cost cycles in digraphs. To make this article self-contained, we briefly recall some results on the last three of the problems mentioned.
In the shortest (s, t)-path problem, we have a digraph G, two specified nodes s and t, and a cost vector c ∈ Q m . The task is find a path from s to t of minimum total cost. This problem has a long history, and a wide variety of algorithms have been proposed for it. Algorithms have also been found for various special cases. A good survey is given in [70]. For brevity, we mention only three algorithms. Dijkstra's algorithm, which is designed for the case in which c ∈ Q m + , can be implemented to run in O(m + n log n) time [29]. The algorithm of Thorup [77], which makes the stricter assumption that c ∈ Z m + , runs in O(m + n log log C) time. Finally, the algorithm in [9], which assumes that c ∈ Z m , runs in O(m polylog n log W) time, where W is the most-negative arc cost.
The transshipment problem, mentioned in the introduction, is the variant of MCF in which no arc capacities are present (or, equivalently, all arc capacities are very large) [61]. A folklore result states that MCF can be reduced to transshipment by subdividing each arc into two, and adjusting the supplies, demands and costs appropriately (see [55]). Note that this transformation increases the number of nodes from n to n + m, which can have an effect on the worst-case running time of various solution algorithms.
Finally, in the negative-cycle detection problem, we have a digraph G and a cost vector c ∈ Z m . The task is to check whether there exists a directed cycle in G whose total cost is negative. The problem can be solved in O(mn) time using the Bellman-Ford algorithm (see [1]).

Pseudo-polynomial MCF algorithms
We now recall the "classical" MCF algorithms, all of which run in pseudo-polynomial time. These algorithms are summarized in Table 4.
In this table, "MF," "SP," and "NC" stand for "maximum flow," "shortest-path," and "negative-cost cycle," respectively. So, for example, the first MCF algorithm in the table uses a shortest-path algorithm as a subroutine, and it calls that subroutine O ( mn 2 C ) times. As in the previous section, we only include algorithms that include fundamental new ideas, and algorithms that had a faster running time than at least one earlier algorithm.
We now make some remarks about each of these algorithms: • Iri [47] and Busacker and Gowen [14] developed what is now known as the "successive shortest path" approach. It is a "primal-dual" approach, in the sense that it maintains dual optimality from the start and then strives to attain primal  [47], Busacker and Gowen [14] 1960 O(mU) SP Minty [60], Fulkerson [30] 1962 O (n min{U, C}) SP and MF Ford and Fulkerson [28] 1967 O(mC) NC Klein [54] 1969 O(nU) SP Edmonds and Karp [25] feasibility. It involves the solution of O ( shortest-path problems in which negative edge-lengths may appear. Later on, Tomizawa [78] showed that one can restrict oneself to shortest-path problems with non-negative edge lengths. • Minty [60] and Fulkerson [30] independently developed the so-called "out-of-kilter" method. It is an unusual method as it does not need primal or dual solutions to be feasible in its early stages. It involves the solution of O(mU) shortest-path problems. • Ford and Fulkerson [28] developed a primal-dual algorithm that has O (n min{U, C}) major iterations. In each such iteration, a shortest-path problem and a maximum flow problem is solved. • Klein [54] presented a primal algorithm, based on iteratively canceling negative-cost cycles. Although he did not give a formal analysis of the running time, the number of major iterations must be O(mC), since the cost of the flow decreases by at least one in each iteration. • Edmonds and Karp [25] found an improved out-of-kilter algorithm that does not need to solve max-flow problems. It requires the solution of O(nU) shortest-path problems.
We remark that Klein's algorithm appeared implicitly in the 1940s, in the works of Leonid Kantorovich (see [71]).

Polynomial MCF algorithms
In the 1970s and 1980s, several polynomial-time algorithms were developed for MCF. The main developments are summarized in Table 5. We now make some remarks about these algorithms: • Edmonds and Karp [26] used capacity scaling (see Section 2.2) to obtain a faster out-of-kilter algorithm that involves only O(m log U) shortest-path computations. • Röck [69] used "cost scaling" to obtain a primal-dual algorithm that involves O(m log C) max-flow computations. (Cost scaling is similar to capacity scaling, except that one iteratively increases the precision of the costs, rather than the capacities.) • Orlin [62] and Fujishige [31] showed how to reduce the transshipment problem to the solution of O ( n 2 log n ) shortest-path problems. Using the transformation mentioned above, this shows that MCF can be reduced to O ( m 2 log n ) shortest-path problems in a digraph with O(m + n) nodes and arcs. • Around the same time, Tardos [76] found a different strongly polynomial-time algorithm which involves the solution of O ( m 2 log n ) max-flow problems. • Galil and Tardos [37,38] showed that, in fact, only O ( n 2 log n ) shortest-path problems are needed even when capacities are present.
• Gabow and Tarjan [32,33] devised an algorithm based on a combination of capacity scaling, cost scaling, and a reduction to a series of transportation problems. The running time is O (mn log n log U log(nC)). • Goldberg and Tarjan [42,44] developed a new primal-dual approach that uses cost scaling. Using an appropriate data structure, they obtain a running time of O(mn log(n 2 ∕m) log(nC)). • Orlin [63,64] presented a new approach based on a relaxed notion of flow called a pseudo-flow. His approach enables one to solve the transshipment problem with only O(n log n) shortest-path calls. Using the transformation mentioned above, this shows that MCF can be reduced to O(m log n) shortest-path problems in a digraph with O(m + n) nodes and arcs. • Ahuja et al. [2,3] combined the best features of the capacity-scaling and cost-scaling approaches, together with sophisticated data structures, to yield an algorithm running in O (mn log log U log(nC)) time.

DATA AVAILABILITY STATEMENT
Data sharing not applicable to this article as no datasets were generated or analyzed during the current study.