Data Structures & AlgorithmsVery hardCodeforces Div 2 D · ICPC regional

A flow network has source S and sink T, with directed arcs and capacities in brackets: S→E (4), S→T (9), C→D (8), C→T (3), B→E (6), B→T (5), D→C (6), D→E (4), D→T (8), E→C (3), E→B (5). What is the maximum flow from S to T?

  1. A. 9
  2. B. 2
  3. C. 13
  4. D. 14

Correct answer: C. 13

Edmonds–Karp (augmenting paths with residual capacities) gives maximum flow 13, which equals the minimum cut capacity. Sending along a single best path only carries 9; the total out of S is 13; and minimising the number of cut arcs (ignoring capacity) gives 2.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic