GATE Computer ScienceHardGATE CS (PYQ pattern)
A directed graph on A–K has edges A→B, B→C, C→A, C→D, D→E, E→F, F→D, G→F, G→H, H→I, I→G, B→H, E→J, K→J, K→A. Let s be its number of strongly connected components and a the minimum number of edges that must be added to make it strongly connected. What is (s, a)?
- A. (5, 2)
- B. (4, 1)
- C. (6, 2)
- D. (5, 1)
Correct answer: D. (5, 1)
SCCs: {A,B,C}, {D,E,F}, {G,H,I}, {J}, {K}: s = 5. The condensation has edges K→ABC, ABC→DEF, ABC→GHI, GHI→DEF, DEF→J, K→J, so exactly one source (K) and one sink (J). The minimum number of added edges is max(#sources, #sinks) = 1 (add J→K).
More Algorithms questions
- 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…
- 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)…