Data Structures & AlgorithmsHardCodeforces Div 2 C · GATE CS

A connected undirected graph has the vertices B, D, I, N, O, P, Z and the edges I–P, I–B, I–Z, I–N, P–N, P–O, B–D, Z–N. How many bridges does it have (edges whose removal disconnects the graph)?

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

Correct answer: A. 3

Removing each edge in turn and testing connectivity finds 3 bridges. The cyclomatic number m − n + 1 = 2 counts independent cycles, not bridges; there are 3 articulation vertices, and 2 vertices of degree 1.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic