GATE / CS ARCHIVE

GATE CSE 2011 / QUESTION 55

Weighted path within the prescribed minimum spanning tree

Algorithms · Graph Algorithms · Full GATE CSE 2011 paper

GATE 2011, Q55 2 marks · MCQ
Report issue

Graph Algorithms

Question 55, GATE 2011: An undirected graph has vertices v1,...,vn, edges precisely when 0<abs(i-j)≤2, and edge weight i+j. For n=10, what is the weighted length of the path from v5 to v6 in the minimum spanning tree of this graph?

(A) 11
(B) 25
(C) 31
(D) 41
Question 55, GATE 2011: An undirected graph has vertices v1,...,vn, edges precisely when 0<abs(i-j)≤2, and edge weight i+j. For n=10, what is the weighted length of the path from v5 to v6 in the minimum spanning tree of this graph?

(A) 11
(B) 25
(C) 31
(D) 41
Question 55, GATE 2011: An undirected graph has vertices v1,...,vn, edges precisely when 0<abs(i-j)≤2, and edge weight i+j. For n=10, what is the weighted length of the path from v5 to v6 in the minimum spanning tree of this graph?

(A) 11
(B) 25
(C) 31
(D) 41
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Step through it (19 steps)

The MST consists of (v1, v2) and (vi−2, vi) for i=3,..., 10. Its unique path from v5 to v6 is v5→v3→v1→v2→v4→v6. The edge weights are 8, 4, 3, 6 and 10, respectively, so its weighted length is 8+4+3+6+10=31, option C. The direct graph edge (v5, v6) has weight 11 but is not in the MST.

Write the two chains explicitly for n=10: odd vertices 1-3-5-7-9 and even vertices 2-4-6-8-10, joined by 1-2. Any route inside this tree from an odd to an even vertex must pass through that bridge. The requested route therefore goes downward in the odd chain to 1, crosses to 2, and climbs the even chain to 6. 'Length' here is total edge weight, not the number of edges; the path uses five edges but has weight 31.

Original paper, page 15 · Answer key