Graph Algorithms



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.