Interactive Graph Theory Learning
Interactive Graph Theory Learning
Guest User
Using app without sign in
Minimum cut calculator
Finds minimum capacity cut separating source from sink
Select an algorithm and generate steps to begin visualization
A minimum cut is the cheapest set of edges whose removal disconnects the sink from the source in a flow network. The max-flow min-cut theorem states its capacity equals the maximum flow, so computing one solves the other.
After running any maximum flow algorithm, the minimum cut is recovered by finding all vertices still reachable from the source in the residual graph; every full edge from that reachable set to the rest is a cut edge. For global minimum cuts without a fixed source and sink, the Stoer-Wagner algorithm contracts vertices in O(V cubed) time and Karger's randomized contraction gives an elegant probabilistic alternative.
Minimum cuts identify network bottlenecks and vulnerabilities, split images into foreground and background in computer vision, partition circuits in VLSI design, and measure community boundaries in social networks. Understanding the duality with max flow is a hallmark of strong algorithm candidates.
The minimum cut is not computed directly. You compute a maximum flow, then read the cut off the residual graph in a single traversal.
MinCut(graph, s, t):
run any max-flow algorithm to saturation
// S = everything still reachable from s
// in the RESIDUAL graph
S = BFS/DFS from s using only edges with
residual capacity > 0
T = all remaining vertices
cut = { (u,v) in original edges :
u in S and v in T }
return cut, sum of original capacities in cutTwo facts make this work. Every edge crossing from S to T must be saturated, otherwise its residual capacity would be positive and its endpoint would have been reachable, putting it in S. And every edge from T back to S must carry zero flow. So the flow across the cut equals the cut capacity exactly, and since no flow can exceed any cut, both must be optimal.
Find the minimum cut on the same network used for maximum flow, by reading the residual graph once the flow is saturated.
Example graph: Directed capacities S to A (10), S to B (10), A to B (2), A to T (4), B to T (9).
The minimum cut is the edge pair A-T and B-T with total capacity 13, matching the maximum flow of 13. Note that S-A and S-B have a combined capacity of 20 and also form a cut, but a more expensive one. The bottleneck is at the sink side, and the residual traversal finds it without any searching over candidate cuts.
Time: same as the max-flow algorithm used · Space: O(V + E)
The cut extraction itself is a single graph traversal at O(V + E), which is negligible. All the cost sits in the maximum-flow computation that precedes it: O(V times E squared) with Edmonds-Karp, or O(V squared times E) with Dinic. This is worth stating plainly because it explains why minimum cut is not treated as a separate problem. There is no known way to find the minimum s-t cut that is asymptotically faster than computing the maximum flow, since by the max-flow min-cut theorem the two are the same computation viewed from opposite sides.
The word "cut" covers several genuinely different problems. Choosing the wrong one is the most common mistake here.
| Alternative | Prefer it when | Cost |
|---|---|---|
| Max flow (Edmonds-Karp / Dinic) | You want the minimum s-t cut for a specific source and sink. This is the standard route. | O(V·E^2) or O(V^2·E) |
| Stoer-Wagner | You want the global minimum cut of an undirected graph, with no designated source or sink. | O(V·E + V^2·log V) |
| Karger's randomised algorithm | Global min cut where a high-probability answer is acceptable and simplicity matters. | O(V^2) per trial |
| Gomory-Hu tree | You need minimum cuts between many different pairs. Encodes all of them in V - 1 max-flow runs. | V - 1 max-flow computations |
Read the full article: Network Flow: Max-Flow and Min-Cut
Related algorithms: Maximum Flow, Bridge Finding