SlideShare a Scribd company logo
Travelling Salesman Problem
Travelling Salesman Problem
Travelling Salesman Problem
Problem
Given a list of cities and the distances between each pair of cities,
what is the shortest possible route that visits each city exactly
once and returns to the origin city.
Travelling Salesman Problem
Travelling Salesman Problem
Example
Akshay has following list of cities and want to visit each city once,
return back to home:
Pune(Home)(A)
Bangalore(B)
Chennai(C)
Delhi(D)
Kolkata(E)
ShriNagae(F)
Travelling Salesman Problem
Travelling Salesman Problem
Matrix
A B C D E F
A 0 36 32 54 20 40
B 36 0 22 58 54 67
c 32 22 0 36 42 71
D 54 58 36 0 50 92
E 20 54 42 50 0 45
F 40 67 71 92 45 0
Let say that , These are the distances from the cities and akshay
want to go from Home-city(Pune) to ShriNagar with minimum
cost. In which order/path he do these?
Travelling Salesman Problem
Travelling Salesman Problem
We Solve the problem using Nearest neighbor algorithm:
Algorithm:
1 Select a city as current city.
2 Find out the shortest edge connecting the current city and an
unvisited city.
3 Set the new city as current city.
4 Mark the previous current city as visited.
5 If all the cities are visited, then terminate.
6 Go to step 2.
Travelling Salesman Problem
Travelling Salesman Problem
Explanation : We visit Cities As follows Using Above algorithm,
A → E = 20
E → C = 42
C → B = 22
B → D = 58
D → F = 92
F → A = 40
Total Cost = 20 + 42 + 22 + 58 + 92 + 40 = 274
Travelling Salesman Problem
Travelling Salesman Problem
Pseudo Code :
Home City = Visited = Current city
While(!visitedAll City)
Node = Find Shortest distance(Current node)
Add Node (Node)
Current node = Node
Result = All node + Home City[0][last Visit Node]
return Final result= Result
Travelling Salesman Problem
Travelling Salesman Problem
Summary
1 Complexity of this algorithm is o(n2)
which is much better than brute force algorithm.
2 It is Fast, Easy and Efficient.
Travelling Salesman Problem
Travelling Salesman Problem
Reference
We can solve TSP problem using genetic algorithm.
1 Research Paper on Travelling Salesman Problem And its
Solution Using Genetic Algorithm.
http://www.ijirt.org/vol1/paperpublished/IJIRT101672PAPER.pdf
2 https://thesai.org/Downloads/Volume3No7/Paper 15-
Improving the Solution of Traveling Salesman Problem
Using Genetic, Memetic Algorithm and Edge assembly Crossover.pdf
Travelling Salesman Problem

More Related Content

What's hot

The Traveling Salesman Problem
The Traveling Salesman ProblemThe Traveling Salesman Problem
The Traveling Salesman ProblemMaryam Alipour
 
Traveling salesman problem
Traveling salesman problemTraveling salesman problem
Traveling salesman problem
Jayesh Chauhan
 
Greedy algorithm
Greedy algorithmGreedy algorithm
Greedy algorithm
Caisar Oentoro
 
Design and analysis of algorithms
Design and analysis of algorithmsDesign and analysis of algorithms
Design and analysis of algorithms
Dr Geetha Mohan
 
Traveling salesman problem(tsp)
Traveling salesman problem(tsp)Traveling salesman problem(tsp)
Traveling salesman problem(tsp)
Viraj Patil
 
Dynamic programming
Dynamic programmingDynamic programming
Dynamic programming
Yıldırım Tam
 
Divide and Conquer
Divide and ConquerDivide and Conquer
Divide and Conquer
Dr Shashikant Athawale
 
Travelling Salesman Problem
Travelling Salesman ProblemTravelling Salesman Problem
Travelling Salesman Problem
Shikha Gupta
 
Greedy Algorithms
Greedy AlgorithmsGreedy Algorithms
Greedy Algorithms
Amrinder Arora
 
All pairs shortest path algorithm
All pairs shortest path algorithmAll pairs shortest path algorithm
All pairs shortest path algorithmSrikrishnan Suresh
 
Introduction to Dynamic Programming, Principle of Optimality
Introduction to Dynamic Programming, Principle of OptimalityIntroduction to Dynamic Programming, Principle of Optimality
Introduction to Dynamic Programming, Principle of Optimality
Bhavin Darji
 
Travelling salesman dynamic programming
Travelling salesman dynamic programmingTravelling salesman dynamic programming
Travelling salesman dynamic programming
maharajdey
 
Dynamic programming
Dynamic programmingDynamic programming
Dynamic programming
Melaku Bayih Demessie
 
Unit 3 daa
Unit 3 daaUnit 3 daa
Unit 3 daa
Nv Thejaswini
 
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
 
Analysis and Design of Algorithms
Analysis and Design of AlgorithmsAnalysis and Design of Algorithms
Analysis and Design of Algorithms
Bulbul Agrawal
 
Directed Acyclic Graph Representation of basic blocks
Directed Acyclic Graph Representation of basic blocksDirected Acyclic Graph Representation of basic blocks
Directed Acyclic Graph Representation of basic blocks
Mohammad Vaseem Akaram
 
Graph coloring problem
Graph coloring problemGraph coloring problem
Graph coloring problem
V.V.Vanniaperumal College for Women
 
Traveling salesman problem: Game Scheduling Problem Solution: Ant Colony Opti...
Traveling salesman problem: Game Scheduling Problem Solution: Ant Colony Opti...Traveling salesman problem: Game Scheduling Problem Solution: Ant Colony Opti...
Traveling salesman problem: Game Scheduling Problem Solution: Ant Colony Opti...
Soumen Santra
 

What's hot (20)

The Traveling Salesman Problem
The Traveling Salesman ProblemThe Traveling Salesman Problem
The Traveling Salesman Problem
 
Traveling salesman problem
Traveling salesman problemTraveling salesman problem
Traveling salesman problem
 
Greedy algorithm
Greedy algorithmGreedy algorithm
Greedy algorithm
 
Design and analysis of algorithms
Design and analysis of algorithmsDesign and analysis of algorithms
Design and analysis of algorithms
 
Traveling salesman problem(tsp)
Traveling salesman problem(tsp)Traveling salesman problem(tsp)
Traveling salesman problem(tsp)
 
Dynamic programming
Dynamic programmingDynamic programming
Dynamic programming
 
Divide and Conquer
Divide and ConquerDivide and Conquer
Divide and Conquer
 
Dynamic pgmming
Dynamic pgmmingDynamic pgmming
Dynamic pgmming
 
Travelling Salesman Problem
Travelling Salesman ProblemTravelling Salesman Problem
Travelling Salesman Problem
 
Greedy Algorithms
Greedy AlgorithmsGreedy Algorithms
Greedy Algorithms
 
All pairs shortest path algorithm
All pairs shortest path algorithmAll pairs shortest path algorithm
All pairs shortest path algorithm
 
Introduction to Dynamic Programming, Principle of Optimality
Introduction to Dynamic Programming, Principle of OptimalityIntroduction to Dynamic Programming, Principle of Optimality
Introduction to Dynamic Programming, Principle of Optimality
 
Travelling salesman dynamic programming
Travelling salesman dynamic programmingTravelling salesman dynamic programming
Travelling salesman dynamic programming
 
Dynamic programming
Dynamic programmingDynamic programming
Dynamic programming
 
Unit 3 daa
Unit 3 daaUnit 3 daa
Unit 3 daa
 
Travelling salesman problem using genetic algorithms
Travelling salesman problem using genetic algorithms Travelling salesman problem using genetic algorithms
Travelling salesman problem using genetic algorithms
 
Analysis and Design of Algorithms
Analysis and Design of AlgorithmsAnalysis and Design of Algorithms
Analysis and Design of Algorithms
 
Directed Acyclic Graph Representation of basic blocks
Directed Acyclic Graph Representation of basic blocksDirected Acyclic Graph Representation of basic blocks
Directed Acyclic Graph Representation of basic blocks
 
Graph coloring problem
Graph coloring problemGraph coloring problem
Graph coloring problem
 
Traveling salesman problem: Game Scheduling Problem Solution: Ant Colony Opti...
Traveling salesman problem: Game Scheduling Problem Solution: Ant Colony Opti...Traveling salesman problem: Game Scheduling Problem Solution: Ant Colony Opti...
Traveling salesman problem: Game Scheduling Problem Solution: Ant Colony Opti...
 

Similar to Travelling SalesMan Problem(TSP)

Travelling salesperson problem
Travelling salesperson problemTravelling salesperson problem
Travelling salesperson problem
AkshayIngole17
 
OPERATIONAL RESEARCH BUSINESS APPLICATIONS
OPERATIONAL RESEARCH BUSINESS APPLICATIONS OPERATIONAL RESEARCH BUSINESS APPLICATIONS
OPERATIONAL RESEARCH BUSINESS APPLICATIONS
Akhilesh Mishra
 
Hungarian Assignment Problem
Hungarian Assignment ProblemHungarian Assignment Problem
Hungarian Assignment Problem
VivekSaurabh7
 
Greedyalgorithm
Greedyalgorithm Greedyalgorithm
Greedyalgorithm
Diksha Lad
 
Operation research model for solving TSP
Operation research model for solving TSPOperation research model for solving TSP
Operation research model for solving TSP
DrGovindshaysharma
 
The Traveling Salesman problem ppt.pptx
The Traveling Salesman problem ppt.pptxThe Traveling Salesman problem ppt.pptx
The Traveling Salesman problem ppt.pptx
HalimFerchichi
 
Comparison Study of Multiple Traveling Salesmen Problem using Genetic Algorithm
Comparison Study of Multiple Traveling Salesmen Problem using Genetic AlgorithmComparison Study of Multiple Traveling Salesmen Problem using Genetic Algorithm
Comparison Study of Multiple Traveling Salesmen Problem using Genetic Algorithm
IOSR Journals
 
Optimal Vacation Itinerary Modeling
Optimal Vacation Itinerary ModelingOptimal Vacation Itinerary Modeling
Optimal Vacation Itinerary Modeling
Gerard Trimberger
 
Ac4103169172
Ac4103169172Ac4103169172
Ac4103169172
IJERA Editor
 
19IS402_LP1_LM_22-23.pdf
19IS402_LP1_LM_22-23.pdf19IS402_LP1_LM_22-23.pdf
19IS402_LP1_LM_22-23.pdf
GOWTHAMR721887
 
Presentation%20on%20Transportation%20and%20Assignment%20Problem.pptx
Presentation%20on%20Transportation%20and%20Assignment%20Problem.pptxPresentation%20on%20Transportation%20and%20Assignment%20Problem.pptx
Presentation%20on%20Transportation%20and%20Assignment%20Problem.pptx
IBMRD Ahmednagar
 
Greedy Algorihm
Greedy AlgorihmGreedy Algorihm
Greedy Algorihm
Muhammad Amjad Rana
 
Travelling salesman problem
Travelling salesman problemTravelling salesman problem
Travelling salesman problem
Pradeep Behera
 
A new hybrid approach for solving travelling salesman problem using ordered c...
A new hybrid approach for solving travelling salesman problem using ordered c...A new hybrid approach for solving travelling salesman problem using ordered c...
A new hybrid approach for solving travelling salesman problem using ordered c...
eSAT Journals
 
whhhhhhhhhhhhhhhhhhhhhhhhhhhhheek 8 Cc.pdf
whhhhhhhhhhhhhhhhhhhhhhhhhhhhheek 8 Cc.pdfwhhhhhhhhhhhhhhhhhhhhhhhhhhhhheek 8 Cc.pdf
whhhhhhhhhhhhhhhhhhhhhhhhhhhhheek 8 Cc.pdf
hassankhan978073
 
QUIZ 1.pptx
QUIZ 1.pptxQUIZ 1.pptx
QUIZ 1.pptx
JayJayHJantar
 
Branch and bound method
Branch and bound methodBranch and bound method
Branch and bound method
VidhyaSenthil
 
Greedy Algorithm
Greedy AlgorithmGreedy Algorithm
Greedy Algorithm
Waqar Akram
 
Branch and bound.ppt
Branch and bound.pptBranch and bound.ppt
Branch and bound.ppt
umairshams6
 
Fast coputation of Phi(x) inverse
Fast coputation of Phi(x) inverseFast coputation of Phi(x) inverse
Fast coputation of Phi(x) inverse
John Cook
 

Similar to Travelling SalesMan Problem(TSP) (20)

Travelling salesperson problem
Travelling salesperson problemTravelling salesperson problem
Travelling salesperson problem
 
OPERATIONAL RESEARCH BUSINESS APPLICATIONS
OPERATIONAL RESEARCH BUSINESS APPLICATIONS OPERATIONAL RESEARCH BUSINESS APPLICATIONS
OPERATIONAL RESEARCH BUSINESS APPLICATIONS
 
Hungarian Assignment Problem
Hungarian Assignment ProblemHungarian Assignment Problem
Hungarian Assignment Problem
 
Greedyalgorithm
Greedyalgorithm Greedyalgorithm
Greedyalgorithm
 
Operation research model for solving TSP
Operation research model for solving TSPOperation research model for solving TSP
Operation research model for solving TSP
 
The Traveling Salesman problem ppt.pptx
The Traveling Salesman problem ppt.pptxThe Traveling Salesman problem ppt.pptx
The Traveling Salesman problem ppt.pptx
 
Comparison Study of Multiple Traveling Salesmen Problem using Genetic Algorithm
Comparison Study of Multiple Traveling Salesmen Problem using Genetic AlgorithmComparison Study of Multiple Traveling Salesmen Problem using Genetic Algorithm
Comparison Study of Multiple Traveling Salesmen Problem using Genetic Algorithm
 
Optimal Vacation Itinerary Modeling
Optimal Vacation Itinerary ModelingOptimal Vacation Itinerary Modeling
Optimal Vacation Itinerary Modeling
 
Ac4103169172
Ac4103169172Ac4103169172
Ac4103169172
 
19IS402_LP1_LM_22-23.pdf
19IS402_LP1_LM_22-23.pdf19IS402_LP1_LM_22-23.pdf
19IS402_LP1_LM_22-23.pdf
 
Presentation%20on%20Transportation%20and%20Assignment%20Problem.pptx
Presentation%20on%20Transportation%20and%20Assignment%20Problem.pptxPresentation%20on%20Transportation%20and%20Assignment%20Problem.pptx
Presentation%20on%20Transportation%20and%20Assignment%20Problem.pptx
 
Greedy Algorihm
Greedy AlgorihmGreedy Algorihm
Greedy Algorihm
 
Travelling salesman problem
Travelling salesman problemTravelling salesman problem
Travelling salesman problem
 
A new hybrid approach for solving travelling salesman problem using ordered c...
A new hybrid approach for solving travelling salesman problem using ordered c...A new hybrid approach for solving travelling salesman problem using ordered c...
A new hybrid approach for solving travelling salesman problem using ordered c...
 
whhhhhhhhhhhhhhhhhhhhhhhhhhhhheek 8 Cc.pdf
whhhhhhhhhhhhhhhhhhhhhhhhhhhhheek 8 Cc.pdfwhhhhhhhhhhhhhhhhhhhhhhhhhhhhheek 8 Cc.pdf
whhhhhhhhhhhhhhhhhhhhhhhhhhhhheek 8 Cc.pdf
 
QUIZ 1.pptx
QUIZ 1.pptxQUIZ 1.pptx
QUIZ 1.pptx
 
Branch and bound method
Branch and bound methodBranch and bound method
Branch and bound method
 
Greedy Algorithm
Greedy AlgorithmGreedy Algorithm
Greedy Algorithm
 
Branch and bound.ppt
Branch and bound.pptBranch and bound.ppt
Branch and bound.ppt
 
Fast coputation of Phi(x) inverse
Fast coputation of Phi(x) inverseFast coputation of Phi(x) inverse
Fast coputation of Phi(x) inverse
 

Recently uploaded

Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
SupreethSP4
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
BrazilAccount1
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
ongomchris
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
Vijay Dialani, PhD
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
BrazilAccount1
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 

Recently uploaded (20)

Runway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptxRunway Orientation Based on the Wind Rose Diagram.pptx
Runway Orientation Based on the Wind Rose Diagram.pptx
 
English lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdfEnglish lab ppt no titlespecENG PPTt.pdf
English lab ppt no titlespecENG PPTt.pdf
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
space technology lecture notes on satellite
space technology lecture notes on satellitespace technology lecture notes on satellite
space technology lecture notes on satellite
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 

Travelling SalesMan Problem(TSP)

  • 2. Travelling Salesman Problem Problem Given a list of cities and the distances between each pair of cities, what is the shortest possible route that visits each city exactly once and returns to the origin city. Travelling Salesman Problem
  • 3. Travelling Salesman Problem Example Akshay has following list of cities and want to visit each city once, return back to home: Pune(Home)(A) Bangalore(B) Chennai(C) Delhi(D) Kolkata(E) ShriNagae(F) Travelling Salesman Problem
  • 4. Travelling Salesman Problem Matrix A B C D E F A 0 36 32 54 20 40 B 36 0 22 58 54 67 c 32 22 0 36 42 71 D 54 58 36 0 50 92 E 20 54 42 50 0 45 F 40 67 71 92 45 0 Let say that , These are the distances from the cities and akshay want to go from Home-city(Pune) to ShriNagar with minimum cost. In which order/path he do these? Travelling Salesman Problem
  • 5. Travelling Salesman Problem We Solve the problem using Nearest neighbor algorithm: Algorithm: 1 Select a city as current city. 2 Find out the shortest edge connecting the current city and an unvisited city. 3 Set the new city as current city. 4 Mark the previous current city as visited. 5 If all the cities are visited, then terminate. 6 Go to step 2. Travelling Salesman Problem
  • 6. Travelling Salesman Problem Explanation : We visit Cities As follows Using Above algorithm, A → E = 20 E → C = 42 C → B = 22 B → D = 58 D → F = 92 F → A = 40 Total Cost = 20 + 42 + 22 + 58 + 92 + 40 = 274 Travelling Salesman Problem
  • 7. Travelling Salesman Problem Pseudo Code : Home City = Visited = Current city While(!visitedAll City) Node = Find Shortest distance(Current node) Add Node (Node) Current node = Node Result = All node + Home City[0][last Visit Node] return Final result= Result Travelling Salesman Problem
  • 8. Travelling Salesman Problem Summary 1 Complexity of this algorithm is o(n2) which is much better than brute force algorithm. 2 It is Fast, Easy and Efficient. Travelling Salesman Problem
  • 9. Travelling Salesman Problem Reference We can solve TSP problem using genetic algorithm. 1 Research Paper on Travelling Salesman Problem And its Solution Using Genetic Algorithm. http://www.ijirt.org/vol1/paperpublished/IJIRT101672PAPER.pdf 2 https://thesai.org/Downloads/Volume3No7/Paper 15- Improving the Solution of Traveling Salesman Problem Using Genetic, Memetic Algorithm and Edge assembly Crossover.pdf Travelling Salesman Problem