Rec 12
Rec 12
Recitation 12
Lecturer: Chaoxu Tong Topic: Approximation Algorithms for the Traveling Salesman Problem
1 Approximation Algorithms
There are several approaches for dealing with NP-complete problems1 :
1. Identify special cases that are easy to solve: for example, the INDEPENDENT SET problem
is NP-complete on arbitrary graph, but easy on trees: recursively pick all leaves and delete
its neighbor give the largest possible independent set.
3. Approximation Algorithm: algorithms that runs in polynomial time and always produce a
solution close to the optimal.
Proof: Suppose for contradiction that such an α-approximation algorithm exists. We will use
this algorithm to solve the Hamiltonian Cycle Problem in polynomial time, giving a contradiction.
Given an instance of Hamiltonian Cycle with graph G, construct an instance of TSP with graph
0
G that is a complete graph on the same set of vertex. Set the edge costs as follows: if an edge e
is in G then let ce = 1, otherwise set ce = αn, where n is the number of vertices in G.
Notice that if G has a Hamiltonian cycle, then the optimal tour in G0 has cost n by using only
the edges in G that are in the Hamiltonian Cycle.
Otherwise if G does not have a Hamiltonian cycle, then the optimal tour in G0 must contain
some edge not in G and hence has cost > αn.
1
Based on previous note by Maurice Cheung
12-1
Since the cost of the optimal tour differ by a factor of more than α depending on if G has a
Hamiltonian cycle or not, the α-approximation will always be able to distinguish between the two
cases, hence decide if G has a Hamiltonian Cycle. This give us the desired contradiction. 2
This lead us to consider the special case of Metric TSP. In the metric TSP, edge costs have
to satisfy the triangle inequality, i.e. for any three vertices x, y, z, cxz ≤ cxy + cyz
We note that the metric TSP is still NP-complete. In the proof of the previous claim, set ce = 2
if e ∈
/ G. Then the edge costs satisfy triangle inequality, and using the same argument as in the
proof above we will that any algorithm that solves the metric TSP can solve the Hamiltonian cycle
problem.
Claim 2 The cost of a Minimum Spanning Tree is no greater than the cost of an optimal tour
Proof: Notice that deleting an edge from a given tour gives us a spanning tree, hence the
minimum spanning tree give us a lower bound on OP T , the cost of the optimal tour. 2
This gives us a simple 2-approximation algorithm for metric TSP. We need the following defi-
nition to define the algorithm.
Definition 1 A (multi-) graph is Eulerian if it has a closed walk that uses every edge exactly once.
Fact 1 A connected graph is Eulerian if and only if every vertex has even degree.
2. Duplicate each edge in the minimum spanning tree to obtain a Eulerian graph
4. Convert J to a tour T by going through the vertices in the same order of T , skipping vertices
that were already visited
Proof: As noted above, cost(M ST ) ≤ OP T . Since J contains two copies of each edge in M ST ,
cost(J )= 2 · cost(M ST ). Finally, by triangle inequality, shortcutting previously visited vertices
does not increase the cost. Hence we have cost(T ) ≤ 2 · cost(M ST ) ≤ OP T . 2
12-2
3 Christofides’ Algorithm
Christofides’ Algorithm is a 3/2-approximation algorithm for metric TSP. It is very similar to the
2-approximation algorithm above. The improvement comes from finding a better way to construct
the Eulerian graph. Since a graph is Eulerian if and only if every vertices has even degree, we only
need to be concerned about the vertices that have odd degree in the M ST . Now if we add to the
MST a minimum-cost perfect matching on V 0 , every vertex will have an even degree, and we get
an Eulerian graph. To bound the approximation ratio of this algorithm, it suffices to bound the
cost of the minimum cost perfect matching in terms of OP T .
Claim 4 Let V 0 ⊆ V such that |V 0 | is even, and let M be a minimum cost perfect matching on V 0 .
Then cost(M ) ≤ OP T /2.
Proof: Consider an optimal TSP tour. Let T 0 be the tour on V 0 by shortcutting vertices in
V V . By triangle inequality, cost(T 0 ) ≤ OP T . Now T 0 is the union of two perfect matchings on
0
V 0 , each consisting of alternate edges on T 0 . Since M is a minimum cost perfect matching, we have
2cost(M ) ≤ OP T 2
Christofides’ Algorithm is as follows:
4. Convert J to a tour T by going through the vertices in the same order of T , skipping vertices
that were already visited.
12-3