Question

The diagram below shows a river system consisting of 7 segments, marked P, Q, R, S, T, U, and V. It splits the land into 5 zones, marked Z1, Z2, Z3, Z4, and Z5. We need to connect these zones using the least number of bridges. Out of the following options, which one is correct?

Note: The figure shown is representative.

Diagram of a river system with 7 segments (P, Q, R, S, T, U, V) dividing a rectangular land area into 5 zones (Z1, Z2, Z3, Z4, Z5).
Choose one option
Official answer and solution
Official answer
C
From
Official GATE 2025 answer key

Solution

Model the 5 zones as vertices and the 7 river segments as edges connecting adjacent zones; a spanning tree on 5 vertices requires exactly 4 bridges with no cycles.

Treat the 5 zones Z1,Z2,Z3,Z4,Z5Z_1, Z_2, Z_3, Z_4, Z_5 as vertices of a graph, where each river segment corresponds to a potential bridge (edge) between two zones:

  • PP connects Z1Z_1 and Z2Z_2
  • QQ connects Z1Z_1 and Z3Z_3
  • RR connects Z2Z_2 and Z3Z_3
  • SS connects Z1Z_1 and Z5Z_5
  • TT connects Z3Z_3 and Z5Z_5
  • UU connects Z4Z_4 and Z5Z_5
  • VV connects Z3Z_3 and Z4Z_4

Connecting 55 zones with the minimum number of bridges requires a spanning tree of 5−1=45 - 1 = 4 bridges:

  • (A) has only 3 bridges and leaves Z4Z_4 isolated.
  • (B) has 4 bridges (P,Q,S,TP, Q, S, T), but Q,S,TQ, S, T form a cycle among Z1,Z3,Z5Z_1, Z_3, Z_5 while leaving Z4Z_4 disconnected.
  • (C) places bridges on QQ (Z1Z_1-Z3Z_3), RR (Z2Z_2-Z3Z_3), TT (Z5Z_5-Z3Z_3), and VV (Z4Z_4-Z3Z_3), connecting all 5 zones via Z3Z_3 using the minimum 4 bridges.
  • (D) uses 5 bridges, which is not the minimum.
Final answer

Option (C)

Common trap

Selecting (B) because it has 4 bridges without checking that zone Z4 (bounded only by U and V) is not connected by P, Q, S, or T.

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2025 Computer Science and Information Technology - Session 2 (CS2)
Question
10 of 65
Section
General Aptitude

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.