Data Structures & AlgorithmsVery hardICPC regional · Codeforces Div2 D

Problem: A directed flow network has source s = 0 and sink t = 3 with arcs and capacities: 0→1 (3), 0→2 (2), 1→2 (1), 1→3 (2), 2→3 (3). What is the maximum flow from 0 to 3?

  1. A. 5
  2. B. 6
  3. C. 4
  4. D. 7

Correct answer: A. 5

Edmonds–Karp augments along shortest residual paths until no path to the sink remains; the total pushed is the max flow, which equals the min cut. Greedily saturating the first path found can stop short.

More Coding Interview Problems questions

Exams that ask this topic