How can I find the minimum cut on a graph using a maximum flow algorithm?

I need to find the minimum cut on a graph. I've been reading about flow networks, but all I can find are maximum flow algorithms such as Ford-Fulkerson, push-relabel, etc. Given the max flow-min cut theorem, is it possible to use one of those algorithms to find the minimum cut on a graph using a maximum flow algorithm? How?

The best information I have found so far is that if I find "saturated" edges i.e. edges where flow equals capacity, those edges correspond to the minimum cut. Is that true? It doesn't sound 100% right to me. It is true that all edges on the minimum cut will be saturated, but I believe there might also be saturated edges which are out of the minimum cut "path".


From the source vertex, do a depth-first search along edges in the residual network (i.e., non-saturated edges and back edges of edges that have flow), and mark all vertices that can be reached this way. The cut consists of all edges that go from a marked to an unmarked vertex. Clearly, those edges are saturated and thus were not traversed. As you noted, there might be other saturated edges that are not part of the minimum cut.


I don't want to be picky, but the suggested solution is not quite right as proposed.

Correct solution: What you actually should be doing is bfs/dfs on the Residual-Network Gf (read it up on wikipedia) and marking vertices. And then you can pick those with marked from-vertex and unmarked to-vertex.

Why 'following unsaturated edges' is not enough: Consider, that the flow algorithm saturates the edges as shown in the picture. I marked the vertices I'm visiting with the approach of "just following unsaturated edges" with green. Clearly the only correct min-cut is the edge from E-F, while the suggested solution would also return A-D (and maybe even D-E).

enter image description here Note that the vertex D would be visited by the dfs/bfs if we considered the Residual network instead, because there'd be an edge from E to D, thereby making the edge E-F the only one with a marked from-vertex and an unmarked to-vertex.


So, to give the exact procedure how to obtain the minimum cut:

  1. Run Ford-Fulkerson algorithm to find the max flow and to get the residual graph1.
  2. Run BFS on the residual graph to find the set of vertices that are reachable from source in the residual graph (respecting that you can't use edges with 0 capacity in the residual graph). IMPORTANT: You have to use reverse edges in the residual graph to find the correct set of reachable vertices!!! (See this algorithm)
  3. All edges in the original graph which are from a reachable vertex to non-reachable vertex are minimum cut edges. Print all such edges.

1 Graph in which the capacity of an edge is defined like it's original capacity minus its flow (flow from the maximum flow network).


Note: Falk's algorythm can be used to find both a minimum cut with minimum vertices and with maximum vertices. For the latter the algorythm should be reversed, ie. search from the sink vertex instead of the source. See a related question: Network Flow: Adding a new edge


One way to understand is, let's define a cut as two sets S and T, which will include s and t, respectively.

Now, add all vertices in S that are reachable from s in the residual network and put the remaining edges in T. This will be one cut.

Second, cut can be formed by putting all vertices in T that are reachable from t in the residual network and put the remaining vertices in S.

Take a look at this video to find out how do we find the vertices reachable from s and t.

https://www.youtube.com/watch?v=FIJaXfUIXJA&index=4&list=PLe-ggMe31CTduQ68XQ-sVj32wYJIspTma