VOOZH about

URL: https://www.geeksforgeeks.org/dsa/minimum-cut-in-a-directed-graph/

⇱ Find minimum s-t cut in a flow network - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Find minimum s-t cut in a flow network

Last Updated : 23 Jul, 2025

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.

  1. Run the Ford-Fulkerson algorithm and consider the final residual graph
  2. Find the set of vertices that are reachable from the source in the residual graph. 
  3. All edges which are from a reachable vertex to a non-reachable vertex are minimum cut edges. Print all such edges. 

Following is the implementation of the above approach. 


Output
1 - 3
4 - 3
4 - 5

Time Complexity: O(V.(E)2)

Space Complexity: O(V2)

Comment
Article Tags:
Article Tags: