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→E (6), S→A (2), S→C (2), S→T (6), E→T (2), D→A (1), D→C (4), D→T (2), A→C (8), C→D (7). What is the maximum flow from S to T?
- A. 16
- B. 10
- C. 3
- D. 11
Correct answer: B. 10
Edmonds–Karp (augmenting paths with residual capacities) gives maximum flow 10, which equals the minimum cut capacity. Sending along a single best path only carries 6; the total out of S is 16; and minimising the number of cut arcs (ignoring capacity) gives 3.
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
- A directed graph has the vertices D, E, H, I, K, N, O and the arcs N→E, N→D, K→N, K→O, E→O, I→N, I→E, H→K, O→N. How many strongly…
- A tree has the vertices A, C, M, R, V, Y, Z and the edges C–M, M–A, C–R, A–Y, A–V, R–Z. A set D dominates the tree if every vertex is in D…
- A directed graph with no directed cycles has arcs u→v (weight) : F→S (3), F→N (0), F→C (8), G→X (2), G→C (4), S→X (3), N→X (1), N→C (6)…
- A connected undirected graph has the vertices B, E, G, K, Q, R, S, V and the edges Q–K, K–B, K–G, K–S, G–V, G–R, G–E, S–E, R–E. Parallel…
- Grid with 4 rows and 3 columns (top to bottom). A cell marked G is a gate; '.' is a normal cell: .GG G.G .G. ... Each step, which is a…
- A tree has vertices with values in brackets: P[-4], S[4], V[7], U[1], G[-4], D[1]. The edges are P–S, S–V, V–U, S–G, S–D. A path is any…