Data Structures & AlgorithmsModerateGATE CS · Codeforces Div 2 B

A connected undirected graph has the vertices H, K, M, N, R, S, V and the edges V–H, H–S, H–K, H–N, H–M, S–R, N–M. How many bridges does it have (edges whose removal disconnects the graph)?

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

Correct answer: B. 4

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

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic