Data Structures & AlgorithmsHardCodeforces Div 2 · ICPC regional

Connected undirected graph on vertices A, B, C, D, E, F, G with edges A–E (1), A–G (1), B–F (1), C–D (1), D–F (1), E–F (1), E–G (1) (weights ignored). How many bridges does it have? A bridge is an edge whose removal disconnects the graph.

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

Correct answer: B. 4

Removing each edge in turn and testing connectivity gives 4 bridges. Articulation points or the cyclomatic number are different structural counts that a student may mix up.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic