Max-flow min-cut theorem
In computer science and optimization theory, the max-flow min-cut theorem states that in a flow network, the maximum amount of flow passing from the source to the sink is equal to the total weight of the edges in the minimum cut, i.e. the smallest total weight of the edges which if removed would disconnect the source from the sink.
The max-flow min-cut theorem is a special case of the duality theorem for linear programs and can be used to derive Menger's theorem and the Kőnig–Egerváry theorem.
Definitions and statement
The theorem relates two quantities: the maximum flow through a network, and the minimum weight of a cut of the network. To state the theorem, each of these quantities must first be defined. Let be a directed graph, where V denotes the set of vertices and E is the set of edges. Let and be the source and the sink of, respectively. The capacity of an edge is a mapping denoted by or where. It represents the maximum amount of flow that can pass through an edge.Flows
A flow is a mapping denoted by or, subject to the following two constraints:- Capacity Constraint: For every edge in E,
- Conservation of Flows: For each vertex v apart from s and t, the following equality holds:
The value of a flow is defined by
where as above is the source node and is the sink node. In the fluid analogy, it represents the amount of fluid entering the network at the source node. Because of the conservation axiom for flows, this is the same as the amount of flow leaving the network at the sink node.
The maximum flow problem asks for the largest flow on a given network.
Cuts
The other half of the max-flow min-cut theorem refers to a different aspect of a network: the collection of cuts. An s-t cut is a partition of such that and. That is, s-t cut is a division of the vertices of the network into two parts, with the source in one part and the sink in the other. The cut-set of a cut is the set of edges that connect the source part of the cut to the sink part:Thus, if all the edges in the cut-set of are removed, then no positive flow is possible, because there is no path in the resulting graph from the source to the sink.
The capacity of an s-t cut is the total weight of its edges,
where if and, otherwise.
There are typically many cuts in a graph, but cuts with smaller weights are often more difficult to find.
Main theorem
The main theorem links the maximum flow through a network with the minimum cut of the network.Linear program formulation
The max-flow problem and min-cut problem can be formulated as two primal-dual linear programs.Max-flow | Min-cut | |
variables | ' | ' ' |
objective | maximize ' | minimize ' |
constraints | subject to ' | subject to ' |
sign constraints |
The max-flow LP is straightforward. The dual LP is obtained using the algorithm described in dual linear program. The resulting LP requires some explanation. The interpretation of the variables in the min-cut LP is:
The minimization objective sums the capacity over all the edges that are contained in the cut.
The constraints guarantee that the variables indeed represent a legal cut:
- The constraints guarantee that, for non-terminal nodes u,v, if u is in S and v is in T, then the edge is counted in the cut.
- The constraints guarantee that, if v is in T, then the edge ' is counted in the cut.
- The constraints guarantee that, if u is in S, then the edge ' is counted in the cut.
The equality in the max-flow min-cut theorem' follows from the strong duality theorem in linear programming, which states that if the primal program has an optimal solution, x*, then the dual program also has an optimal solution, y''*, such that the optimal values formed by the two solutions are equal.
Example
The figure on the right is a network having a value of flow of 7. The numerical annotation on each arrow, in the form x/y, indicates the flow and the capacity. The flows emanating from the source total seven, as do the flows into the sink.The vertex in white and the vertices in grey form the subsets and of an s-t cut, whose cut-set contains the dashed edges. Since the capacity of the s-t cut is 7, which equals the value of flow, the max-flow min-cut theorem indicates that the value of flow and the capacity of the s-t cut are both optimal in this network.
Note that the flow through each of the dashed edges is at full capacity: this is the 'bottleneck' of the system. By contrast there is spare capacity in the right-hand part of the network. In particular, the flow from node one to node two need not be equal to 1. If there were no flow between nodes one and two, then the inputs to the sink would change to 4/4 and 3/5; the total flow would still be seven. On the other hand, if the flow from node one to node two were doubled to 2, then the inputs to the sink would change to 2/4 and 5/5; the total flow would again remain at seven.
Application
Cederbaum's maximum flow theorem
The maximum flow problem can be formulated as the maximization of the electrical current through a network composed of nonlinear resistive elements. In this formulation, the limit of the current between the input terminals of the electrical network as the input voltage approaches, is equal to the weight of the minimum-weight cut set.Generalized max-flow min-cut theorem
In addition to edge capacity, consider there is capacity at each vertex, 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 constraintIn other words, the amount of flow passing through a vertex cannot exceed its capacity. Define an s-t cut to be the set of vertices and edges such that for any path from s to t, the path contains a member of the cut. In this case, the capacity of the cut is the sum the capacity of each edge and vertex in it.
In this new definition, the generalized max-flow min-cut theorem states that the maximum value of an s-t flow is equal to the minimum capacity of an s-t cut in the new sense.
Menger's theorem
In the undirected edge-disjoint paths problem, we are given an undirected graph and two vertices and, and we have to find the maximum number of edge-disjoint s-t paths in.The Menger's theorem states that the maximum number of edge-disjoint s-t paths in an undirected graph is equal to the minimum number of edges in an s-t cut-set.
Project selection problem
In the project selection problem, there are projects and machines. Each project yields revenue and each machine costs to purchase. Each project requires a number of machines and each machine can be shared by several projects. The problem is to determine which projects and machines should be selected and purchased respectively, so that the profit is maximized.Let be the set of projects not selected and be the set of machines purchased, then the problem can be formulated as,
Since the first term does not depend on the choice of and, this maximization problem can be formulated as a minimization problem instead, that is,
The above minimization problem can then be formulated as a minimum-cut problem by constructing a network, where the source is connected to the projects with capacity, and the sink is connected by the machines with capacity. An edge with infinite capacity is added if project requires machine. The s-t cut-set represents the projects and machines in and respectively. By the max-flow min-cut theorem, one can solve the problem as a maximum flow problem.
The figure on the right gives a network formulation of the following project selection problem:
Project | Machine | ||
1 | 100 | 200 | Project 1 requires machines 1 and 2. |
2 | 200 | 100 | Project 2 requires machine 2. |
3 | 150 | 50 | Project 3 requires machine 3. |
The minimum capacity of an s-t cut is 250 and the sum of the revenue of each project is 450; therefore the maximum profit g is 450 − 250 = 200, by selecting projects and.
The idea here is to 'flow' the project profits through the 'pipes' of the machine. If we cannot fill the pipe, the machine's return is less than its cost, and the min cut algorithm will find it cheaper to cut the project's profit edge instead of the machine's cost edge.
Image segmentation problem
In the image segmentation problem, there are pixels. Each pixel can be assigned a foreground value or a background value. There is a penalty of if pixels are adjacent and have different assignments. The problem is to assign pixels to foreground or background such that the sum of their values minus the penalties is maximum.Let be the set of pixels assigned to foreground and be the set of points assigned to background, then the problem can be formulated as,
This maximization problem can be formulated as a minimization problem instead, that is,
The above minimization problem can be formulated as a minimum-cut problem by constructing a network where the source is connected to all the pixels with capacity, and the sink is connected by all the pixels with capacity. Two edges and with capacity are added between two adjacent pixels. The s-t cut-set then represents the pixels assigned to the foreground in and pixels assigned to background in.
History
An account of the discovery of the theorem was given by Ford and Fulkerson in 1962:"Determining a maximal steady state flow from one point to another in a network subject to capacity limitations on arcs... was posed to the authors in the spring of 1955 by T.E. Harris, who, in conjunction with General F. S. Ross had formulated a simplified model of railway traffic flow, and pinpointed this particular problem as the central one suggested by the model. It was not long after this until the main result, Theorem 5.1, which we call the max-flow min-cut theorem, was conjectured and established. A number of proofs have since appeared."
Proof
Let be a network with and being the source and the sink of respectively.Consider the flow computed for by Ford–Fulkerson algorithm. In the residual graph obtained for , define two subsets of vertices as follows:
- : the set of vertices reachable from in
- : the set of remaining vertices i.e.
Now, we know, for any subset of vertices,. Therefore, for we need:
- All outgoing edges from the cut must be fully saturated.
- All incoming edges to the cut must have zero flow.
- In, there exists an outgoing edge such that it is not saturated, i.e.,. This implies, that there exists a forward edge from to in, therefore there exists a path from to in, which is a contradiction. Hence, any outgoing edge is fully saturated.
- In, there exists an incoming edge such that it carries some non-zero flow, i.e.,. This implies, that there exists a backward edge from to in, therefore there exists a path from to in, which is again a contradiction. Hence, any incoming edge must have zero flow.