Data Structures & AlgorithmsVery hardCodeforces Div 2 D · ICPC regional

A connected undirected graph has the vertices D, H, J, K, L, T and the edges J–L, J–D, J–H, D–K, D–T, K–T, T–H. How many bridges does it have (edges whose removal disconnects the graph)?

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

Correct answer: B. 1

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

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic