Maximum flow problem
In optimization theory, maximum flow problems involve finding a feasible flow through a single-source, single-sink flow network that is maximum.
The maximum flow problem can be seen as a special case of more complex network flow problems, such as the circulation problem. The maximum value of an s-t flow (i.e., flow from source s to sink t) is equal to the minimum capacity of an s-t cut (i.e., cut severing s from t) in the network, as stated in the max-flow min-cut theorem.
History
The maximum flow problem was first formulated in 1954 by T. E. Harris and F. S. Ross as a simplified model of Soviet railway traffic flow.[1][2][3] In 1955, Lester R. Ford, Jr. and Delbert R. Fulkerson created the first known algorithm, the Ford–Fulkerson algorithm.[4][5]
Over the years, various improved solutions to the maximum flow problem were discovered, notably the shortest augmenting path algorithm of Edmonds and Karp and independently Dinitz; the blocking flow algorithm of Dinitz; the push-relabel algorithm of Goldberg and Tarjan; and the binary blocking flow algorithm of Goldberg and Rao. The electrical flow algorithm of Christiano, Kelner, Madry, and Spielman finds an approximately optimal maximum flow but only works in undirected graphs.[6][7]
Definition
Let be a network with being the source and the sink of respectively.
- The capacity of an edge is a mapping , denoted by or . It represents the maximum amount of flow that can pass through an edge.
- A flow is a mapping , denoted by or , subject to the following two constraints:
- 1. , for each (capacity constraint: the flow of an edge cannot exceed its capacity)
- 2. , for each (conservation of flows: the sum of the flows entering a node must equal the sum of the flows exiting a node, except for the source and the sink nodes)
- The value of flow is defined by , where is the source of . It represents the amount of flow passing from the source to the sink.
The maximum flow problem is to maximize , that is, to route as much flow as possible from to .
Solutions
We can define the Residual Graph, which provides a systematic way to search for forward-backward operations in order to find the maximum flow.
Given a flow network , and a flow on , we define the residual graph of with respect to as follows.
1. The node set of is the same as that of .
2. Each edge of is with a capacity of .
3. Each edge of is with a capacity of .
The following table lists algorithms for solving the maximum flow problem.
Method | Complexity | Description |
---|---|---|
Linear programming | Constraints given by the definition of a legal flow. See the linear program here. | |
Ford–Fulkerson algorithm | O(E max| f |) | As long as there is an open path through the residual graph, send the minimum of the residual capacities on the path.
The algorithm works only if all weights are integers. Otherwise it is possible that the Ford–Fulkerson algorithm will not converge to the maximum value. |
Edmonds–Karp algorithm | O(VE2) | A specialization of Ford–Fulkerson, finding augmenting paths with breadth-first search. |
Dinitz blocking flow algorithm | O(V2E) | In each phase the algorithms builds a layered graph with breadth-first search on the residual graph. The maximum flow in a layered graph can be calculated in O(VE) time, and the maximum number of the phases is n-1. In networks with unit capacities, Dinic's algorithm terminates in time. |
General push-relabel maximum flow algorithm | O(V2E) | The push relabel algorithm maintains a preflow, i.e. a flow function with the possibility of excess in the vertices. The algorithm runs while there is a vertex with positive excess, i.e. an active vertex in the graph. The push operation increases the flow on a residual edge, and a height function on the vertices controls which residual edges can be pushed. The height function is changed with a relabel operation. The proper definitions of these operations guarantee that the resulting flow function is a maximum flow. |
Push-relabel algorithm with FIFO vertex selection rule | O(V3) | Push-relabel algorithm variant which always selects the most recently active vertex, and performs push operations until the excess is positive or there are admissible residual edges from this vertex. |
Dinitz blocking flow algorithm with dynamic trees | O(VE log(V)) | The dynamic trees data structure speeds up the maximum flow computation in the layered graph to O(Elog(V)). |
Push-relabel algorithm with dynamic trees | O(VE log(V2/E)) | The algorithm builds limited size trees on the residual graph regarding to height function. These trees provide multilevel push operations. |
Binary blocking flow algorithm[8] | The value U corresponds to the maximum capacity of the network. | |
MPM (Malhotra, Pramodh-Kumar and Maheshwari) algorithm | O(V3) | Refer to the Original Paper. |
Jim Orlin's + KRT (King, Rao, Tarjan)'s algorithm | O(VE) | Orlin's algorithm solves max-flow in O(VE) time for while KRT solves it in O(VE) for |
For a more extensive list, see[9]
Integral flow theorem
The integral flow theorem states that
- If each edge in a flow network has integral capacity, then there exists an integral maximal flow.
Application
Multi-source multi-sink maximum flow problem
Given a network N = (V,E) with a set of sources S = {s1, ..., sn} and a set of sinks T = {t1, ..., tm} instead of only one source and one sink, we are to find the maximum flow across N. We can transform the multi-source multi-sink problem into a maximum flow problem by adding a consolidated source connecting to each vertex in S and a consolidated sink connected by each vertex in T (also known as supersource and supersink) with infinite capacity on each edge (See Fig. 4.1.1.).
Minimum path cover in directed acyclic graph
Given a directed acyclic graph G = (V, E), we are to find the minimum number of paths to cover each vertex in V. We can construct a bipartite graph G' = (Vout∪Vin, E' ) from G, where
- Vout = {v∈V: v has positive out-degree}.
- Vin = {v∈V: v has positive in-degree}.
- E' = {(u,v)∈(Vout,Vin): (u,v)∈E}.
Then it can be shown, via König's theorem, that G' has a matching of size m if and only if there exists n-m paths that cover each vertex in G, where n is the number of vertices in G. Therefore, the problem can be solved by finding the maximum cardinality matching in G' instead.
Maximum cardinality bipartite matching
Given a bipartite graph G = (X∪Y, E), we are to find a maximum cardinality matching in G, that is a matching that contains the largest possible number of edges. This problem can be transformed into a maximum flow problem by constructing a network N = (X∪Y∪{s,t}, E' }, where
- E' contains the edges in G directed from X to Y.
- (s,x)∈E' for each x∈X and (y,t)∈E' for each y∈Y.
- c(e) = 1 for each e∈E' (See Fig. 4.3.1).
Then the value of the maximum flow in N is equal to the size of the maximum matching in G.
Maximum flow problem with vertex capacities
Given a network , in which there is capacity at each node in addition to edge capacity, that is, a mapping , denoted by , such that the flow has to satisfy not only the capacity constraint and the conservation of flows, but also the vertex capacity constraint
In other words, the amount of flow passing through a vertex cannot exceed its capacity. To find the maximum flow across , we can transform the problem into the maximum flow problem in the original sense by expanding . First, each is replaced by and , where is connected by edges going into and is connected to edges coming out from , then assign capacity to the edge connecting and (see Fig. 4.4.1, but note that it has incorrectly swapped and ). In this expanded network, the vertex capacity constraint is removed and therefore the problem can be treated as the original maximum flow problem.
Maximum independent path
Given a directed graph G = (V, E) and two vertices s and t, we are to find the maximum number of independent paths from s to t. Two paths are said to be independent if they do not have a vertex in common apart from s and t. We can construct a network N = (V, E) from G with vertex capacities, where
- s and t are the source and the sink of N respectively.
- c(v) = 1 for each v∈V.
- c(e) = 1 for each e∈E.
Then the value of the maximum flow is equal to the maximum number of independent paths from s to t.
Maximum edge-disjoint path
Given a directed graph G = (V, E) and two vertices s and t, we are to find the maximum number of edge-disjoint paths from s to t. This problem can be transformed to a maximum flow problem by constructing a network N = (V, E) from G with s and t being the source and the sink of N respectively and assign each edge with unit capacity.
Real world applications
Baseball Elimination
Let G = (V, E) be a network with s,t ∈ V being the source and the sink respectively. We add a game node {i,j} with i < j to V and connect each of them to s by an edge and set its capacity to rij which represents the number of plays between these two teams. We also add a node for each team i and connect each node {i,j} with team nodes i and j to ensure one of them wins. We do not need to restrict the flow value on these edges. Finally, we make edges from team node i to the sink node t and set the capacity of wk+rk–wi to prevent team i from winning more than wk+rk. Let S be the set of all team participating in the league and let . In this method it is claimed team k is not eliminated if and only if a flow value of size r(S - {k}) exists in network G. In the mentioned article it is proved that this flow value is the maximum flow value from s to t.
Airline scheduling
In the airline industry a major problem is the scheduling of the flight crews. Airline scheduling problem could be considered as an application of extended maximum network flow. The input of this problem is a set of flights F which contains the information about where and when each flight departs and arrives. In one version of Airline Scheduling the goal is to produce a feasible schedules with at most k crews.
In order to solve this problem we use a variation of circulation problem called bounded circulation which is the generalization of network flow problems, with the added constraint of a lower bound on edge flows.
Let G = (V, E) be a network with s,t ∈ V as the source and the sink nodes. For the source and destination of every flight i we add two nodes to V, node si as the source and node di as the destination node of flight i. We also add the following edges to E:
- An edge with capacity [0, 1] between s and each si.
- An edge with capacity [0, 1] between each di and t.
- An edge with capacity [1, 1] between each pair of si and di.
- An edge with capacity [0, 1] between each di and sj, if source sj is reachable with a reasonable amount of time and cost from the destination of flight i.
- An edge with capacity [0, ∞] between s and t.
In the mentioned method, it is claimed and proved that finding a flow value of k in G between s and t is equal to finding a feasible schedule for flight set F with at most k crews.
Another version of Airline Scheduling is finding the minimum needed crews to perform all the flights. In order to find an answer to this problem we create a bipartite graph G’ = (A ∪ B, E) where each flight has a copy in set A and set B. If the same plane can perform flight j after flight i, connect i∈A to j∈B. A matching in G’ induces a schedule for F and obviously maximum bipartite matching in this graph produces the an airline schedule with minimum number of crews. As it is mentioned in the Application part of this article, the maximum cardinality bipartite matching is an application of maximum flow problem.
See also
- Closure problem
- Minimum cost flow problem
References
- ↑ Schrijver, A. (2002). "On the history of the transportation and maximum flow problems". Mathematical Programming 91 (3): 437–445. doi:10.1007/s101070100259.
- ↑ Gass, Saul I.; Assad, Arjang A. (2005). "Mathematical, algorithmic and professional developments of operations research from 1951 to 1956". An Annotated Timeline of Operations Research. International Series in Operations Research & Management Science 75. pp. 79–110. doi:10.1007/0-387-25837-X_5. ISBN 1-4020-8116-2.
- ↑ Harris, T. E.; Ross, F. S. (1955). "Fundamentals of a Method for Evaluating Rail Net Capacities". Research Memorandum (Rand Corporation).
- ↑ Ford, L. R.; Fulkerson, D. R. (1956). "Maximal flow through a network". Canadian Journal of Mathematics 8: 399. doi:10.4153/CJM-1956-045-5.
- ↑ Ford, L.R., Jr.; Fulkerson, D.R., Flows in Networks, Princeton University Press (1962).
- ↑ Kelner, J. A.; Lee, Y. T.; Orecchia, L.; Sidford, A. (2014). "An Almost-Linear-Time Algorithm for Approximate Max Flow in Undirected Graphs, and its Multicommodity Generalizations". Proceedings of the Twenty-Fifth Annual ACM-SIAM Symposium on Discrete Algorithms. p. 217. arXiv:1304.2338. doi:10.1137/1.9781611973402.16. ISBN 978-1-61197-338-9.
- ↑ Knight, Helen (7 January 2014). "New algorithm can dramatically streamline solutions to the ‘max flow’ problem". MIT News. Retrieved 8 January 2014.
- ↑ Goldberg, A. V.; Rao, S. (1998). "Beyond the flow decomposition barrier". Journal of the ACM 45 (5): 783. doi:10.1145/290179.290181.
- ↑ Goldberg, A. V.; Tarjan, R. E. (1988). "A new approach to the maximum-flow problem". Journal of the ACM 35 (4): 921. doi:10.1145/48014.61051.
- ↑ Schwartz, B. L. (1966). "Possible Winners in Partially Completed Tournaments". SIAM Review 8 (3): 302. doi:10.1137/1008062. JSTOR 2028206.
- ^ Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, Clifford Stein (2001). "26. Maximum Flow": Introduction to Algorithms. Second Edition. MIT Press and McGraw-Hill. ISBN 0-262-03293-7.
Notes
- ^ Joseph Cheriyan and Kurt Mehlhorn (1999). "An analysis of the highest-level selection rule in the preflow-push max-flow algorithm". Information Processing Letters 69 (5): 239–242. doi:10.1016/S0020-0190(99)00019-8.
- ^ Daniel D. Sleator and Robert E. Tarjan (1983). "A data structure for dynamic trees". Journal of Computer and System Sciences 26 (3): 362–391. doi:10.1016/0022-0000(83)90006-5. ISSN 0022-0000.
- Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein (2001). "26. Maximum Flow". Introduction to Algorithms, Second Edition. MIT Press and McGraw-Hill. pp. 643–668. ISBN 0-262-03293-7.
- Eugene Lawler (2001). "4. Network Flows". Combinatorial Optimization: Networks and Matroids. Dover. pp. 109–177. ISBN 0-486-41453-1.