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→A (5), S→D (9), S→T (7), E→C (2), E→D (2), E→T (1), C→D (2), A→C (9), A→D (7), A→T (5), D→A (6), D→T (2). What is the maximum flow from S to T?

  1. A. 3
  2. B. 7
  3. C. 15
  4. D. 14

Correct answer: D. 14

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

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic