Data Structures & AlgorithmsVery hardGATE CS · ICPC regional
A flow network has source S and sink T, with directed arcs and capacities in brackets: S→B (7), S→T (6), A→B (5), A→T (3), E→B (2), B→C (3), C→A (9), C→E (3). What is the maximum flow from S to T?
- A. 13
- B. 6
- C. 9
- D. 2
Correct answer: C. 9
Edmonds–Karp (augmenting paths with residual capacities) gives maximum flow 9, which equals the minimum cut capacity. Sending along a single best path only carries 6; the total out of S is 13; and minimising the number of cut arcs (ignoring capacity) gives 2.
Practise more Trees, Graphs, Recursion and Dynamic Programming questionsTrees, Graphs, Recursion and Dynamic Programming: notes and key points
More Trees, Graphs, Recursion and Dynamic Programming questions
- Starting from the integer 3, one operation either adds 1, subtracts 1, or doubles the current value. Values may be any non-negative…
- A pile holds p stones. In one move a player removes exactly s stones, where s is one of {4, 5, 6} and s ≤ the pile size. The player who…
- A pile holds p stones. In one move a player removes exactly s stones, where s is one of {2, 3, 5} and s ≤ the pile size. The player who…
- A directed acyclic graph has the vertices A, E, F, J, S, U and the arcs A→E, A→S, A→F, E→J, E→S, E→F, E→U, J→U, F→U. Two players…
- A pile holds p stones. In one move a player removes exactly s stones, where s is one of {3, 4, 6} and s ≤ the pile size. The player who…
- A tree has the vertices C, F, G, I, N, R, S and the edges R–G, R–S, S–I, I–C, C–F, R–N. A set D dominates the tree if every vertex is in D…