Data Structures & AlgorithmsModerateGATE CS · ICPC regional
A connected undirected graph has the vertices A, F, I, M, Q, S, X and the edges M–Q, M–S, M–A, M–X, Q–S, S–F, A–I. How many bridges does it have (edges whose removal disconnects the graph)?
- A. 1
- B. 4
- C. 5
- D. 3
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 3 articulation vertices, and 3 vertices of degree 1.
Practise more Trees, Graphs, Recursion and Dynamic Programming questionsTrees, Graphs, Recursion and Dynamic Programming: notes and key points
More Trees, Graphs, Recursion and Dynamic Programming questions
- Bellman–Ford is run from source C on the directed graph whose arcs (weights in brackets) are listed in the order they are relaxed: C→F…
- A flow network has source S and sink T, with directed arcs and capacities in brackets: S→A (5), S→D (9), S→T (7), E→C (2), E→D (2), E→T…
- An undirected graph has the vertices D, L, N, R, X, Z and the edges N–L, Z–X, X–L, Z–D, L–R, Z–L, Z–N. How many simple cycles does it…
- An undirected graph has the vertices A, J, L, Q, W, X, Y and the edges L–J, L–X, L–W, L–A, Q–X, Q–A, J–Y, Y–W. What is the size of a…
- A pile holds p stones. In one move a player removes exactly s stones, where s is one of {1, 2, 4} and s ≤ the pile size. The player who…
- An undirected graph has the vertices F, J, K, M, S, T, V, X and the edges J–V, J–X, J–F, J–M, J–K, V–F, V–S, X–F, X–M, X–K, F–K, S–M. What…