






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







The Traveling Salesman Problem (TSP) is a challenge to the salesman who wants to visit every location exactly once and return home, as quickly as possible. Each location can be reached from every other location, and for each pair of locations, there is metric that defines the time between them.
Input: An complete undirected weighted graph G = (V, E) with |V | ≥ 3. Weights on edge e = {vi, vj } are written as w(e) = wi,j = wj,i. All weights are positive.
Output: Consider all cycles C′^ where all vertices are visited exactly once. C′^ = vπ(0), vπ(0),... , vπ(n−2), vπ(n−1) i 6 = j : vπ(i) 6 = vπ(j)
The weight of these cycles w(C′) is the sum of the weight of the edges used to walk the cycle.
w(C′) =
n∑− 1
i=
wπ(i),π(i+1) + wπ(n−1),π(0)
The output is the cycle C together with its weight w(C) where C is the cycle of minimum weight, OP T. Note that this cycle is not necessarily unique.
∀C′^ : OP T = w(C) ≤ w(C′)
The output can also be written as a tour T , or sequence of edges:
ei = {vπ(i), vπ((i+1)%n)} T = e 0 , e 1 ,... , en− 2 , en− 1
w(T ) =
n∑− 1
i=
w(ei)
Complexity: This problem is NP-hard.
Figure 1: Example input to the TSP
In general, we can say nothing about the weights of edges in a given TSP graph except that they are positive. Metric TSP is an special case of the TSP that satisfies the triangle inequality. The triangle inequality ensures that a direct path between two vertices is at least as short as any indirect path. This is called the triangle inequality because no 1 side of a triangle can be longer than the sum of the other 2.
Definition 2.0.1 A complete graph satisfies the Triangle Inequality if ∀i, j, k : wi,k ≤ wi,j + wj,k.
The example given in figure 1 satisfies the triangle inequality and therefore this is a case of Metric TSP. On the other hand, there are commonly occurring examples on non-metric TSP. If the weights represent something like the cost of airline tickets, for example, there is no reason to expect the input would satisfy the triangle inequality; it is often the case that taking an indirect route is less expensive than a direct route.
Figure 2: Minimum spanning tree
Now that we have our MST M , we can create a cycle W from it. To do this, we perform preorder tree walk on the MST, and list vertices in the order in which they are visited. Graphically, this means outlining the tree. An example cycle is given in figure 3. Using the first letter of the city names, this cycle is S,M,S,E,S,B,C,B,S,A.
Because each edge is used exactly twice during a depth first search on a tree (once descending, once ascending), w(W ) = 2 ∗ w(M ) < 2 ∗ OP T. However, we cannot call this our solution, because we are visiting vertices multiple times.
Figure 3: Cycle from MST shown in dashed blue
In order to create a plausible solution for the TSP, we must visit vertices exactly once. Since we used an MST, we know that each vertex is visited at least once, so we need only remove duplicates in such a way that does not increase the weight.
Using the triangle inequality, we can create our solution cycle C by using vertices only the first time that they are seen. This is possible because the triangle inequality allows us to remove any intermediate vertices in a path and not increase the path weight.
The solution to this approximation algorithm is shown in figure 4. The cycle is S,M,E,B,C,A with weight 64.
with odd degree must be even.
Any connected graph whose vertices are all of even degree has an Eulerian Tour.
Definition 4.2.1 A Eulerian Tour is a cyclic tour that uses every edge exactly once.
For the proof, see any intermediate algorithms text such as the class text. The proof relies on the intuition that with all vertices having even degrees, when entering a vertex, it is always possible to exit it, unless it is the origin. If any edges are unused, repeat the process and merge the two cyclic tours.
Given a complete weighted graph with an even number of vertices, a minimal weight perfect matching can be found in polynomial time.
For the proof see Paths, Trees, and Flowers by Jack Edmonds [3]. The proof goes beyond the scope of this class.
The running time of even bad implementations of Edmonds’ algorithm is certainly bounded by O(n^4 ) times a polylogarithmic factor. As you’ll see, this dominates the running time of the other steps of Chrisofides algorithm, resulting in Christofides algorithm also running in O(n^4 ) times a polyloga- rithmic factor.
Step 1: Create an MST T of the input graph G in the same manner as for approximation algorithm 1.
Figure 5: Minimal matching on vertices with odd degree in the MST
Step 2: Take G restricted to vertices of odd degree in T as the subgraph G∗. This graph has an even number of nodes due to Fact 1 and is complete because we have not removed any existing edges between the vertices that remain.
Step 3: Find a minimum weight matching M ∗^ on G∗. This is possible in polynomial time due to Fact 2. See figure 5
Claim 4.4.1 w(M ∗) ≤. 5 ∗ OP T
Proof:
Figure 7: Solution with weight less than 1. 5 ∗ OP T
There is a special case of Metric TSP called Euclidean TSP. In Euclidean TSP, the weight of edges corresponds to ordinary (Euclidean) distances be- tween their endpoints in the plane. Unfortunately, this problem is also NP- hard.
Vaidya has found an algorithm to find a minimum weight matching in Euclidean TSP that is O(n^2.^5 log^4 (n)) [4]. This causes the overall running time of Christofides algorithm to come down to the same asymptote in the case of Euclidean TSP.
Sanjeev Arora has found a Polynomial Time Approximation Scheme (PTAS) for Euclidean TSP [1].
[1] Arora, Sanjeev. 1998 Polynomial time approximation schemes for Eu- clidean travleing salesman and other geometric problems ACM vol 45,
num 5. pg 753-782.
[2] Christofides, N. 1976 Worst-case analysis of a new heuristic for the travel- ing salesman problem Symposium on New Directions and Recent Results in Algorithms and Complexity. J.F. Traub, ed. pg 441.
[3] Edmonds, D. 1965 Paths, Trees, and Flowers Canadian Journal of Math vol 17, pg 449-467.
[4] Vaidya, P.M. 1989 Geometry helps in matching SIAM Journal on Cmoputing vol 18, num 6, pg 1201-1225.