Skip to content
Official PYQ · 2010

GATE CS 2010 Q50 — Minimum Spanning Trees

Explain with AI

Consider a complete undirected graph with vertex set {0,1,2,3,4}\{0, 1, 2, 3, 4\}. Entry WijW_{ij} in the matrix WW below is the weight of the edge {i,j}\{i, j\}

W=(018141012498120731470249320)W=\begin{pmatrix} 0 & 1 & 8 & 1 & 4 \\ 1 & 0 & 12 & 4 & 9 \\ 8 & 12 & 0 & 7 & 3 \\ 1 & 4 & 7 & 0 & 2 \\ 4 & 9 & 3 & 2 & 0 \end{pmatrix}

What is the minimum possible weight of a spanning tree TT in this graph such that vertex 00 is a leaf node in the tree TT?

Choose one option
View worked solution

Answer: D

Since vertex 00 must be a leaf in the spanning tree TT, its degree in TT is exactly 11. Removing vertex 00 and its single incident edge must leave a spanning tree T′T' on the remaining vertices {1,2,3,4}\{1, 2, 3, 4\}.

To minimize the total weight of TT, we can decompose the problem into two independent steps:

  1. Find the Minimum Spanning Tree (MST) of the subgraph induced by the vertices {1,2,3,4}\{1, 2, 3, 4\}.
  2. Connect vertex 00 to this MST using the edge of minimum weight incident on 00.

Step 1: MST of the subgraph on {1,2,3,4}\{1, 2, 3, 4\}
Using Kruskal's algorithm, we sort the edges of the subgraph by weight:

  • Edge {3,4}\{3, 4\} with weight 22 (Selected)
  • Edge {2,4}\{2, 4\} with weight 33 (Selected)
  • Edge {1,3}\{1, 3\} with weight 44 (Selected)
These three edges connect all vertices {1,2,3,4}\{1, 2, 3, 4\} without cycles.
Weight of T′=2+3+4=9\text{Weight of } T' = 2 + 3 + 4 = 9

Step 2: Connect vertex 00
The weights of the edges incident on vertex 00 are W01=1W_{01} = 1, W02=8W_{02} = 8, W03=1W_{03} = 1, and W04=4W_{04} = 4.
The minimum weight edge incident on 00 has weight min⁡(1,8,1,4)=1\min(1, 8, 1, 4) = 1 (using either {0,1}\{0, 1\} or {0,3}\{0, 3\}).

Thus, the minimum possible weight of the spanning tree TT is: Total Weight=9+1=10\text{Total Weight} = 9 + 1 = 10

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Minimum Spanning Trees questions