Professional Documents
Culture Documents
06 Traveling-Salesman-Problem-Malabago
06 Traveling-Salesman-Problem-Malabago
06 Traveling-Salesman-Problem-Malabago
Malabago
I. Introduction:
1. Symmetric TSP (STSP) - there is only one way between two adjacent
cities, i.e., the distance between cities A and B is equal to the
distance between cities B and A (refer to the figure above)
2. Asymmetric TSP (ATSP)- there is not such symmetry and it is possible to have two different
costs or distances between two cities.
III. Methods of solving TSP
Greedy Algorithm
The main idea behind a greedy algorithm is local optimization. That is, the algorithm
picks what seems to be the best thing to do at the particular time, instead of considering the
global situation.
Hence it is called "greedy" because a greedy person grabs anything good he can at the
particular time without considering the long-range implications of his actions.
In some situations, when the optimal solution is too expensive, a greedy algorithm may
be able to come up with an OK solution.
A Hamiltonian cycle of a graph G is a cycle which visits every vertex of G exactly once. For
example, given the graph:
Interestingly enough, they all have the same cost, 22, so they're all minimal. The travelling
salesman problem is to figure out a Hamiltonian cycle that is minimal.
T=
P=
3. Transform P into a Hamiltonian cycle C by cutting corners to avoid revisiting any vertices:
C=
The shortcut edges must exist because the graph is assumed to be complete, and the triangle
inequality guarantees that cutting corners cannot increase the cost, so c(C) <= c(P) = 2c(T).
Take any minimum Hamiltonian cycle Cmin. Deleting any edge e of Cmin gives a (skew) spanning
tree of G. Since T is a minimum spanning tree,
The nearest neighbour algorithm was one of the first algorithms used to determine a solution
to the travelling salesman problem. In it, the salesman starts at a random city and repeatedly
visits the nearest city until all have been visited. It quickly yields a short tour, but usually not the
optimal one.