Maxflow mincut theorem
In optimization theory, the maxflow mincut theorem states that in a flow network, the maximum amount of flow passing from the source to the sink is equal to the minimum capacity that, when removed in a specific way from the network, causes the situation that no flow can pass from the source to the sink.
The maxflow mincut theorem is a special case of the duality theorem for linear programs and can be used to derive Menger's theorem and the KönigEgerváry Theorem.
Contents
Definitions and Statement
Let N = (V, E) be a network (directed graph) with Template:Mvar and Template:Mvar being the source and the sink of Template:Mvar respectively.
Maximum Flow
Definition. The capacity of an edge is a mapping c : E → R^{+}, denoted by Template:Mvar or c(u, v). It represents the maximum amount of flow that can pass through an edge.
Definition. A flow is a mapping f : E → R^{+}, denoted by Template:Mvar or f (u, v), subject to the following two constraints:
 1. Capacity Constraint:
 2. Conservation of Flows:
Definition. The value of flow is defined by
where Template:Mvar is the source of Template:Mvar. It represents the amount of flow passing from the source to the sink.
 Maximum Flow Problem. Maximize  f , that is, to route as much flow as possible from Template:Mvar to Template:Mvar.
Minimum Cut
Definition. An st cut C = (S, T) is a partition of Template:Mvar such that s ∈ S and t ∈ T. The cutset of Template:Mvar is the set
Note that if the edges in the cutset of Template:Mvar are removed,  f  = 0.
Definition. The capacity of an st cut is defined by
 Minimum st Cut Problem. Minimize c(S, T), that is, to determine Template:Mvar and Template:Mvar such that the capacity of the ST cut is minimal.
Statement
 MaxFlow MinCut Theorem. The maximum value of an st flow is equal to the minimum capacity over all st cuts.
Linear program formulation
The maxflow problem and mincut problem can be formulated as two primaldual linear programs.
Maxflow (Primal) 
Mincut (Dual) 

maximize 
minimize 
subject to

subject to

The equality in the maxflow mincut 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 vertex in white and the vertices in grey form the subsets Template:Mvar and Template:Mvar of an st cut, whose cutset contains the dashed edges. Since the capacity of the st cut is 7, which equals to the value of flow, the maxflow mincut theorem tells us that the value of flow and the capacity of the st cut are both optimal in this network.
Application
Generalized maxflow mincut theorem
In addition to edge capacity, consider there is capacity at each vertex, that is, a mapping c : V → R^{+}, denoted by c(v), such that the flow f 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. Define an st 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 maxflow mincut theorem states that the maximum value of an st flow is equal to the minimum capacity of an st cut in the new sense.
Menger's theorem
{{#invoke:see alsoseealso}} In the undirected edgedisjoint paths problem, we are given an undirected graph G = (V, E) and two vertices Template:Mvar and Template:Mvar, and we have to find the maximum number of edgedisjoint st paths in Template:Mvar.
The Menger's theorem states that the maximum number of edgedisjoint st paths in an undirected graph is equal to the minimum number of edges in an st cutset.
Project selection problem
{{#invoke:see alsoseealso}}
In the project selection problem, there are Template:Mvar projects and Template:Mvar equipments. Each project Template:Mvar yields revenue r(p_{i}) and each equipment Template:Mvar costs c(q_{j}) to purchase. Each project requires a number of equipments and each equipment can be shared by several projects. The problem is to determine which projects and equipments should be selected and purchased respectively, so that the profit is maximized.
Let Template:Mvar be the set of projects not selected and Template:Mvar be the set of equipments purchased, then the problem can be formulated as,
Since the first term does not depend on the choice of Template:Mvar and Template:Mvar, this maximization problem can be formulated as a minimization problem instead, that is,
The above minimization problem can then be formulated as a minimumcut problem by constructing a network, where the source is connected to the projects with capacity r(p_{i}), and the sink is connected by the equipments with capacity c(q_{j}). An edge (p_{i}, q_{j}) with infinite capacity is added if project Template:Mvar requires equipment Template:Mvar. The st cutset represents the projects and equipments in Template:Mvar and Template:Mvar respectively. By the maxflow mincut 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 r(p_{i}) 
Equipment c(q_{j}) 


1  100  200 
Project 1 requires equipments 1 and 2. 
2  200  100 
Project 2 requires equipment 2. 
3  150  50 
Project 3 requires equipment 3. 
The minimum capacity of a st 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 p_{2} and p_{3}.
The idea here is to 'flow' the project profits through the 'pipes' of the equipment. If we cannot fill the pipe, the equipment'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 equipment's cost edge.
Image Segmentation problem
{{#invoke:see alsoseealso}}
In the image segmentation problem, there are Template:Mvar pixels. Each pixel Template:Mvar can be assigned a foreground value Template:Mvar or a background value Template:Mvar. There is a penalty of Template:Mvar if pixels Template:Mvar 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 Template:Mvar be the set of pixels assigned to foreground and Template:Mvar 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 minimumcut problem by constructing a network where the source (orange node) is connected to all the pixels with capacity Template:Mvar, and the sink (purple node) is connected by all the pixels with capacity Template:Mvar. Two edges (Template:Mvar) and (Template:Mvar) with Template:Mvar capacity are added between two adjacent pixels. The st cutset then represents the pixels assigned to the foreground in Template:Mvar and pixels assigned to background in Template:Mvar.
History
The maxflow mincut theorem was proven by P. Elias, A. Feinstein, and C.E. Shannon in 1956^{[1]}, and independently also by L.R. Ford, Jr. and D.R. Fulkerson in the same year^{[2]}.
Proof
Let G = (V, E) be a network (directed graph) with Template:Mvar and Template:Mvar being the source and the sink of Template:Mvar respectively.
Consider the flow f computed for Template:Mvar by FordFulkerson algorithm. In the residual graph (G_{f} ) obtained for Template:Mvar (after the final flow assignment by FordFulkerson algorithm), define two subsets of vertices as follows:
 Template:Mvar: the set of vertices reachable from Template:Mvar in Template:Mvar
 Template:Mvar: the set of remaining vertices i.e. Template:Mvar
Claim. value( f ) = c(A, A^{c}), where the capacity of an st cut is defined by
 .
Now, we know, for any subset of vertices, Template:Mvar. Therefore for value( f ) = c(A, A^{c}) we need:
 All outgoing edges from the cut must be fully saturated.
 All incoming edges to the cut must have zero flow.
To prove the above claim we consider two cases:
 In Template:Mvar, there exists an outgoing edge such that it is not saturated, i.e., f (x, y) < c_{xy}. This implies, that there exists a forward edge from Template:Mvar to Template:Mvar in Template:Mvar, therefore there exists a path from Template:Mvar to Template:Mvar in Template:Mvar, which is a contradiction. Hence, any outgoing edge (x, y) is fully saturated.
 In Template:Mvar, there exists an incoming edge such that it carries some nonzero flow, i.e., f (x, y) > 0. This implies, that there exists a backward edge from Template:Mvar to Template:Mvar in Template:Mvar, therefore there exists a path from Template:Mvar to Template:Mvar in Template:Mvar, which is again a contradiction. Hence, any incoming edge (x, y) must have zero flow.
Both of the above statements prove that the capacity of cut obtained in the above described manner is equal to the flow obtained in the network. Also, the flow was obtained by FordFulkerson algorithm, so it is the maxflow of the network as well.
 Also, since any flow in the network is always less than or equal to capacity of every cut possible in a network, the above described cut is also the mincut which obtains the maxflow.
See also
 Linear programming
 Maximum flow
 Minimum cut
 Flow network
 EdmondsKarp algorithm
 FordFulkerson algorithm
References
 {{#invoke:citation/CS1citation
CitationClass=book }}
 {{#invoke:citation/CS1citation
CitationClass=book }}
 {{#invoke:citation/CS1citation
CitationClass=book }}