GateAI
Minimum Spanning Trees

GATE CSE 2016 Set 1 · Q39

NAT2 marksMedium

Time

Let GG 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 GG can have is _______.

Your answerNumerical answer

Enter a value to check

Solution

Step-by-step verified solution

Official answer: 7

Minimum Spanning Trees

A complete graph on 4 vertices (K4K_4) has (42)=6\binom{4}{2} = 6 edges. A spanning tree on 4 vertices must contain exactly 4−1=34 - 1 = 3 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:

  1. By Kruskal's algorithm, the two edges with smallest weights, 11 and 22, 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.

  2. To avoid including the edge with weight 33, the edge of weight 33 must form a cycle with the edges of weights 11 and 22. This is possible if the edges with weights 1,2,1, 2, and 33 form a triangle (cycle of length 3) on 3 vertices.

  3. In that case, after selecting edges 11 and 22, edge 33 is discarded because it forms a cycle with 11 and 22.

  4. 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.

  5. Therefore, the MST edges chosen will have weights 1,2,1, 2, and 44.

The total weight of this MST is:

Weight=1+2+4=7\text{Weight} = 1 + 2 + 4 = 7

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 {1,2}\{1, 2\} 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.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

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

Where do you stand for GATE?

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.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Minimum Spanning Trees in GATE CSE

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 Trees

More from GATE CSE 2016 Set 1

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2016 Set 1 · Q39 · NAT

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

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.