SlideShare a Scribd company logo
1 of 28
Travelling Salesman Problem
Travelling salesman Problem-Definition
3
1
2
4
5
•Let us look at a situation that
there are 5 cities, Which are
represented as NODES
•There is a Person at NODE-1
•This PERSON HAS TO REACH
EACH NODES ONE AND ONLY
ONCE AND COME BACK TO
ORIGINAL (STARTING)POSITION.
•This process has to occur with
minimum cost or minimum
distance travelled.
•Note that starting point can start
with any Node. For Example:
1-5-2-3-4-1
2-3-4-1-5-2
Travelling salesman Problem-Definition
• If there are ‘n’ nodes there are (n-1)! Feasible
solutions
• From these (n-1)! Feasible solutions we have
to find OPTIMAL SOLUTION.
• This can be related to GRAPH THEORY.
• Graph is a collection of Nodes and
Arcs(Edges).
Travelling salesman Problem-Definition
• Let us say there are
Nodes Connected as
shown
• We can find a Sub graph
as 1-3-2-1.Hence this
GRAPH IS HAMILTONIAN
1
2 3
Travelling salesman Problem-Definition
• But let us consider
this graph
• We can go to
1-3-4-3-2-1
But we are reaching
3 again to make a
cycle. HENCE THIS
GRAPH IS NOT
HAMILTONIAN
1
2 3
4
HAMILTONIAN GRAPHS
• The Given Graph is
Hamiltonian
• If a graph is
Hamiltonian, it may
have more than one
Hamiltonian Circuits.
• For eg:
1-4-2-3-1
1-2-3-4-1 etc.,
4
1
2
3
Hamiltonian Graphs And Travelling
Salesman Problem
• Graphs Which are
Completely Connected i.e.,
if we have Graphs with
every vertex connected to
every other vertex, then
Clearly That graph is
HAMILTONIAN.
• So Travelling Salesman
Problem is nothing but
finding out LEAST COST
HAMILTONIAN CIRCUIT
Travelling salesman Problem Example
1 2 3 4 5
1 - 10 8 9 7
2 10 - 10 5 6
3 8 10 - 8 9
4 9 5 8 - 6
5 7 6 9 6 -
Here Every Node is
connected to every
other Node. But the
cost of reaching the
same node from that
node is Nil. So only a
DASH is put over
there.
Since Every Node is
connected to every
other Node various
Hamiltonian Circuits
are Possible.
Travelling salesman Problem Example
1 2 3 4 5
1 - 10 8 9 7
2 10 - 10 5 6
3 8 10 - 8 9
4 9 5 8 - 6
5 7 6 9 6 -
We can have various
Feasible Solutions.
For Example
1-2-4-5-3-1
2-5-1-4-3-2
Etc…
But From these Feasible
Solutions We want to find
the optimal Solution.
We should not have
SUBTOURS.
It should comprise of
TOURS.
Travelling salesman Problem Example-
Formulations
• Xij = 1,if person moves IMMEDIATELY from I to j.
• Objective Function is to minimize the total
distance travelled which is given by
∑∑Cij Xij
Where Cij is given by Cost incurred or Distance
Travelled
For j=1 to n, ∑ Xij=1, ɏ i
For i= 1 to n, ∑ Xij=1, ɏj
Xij=0 or 1
Sub Tour Elimination Constraints
• We can have Sub tours of length n-1
• We eliminate sub tour of length 1 By making Cost to travel from j to
j as infinity.
Cjj=∞
• To eliminate Sub tour of Length 2 we have
Xij+Xji<=1
• To eliminate Sub tour of Length 3 we have
Xij+Xjk+Xki<=2
• If there are n nodes Then we have the following constraints
• nc2 for length 2
• nc3 for length 3
• ……
• ncn-1 for length n-1
Travelling salesman Problem Example
Sub tour elimination
1 2 3 4 5
1 - 10 8 9 7
2 10 - 10 5 6
3 8 10 - 8 9
4 9 5 8 - 6
5 7 6 9 6 -
We can eliminate Sub
tours by a formidable
method as
Ui-Uj+nXij<=n-1
For i=1 to n-1
And j=2 to n
TSP - SOLUTIONS
• Branch and Bound Algorithm
• Heuristic Techniques
Travelling salesman Problem Example
Row Minimum
1 2 3 4 5
1 - 10 8 9 7
2 10 - 10 5 6
3 8 10 - 8 9
4 9 5 8 - 6
5 7 6 9 6 -
Total Minimum Distance
=Sum of Row Minima
Here Total
Minimum
Distance =31
Lower Bound=31 that a
person should surely
travel. Our cost of optimal
Solution should be surely
greater than or equal to 31
Travelling salesman Problem Example
Column Minimum
1 2 3 4 5
1 - 10 8 9 7
2 10 - 10 5 6
3 8 10 - 8 9
4 9 5 8 - 6
5 7 6 9 6 -
Total Minimum Distance =Sum of
Column Minima
Here Total Minimum
Distance also =31
Hence the Problem
Matrices is
Symmetric.
TSP USUALLY SATISFIES
1.SQUARE
2.SYMMETRIC
3.TRIANGLE INEQUALITY
dij+djk>=dik
Branch and Bound-Step
31
1 2 3 4 5
1 - 10 8 9 7
2 10 - 10 5 6
3 8 10 - 8 9
4 9 5 8 - 6
5 7 6 9 6 -
35
X12
X13
X14
X15
For X12
10+5+8+6+6=35
1 3 4 5
2 - 10 5 6
3 8 - 8 9
4 9 8 - 6
5 7 9 6 -
Branch and Bound-Step
31
1 2 3 4 5
1 - 10 8 9 7
2 10 - 10 5 6
3 8 10 - 8 9
4 9 5 8 - 6
5 7 6 9 6 -
35 32
X12
X13
X14
X15
For X13
8+5+8+5+6=32
1 2 4 5
2 10 - 5 6
3 - 10 8 9
4 9 5 - 6
5 7 6 6 -
Branch and Bound-Step
31
1 2 3 4 5
1 - 10 8 9 7
2 10 - 10 5 6
3 8 10 - 8 9
4 9 5 8 - 6
5 7 6 9 6 -
35 32 34
X12
X13
X14
X15
For X14
9+6+8+5+6=34
1 2 3 5
2 10 - 10 6
3 8 10 - 9
4 - 5 8 6
5 7 6 9 -
Branch and Bound-Step
31
1 2 3 4 5
1 - 10 8 9 7
2 10 - 10 5 6
3 8 10 - 8 9
4 9 5 8 - 6
5 7 6 9 6 -
35 32 34 31
X12
X13
X14
X15
For X15
7+5+8+5+6=31
1 2 3 4
2 10 - 10 5
3 8 10 - 8
4 9 5 8 -
5 - 6 9 6
Branch and Bound-Step
31
1 2 3 4 5
1 - 10 8 9 7
2 10 - 10 5 6
3 8 10 - 8 9
4 9 5 8 - 6
5 7 6 9 6 -
35 32 34 31
X12
X13
X14
X15
X21
X23
X24
2 3 4
3 10 - 8
4 5 8 -
5 - 9 6
For X15
And X21
7+10+8+5+6=36
36
Branch and Bound-Step
31
1 2 3 4 5
1 - 10 8 9 7
2 10 - 10 5 6
3 8 10 - 8 9
4 9 5 8 - 6
5 7 6 9 6 -
35 32 34 31
X12
X13
X14
X15
X21
X23 X24
For X15
And X23
7+10+8+5+6=36
36
1 2 4
3 - 10 8
4 9 5 -
5 7 6 6
36
Branch and Bound-Step
31
1 2 3 4 5
1 - 10 8 9 7
2 10 - 10 5 6
3 8 10 - 8 9
4 9 5 8 - 6
5 7 6 9 6 -
35 32 34 31
X12
X13
X14
X15
X21 X23
X24
For X15
And X24
7+5+8+8+6=34
36
1 2 3
3 8 10 -
4 9 - 8
5 7 6 9
36 34
Branch and Bound-Step
31
1 2 3 4 5
1 - 10 8 9 7
2 10 - 10 5 6
3 8 10 - 8 9
4 9 5 8 - 6
5 7 6 9 6 -
35 32 34 31
X12
X13
X14
X15
X21 X23
X24
36
36 34
X21 X24 X25
37
2 4 5
3 - 8 9
4 5 - 6
5 6 6 -
For X13
And X21
8+10+8+5+6=37
Branch and Bound-Step
31
1 2 3 4 5
1 - 10 8 9 7
2 10 - 10 5 6
3 8 10 - 8 9
4 9 5 8 - 6
5 7 6 9 6 -
35 32 34 31
X12
X13
X14
X15
X21 X23
X24
36
36 34
X21 X24 X25
37
For X13
And X24
8+5+8+6+6=33
1 2 5
3 8 10 9
4 9 - 6
5 7 6 -
33
Branch and Bound-Steps
31
1 2 3 4 5
1 - 10 8 9 7
2 10 - 10 5 6
3 8 10 - 8 9
4 9 5 8 - 6
5 7 6 9 6 -
35 32 34 31
X12
X13
X14
X15
X21 X23
X24
36
36 34
X21 X24 X25
37
For X13
And X25
8+6+8+5+6=33
33
1 2 4
3 8 10 8
4 9 5 -
5 7 - 6
33
Branch and Bound-Steps
31
1 2 3 4 5
1 - 10 8 9 7
2 10 - 10 5 6
3 8 10 - 8 9
4 9 5 8 - 6
5 7 6 9 6 -
35 32 34 31
X12
X13
X14
X15
X21 X23
X24
36
36 34
X21 X24 X25
37 33 33
X32 X35
1-3-2-4-5-1
Distance=8+10+
5+6+7=36
1-3-5-2-4-1
Distance=8+9+6
+5+9=37
Branch and Bound-Steps
31
1 2 3 4 5
1 - 10 8 9 7
2 10 - 10 5 6
3 8 10 - 8 9
4 9 5 8 - 6
5 7 6 9 6 -
35 32 34 31
X12
X13
X14
X15
X21 X23
X24
36
36 34
X21 X24 X25
37 33 33
X32 X35
1-3-2-4-5-1
Distance=8+10+
5+6+7=36
1-3-5-2-4-1
Distance=8+9+6
+5+9=37
X32
X34
1-3-2-5-4-1
Distance=8+10+
6+6+9=39
1-3-4-2-5-1
Distance=8+8+5+6+
7=34
Branch and Bound-Steps
31
1 2 3 4 5
1 - 10 8 9 7
2 10 - 10 5 6
3 8 10 - 8 9
4 9 5 8 - 6
5 7 6 9 6 -
35 32 34 31
X12
X13
X14
X15
X21 X23
X24
36
36 34
X21 X24 X25
37 33 33
X32 X35
1-3-2-4-5-1
Distance=8+10+
5+6+7=36
1-3-5-2-4-1
Distance=8+9+6
+5+9=37
X32
X34
1-3-2-5-4-1
Distance=8+10+
6+6+9=39
1-3-4-2-5-1
Distance=8+8+5+6+7=34
This is the Optimal Solution.
This is same as
1-5-2-4-3-1

More Related Content

What's hot (20)

Travelling SalesMan Problem(TSP)
Travelling SalesMan Problem(TSP)Travelling SalesMan Problem(TSP)
Travelling SalesMan Problem(TSP)
 
Minimum spanning tree
Minimum spanning treeMinimum spanning tree
Minimum spanning tree
 
The n Queen Problem
The n Queen ProblemThe n Queen Problem
The n Queen Problem
 
N queen problem
N queen problemN queen problem
N queen problem
 
Shortest path algorithms
Shortest path algorithmsShortest path algorithms
Shortest path algorithms
 
4 greedy methodnew
4 greedy methodnew4 greedy methodnew
4 greedy methodnew
 
Greedy algorithm
Greedy algorithmGreedy algorithm
Greedy algorithm
 
Loop invarient
Loop invarientLoop invarient
Loop invarient
 
daa-unit-3-greedy method
daa-unit-3-greedy methoddaa-unit-3-greedy method
daa-unit-3-greedy method
 
Backtracking
BacktrackingBacktracking
Backtracking
 
Asymptotic Notation and Complexity
Asymptotic Notation and ComplexityAsymptotic Notation and Complexity
Asymptotic Notation and Complexity
 
The Floyd–Warshall algorithm
The Floyd–Warshall algorithmThe Floyd–Warshall algorithm
The Floyd–Warshall algorithm
 
5.1 greedy
5.1 greedy5.1 greedy
5.1 greedy
 
Prim's Algorithm on minimum spanning tree
Prim's Algorithm on minimum spanning treePrim's Algorithm on minimum spanning tree
Prim's Algorithm on minimum spanning tree
 
Tsp branch and bound
Tsp branch and boundTsp branch and bound
Tsp branch and bound
 
Minimum spanning tree
Minimum spanning treeMinimum spanning tree
Minimum spanning tree
 
String matching algorithms
String matching algorithmsString matching algorithms
String matching algorithms
 
Recursion tree method
Recursion tree methodRecursion tree method
Recursion tree method
 
Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)
 
Divide and Conquer
Divide and ConquerDivide and Conquer
Divide and Conquer
 

Similar to Tsp branch and-bound

DATA STRUCTURE AND ALGORITHM LMS MST KRUSKAL'S ALGORITHM
DATA STRUCTURE AND ALGORITHM LMS MST KRUSKAL'S ALGORITHMDATA STRUCTURE AND ALGORITHM LMS MST KRUSKAL'S ALGORITHM
DATA STRUCTURE AND ALGORITHM LMS MST KRUSKAL'S ALGORITHMABIRAMIS87
 
Calculation techniques in numbers
Calculation techniques in numbersCalculation techniques in numbers
Calculation techniques in numberssealih
 
Overview of sparse and low-rank matrix / tensor techniques
Overview of sparse and low-rank matrix / tensor techniques Overview of sparse and low-rank matrix / tensor techniques
Overview of sparse and low-rank matrix / tensor techniques Alexander Litvinenko
 
Cuadernillo de Matemática 6 EGB JICA
Cuadernillo de Matemática 6 EGB JICACuadernillo de Matemática 6 EGB JICA
Cuadernillo de Matemática 6 EGB JICAPalAlbn
 
Vedic mathematicss-R.SANKAR
Vedic mathematicss-R.SANKARVedic mathematicss-R.SANKAR
Vedic mathematicss-R.SANKARSankar Rangasamy
 
Vedic mathematicss by SANKAR
Vedic mathematicss by SANKARVedic mathematicss by SANKAR
Vedic mathematicss by SANKARSankar Rangasamy
 
Transportation and transshipment problems
Transportation  and transshipment problemsTransportation  and transshipment problems
Transportation and transshipment problemsDr. Adinath Damale
 
Solve Sudoku using Constraint Propagation- Search and Genetic Algorithm
Solve Sudoku using  Constraint Propagation- Search and Genetic AlgorithmSolve Sudoku using  Constraint Propagation- Search and Genetic Algorithm
Solve Sudoku using Constraint Propagation- Search and Genetic AlgorithmAi Sha
 
Introducing maths in qbasic
Introducing maths in qbasicIntroducing maths in qbasic
Introducing maths in qbasicNishan Sharma
 

Similar to Tsp branch and-bound (20)

Inequalities
InequalitiesInequalities
Inequalities
 
Tp for b.tech. (mechanical)
Tp for b.tech. (mechanical)Tp for b.tech. (mechanical)
Tp for b.tech. (mechanical)
 
Alg 1 ch. 3.5
Alg 1 ch. 3.5Alg 1 ch. 3.5
Alg 1 ch. 3.5
 
DATA STRUCTURE AND ALGORITHM LMS MST KRUSKAL'S ALGORITHM
DATA STRUCTURE AND ALGORITHM LMS MST KRUSKAL'S ALGORITHMDATA STRUCTURE AND ALGORITHM LMS MST KRUSKAL'S ALGORITHM
DATA STRUCTURE AND ALGORITHM LMS MST KRUSKAL'S ALGORITHM
 
Calculation techniques in numbers
Calculation techniques in numbersCalculation techniques in numbers
Calculation techniques in numbers
 
Maths T6 W1
Maths T6 W1Maths T6 W1
Maths T6 W1
 
Overview of sparse and low-rank matrix / tensor techniques
Overview of sparse and low-rank matrix / tensor techniques Overview of sparse and low-rank matrix / tensor techniques
Overview of sparse and low-rank matrix / tensor techniques
 
Absolute Value
Absolute ValueAbsolute Value
Absolute Value
 
Cuadernillo de Matemática 6 EGB JICA
Cuadernillo de Matemática 6 EGB JICACuadernillo de Matemática 6 EGB JICA
Cuadernillo de Matemática 6 EGB JICA
 
Maths T5 W3
Maths T5 W3Maths T5 W3
Maths T5 W3
 
Vedic mathematicss-R.SANKAR
Vedic mathematicss-R.SANKARVedic mathematicss-R.SANKAR
Vedic mathematicss-R.SANKAR
 
Vedic mathematicss by SANKAR
Vedic mathematicss by SANKARVedic mathematicss by SANKAR
Vedic mathematicss by SANKAR
 
Transportation and transshipment problems
Transportation  and transshipment problemsTransportation  and transshipment problems
Transportation and transshipment problems
 
Solve Sudoku using Constraint Propagation- Search and Genetic Algorithm
Solve Sudoku using  Constraint Propagation- Search and Genetic AlgorithmSolve Sudoku using  Constraint Propagation- Search and Genetic Algorithm
Solve Sudoku using Constraint Propagation- Search and Genetic Algorithm
 
Network analysis
Network analysisNetwork analysis
Network analysis
 
Introducing maths in qbasic
Introducing maths in qbasicIntroducing maths in qbasic
Introducing maths in qbasic
 
surekha1
surekha1surekha1
surekha1
 
Maths T5 W2
Maths T5 W2Maths T5 W2
Maths T5 W2
 
Trig packet1 000
Trig packet1 000Trig packet1 000
Trig packet1 000
 
Trig packet1 000
Trig packet1 000Trig packet1 000
Trig packet1 000
 

Recently uploaded

Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfRagavanV2
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...tanu pandey
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Arindam Chakraborty, Ph.D., P.E. (CA, TX)
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...SUHANI PANDEY
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxJuliansyahHarahap1
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01KreezheaRecto
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptMsecMca
 

Recently uploaded (20)

Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 

Tsp branch and-bound

  • 2. Travelling salesman Problem-Definition 3 1 2 4 5 •Let us look at a situation that there are 5 cities, Which are represented as NODES •There is a Person at NODE-1 •This PERSON HAS TO REACH EACH NODES ONE AND ONLY ONCE AND COME BACK TO ORIGINAL (STARTING)POSITION. •This process has to occur with minimum cost or minimum distance travelled. •Note that starting point can start with any Node. For Example: 1-5-2-3-4-1 2-3-4-1-5-2
  • 3. Travelling salesman Problem-Definition • If there are ‘n’ nodes there are (n-1)! Feasible solutions • From these (n-1)! Feasible solutions we have to find OPTIMAL SOLUTION. • This can be related to GRAPH THEORY. • Graph is a collection of Nodes and Arcs(Edges).
  • 4. Travelling salesman Problem-Definition • Let us say there are Nodes Connected as shown • We can find a Sub graph as 1-3-2-1.Hence this GRAPH IS HAMILTONIAN 1 2 3
  • 5. Travelling salesman Problem-Definition • But let us consider this graph • We can go to 1-3-4-3-2-1 But we are reaching 3 again to make a cycle. HENCE THIS GRAPH IS NOT HAMILTONIAN 1 2 3 4
  • 6. HAMILTONIAN GRAPHS • The Given Graph is Hamiltonian • If a graph is Hamiltonian, it may have more than one Hamiltonian Circuits. • For eg: 1-4-2-3-1 1-2-3-4-1 etc., 4 1 2 3
  • 7. Hamiltonian Graphs And Travelling Salesman Problem • Graphs Which are Completely Connected i.e., if we have Graphs with every vertex connected to every other vertex, then Clearly That graph is HAMILTONIAN. • So Travelling Salesman Problem is nothing but finding out LEAST COST HAMILTONIAN CIRCUIT
  • 8. Travelling salesman Problem Example 1 2 3 4 5 1 - 10 8 9 7 2 10 - 10 5 6 3 8 10 - 8 9 4 9 5 8 - 6 5 7 6 9 6 - Here Every Node is connected to every other Node. But the cost of reaching the same node from that node is Nil. So only a DASH is put over there. Since Every Node is connected to every other Node various Hamiltonian Circuits are Possible.
  • 9. Travelling salesman Problem Example 1 2 3 4 5 1 - 10 8 9 7 2 10 - 10 5 6 3 8 10 - 8 9 4 9 5 8 - 6 5 7 6 9 6 - We can have various Feasible Solutions. For Example 1-2-4-5-3-1 2-5-1-4-3-2 Etc… But From these Feasible Solutions We want to find the optimal Solution. We should not have SUBTOURS. It should comprise of TOURS.
  • 10. Travelling salesman Problem Example- Formulations • Xij = 1,if person moves IMMEDIATELY from I to j. • Objective Function is to minimize the total distance travelled which is given by ∑∑Cij Xij Where Cij is given by Cost incurred or Distance Travelled For j=1 to n, ∑ Xij=1, ɏ i For i= 1 to n, ∑ Xij=1, ɏj Xij=0 or 1
  • 11. Sub Tour Elimination Constraints • We can have Sub tours of length n-1 • We eliminate sub tour of length 1 By making Cost to travel from j to j as infinity. Cjj=∞ • To eliminate Sub tour of Length 2 we have Xij+Xji<=1 • To eliminate Sub tour of Length 3 we have Xij+Xjk+Xki<=2 • If there are n nodes Then we have the following constraints • nc2 for length 2 • nc3 for length 3 • …… • ncn-1 for length n-1
  • 12. Travelling salesman Problem Example Sub tour elimination 1 2 3 4 5 1 - 10 8 9 7 2 10 - 10 5 6 3 8 10 - 8 9 4 9 5 8 - 6 5 7 6 9 6 - We can eliminate Sub tours by a formidable method as Ui-Uj+nXij<=n-1 For i=1 to n-1 And j=2 to n
  • 13. TSP - SOLUTIONS • Branch and Bound Algorithm • Heuristic Techniques
  • 14. Travelling salesman Problem Example Row Minimum 1 2 3 4 5 1 - 10 8 9 7 2 10 - 10 5 6 3 8 10 - 8 9 4 9 5 8 - 6 5 7 6 9 6 - Total Minimum Distance =Sum of Row Minima Here Total Minimum Distance =31 Lower Bound=31 that a person should surely travel. Our cost of optimal Solution should be surely greater than or equal to 31
  • 15. Travelling salesman Problem Example Column Minimum 1 2 3 4 5 1 - 10 8 9 7 2 10 - 10 5 6 3 8 10 - 8 9 4 9 5 8 - 6 5 7 6 9 6 - Total Minimum Distance =Sum of Column Minima Here Total Minimum Distance also =31 Hence the Problem Matrices is Symmetric. TSP USUALLY SATISFIES 1.SQUARE 2.SYMMETRIC 3.TRIANGLE INEQUALITY dij+djk>=dik
  • 16. Branch and Bound-Step 31 1 2 3 4 5 1 - 10 8 9 7 2 10 - 10 5 6 3 8 10 - 8 9 4 9 5 8 - 6 5 7 6 9 6 - 35 X12 X13 X14 X15 For X12 10+5+8+6+6=35 1 3 4 5 2 - 10 5 6 3 8 - 8 9 4 9 8 - 6 5 7 9 6 -
  • 17. Branch and Bound-Step 31 1 2 3 4 5 1 - 10 8 9 7 2 10 - 10 5 6 3 8 10 - 8 9 4 9 5 8 - 6 5 7 6 9 6 - 35 32 X12 X13 X14 X15 For X13 8+5+8+5+6=32 1 2 4 5 2 10 - 5 6 3 - 10 8 9 4 9 5 - 6 5 7 6 6 -
  • 18. Branch and Bound-Step 31 1 2 3 4 5 1 - 10 8 9 7 2 10 - 10 5 6 3 8 10 - 8 9 4 9 5 8 - 6 5 7 6 9 6 - 35 32 34 X12 X13 X14 X15 For X14 9+6+8+5+6=34 1 2 3 5 2 10 - 10 6 3 8 10 - 9 4 - 5 8 6 5 7 6 9 -
  • 19. Branch and Bound-Step 31 1 2 3 4 5 1 - 10 8 9 7 2 10 - 10 5 6 3 8 10 - 8 9 4 9 5 8 - 6 5 7 6 9 6 - 35 32 34 31 X12 X13 X14 X15 For X15 7+5+8+5+6=31 1 2 3 4 2 10 - 10 5 3 8 10 - 8 4 9 5 8 - 5 - 6 9 6
  • 20. Branch and Bound-Step 31 1 2 3 4 5 1 - 10 8 9 7 2 10 - 10 5 6 3 8 10 - 8 9 4 9 5 8 - 6 5 7 6 9 6 - 35 32 34 31 X12 X13 X14 X15 X21 X23 X24 2 3 4 3 10 - 8 4 5 8 - 5 - 9 6 For X15 And X21 7+10+8+5+6=36 36
  • 21. Branch and Bound-Step 31 1 2 3 4 5 1 - 10 8 9 7 2 10 - 10 5 6 3 8 10 - 8 9 4 9 5 8 - 6 5 7 6 9 6 - 35 32 34 31 X12 X13 X14 X15 X21 X23 X24 For X15 And X23 7+10+8+5+6=36 36 1 2 4 3 - 10 8 4 9 5 - 5 7 6 6 36
  • 22. Branch and Bound-Step 31 1 2 3 4 5 1 - 10 8 9 7 2 10 - 10 5 6 3 8 10 - 8 9 4 9 5 8 - 6 5 7 6 9 6 - 35 32 34 31 X12 X13 X14 X15 X21 X23 X24 For X15 And X24 7+5+8+8+6=34 36 1 2 3 3 8 10 - 4 9 - 8 5 7 6 9 36 34
  • 23. Branch and Bound-Step 31 1 2 3 4 5 1 - 10 8 9 7 2 10 - 10 5 6 3 8 10 - 8 9 4 9 5 8 - 6 5 7 6 9 6 - 35 32 34 31 X12 X13 X14 X15 X21 X23 X24 36 36 34 X21 X24 X25 37 2 4 5 3 - 8 9 4 5 - 6 5 6 6 - For X13 And X21 8+10+8+5+6=37
  • 24. Branch and Bound-Step 31 1 2 3 4 5 1 - 10 8 9 7 2 10 - 10 5 6 3 8 10 - 8 9 4 9 5 8 - 6 5 7 6 9 6 - 35 32 34 31 X12 X13 X14 X15 X21 X23 X24 36 36 34 X21 X24 X25 37 For X13 And X24 8+5+8+6+6=33 1 2 5 3 8 10 9 4 9 - 6 5 7 6 - 33
  • 25. Branch and Bound-Steps 31 1 2 3 4 5 1 - 10 8 9 7 2 10 - 10 5 6 3 8 10 - 8 9 4 9 5 8 - 6 5 7 6 9 6 - 35 32 34 31 X12 X13 X14 X15 X21 X23 X24 36 36 34 X21 X24 X25 37 For X13 And X25 8+6+8+5+6=33 33 1 2 4 3 8 10 8 4 9 5 - 5 7 - 6 33
  • 26. Branch and Bound-Steps 31 1 2 3 4 5 1 - 10 8 9 7 2 10 - 10 5 6 3 8 10 - 8 9 4 9 5 8 - 6 5 7 6 9 6 - 35 32 34 31 X12 X13 X14 X15 X21 X23 X24 36 36 34 X21 X24 X25 37 33 33 X32 X35 1-3-2-4-5-1 Distance=8+10+ 5+6+7=36 1-3-5-2-4-1 Distance=8+9+6 +5+9=37
  • 27. Branch and Bound-Steps 31 1 2 3 4 5 1 - 10 8 9 7 2 10 - 10 5 6 3 8 10 - 8 9 4 9 5 8 - 6 5 7 6 9 6 - 35 32 34 31 X12 X13 X14 X15 X21 X23 X24 36 36 34 X21 X24 X25 37 33 33 X32 X35 1-3-2-4-5-1 Distance=8+10+ 5+6+7=36 1-3-5-2-4-1 Distance=8+9+6 +5+9=37 X32 X34 1-3-2-5-4-1 Distance=8+10+ 6+6+9=39 1-3-4-2-5-1 Distance=8+8+5+6+ 7=34
  • 28. Branch and Bound-Steps 31 1 2 3 4 5 1 - 10 8 9 7 2 10 - 10 5 6 3 8 10 - 8 9 4 9 5 8 - 6 5 7 6 9 6 - 35 32 34 31 X12 X13 X14 X15 X21 X23 X24 36 36 34 X21 X24 X25 37 33 33 X32 X35 1-3-2-4-5-1 Distance=8+10+ 5+6+7=36 1-3-5-2-4-1 Distance=8+9+6 +5+9=37 X32 X34 1-3-2-5-4-1 Distance=8+10+ 6+6+9=39 1-3-4-2-5-1 Distance=8+8+5+6+7=34 This is the Optimal Solution. This is same as 1-5-2-4-3-1