View on GitHub

csc263

Notes for CSC263 - Data Structures and Analysis

Back to index

Metric Travelling Salesman Problem Approximation via MSTs

Travelling Salesman Problem

Given a graph $G = (V, E)$, a Hamiltonian cycle of $G$ is a simple cycle that visits every vertex once (not every graph has a Hamiltonian cycle!)

The Travelling Salesman Problem is the task of finding the minimum weight Hamiltonian cycle in a graph

Metric TSP

A metric (as in math) is a distance function $d : X^2 \to \mathbb R^{\geq 0}$ which satisfies some properties (that agree with our intuitive understanding of distance)

For any points $x, y \in X$

The metric TSP is the TSP problem with the additional assumption that the weight function on the graph $wt : E \to \mathbb R$ is a metric

Approximation Algorithms

Metric TSP 2-Approximation

(“2-approximation” means the algorithm finds $H$ so that $wt(H) \leq 2 \cdot wt(O)$)

Suppose $O$ is a minimum weight Hamiltonian cycle of $G$ (optimal solution)

To find a good solution to metric TSP:

  1. Find an MST $T$ of $G$
    • $O$ is a spanning graph with positive weights, so $wt(T) \leq wt(O)$
  2. let $s \in V$ be some vertex, we can start looking for a cycle by doing a DFS on $T$ starting at $s$, recording when nodes are visited and when they are revisited - this gives a “pseudo-Hamiltonian” cycle $P_T$
    • this cycle contains each edge twice - once when a node is visited and once again when a node is left, going back to its parent - so $wt(P_T) = 2wt(T)$
  3. we can turn $P_T$ into an actual Hamiltonian cycle $H_T$ by skipping vertices that have been visited before
    • with a path $a \to b \to c$, skipping $b$ is good because by the triangle inequality, the new path $a \to c$ has lesser weight
      • this holds because $wt$ is a metric
    • thus $wt(H_T) \leq wt(P_T) = 2wt(T) \leq 2wt(O)$