GATE Computer ScienceVery hardGATE CS (PYQ pattern)
The directed graph on vertices A–K has edges A→B, B→A, C→D, D→C, E→F, F→G, G→E, A→H, C→H, E→H, H→I, H→J, I→K, J→K, B→J. What is the minimum number of directed edges that must be added to make it strongly connected?
- A. 3
- B. 2
- C. 4
- D. 5
Correct answer: A. 3
Condensing gives a DAG with 3 source components ({A,B}, {C,D}, {E,F,G}) and 1 sink component ({K}). The minimum number of edges to make a DAG strongly connected is max(#sources, #sinks) = 3 (confirmed by brute force over all edge sets of size 1 and 2).
More Algorithms questions
- An undirected graph has vertices 0–11 and edges 0-1, 1-2, 2-0, 2-3, 3-4, 4-5, 5-3, 5-6, 6-7, 7-8, 8-6, 1-9, 9-10, 10-1, 4-11. Let a be its…
- A flow network has edges s→a 10, s→b 8, a→c 4, a→d 3, b→d 5, b→c 2, a→b 3, c→t 9, d→t 8; its maximum flow value is 14. How many different…
- A network has capacities s→u 100, s→v 50, u→v 1, u→t 50, v→t 100. Ford–Fulkerson may choose ANY augmenting path in the residual graph…
- A bipartite graph has left vertices L0–L8 and right vertices R0–R6, with adjacency L0:{R0}, L1:{R0,R1}, L2:{R0,R1}, L3:{R0,R1}…
- Johnson's algorithm reweights the directed graph with edges A→B 3, A→C 8, B→D −4, C→B 10, D→C −5, D→E 2, E→A 6, C→E 1. The potentials h(v)…
- An activity-on-arc project has events S, A, B, C, D, E, T and activities (duration): S→A 3, S→B 2, A→C 4, B→C 6, A→D 2, C→D 3, C→E 5, D→E…