Data Structures & AlgorithmsHardICPC regional · GATE CS

Connected simple undirected graph on vertices 0 to 7 with edges: 1–4, 0–3, 3–7, 4–6, 6–7, 2–7, 0–5, 1–6. How many bridges does it have (edges whose removal disconnects the graph)?

  1. A. 5
  2. B. 4
  3. C. 1
  4. D. 2

Correct answer: A. 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 (2) answer different questions.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic