The Travelling Salesman Problem
The Travelling Salesman Problem
A travelling salesman, starting in his own town, has to visit each of towns where
he should go to precisely or at least once and return his home by the shortest route.
This is known as the travelling salesman problem.
x x
1 1 1 1
y z y z
3 2(y, x, z)
Let (G, w) be a connected undirected weighted graph. If for any two distinct
vertices x and y of G, the weighted distance w(x,y), the minimum-weight of any
xy-path in (G, w), satisfies
then we will say that the triangle inequality is satisfied in (G, w).
For example, see Figure 5.15, (K3 , w′ ) in (b) is constructed from (G, w) in (a)
by the above way.
x x
1 1 1 1
y z y z
3 2(y, x, z)
204 Matchings and Independent Sets
Basic Theory-Relationships
Lemma 5.12 (i) For any Hamilton cycle C in (Kv , w′ ), there exists a
salesman route R in (G, w) with w(R) = w′ (C).
(ii) For any optimal route R in (G, w), there exists a Hamilton cycle C
Proof: Suppose that R is an optimal route in (G, w). By Lemma 5.12(ii), there
exists a Hamilton cycle C in (Kv , w′ ) with w′ (C) = w(R). If C is not optimal, let
C ∗ be an optimal cycle in (Kv , w′ ), then w′ (C ∗ ) < w′ (C). Thus, by Lemma 5.12(i),
there exists a salesman route R′ in (G, w) such that w(R′ ) = w′ (C ∗ ). Thus,
optimal, and let R′ be an optimal route in (G, w). Then w(R′ ) < w(R). By Lemma
5.12(ii), there is a Hamilton cycle C ′ in (Kv , w′ ) with w′ (C ′ ) = w(R′ ). Thus,
Transform of Problem
Intractability: NP-completeness
For the travelling salesman problem, as indeed for any other intractable problem,
it is useful to have a polynomial-time algorithm which will produce, within known
bound, an approximation to the required result. Such algorithms are called approx-
imation algorithms. We now describe the best one in these known algorithms for
solving the travelling salesman problem, discovered by Christofides in 1976.
3. Find the set V ′ of vertices of odd degree in T and a minimum weight perfect
matching M in G′ = Kv [V ′ ].
5. Starting at vertex x, we trace C0 and delete the vertex that has visited before
in turn. Then remaining vertices, in the original order in C0 , determine a
Hamilton cycle C in Kv , which is a required approximation optimal cycle.
In the algorithm,
the Dijsktra’s (see Section 2.5) algorithm can be used in Step 1;
the Prim’s algorithm (see Section 2.4) can be used in Step 2.
In Step 3, V ′ is nonempty certainly, and |V ′ | is even by Corollary 1.1. Since
G′ = Kv [V ′ ] is a complete graphs of even order, it must contain a perfect matching
M by Corollary 5.2.1. Edmonds and Johnson (1970) have presented an efficient
algorithm for finding minimum weight perfect in any weighted graph.
In Step 4, every vertex of G∗ is even degree and, hence, G∗ is eulerian by Corollary
1.7.2. Using the Edmonds and Johnson’s algorithm can find an Euler circuit C0 in
G∗ .
All of the above-mentioned algorithms are efficient, thus, Christofides’
approximation algorithm is efficient.
5.5. THE TRAVELLING SALESMAN PROBLEM 207
Example 5.5.1 Consider the weighted graph (G, w) in Figure 5.16 (a), within
which the triangle inequality is satisfied. (b) shows its weighted distance ma-
trix W′ ; (c) shows (K6 , w′ ) and a minimum tree T . V ′ = {x2 , x3 , x4 , x6 } is
the set of vertices of odd degree in T , M = {x2 x3 , x4 x6 } is a minimum weight
x5
4
x6 3 x4 0 1
BB CC
0 2 2 4 1 1
2 2 0 1 4 2 3
1
=B
B 2 1 0 4 3 3 CC
1 3 W′
B 4 3 4 0 4 3 CA
1 2 3 4 0 2
2 1 3 3 3 2 0
x1 x3
2 1
x2
(a) (G, w) and an optimal cycle C (b) the weighted distance matrix of (G, w)
x5 x5
2 4
3 3
x6 3 x4 x6 x4
2
1 1
2
1 4 3 4 1 3
3
x1 2 x3 x1 x3
3 1
2 1
1
x2 x2
Remarks
Exercise 5.5.4: Solve the travelling salesman problem in the following traffic system
(the minimum weight is 8117)(cited from Mathematics Today, 1978).
467
485 699 415
161
246
445
252
348
348 436
101
489
459
168
504
548 195
523 610 636
426
574
386
294
535
540
355
702 653
338
593
522
399
731
137
445 374
769 985 477
(Exercise 5.5.5)
Thank You !