Implement Edmonds–Karp: repeatedly find the shortest augmenting path (by number of edges) from source to sink in the residual graph with BFS, and push as much flow as its bottleneck allows.
Unlock this and every premium problem across all tracks — plus hidden-test grading, advanced AI engineering modules and new content every week.
Start 7-day free trial