Exercise

Analyze the Metric TSP Double-Tree Algorithm

Combine an MST lower bound, Euler traversal, and metric shortcutting for a factor-two tour.

Assignment sources

Noy 2025 high-quality exam preparation and community solutionsCommunity solutionפתרון מטלה 5 - סיבוכיות.pdfAssignment 5High-quality preparation and community solution — not official

Problem

For a complete graph with nonnegative symmetric costs satisfying the triangle inequality, analyze: compute an MST, double every tree edge, take an Euler tour, and shortcut repeated vertices. Prove a Hamiltonian tour of cost at most 2 OPT2\,\mathrm{OPT} and give polynomial runtime.

Prerequisites

Know the unit definitions and how resources are measured against encoded input length. Distinguish a conditional theorem, a reduction, and an algorithm.

Hint 1

Deleting one edge from an optimal tour leaves a spanning tree.

Hint 2

Doubling makes every tree degree even.

Hint 3

Triangle inequality proves that skipping visited vertices cannot increase cost.

Guided construction

Metric TSP double-tree 2-approximation

Step 1 of 6
Metric TSP double-tree 2-approximation on five pointsA complete metric instance on five points becomes a minimum spanning tree, then a doubled multigraph, then an Euler circuit, and finally a shortcut Hamiltonian tour.Complete metric instance8151319871210117ABCDE
Metric edge with its cost
Triangle inequalityCosts: AB 8, AC 15, AD 13, AE 19, BC 8, BD 7, BE 12, CD 10, CE 11, DE 7Holds for all sixty ordered triples of distinct points

Full solution

Let TT be a minimum spanning tree. Remove any edge from an optimal Hamiltonian tour; the remaining edges form a spanning path and therefore a spanning tree. By minimality,

w(T)≤w(OPT).w(T)\le w(\mathrm{OPT}).

After doubling every edge of TT, the resulting connected multigraph has even degree at every vertex, so it has an Euler circuit. Its cost is exactly 2w(T)2w(T).

Traverse that Euler circuit and record each vertex only at its first occurrence, finally returning to the start. This produces a Hamiltonian cycle because every tree vertex appears in the Euler circuit. Whenever the Euler walk contains a segment from uu through already visited vertices to the next new vertex vv, replace the segment by edge (u,v)(u,v). Completeness ensures the shortcut edge exists. Repeated application of the triangle inequality shows its cost is no greater than the skipped path. Therefore

w(output)≤2w(T)≤2w(OPT).w(\text{output})\le2w(T)\le2w(\mathrm{OPT}).

Every stage is polynomial. A dense implementation computes an MST in O(n2)O(n^2) or O(n2log⁡n)O(n^2\log n) time, forms 2(n−1)2(n-1) multiedges, finds an Euler tour in linear time in that multigraph, and shortcuts using a visited array. Cost arithmetic is polynomial in the binary lengths of edge weights. The output visits every vertex once and returns to its start.

The assumptions are all used. Without triangle inequality, one shortcut may be arbitrarily more expensive than the path it replaces. Without completeness, the shortcut edge may not exist. Negative costs undermine standard metric interpretation and lower-bound reasoning, although ordinary metrics are nonnegative. Symmetry is for the undirected version; directed metric TSP requires different methods.

The analysis gives approximation ratio two, often stated as “at most twice optimum.” It does not show equality, and it does not claim the MST itself is a tour. Doubling is what supplies even degrees; shortcutting is what turns the Euler walk, which repeats vertices, into a legal TSP tour.

Checkpoints

Check both logical directions, halting of every relevant branch, and that output length and construction time are polynomial in the encoded input length.

Common mistakes

  • Claiming an MST is itself a Hamiltonian tour.
  • Shortcutting without citing completeness and triangle inequality.
  • Reversing the lower bound w(T)≤OPTw(T)\le\mathrm{OPT}.

Sources and verification

  • Papadimitriou, ch. 13 (metric TSP approximation)
  • Corpus coverage note: No direct merged-summary coverage; pp. 79-80 contain only a related Steiner-tree pattern.
  • Catalog mapping: data/exercises.json; statements and solutions are independently written; personal submissions are non-authoritative.

Provenance and confidence

The exercise is an original synthesis. Confidence reflects verification of the mathematical claim against the textbook sources listed above; course sources are used only where direct coverage is identified.