Data Structures & AlgorithmsHardCodeforces Div 2 C · GATE CS

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

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

Correct answer: C. 5

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

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic