Let G be a complete undirected graph on 4 vertices, having 6 edges with weights being 1, 2, 3, 4, 5, and 6. The maximum possible weight that a minimum weight spanning tree of G can have is …
Topic-wise GATE CS PYQs with verified steps
GATE CSE 2016 Set 1 · Q39
Time
Your answerNumerical answer
Solution
Official answer: 7
Minimum Spanning TreesA complete graph on 4 vertices () has edges. A spanning tree on 4 vertices must contain exactly edges without forming any cycle.
To maximize the weight of the Minimum Spanning Tree (MST), we want Kruskal's algorithm to pick edges with weights as large as possible:
By Kruskal's algorithm, the two edges with smallest weights, and , can never form a cycle because 2 edges cannot form a cycle. Thus, edges with weights 1 and 2 must always be included in the MST.
To avoid including the edge with weight , the edge of weight must form a cycle with the edges of weights and . This is possible if the edges with weights and form a triangle (cycle of length 3) on 3 vertices.
In that case, after selecting edges and , edge is discarded because it forms a cycle with and .
Next, the algorithm considers the edge with weight 4. Since the fourth vertex is not yet connected to the component of the other 3 vertices, an edge of weight 4 can connect the fourth vertex without forming a cycle.
Therefore, the MST edges chosen will have weights and .
The total weight of this MST is:
It is not possible to achieve an MST weight larger than 7 because to avoid picking edge 4, edge 4 would also have to form a cycle with previously chosen edges, but the chosen edges span only 3 vertices, so only one non-tree edge (the edge of weight 3) can form a cycle with them.
Hence, the maximum possible weight of an MST is 7.
Try the question first, then check your work.
Examiner trap
Any spanning tree on 4 vertices needs 3 edges. Edges with weights 1 and 2 must always be chosen. Can edge 3 be avoided by placing it in a cycle with 1 and 2?
This Minimum Spanning Trees previous year question is Q39 of the GATE CSE 2016 Set 1 paper. Find more GATE CSE PYQs on Minimum Spanning Trees in Algorithms, or browse all GATE CSE PYQs.
Free diagnostic
Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Minimum Spanning Trees PYQs now with no account.
An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.
Minimum Spanning Trees has 13 GATE CSE PYQs across 9 papers from 2011 to 2026. 3 of them are 2-mark NAT questions like this one, and GATE CSE 2016 Set 1 has 2.
How GATE tests Minimum Spanning TreesIndependent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.