← All Tools

Ford-Fulkerson Max Flow Visualizer

Ford-Fulkerson finds the maximum flow from a source s to a sink t by repeatedly discovering augmenting paths in the residual graph, pushing as much flow as the bottleneck edge allows, and reducing residual capacity accordingly. The Edmonds-Karp variant always picks the shortest augmenting path (BFS), giving a clean O(V·E²) bound. When BFS can no longer reach t, the vertices it did reach form the s-side of the min-cut: by the max-flow min-cut theorem, the sum of forward-edge capacities across that cut equals the max flow.

Run stats

Vertices |V|0
Edges |E|0
Augmenting paths found0
BFS total edges scanned0
Current max flow0

Last augmenting path

bottleneck:

Min-cut (S / T partition)

not solved yet

Trace

source   sink   augmenting path   saturated / min-cut edge

Reading the labels

Each edge is labelled flow / capacity. When flow equals capacity the edge turns red and adds nothing to the forward residual — but the algorithm can still push a reverse flow along it in the residual graph, effectively "cancelling" flow it committed earlier. That's why Ford-Fulkerson always finds the true optimum, not a greedy local one: back-edges give it the freedom to reroute. When BFS from s finally cannot reach t, the vertices it visited form the S-side of a min-cut, and the max-flow value equals the total capacity of edges crossing S → T. This is the max-flow min-cut theorem in one screen.

Where max-flow shows up in real code

Bipartite matching (interviewer ↔ candidate scheduling), image-segmentation cost cuts, edge-connectivity in a network, project-selection with prerequisites, baseball-elimination proofs, traffic-plan capacity checks, ETL pipeline throughput limits — all reduce to a graph, a source, a sink, and this one loop. When capacities are unit or small integers, Edmonds-Karp finishes in milliseconds even on graphs with tens of thousands of edges. For denser or higher-capacity graphs, Dinic's algorithm and push-relabel keep the same theorem but tighten the loop.