Chapter 10 The Traveling Salesman Problem
Chapter 10 The Traveling Salesman Problem
Chapter 10 The Traveling Salesman Problem
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
C<br />
<strong>10</strong>.2 Methods to solve the traveling salesman problem<br />
<strong>10</strong>.2.1 Using the triangle inequality to solve the traveling salesman problem<br />
Definition:<br />
If for the set of vertices a, b, c ∈ V, it is true that t (a, c) ≤ t(a, b) + t(b, c) where t is the cost<br />
function, we say that t satisfies the triangle inequality.<br />
First, we create a minimum spanning tree the weight of which is a lower bound on the cost of an<br />
optimal traveling salesman tour. Using this minimum spanning tree we will create a tour the cost<br />
of which is at most 2 times the weight of the spanning tree. We present the algorithm that<br />
performs these computations using the MST-Prim algorithm.<br />
Approximation-TSP<br />
Input: A complete graph G (V, E)<br />
Output: A Hamiltonian cycle<br />
1.select a “root” vertex r ∈ V [G].<br />
2.use MST-Prim (G, c, r) to compute a minimum spanning tree from r.<br />
3.assume L to be the sequence of vertices visited in a preorder tree walk of T.<br />
4.return the Hamiltonian cycle H that visits the vertices in the order L.<br />
<strong>The</strong> next set of figures show the working of the proposed algorithm.<br />
B<br />
C<br />
A<br />
E<br />
D<br />
B<br />
(a)<br />
D<br />
D<br />
(b) (c)<br />
Figure <strong>10</strong>.3 A set of cities and the resulting connection after the MST-Prim algorithm has been<br />
applied..<br />
A<br />
C<br />
E<br />
B<br />
A<br />
E