TSP
TSP
TSP
Overview
Traveling Salesman Problem (TSP): Given a complete graph with nonnegative edge costs, Find a minimum cost cycle visiting every vertex exactly once.
Application (Example): Given a number of cities and the costs of traveling from any city to any other city, what is the cheapest round-trip route that visits each city exactly once and then returns to the starting city.
The goal of the Travelling Salesman Problem (TSP) is to find the cheapest tour of a select number of cities with the following restrictions: We must visit each city once and only once We must return to the original starting point
Hamiltonian Circuit
Hamiltonian circuit (HC): is a cycle which passes once and exactly once through every vertex of G (G can be digraph). Hamiltonian path: is a path which passes once and exactly once through every vertex of G (G can be digraph).
Find the Hamiltonian cycle in a weighted graph with the minimal length of the longest edge. (bottleneck TSP).
Nearest Neighbor
The nearest neighbor 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.
Go from v to s.
It is depth first priority based search
Vertex Insertion
Insertion Construction Heuristic n In each step, extend partial tour p by inserting a vertex v that leads to minimal increase Types of insertion heuristics .. Nearest Insertion .. Farthest Insertion .. Random Insertion Nearest and cheapest and provably at most twice as long as optimal tour
Vertex Insertion
Input: N*N distance matrix Output: TSP tour Let V1 and V2 vertices are chosen randomly from the set of vertices according to some rules. Initialize cycle c=<V1,V2,V1>. For s=3,4,5,n.
Let Vs be a vertex not on cycle c, chosen by the rule. Insert vertex Vs at an arc (a*,b*) of cycle. c=<V1,V2,..,Vs,V1> such that c=<a*,Vs,b*> is minimum among the cycle c(a,Vs,b) for all arcs (a,b) is c.
Consider all the vertices to complete the Euler Path that is the TSP tour.
Vertex Insertion
The rules are: Random vertex insertion (RVI) : chosen vertex Vs is randomly Nearest Vertex Insertion (NVI) : chosen vertex Vs so that its distance to cycle C is minimum that is, d(Vs,c)= min d(V,c). Furthest Vertex Insertion (FVI) : chosen vertex Vs so that its distance to cycle c is maximum that is, d(Vs,c)= max d(V,c).
11
13
MST T* of GRAPH G
HAMILTONIAN CYCLE
THANK YOU