Why it matters

Dinic's is standard efficient max flow. Good for bipartite matching too.

Advertisement

The architecture

BFS builds layered graph.

DFS finds blocking flow.

Repeat until no augment.

Dinic's max flowBFS layeredgraphDFSblocking flowIterateuntil no augmentDinic 1970; O(V^2 E); best for bipartite matching O(E sqrt V)
Dinic's max flow.
Advertisement

How it works end to end

Dinic 1970.

Layered + blocking flow.

Bipartite O(E sqrt V).