Data Structures & AlgorithmsHardICPC regional · GATE CS top band

Complete undirected graph on vertices A to F with symmetric edge weights given row by row (row i, column j = weight of edge between vertices i and j, with A = row 0): 0 3 3 13 15 6; 3 0 13 7 2 2; 3 13 0 1 11 7; 13 7 1 0 12 15; 15 2 11 12 0 2; 6 2 7 15 2 0. A tour visits every vertex exactly once and returns to the start. What is the minimum total weight of such a tour?

  1. A. 69
  2. B. 21
  3. C. 37
  4. D. 28

Correct answer: B. 21

Brute force over all 120 orders of the remaining vertices gives a minimum of 21. The greedy nearest-neighbour tour gives 28, and the largest tour weight 69 is a maximisation mistake.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic