Data Structures & AlgorithmsVery hardICPC regional · GATE CS
Connected simple undirected graph on vertices 0 to 8 with edges: 2–5, 5–6, 3–5, 3–4, 0–1, 1–4, 5–7, 7–8, 4–6. How many bridges does it have (edges whose removal disconnects the graph)?
- A. 4
- B. 1
- C. 3
- D. 5
Correct answer: D. 5
Removing each edge in turn and recounting components finds 5 bridge(s). The cycle rank m−n+1 = 1 counts independent cycles, not cuts, and the cut vertices (4) and leaves (3) answer different questions.
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
- Directed flow network on vertices 0 to 4 (source 0, sink 4) with capacities (u→v (c)): 4→1 (5), 1→2 (5), 0→1 (10), 0→3 (1), 4→0 (7), 2→3…
- Directed flow network on vertices 0 to 5 (source 0, sink 5) with capacities (u→v (c)): 2→0 (6), 0→3 (3), 0→5 (9), 4→1 (9), 0→1 (6), 2→4…
- Directed flow network on vertices 0 to 5 (source 0, sink 5) with capacities (u→v (c)): 2→3 (8), 5→0 (8), 1→5 (6), 3→2 (10), 5→3 (6), 0→3…
- Directed flow network on vertices 0 to 4 (source 0, sink 4) with capacities (u→v (c)): 2→3 (5), 0→3 (10), 1→4 (5), 1→3 (9), 3→4 (6), 0→4…
- Directed flow network on vertices 0 to 6 (source 0, sink 6) with capacities (u→v (c)): 4→1 (9), 6→0 (8), 1→0 (1), 0→4 (2), 2→0 (6), 0→6…
- Directed flow network on vertices 0 to 5 (source 0, sink 5) with capacities (u→v (c)): 4→3 (1), 3→5 (4), 4→2 (3), 0→3 (7), 4→1 (10), 0→4…