GateAI
Minimum Spanning Trees

GATE CSE 2021 Set 1 · Q17

NAT1 markMedium

Time

Consider the following undirected graph with edge weights as shown: The number of minimum-weight spanning trees of the graph is _________.

GATE CSE 2021 Set 1 Q17 diagram

Your answerNumerical answer

Enter a value to check

Solution

Step-by-step verified solution

Official answer: 3

Minimum Spanning Trees

The graph contains 99 vertices arranged in a 3×33 \times 3 grid. A spanning tree must contain 9−1=89 - 1 = 8 edges.

  1. Edges of weight 0.10.1:

    • There are 77 edges with weight 0.10.1.

    • These 77 edges do not contain any cycle and connect the 99 vertices into 22 disjoint connected components:

      • Component 1: {1,2,3}\{1, 2, 3\} (the top row)

      • Component 2: {4,5,6,7,8,9}\{4, 5, 6, 7, 8, 9\} (the middle and bottom rows)

    • By Kruskal's algorithm, all 77 edges of weight 0.10.1 must be included in any minimum spanning tree.

  2. Edges of weight 0.90.9:

    • To connect the two components into a single spanning tree, exactly 11 edge of weight 0.90.9 that crosses between Component 1 and Component 2 must be chosen.

    • The available crossing edges between the top row and middle row are the three vertical edges: (1,4)(1, 4), (2,5)(2, 5), and (3,6)(3, 6).

    • Any other edge of weight 0.90.9 connects vertices within Component 2 and would create a cycle.

  3. Therefore, there are 3 possible choices to complete the MST, resulting in 33 distinct minimum-weight spanning trees of total weight:

7×0.1+1×0.9=1.67 \times 0.1 + 1 \times 0.9 = 1.6

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 Q17 of the GATE CSE 2021 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. This is the only 1-mark NAT question among them, and it is the only one in GATE CSE 2021 Set 1.

How GATE tests Minimum Spanning Trees

More from GATE CSE 2021 Set 1

Share this solution

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

GateAI solution cardGATE CSE 2021 Set 1 · Q17 · NAT

Consider the following undirected graph with edge weights as shown: The number of minimum-weight spanning trees of the graph 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.