Question

Consider a graph G=(V,E)G = (V, E), where V={v1,v2,…,v100}V = \{v_1, v_2, \dots, v_{100}\}, E={(vi,vj)∣1≤i<j≤100}E = \{(v_i, v_j) \mid 1 \le i < j \le 100\}, and weight of the edge (vi,vj)(v_i, v_j) is ∣i−j∣|i - j|. The weight of minimum spanning tree of GG is _______.

Official answer and solution
Official answer
99
From
Official GATE 2020 answer key

Solution

Identify the minimum weight edges in the graph and construct an MST path spanning all vertices.

The graph G=(V,E)G = (V, E) has vertices V={v1,v2,…,v100}V = \{v_1, v_2, \dots, v_{100}\} and edge weights w(vi,vj)=∣i−j∣w(v_i, v_j) = |i - j| for all 1≤i<j≤1001 \le i < j \le 100.

Minimum edge weight analysis:

  • Since i≠ji \ne j and indices are integers, the minimum possible weight for any edge in GG is:
    min⁡∣i−j∣=1\min |i - j| = 1
  • Edges of weight 1 are exactly the adjacent-index pairs: (vi,vi+1)(v_i, v_{i+1}) for i=1,2,…,99i = 1, 2, \dots, 99.

Spanning tree construction:

  • Consider the subgraph formed by the 99 edges: Epath={(v1,v2),(v2,v3),…,(v99,v100)}E_{\text{path}} = \{(v_1, v_2), (v_2, v_3), \dots, (v_{99}, v_{100})\}.
  • This forms a simple path spanning all 100 vertices of VV without any cycles.
  • A spanning tree on 100 vertices must contain exactly 100−1=99100 - 1 = 99 edges.
  • Since every edge in EpathE_{\text{path}} has the absolute minimum weight possible in GG (weight 1), no spanning tree can have a smaller total weight.
  • Total weight of the minimum spanning tree:
    Weight=∑i=199w(vi,vi+1)=99×1=99\text{Weight} = \sum_{i=1}^{99} w(v_i, v_{i+1}) = 99 \times 1 = 99
Final answer

99

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2020 Computer Science and Information Technology (CS)
Question
59 of 65, printed as CS Q.49
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.