You are on page 1of 9

Traveling Salesman Problem

Introduction to TSP
Traveling Salesman Problem (TSP): Given a complete graph
with nonnegative edge costs, Find a minimum cost cycle
visiting every vertex exactly once.
The travelling salesman problem (TSP) is an NP-hard
problem
The TSP has several applications even in its purest
formulation, such as planning, logistics, and the
manufacture of microchips. Slightly modified, it appears as
a sub-problem in many areas, such as DNA sequencing.
Introduction to TSP(1)
TSP can be modeled as an undirected weighted graph, such that
cities are the graph's vertices, paths are the graph's edges, and a
path's distance is the edge's length. A TSP tour becomes a
Hamiltonian cycle, and the optimal TSP tour is the shortest
Hamiltonian cycle
Asymmetric and symmetric
In the symmetric TSP, the distance between two cities is the same
in each opposite direction, forming an undirected graph. This
symmetry halves the number of possible solutions.
 In the asymmetric TSP, paths may not exist in both directions or
the distances might be different, forming a directed graph.
Branch and Bound
The branch and bound strategy divides a problem to be solved into a
number of sub problems, similar to the strategy backtracking. To
avoid the complete calculation of all partial trees, one first tries to find
a viable solution and note its value as a upper bound for the optimum.
All following calculations are terminated as soon as their costs exceed
the costs of the upper bound.
If a new cheaper solution was found, its value is used as the new
upper bound.
The animation uses the travelling salesman problem as an example.
The travelling salesman problem comprises of finding the cheapest
round path on a weighted graph where each node is only visited once.
Under the graph and its adjacency matrix, the algorithm is described
verbally and the current step is highlighted.
Traveling Salesman Problem
The problem starts at vertex 1
The initial bound for the minimum tour is the sum of
the minimum outgoing edges from each vertex

Vertex 1           min (10, 8, 9, 7)       =  7


- 10 8 9 7
Vertex 2          min (10, 10, 5,6 )          =  5
Vertex 3           min (8, 10, 8, 9)           =  8
Vertex 4           min (9, 5, 8, 6)           =  5 10 - 10 5 6
Vertex 5           min (7, 6, 9, 6)        =  6
11 10 - 8 9
Bound                                                 = 31
9 5 8 - 6

7 6 9 6 -
Traveling Salesman Problem
Next, the bound for the node for the partial tour from
1 to 2 is calculated using the formula:
Bound = Length from 1 to 2 + sum of min outgoing edges
for vertices 2 to 5 = 10 + (5 + 8 + 6 + 6) = 35
Traveling Salesman Problem
The final results of this
example are in this tree:
The accompanying
number for each node is
the order it was removed
in
Efficiency of Branch and Bound
In many types of problems, branch and bound is faster
than branching, due to the use of a breadth-first
search instead of a depth-first search
The worst case scenario is the same, as it will still visit
every node in the tree
THANK YOU

You might also like