Skip to content
Official PYQ · 2011

GATE CS 2011 Q55 — Minimum Spanning Trees

Explain with AI

An undirected graph G(V,E)G(V,E) contains n (n>2)n \: (n>2) nodes named v1,v2,…,vnv_1,v_2, \dots, v_n. Two nodes vi,vjv_i, v_j  are connected if and only if 0<∣i−j∣≤20 < \mid i-j\mid \leq 2. Each edge (vi,vj)(v_i,v_j) is assigned a weight i+ji+j. A sample graph with n=4n=4 is shown below.

The length of the path from v5v_5 to v6v_6 in the MST of previous question with n=10n=10 is

Choose one option
View worked solution

Answer: C

To find the length of the path from v5v_5 to v6v_6 in the Minimum Spanning Tree (MST) of the graph with n=10n = 10, we first construct the MST using Kruskal's algorithm.

The edges of the graph can be categorized into two types:

  1. Edges of the form (vi,vi+1)(v_i, v_{i+1}) with weight 2i+12i + 1
  2. Edges of the form (vi,vi+2)(v_i, v_{i+2}) with weight 2i+22i + 2

Sorting all edges by weight and applying Kruskal's algorithm (avoiding cycles) yields the following edges in the MST:

  • (v1,v2)(v_1, v_2) with weight 33
  • (v1,v3)(v_1, v_3) with weight 44
  • (v2,v4)(v_2, v_4) with weight 66
  • (v3,v5)(v_3, v_5) with weight 88
  • (v4,v6)(v_4, v_6) with weight 1010
  • (v5,v7)(v_5, v_7) with weight 1212
  • (v6,v8)(v_6, v_8) with weight 1414
  • (v7,v9)(v_7, v_9) with weight 1616
  • (v8,v10)(v_8, v_{10}) with weight 1818

Since the MST is a tree, there is a unique path between any two nodes. The path from v5v_5 to v6v_6 in this MST is:

Path: v5→8v3→4v1→3v2→6v4→10v6\text{Path: } v_5 \xrightarrow{8} v_3 \xrightarrow{4} v_1 \xrightarrow{3} v_2 \xrightarrow{6} v_4 \xrightarrow{10} v_6

Summing the weights of the edges along this path:

Length=8+4+3+6+10=31\text{Length} = 8 + 4 + 3 + 6 + 10 = 31

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

Published
Report a correction
Keep exploringMore Minimum Spanning Trees questions