![]() |
VOOZH | about |
In a flow network, an s-t cut is a cut that requires the source 's' and the sink 't' to be in different subsets, and it consists of edges going from the source's side to the sink's side. The capacity of an s-t cut is defined by the sum of the capacity of each edge in the cut-set. (Source: Wiki) The problem discussed here is to find the minimum capacity s-t cut of the given network. The expected output is all edges of the minimum cut. For example, in the following flow network, example s-t cuts are {{0,1}, {0, 2}}, {{0, 2}, {1, 2}, {1, 3}}, etc. The minimum s-t cut is {{1, 3}, {4, 3}, {4 5}} which has capacity as 12+7+4 = 23.
We strongly recommend reading the below post first. Ford-Fulkerson Algorithm for Maximum Flow Problem
Minimum Cut and Maximum Flow:
Like Maximum Bipartite Matching, this is another problem that can be solved using Ford-Fulkerson Algorithm. This is based on the max-flow min-cut theorem.
The max-flow min-cut theorem states that in a flow network, the amount of maximum flow is equal to the capacity of the minimum cut.
From Ford-Fulkerson, we get a capacity of minimum cut. How to print all edges that form the minimum cut? The idea is to use a residual graph.
Following are steps to print all edges of the minimum cut.
Following is the implementation of the above approach.
1 - 3 4 - 3 4 - 5
Time Complexity: O(V.(E)2)
Space Complexity: O(V2)