SlideShare a Scribd company logo
1 of 16
Travelling Salesman Problem
(TSP)
A
E
D
C
B
Different paths to previous example
• A-B-C-D-E-A
• B-A-C-D-E-B
• B-C-A-D-E-B
• B-C-D-A-E-B
• B-D-C-A-E-B
• B-E-D-C-A-B
• C-B-A-D-E-C
• D-C-B-A-E-D
• D-B-C-A-E-D
• …..
There are (n-1)!
Solutions when you
have n nodes.
4
A route returning to the beginning is known as a
Hamiltonian Circuit
A route not returning to the beginning is known as a
Hamiltonian Path
A
C
B
A
C
B
D
Hamiltonian
A
C
B
D
A
C
B
D
Not Hamiltonian
Real-Life Applications
• It’s not likely anyone would want to plan a bike trip to 25 cities
• But the solution of several important “real world” problems is the
same as finding a tour of a large number of cities
– transportation: school bus routes,
service calls, delivering meals, ...
– manufacturing: an industrial robot
that drills holes in printed circuit
boards
– VLSI (microchip) layout
– communication: planning new
telecommunication networks
– connecting together computer
components using minimum
wire length
7
8am-10am
2pm-3pm
3am-5am7am-8am10am-1pm
4pm-7pm
Major Practical Extension of the TSP
Vehicle Routing - Meet customers demands within given
time windows using lorries of limited capacity
Depot
6am-9am
6pm-7pm
Much more difficult than TSP
TSP Formulation
• TSP problem formulation is look like
assignment problem formulation with
additional constraints.
𝑥𝑖𝑗 = 0 𝑂𝑟 1
A
E
D
C
B
Additional constraints for TSP
1. Sub tour of length 0 (e.g. from city A to city A):
2. Sub tour of length 1 (e.g. from city A to city B and then city B to city A):
3. Sub tour of length 2 (e.g. from city A to city C via city B and then city C to
city A without travelling other cities):
4. And so on
5. No city is visited twice before the tour of all cities is completed.
A B
A B
C
A
10
Solution Methods
I. Try every possibility (n-1)! possibilities – grows faster
than exponentially
If it took 1 microsecond to calculate each possibility
takes 10140 centuries to calculate all possibilities when n = 100
II. Optimising Methods obtain guaranteed optimal
solution, but can take a very,
very, long time
III. Heuristic Methods obtain ‘good’ solutions ‘quickly’
by intuitive methods.
No guarantee of optimality
Example-1
City A B C D
A - 46 16 40
B 41 - 50 40
C 82 32 - 60
D 40 40 36 -
Solve using Hungarian algorithm (Assignment problem solving
technique). If it is fulfilling all the TSP criteria then it is the final
solution to the TSP. Otherwise treat next lowest value as
assignable position to break sub-tour.
Example-1 solution
• Solve using
assignment solution:
• Row substation:
City A B C D
A - 46 16 40
B 41 - 50 40
C 82 32 - 60
D 40 40 36 -
City A B C D
A - 30 0 24
B 1 - 10 0
C 50 0 - 28
D 4 4 0 -
City A B C D
A - 30 0 24
B 0 - 10 0
C 49 0 - 28
D 3 4 0 -
Example-1 solution
• Solve using
assignment solution:
City A B C D
A - 30 0 24
B 0 - 10 0
C 49 0 - 28
D 3 4 0 -
City A B C D
A - 27 0 21
B 0 - 13 0
C 49 0 - 28
D 0 1 0 -
Example-1 solution
Solution:
A-C
B-D
C-B
D-A
i.e.
A-C-B-D-A
City A B C D
A - 46 16 40
B 41 - 50 40
C 82 32 - 60
D 40 40 36 -
Solution using Hungarian algorithm is A to C, B to D, C to B and D to A.
It is fulfilling all the TSP criteria i.e. A to C to B to D to A and the total
cost is 128.
Example-2
City A B C D E
A - 4 7 3 4
B 4 - 6 3 4
C 7 6 - 7 5
D 3 3 7 - 7
E 4 4 5 7 -
Example-2 Solution
Solution: The optimum
assignment cost is 20.
A-D
B-A
C-E
D-B
E-C
i.e. two sub tours: A-D-B-A and
C-E-C
City A B C D E
A - 0 2 0 0
B 0 - 1 0 0
C 2 1 - 3 0
D 0 0 3 - 4
E 0 0 0 4 -
• It is not fulfilling all the TSP criteria because A to D to B to A without passing through C and E.
• The next minimum non-zero element in the cost matrix is 1. So bring 1 into the solution. But the element 1
occurs at two places. Hence consider all cases separately until get an optimal solution.
• Start with making an assignment at (B, C) instead of zero assignment at (B, A). The resulting solution is A to D to
B to C to E to A.
• When an assignment is made at (C, B) instead of zero assignment at (C, E), the resulting solution is A to E to C
to B to D to A.
• Both the case total cost is 21.

More Related Content

What's hot

Travelling salesman problem
Travelling salesman problemTravelling salesman problem
Travelling salesman problemWajahat Hussain
 
The Traveling Salesman Problem
The Traveling Salesman ProblemThe Traveling Salesman Problem
The Traveling Salesman ProblemMaryam Alipour
 
Dijkstra s algorithm
Dijkstra s algorithmDijkstra s algorithm
Dijkstra s algorithmmansab MIRZA
 
Transportation Problem In Linear Programming
Transportation Problem In Linear ProgrammingTransportation Problem In Linear Programming
Transportation Problem In Linear ProgrammingMirza Tanzida
 
Branch and bound technique
Branch and bound techniqueBranch and bound technique
Branch and bound techniqueishmecse13
 
Solving the traveling salesman problem by genetic algorithm
Solving the traveling salesman problem by genetic algorithmSolving the traveling salesman problem by genetic algorithm
Solving the traveling salesman problem by genetic algorithmAlex Bidanets
 
DESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMSDESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMSGayathri Gaayu
 
P, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-HardP, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-HardAnimesh Chaturvedi
 
Traveling salesman problem(tsp)
Traveling salesman problem(tsp)Traveling salesman problem(tsp)
Traveling salesman problem(tsp)Viraj Patil
 
Ant colony optimization
Ant colony optimizationAnt colony optimization
Ant colony optimizationvk1dadhich
 
Travelling salesman problem using genetic algorithms
Travelling salesman problem using genetic algorithms Travelling salesman problem using genetic algorithms
Travelling salesman problem using genetic algorithms Shivank Shah
 
Simulated Annealing
Simulated AnnealingSimulated Annealing
Simulated AnnealingJoy Dutta
 

What's hot (20)

Travelling salesman problem
Travelling salesman problemTravelling salesman problem
Travelling salesman problem
 
Travelling salesman problem
Travelling salesman problemTravelling salesman problem
Travelling salesman problem
 
The Traveling Salesman Problem
The Traveling Salesman ProblemThe Traveling Salesman Problem
The Traveling Salesman Problem
 
Traveling Salesman Problem
Traveling Salesman Problem Traveling Salesman Problem
Traveling Salesman Problem
 
Randomized algorithms ver 1.0
Randomized algorithms ver 1.0Randomized algorithms ver 1.0
Randomized algorithms ver 1.0
 
Dijkstra s algorithm
Dijkstra s algorithmDijkstra s algorithm
Dijkstra s algorithm
 
Transportation Problem In Linear Programming
Transportation Problem In Linear ProgrammingTransportation Problem In Linear Programming
Transportation Problem In Linear Programming
 
Branch and bound
Branch and boundBranch and bound
Branch and bound
 
Branch and bound technique
Branch and bound techniqueBranch and bound technique
Branch and bound technique
 
Solving the traveling salesman problem by genetic algorithm
Solving the traveling salesman problem by genetic algorithmSolving the traveling salesman problem by genetic algorithm
Solving the traveling salesman problem by genetic algorithm
 
DESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMSDESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMS
 
Graph coloring using backtracking
Graph coloring using backtrackingGraph coloring using backtracking
Graph coloring using backtracking
 
Branch and bound
Branch and boundBranch and bound
Branch and bound
 
P, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-HardP, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-Hard
 
Network flows
Network flowsNetwork flows
Network flows
 
Traveling salesman problem(tsp)
Traveling salesman problem(tsp)Traveling salesman problem(tsp)
Traveling salesman problem(tsp)
 
Ant colony optimization
Ant colony optimizationAnt colony optimization
Ant colony optimization
 
And or graph
And or graphAnd or graph
And or graph
 
Travelling salesman problem using genetic algorithms
Travelling salesman problem using genetic algorithms Travelling salesman problem using genetic algorithms
Travelling salesman problem using genetic algorithms
 
Simulated Annealing
Simulated AnnealingSimulated Annealing
Simulated Annealing
 

Similar to Travelling salesman problem

TSP-MIN.-SPANNING-TREE.pptx
TSP-MIN.-SPANNING-TREE.pptxTSP-MIN.-SPANNING-TREE.pptx
TSP-MIN.-SPANNING-TREE.pptxKimmyGalupo
 
Undecidable Problems and Approximation Algorithms
Undecidable Problems and Approximation AlgorithmsUndecidable Problems and Approximation Algorithms
Undecidable Problems and Approximation AlgorithmsMuthu Vinayagam
 
Hungarian Assignment Problem
Hungarian Assignment ProblemHungarian Assignment Problem
Hungarian Assignment ProblemVivekSaurabh7
 
Branch and bound method
Branch and bound methodBranch and bound method
Branch and bound methodVidhyaSenthil
 
OPERATIONAL RESEARCH BUSINESS APPLICATIONS
OPERATIONAL RESEARCH BUSINESS APPLICATIONS OPERATIONAL RESEARCH BUSINESS APPLICATIONS
OPERATIONAL RESEARCH BUSINESS APPLICATIONS Akhilesh Mishra
 
A.Consider the transportation problem where costs are to be minimi.docx
A.Consider the transportation problem where costs are to be minimi.docxA.Consider the transportation problem where costs are to be minimi.docx
A.Consider the transportation problem where costs are to be minimi.docxransayo
 
Branch and bound technique
Branch and bound techniqueBranch and bound technique
Branch and bound techniqueishmecse13
 
unit-4-dynamic programming
unit-4-dynamic programmingunit-4-dynamic programming
unit-4-dynamic programminghodcsencet
 
transportationproblem.pdf
transportationproblem.pdftransportationproblem.pdf
transportationproblem.pdfJohn684538
 
Travelling salesman problem
Travelling salesman problemTravelling salesman problem
Travelling salesman problemMariamS99
 
Backtracking & branch and bound
Backtracking & branch and boundBacktracking & branch and bound
Backtracking & branch and boundVipul Chauhan
 
QABD Transportation problems-UNIT-3.pptx
QABD Transportation problems-UNIT-3.pptxQABD Transportation problems-UNIT-3.pptx
QABD Transportation problems-UNIT-3.pptxhonakjannu789
 
Archivetemp est i - math test
 Archivetemp est i - math test Archivetemp est i - math test
Archivetemp est i - math testEdatBenha
 
352735352 rsh-qam11-tif-09-doc
352735352 rsh-qam11-tif-09-doc352735352 rsh-qam11-tif-09-doc
352735352 rsh-qam11-tif-09-docFiras Husseini
 
352735352 rsh-qam11-tif-09-doc
352735352 rsh-qam11-tif-09-doc352735352 rsh-qam11-tif-09-doc
352735352 rsh-qam11-tif-09-docBookStoreLib
 
Undecidable Problems - COPING WITH THE LIMITATIONS OF ALGORITHM POWER
Undecidable Problems - COPING WITH THE LIMITATIONS OF ALGORITHM POWERUndecidable Problems - COPING WITH THE LIMITATIONS OF ALGORITHM POWER
Undecidable Problems - COPING WITH THE LIMITATIONS OF ALGORITHM POWERmuthukrishnavinayaga
 
Ap for b.tech. (mechanical) Assignment Problem
Ap for b.tech. (mechanical) Assignment Problem Ap for b.tech. (mechanical) Assignment Problem
Ap for b.tech. (mechanical) Assignment Problem Prashant Khandelwal
 

Similar to Travelling salesman problem (20)

TSP-MIN.-SPANNING-TREE.pptx
TSP-MIN.-SPANNING-TREE.pptxTSP-MIN.-SPANNING-TREE.pptx
TSP-MIN.-SPANNING-TREE.pptx
 
Undecidable Problems and Approximation Algorithms
Undecidable Problems and Approximation AlgorithmsUndecidable Problems and Approximation Algorithms
Undecidable Problems and Approximation Algorithms
 
Hungarian Assignment Problem
Hungarian Assignment ProblemHungarian Assignment Problem
Hungarian Assignment Problem
 
Branch and bound method
Branch and bound methodBranch and bound method
Branch and bound method
 
OPERATIONAL RESEARCH BUSINESS APPLICATIONS
OPERATIONAL RESEARCH BUSINESS APPLICATIONS OPERATIONAL RESEARCH BUSINESS APPLICATIONS
OPERATIONAL RESEARCH BUSINESS APPLICATIONS
 
A.Consider the transportation problem where costs are to be minimi.docx
A.Consider the transportation problem where costs are to be minimi.docxA.Consider the transportation problem where costs are to be minimi.docx
A.Consider the transportation problem where costs are to be minimi.docx
 
Branch and bound technique
Branch and bound techniqueBranch and bound technique
Branch and bound technique
 
unit-4-dynamic programming
unit-4-dynamic programmingunit-4-dynamic programming
unit-4-dynamic programming
 
MathsX.pdf
MathsX.pdfMathsX.pdf
MathsX.pdf
 
transportationproblem.pdf
transportationproblem.pdftransportationproblem.pdf
transportationproblem.pdf
 
Travelling salesman problem
Travelling salesman problemTravelling salesman problem
Travelling salesman problem
 
Backtracking & branch and bound
Backtracking & branch and boundBacktracking & branch and bound
Backtracking & branch and bound
 
2.ppt
2.ppt2.ppt
2.ppt
 
HCF & LCM (1).pptx
HCF & LCM (1).pptxHCF & LCM (1).pptx
HCF & LCM (1).pptx
 
QABD Transportation problems-UNIT-3.pptx
QABD Transportation problems-UNIT-3.pptxQABD Transportation problems-UNIT-3.pptx
QABD Transportation problems-UNIT-3.pptx
 
Archivetemp est i - math test
 Archivetemp est i - math test Archivetemp est i - math test
Archivetemp est i - math test
 
352735352 rsh-qam11-tif-09-doc
352735352 rsh-qam11-tif-09-doc352735352 rsh-qam11-tif-09-doc
352735352 rsh-qam11-tif-09-doc
 
352735352 rsh-qam11-tif-09-doc
352735352 rsh-qam11-tif-09-doc352735352 rsh-qam11-tif-09-doc
352735352 rsh-qam11-tif-09-doc
 
Undecidable Problems - COPING WITH THE LIMITATIONS OF ALGORITHM POWER
Undecidable Problems - COPING WITH THE LIMITATIONS OF ALGORITHM POWERUndecidable Problems - COPING WITH THE LIMITATIONS OF ALGORITHM POWER
Undecidable Problems - COPING WITH THE LIMITATIONS OF ALGORITHM POWER
 
Ap for b.tech. (mechanical) Assignment Problem
Ap for b.tech. (mechanical) Assignment Problem Ap for b.tech. (mechanical) Assignment Problem
Ap for b.tech. (mechanical) Assignment Problem
 

Recently uploaded

“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 

Recently uploaded (20)

“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 

Travelling salesman problem

  • 3. Different paths to previous example • A-B-C-D-E-A • B-A-C-D-E-B • B-C-A-D-E-B • B-C-D-A-E-B • B-D-C-A-E-B • B-E-D-C-A-B • C-B-A-D-E-C • D-C-B-A-E-D • D-B-C-A-E-D • ….. There are (n-1)! Solutions when you have n nodes.
  • 4. 4 A route returning to the beginning is known as a Hamiltonian Circuit A route not returning to the beginning is known as a Hamiltonian Path A C B A C B D
  • 6. Real-Life Applications • It’s not likely anyone would want to plan a bike trip to 25 cities • But the solution of several important “real world” problems is the same as finding a tour of a large number of cities – transportation: school bus routes, service calls, delivering meals, ... – manufacturing: an industrial robot that drills holes in printed circuit boards – VLSI (microchip) layout – communication: planning new telecommunication networks – connecting together computer components using minimum wire length
  • 7. 7 8am-10am 2pm-3pm 3am-5am7am-8am10am-1pm 4pm-7pm Major Practical Extension of the TSP Vehicle Routing - Meet customers demands within given time windows using lorries of limited capacity Depot 6am-9am 6pm-7pm Much more difficult than TSP
  • 8. TSP Formulation • TSP problem formulation is look like assignment problem formulation with additional constraints. 𝑥𝑖𝑗 = 0 𝑂𝑟 1 A E D C B
  • 9. Additional constraints for TSP 1. Sub tour of length 0 (e.g. from city A to city A): 2. Sub tour of length 1 (e.g. from city A to city B and then city B to city A): 3. Sub tour of length 2 (e.g. from city A to city C via city B and then city C to city A without travelling other cities): 4. And so on 5. No city is visited twice before the tour of all cities is completed. A B A B C A
  • 10. 10 Solution Methods I. Try every possibility (n-1)! possibilities – grows faster than exponentially If it took 1 microsecond to calculate each possibility takes 10140 centuries to calculate all possibilities when n = 100 II. Optimising Methods obtain guaranteed optimal solution, but can take a very, very, long time III. Heuristic Methods obtain ‘good’ solutions ‘quickly’ by intuitive methods. No guarantee of optimality
  • 11. Example-1 City A B C D A - 46 16 40 B 41 - 50 40 C 82 32 - 60 D 40 40 36 - Solve using Hungarian algorithm (Assignment problem solving technique). If it is fulfilling all the TSP criteria then it is the final solution to the TSP. Otherwise treat next lowest value as assignable position to break sub-tour.
  • 12. Example-1 solution • Solve using assignment solution: • Row substation: City A B C D A - 46 16 40 B 41 - 50 40 C 82 32 - 60 D 40 40 36 - City A B C D A - 30 0 24 B 1 - 10 0 C 50 0 - 28 D 4 4 0 - City A B C D A - 30 0 24 B 0 - 10 0 C 49 0 - 28 D 3 4 0 -
  • 13. Example-1 solution • Solve using assignment solution: City A B C D A - 30 0 24 B 0 - 10 0 C 49 0 - 28 D 3 4 0 - City A B C D A - 27 0 21 B 0 - 13 0 C 49 0 - 28 D 0 1 0 -
  • 14. Example-1 solution Solution: A-C B-D C-B D-A i.e. A-C-B-D-A City A B C D A - 46 16 40 B 41 - 50 40 C 82 32 - 60 D 40 40 36 - Solution using Hungarian algorithm is A to C, B to D, C to B and D to A. It is fulfilling all the TSP criteria i.e. A to C to B to D to A and the total cost is 128.
  • 15. Example-2 City A B C D E A - 4 7 3 4 B 4 - 6 3 4 C 7 6 - 7 5 D 3 3 7 - 7 E 4 4 5 7 -
  • 16. Example-2 Solution Solution: The optimum assignment cost is 20. A-D B-A C-E D-B E-C i.e. two sub tours: A-D-B-A and C-E-C City A B C D E A - 0 2 0 0 B 0 - 1 0 0 C 2 1 - 3 0 D 0 0 3 - 4 E 0 0 0 4 - • It is not fulfilling all the TSP criteria because A to D to B to A without passing through C and E. • The next minimum non-zero element in the cost matrix is 1. So bring 1 into the solution. But the element 1 occurs at two places. Hence consider all cases separately until get an optimal solution. • Start with making an assignment at (B, C) instead of zero assignment at (B, A). The resulting solution is A to D to B to C to E to A. • When an assignment is made at (C, B) instead of zero assignment at (C, E), the resulting solution is A to E to C to B to D to A. • Both the case total cost is 21.