0% found this document useful (0 votes)
10 views16 pages

TSP Using Branchandbound

The document discusses using branch and bound to solve the travelling salesman problem. It describes computing lower bounds and exploring the state space tree to find optimal tours between cities. The nearest neighbour and twice around tree approximation algorithms are also covered, along with their performance ratios.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views16 pages

TSP Using Branchandbound

The document discusses using branch and bound to solve the travelling salesman problem. It describes computing lower bounds and exploring the state space tree to find optimal tours between cities. The nearest neighbour and twice around tree approximation algorithms are also covered, along with their performance ratios.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Travelling Salesman Problem Using Branch and Bound

• TSP can be stated as follows, consider that there are n cities and
travelling salesman has to visit each city exactly once and has to
return to the city from where he has started.
• Finding shortest hamiltonian circuit of a graph.
• Computing lower bounds using the formula.
• LB=∑ (sum of costs of the two least cost edges
vε V adjacent to v) / 2
a b c d e
LB = [(1+ 3) + (3 + 6) + (1+ 2) + (3 + 4) + (2 + 3)]/2
= 28/2=14.(this is the root of the state space tree)
• Compute the distances at level 1 a-b,a-c,a-d,a-e.
• Compute the distances at level 2 a-b-c,a-b-d,
a-b-e.
• Compute the distances at level 3 a-b-c-d,a-b-c-e
and a-b-d-c,a-b-d-e.
• Thus the state space tree can be
LB = [(1+ 3) + (3 + 6) + (1+ 2) + (3 + 4) + (2 + 3)]/2
= 28/2=14.(this is the root of the state space tree)
Node 1:consider distance a-b in computation of the
corresponding vertices along with 1 minimum
distance. Find 2 least cost edges adjacent to V/2.
a=a-b + a-c=3+1=4 (consider a-b here)
b=a-b+b-c=3+6=9 (consider a-b here)
c=a-c+c-e=1+2=3 LB=4+9+3+7+5=28/2=14
d=d-e+c-d=3+4=7
e=c-e+d-e=2+3=5
Node 2:consider distance a-c in computation of the
corresponding vertices along with 1 minimum
distance. Find 2 least cost edges adjacent to V/2.
a=a-b + a-c=3+1=4 (consider a-c here)
b=a-b+b-c=3+6=9
c=a-c+c-e=1+2=3 (consider a-c here)
d=d-e+c-d=3+4=7
e=c-e+d-e=2+3=5
LB=4+9+3+7+5=28/2=14
Node 3:consider distance a-d in computation of the
corresponding vertices along with 1 minimum
distance. Find 2 least cost edges adjacent to V/2.
a=a-c + a-d=1+5=6 (consider a-d here)
b=a-b+b-c=3+6=9
c=a-c+c-e=1+2=3
d=d-e+a-d=3+5=8 (consider a-d here)
e=c-e+d-e=2+3=5
LB=6+9+3+8+5=31/2=15.5=16
Node 4:consider distance a-e in computation of
the corresponding vertices along with 1
minimum distance. Find 2 least cost edges
adjacent to V/2.
a=a-c + a-e=1+8=9 (consider a-e here)
b=a-b+b-c=3+6=9
c=a-c+c-e=1+2=3
d=c-d+d-e=4+3=7
e=c-e+a-e=2+8=10 (consider a-e here)
LB=9+9+3+7+10=38/2=19
Node 5:consider distance a-b-c .including edges
(a-b),(b-c) wherever possible. Find 2 least cost
edges adjacent to V/2.
a=a-b + a-c=3+1=4 (consider a-b here)
b=a-b+b-c=3+6=9
c=a-c+b-c=1+6=7 (consider b-c here)
d=d-c+d-e=4+3=7
e=c-e+d-e=2+3=5
LB=4+9+7+7+5=32/2=16
Same as node 6 (a-b-d),node 7 (a-b-e)
Node 8:consider distance a-b-c-d (e,a).including
edges (a-b),(b-c) ,(c-d) (e,a)wherever possible. Find
2 least cost edges adjacent to V/2.
a=a-b + a-e=3+8=11 (consider a-b & e,ahere)
b=a-b+b-c=3+6=9 (consider a-b,b-c here)
c=b-c+c-d=6+4=10 (consider b-c,c-d here)
d=c-d+d-e=4+3=7 (consider c-d here)
e=a-e+d-e=8+3=11(consider a-e here)
LB=11+9+10+7+11=48/2=24
• Same as node 9 a-b-c-e(d,a)
• Same as node 10 a-b-d-c (e,a)
Node 11:consider distance a-b-d-e (c,a).including edges
(a-b),(b-d) ,(d-e) (c,a)wherever possible. Find 2 least
cost edges adjacent to V/2.
a=a-b + a-c=3+1=4 (consider a-b & e,ahere)
b=a-b+b-d=3+7=10 (consider a-b,b-c here)
c=a-c+c-e=1+2=3 (consider b-c,c-d here)
d=b-d+d-e=7+3=10 (consider c-d here)
e=c-e+d-e=2+3=5(consider a-e here)
LB=4+10+3+10+5=32/2=16
• At node 11 we get optimum tour .
• Hence the optimal tour of TSP is a-b-d-e-c-a with
cost 16.
Approximation Algorithm for NP-Hard Problems
• If an NP hard pblm can be solved in polynomial time then all
NP-complete pblms can also be solved in polynomial time.
• All NP-complete pblms are NP-hard but all NP-hard pblms cannot be
NP-complete.
• A pblm is NP-complete if it belongs to NP-class and also every pblm
in NP can also be solved in polynomial time.
• The Np class pblms are the decision pblms that can be solved by
non-deterministic polynomial algorithms.
• non-deterministic-no particular rule is defined.
• Approximation Algorithm for TSP

Decision version of this algm belongs to NP complete pblm.


Optimization version of this algm belongs to NP-hard pblms.

2 Approximation algms are used for TSP.A NP-hard class of pblms


and those are
• Approximation algms for TSP.
• Nearest Neighbour algm.
• Twice around the tree algm.

Nearest Neighbour algm


• Idea-choose nearest neighbour while traversing from one city to another.
Q1.using nearest neighbour algm,obtain the optimal solution for given travelling
salesman pblm and also find the accuracy ratio for the same.
Accuracy ratio r(Sa) = f(Sa)/f(S*)
Where,
• Sa approximate solution
• f(Sa) value of objective function for soln given by approximation algm.
• f(S*) value of objective function
• Generally r(Sa) >=1.
• When r(Sa) reaches close to 1 then it is a better approximate solution.
Nearest Neighbour algm
• We will apply Nearest Neighbour algm for the tour for given TSP. The
output is a-b-c-d-a.., Sa =2+3+2+7=14.
• Now the optimal solution is a-b-d-c -a S*=2+4+2+4=12.
• Accuracy ratio r(Sa) = f(Sa)/f(S*)=14/12=1.16
• Hence the tour Sa is 16% longer than optimal tour S*.
• Drawback: long path.
• Important role is the distance d-a=7
• r(Sa) = f(Sa)/f(S*)
= 7+w/12 (i.e w is the edge d-a)
• As ‘w’ increases, r(Sa) increases.For longer value of w, r(Sa) tends to
infinity.Hence our AA will fail to obtain the optimal soln.
Twice around the tree algorithm-Algm:
• Compute MST from the graph.
• Start at any arbitrary city and walk around the tree and record nodes
visited.
• Eliminate duplicates from the generated node list
Christofides Algorithm

• There is an approximation algorithm with a better


performance ratio for the Euclidean traveling salesman
problem. The tour yields a − b − c − e − d − a of length 37.

You might also like