AlgoScope

Dinic

AlgorithmexpertNetwork Flow

Build a level graph with BFS, then push blocking flows with DFS; O(V^2 E).

Decision · step 2 of 13Maximum Flow: Dinic: level graphs and blocking flows
0/160/130/120/40/140/90/200/70/4001121324253

Phase 1: BFS levels 0 at 0, 1 at 1, 2 at 1, 3 at 2, 4 at 2, 5 at 3; 5 is at level 3, so every shortest augmenting path has 3 edges. The highlighted edges are the level graph: residual edges from a level to the next. Everything else is ignored until the phase ends.

Open in the player →or start at step 2

What you will see

Levels drawn as columns; several augmenting paths per phase.

How maximum flow works →

Cost

BestO(E)
AverageO(V^2 * E)
WorstO(V^2 * E)
SpaceO(V + E)

O(E sqrt(V)) on unit-capacity networks.

How you work with it here

play it through, step one change at a time, scrub to any step, run it on your own input.

Screen readers: Edges announce capacity, flow and residual; each step announces the augmenting path and bottleneck.

Reduced motion: Flow labels update with a crossfade; the augmenting path is emphasized statically.

Before this

Taught by the same lesson

Maximum Flow covers these too, in the same run.