SlideShare a Scribd company logo
1 of 13
Download to read offline
Traveling
Salesman
Problem
Maksym Voitko
Problem
Given a list of cities and the distances between each
pair of cities, what is _the shortest possible route_
that visits each city and returns to the origin city?.
Bonus
NP-hard - Non-deterministic Polynomial-time Hardness
Context
The importance of the TSP does not arise from an overwhelming
demand of salespeople to minimize their travel length.

Rather from a wealth of other applications such as:

• vehicle routing,

• circuit board drilling, 

• VLSI design, 

• robot control, 

• X-ray crystallography, 

• machine scheduling, 

• and computational biology.
Solution
The traditional lines of attack for the NP-hard problems are
the following:

• Devising exact algorithms, which work reasonably fast
only for small problem sizes.

• Devising "suboptimal" or heuristic algorithms, i.e.,
algorithms that deliver approximated solutions in a
reasonable time.

• Finding special cases for the problem (“subproblems") for
which either better or exact heuristics are possible.
GREED is good
Heuristic and approximation
algorithms
Modern methods can find solutions for extremely large
problems (millions of cities) within a reasonable time, which
are with a high probability just 2–3% away from the optimal
solution.
Nearest neighbors
1.Make two sets of nodes, set A and set B, and put all
nodes into set B

2.Put your starting node into set A

3.Pick the node which is closest to the last node which was
placed in set A and is not in set A; 

4.Put this closest neighbouring node into set A

5.Repeat step 3 until all nodes are in set A and B is empty.
Smallest Insertion
Put the node to the current
tour after the point,

where it results in the least
possible increase in the
tour length.
Results Time
Poins count  Algorithm Nearest Neighbor Smallest Insertion
10 0.0002040863037 0.0002779960632
100 0.005702018738 0.01178383827
1000 0.5322930813 1.139199972
Results Tour Length
Poins count 
Algorithm
Nearest Neighbor Smallest Insertion Optimal
10 1566.1363 1655.7461 1552.9612
100 7389.9297 4887.2190
1000 27868.7106 17265.6282
Further Plans
Ant colony optimization
1. Populate the beginning city with a colony of ants.

2. For each ant, send the ant on a tour of all cities where they visit each
city only once. The selection for which city to visit next is initially
effectively random. After the first run, the next city selection becomes
gradually more influenced by the amount of pheromone on a possible
trail.

3. Once all ants have completed a tour of the world, deposit pheromone
on each city path. The amount of pheromone deposited by each ant
is proportional to the length of the path traveled by the given ant.


More Related Content

What's hot

implementation of travelling salesman problem with complexity ppt
implementation of travelling salesman problem with complexity pptimplementation of travelling salesman problem with complexity ppt
implementation of travelling salesman problem with complexity pptAntaraBhattacharya12
 
Ant Colony Optimization (ACO)
Ant Colony Optimization (ACO)Ant Colony Optimization (ACO)
Ant Colony Optimization (ACO)Mahmoud El-tayeb
 
Travelling salesman problem
Travelling salesman problemTravelling salesman problem
Travelling salesman problemWajahat Hussain
 
Ant Colony Optimization presentation
Ant Colony Optimization presentationAnt Colony Optimization presentation
Ant Colony Optimization presentationPartha Das
 
Floyd Warshall Algorithm
Floyd Warshall Algorithm Floyd Warshall Algorithm
Floyd Warshall Algorithm Imamul Kadir
 
code optimization
code optimization code optimization
code optimization Sanjeev Raaz
 
Ant Colony Optimization: The Algorithm and Its Applications
Ant Colony Optimization: The Algorithm and Its ApplicationsAnt Colony Optimization: The Algorithm and Its Applications
Ant Colony Optimization: The Algorithm and Its Applicationsadil raja
 
Ant colony optimization (aco)
Ant colony optimization (aco)Ant colony optimization (aco)
Ant colony optimization (aco)gidla vinay
 
Particle Swarm optimization
Particle Swarm optimizationParticle Swarm optimization
Particle Swarm optimizationmidhulavijayan
 
Particle Swarm Optimization by Rajorshi Mukherjee
Particle Swarm Optimization by Rajorshi MukherjeeParticle Swarm Optimization by Rajorshi Mukherjee
Particle Swarm Optimization by Rajorshi MukherjeeRajorshi Mukherjee
 
Bounded Model Checking
Bounded Model CheckingBounded Model Checking
Bounded Model CheckingIlham Amezzane
 
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
 
Ant colony optimization
Ant colony optimizationAnt colony optimization
Ant colony optimizationvk1dadhich
 
Ant colony optimization
Ant colony optimizationAnt colony optimization
Ant colony optimizationAbdul Rahman
 
Particle swarm optimization
Particle swarm optimizationParticle swarm optimization
Particle swarm optimizationHanya Mohammed
 
Ch 2 State Space Search - slides part 1.pdf
Ch 2 State Space Search - slides part 1.pdfCh 2 State Space Search - slides part 1.pdf
Ch 2 State Space Search - slides part 1.pdfKrishnaMadala1
 

What's hot (20)

implementation of travelling salesman problem with complexity ppt
implementation of travelling salesman problem with complexity pptimplementation of travelling salesman problem with complexity ppt
implementation of travelling salesman problem with complexity ppt
 
Ant Colony Optimization (ACO)
Ant Colony Optimization (ACO)Ant Colony Optimization (ACO)
Ant Colony Optimization (ACO)
 
Travelling salesman problem
Travelling salesman problemTravelling salesman problem
Travelling salesman problem
 
Ant Colony Optimization presentation
Ant Colony Optimization presentationAnt Colony Optimization presentation
Ant Colony Optimization presentation
 
Floyd Warshall Algorithm
Floyd Warshall Algorithm Floyd Warshall Algorithm
Floyd Warshall Algorithm
 
code optimization
code optimization code optimization
code optimization
 
Ant Colony Optimization: The Algorithm and Its Applications
Ant Colony Optimization: The Algorithm and Its ApplicationsAnt Colony Optimization: The Algorithm and Its Applications
Ant Colony Optimization: The Algorithm and Its Applications
 
Ant colony optimization (aco)
Ant colony optimization (aco)Ant colony optimization (aco)
Ant colony optimization (aco)
 
Ant colony algorithm
Ant colony algorithm Ant colony algorithm
Ant colony algorithm
 
Traveling Salesman Problem
Traveling Salesman Problem Traveling Salesman Problem
Traveling Salesman Problem
 
Particle Swarm optimization
Particle Swarm optimizationParticle Swarm optimization
Particle Swarm optimization
 
Particle Swarm Optimization by Rajorshi Mukherjee
Particle Swarm Optimization by Rajorshi MukherjeeParticle Swarm Optimization by Rajorshi Mukherjee
Particle Swarm Optimization by Rajorshi Mukherjee
 
Bounded Model Checking
Bounded Model CheckingBounded Model Checking
Bounded Model Checking
 
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
 
Master theorem
Master theoremMaster theorem
Master theorem
 
Ant colony optimization
Ant colony optimizationAnt colony optimization
Ant colony optimization
 
Ant colony optimization
Ant colony optimizationAnt colony optimization
Ant colony optimization
 
Particle swarm optimization
Particle swarm optimizationParticle swarm optimization
Particle swarm optimization
 
Ch 2 State Space Search - slides part 1.pdf
Ch 2 State Space Search - slides part 1.pdfCh 2 State Space Search - slides part 1.pdf
Ch 2 State Space Search - slides part 1.pdf
 
Kr using rules
Kr using rulesKr using rules
Kr using rules
 

Similar to Solving the Traveling Salesman Problem with Heuristics

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 AlgorithmIOSR Journals
 
AntColonyOptimizationManetNetworkAODV.pptx
AntColonyOptimizationManetNetworkAODV.pptxAntColonyOptimizationManetNetworkAODV.pptx
AntColonyOptimizationManetNetworkAODV.pptxLina Kadam
 
Particle Swarm Optimization to Solve Multiple Traveling Salesman Problem
Particle Swarm Optimization to Solve Multiple Traveling Salesman ProblemParticle Swarm Optimization to Solve Multiple Traveling Salesman Problem
Particle Swarm Optimization to Solve Multiple Traveling Salesman ProblemIRJET Journal
 
3rd Conference on Sustainable Urban Mobility
3rd Conference on Sustainable Urban Mobility3rd Conference on Sustainable Urban Mobility
3rd Conference on Sustainable Urban MobilityLIFE GreenYourMove
 
Presentation of GreenYourMove's hybrid approach in the 3rd Conference on Sust...
Presentation of GreenYourMove's hybrid approach in the 3rd Conference on Sust...Presentation of GreenYourMove's hybrid approach in the 3rd Conference on Sust...
Presentation of GreenYourMove's hybrid approach in the 3rd Conference on Sust...GreenYourMove
 
Travelling salesman problem
Travelling salesman problemTravelling salesman problem
Travelling salesman problemhamza haseeb
 
A feasible solution algorithm for a primitive vehicle routing problem
A feasible solution algorithm for a primitive vehicle routing problemA feasible solution algorithm for a primitive vehicle routing problem
A feasible solution algorithm for a primitive vehicle routing problemCem Recai Çırak
 
[215]streetwise machine learning for painless parking
[215]streetwise machine learning for painless parking[215]streetwise machine learning for painless parking
[215]streetwise machine learning for painless parkingNAVER D2
 
Using Genetic Algorithm for Shortest Path Selection with Real Time Traffic Flow
Using Genetic Algorithm for Shortest Path Selection with Real Time Traffic FlowUsing Genetic Algorithm for Shortest Path Selection with Real Time Traffic Flow
Using Genetic Algorithm for Shortest Path Selection with Real Time Traffic FlowIJCSIS Research Publications
 
Quantum inspired evolutionary algorithm for solving multiple travelling sales...
Quantum inspired evolutionary algorithm for solving multiple travelling sales...Quantum inspired evolutionary algorithm for solving multiple travelling sales...
Quantum inspired evolutionary algorithm for solving multiple travelling sales...eSAT Publishing House
 
Webinar: How to design express services on a bus transit network
Webinar: How to design express services on a bus transit networkWebinar: How to design express services on a bus transit network
Webinar: How to design express services on a bus transit networkBRTCoE
 
Cognitive Urban Transport
Cognitive Urban TransportCognitive Urban Transport
Cognitive Urban TransportSasha Lazarevic
 
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
 
Algorithms And Optimization Techniques For Solving TSP
Algorithms And Optimization Techniques For Solving TSPAlgorithms And Optimization Techniques For Solving TSP
Algorithms And Optimization Techniques For Solving TSPCarrie Romero
 
With saloni in ijarcsse
With saloni in ijarcsseWith saloni in ijarcsse
With saloni in ijarcssesatish rana
 

Similar to Solving the Traveling Salesman Problem with Heuristics (20)

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
 
AntColonyOptimizationManetNetworkAODV.pptx
AntColonyOptimizationManetNetworkAODV.pptxAntColonyOptimizationManetNetworkAODV.pptx
AntColonyOptimizationManetNetworkAODV.pptx
 
Particle Swarm Optimization to Solve Multiple Traveling Salesman Problem
Particle Swarm Optimization to Solve Multiple Traveling Salesman ProblemParticle Swarm Optimization to Solve Multiple Traveling Salesman Problem
Particle Swarm Optimization to Solve Multiple Traveling Salesman Problem
 
3rd Conference on Sustainable Urban Mobility
3rd Conference on Sustainable Urban Mobility3rd Conference on Sustainable Urban Mobility
3rd Conference on Sustainable Urban Mobility
 
Presentation 3rd CSUM
Presentation 3rd CSUM Presentation 3rd CSUM
Presentation 3rd CSUM
 
Presentation of GreenYourMove's hybrid approach in the 3rd Conference on Sust...
Presentation of GreenYourMove's hybrid approach in the 3rd Conference on Sust...Presentation of GreenYourMove's hybrid approach in the 3rd Conference on Sust...
Presentation of GreenYourMove's hybrid approach in the 3rd Conference on Sust...
 
Travelling salesman problem
Travelling salesman problemTravelling salesman problem
Travelling salesman problem
 
A feasible solution algorithm for a primitive vehicle routing problem
A feasible solution algorithm for a primitive vehicle routing problemA feasible solution algorithm for a primitive vehicle routing problem
A feasible solution algorithm for a primitive vehicle routing problem
 
[215]streetwise machine learning for painless parking
[215]streetwise machine learning for painless parking[215]streetwise machine learning for painless parking
[215]streetwise machine learning for painless parking
 
Using Genetic Algorithm for Shortest Path Selection with Real Time Traffic Flow
Using Genetic Algorithm for Shortest Path Selection with Real Time Traffic FlowUsing Genetic Algorithm for Shortest Path Selection with Real Time Traffic Flow
Using Genetic Algorithm for Shortest Path Selection with Real Time Traffic Flow
 
project final ppt.pptx
project final ppt.pptxproject final ppt.pptx
project final ppt.pptx
 
Quantum inspired evolutionary algorithm for solving multiple travelling sales...
Quantum inspired evolutionary algorithm for solving multiple travelling sales...Quantum inspired evolutionary algorithm for solving multiple travelling sales...
Quantum inspired evolutionary algorithm for solving multiple travelling sales...
 
Webinar: How to design express services on a bus transit network
Webinar: How to design express services on a bus transit networkWebinar: How to design express services on a bus transit network
Webinar: How to design express services on a bus transit network
 
Cognitive Urban Transport
Cognitive Urban TransportCognitive Urban Transport
Cognitive Urban Transport
 
Traveling Eco-Salesman
Traveling Eco-SalesmanTraveling Eco-Salesman
Traveling Eco-Salesman
 
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...
 
Algorithms And Optimization Techniques For Solving TSP
Algorithms And Optimization Techniques For Solving TSPAlgorithms And Optimization Techniques For Solving TSP
Algorithms And Optimization Techniques For Solving TSP
 
With saloni in ijarcsse
With saloni in ijarcsseWith saloni in ijarcsse
With saloni in ijarcsse
 
Major ppt
Major pptMajor ppt
Major ppt
 
Where Next
Where NextWhere Next
Where Next
 

Recently uploaded

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 

Solving the Traveling Salesman Problem with Heuristics

  • 2. Problem Given a list of cities and the distances between each pair of cities, what is _the shortest possible route_ that visits each city and returns to the origin city?.
  • 3. Bonus NP-hard - Non-deterministic Polynomial-time Hardness
  • 4. Context The importance of the TSP does not arise from an overwhelming demand of salespeople to minimize their travel length. Rather from a wealth of other applications such as: • vehicle routing, • circuit board drilling, • VLSI design, • robot control, • X-ray crystallography, • machine scheduling, • and computational biology.
  • 5. Solution The traditional lines of attack for the NP-hard problems are the following: • Devising exact algorithms, which work reasonably fast only for small problem sizes. • Devising "suboptimal" or heuristic algorithms, i.e., algorithms that deliver approximated solutions in a reasonable time. • Finding special cases for the problem (“subproblems") for which either better or exact heuristics are possible.
  • 7. Heuristic and approximation algorithms Modern methods can find solutions for extremely large problems (millions of cities) within a reasonable time, which are with a high probability just 2–3% away from the optimal solution.
  • 8. Nearest neighbors 1.Make two sets of nodes, set A and set B, and put all nodes into set B 2.Put your starting node into set A 3.Pick the node which is closest to the last node which was placed in set A and is not in set A; 4.Put this closest neighbouring node into set A 5.Repeat step 3 until all nodes are in set A and B is empty.
  • 9.
  • 10. Smallest Insertion Put the node to the current tour after the point, where it results in the least possible increase in the tour length.
  • 11. Results Time Poins count Algorithm Nearest Neighbor Smallest Insertion 10 0.0002040863037 0.0002779960632 100 0.005702018738 0.01178383827 1000 0.5322930813 1.139199972
  • 12. Results Tour Length Poins count Algorithm Nearest Neighbor Smallest Insertion Optimal 10 1566.1363 1655.7461 1552.9612 100 7389.9297 4887.2190 1000 27868.7106 17265.6282
  • 13. Further Plans Ant colony optimization 1. Populate the beginning city with a colony of ants. 2. For each ant, send the ant on a tour of all cities where they visit each city only once. The selection for which city to visit next is initially effectively random. After the first run, the next city selection becomes gradually more influenced by the amount of pheromone on a possible trail. 3. Once all ants have completed a tour of the world, deposit pheromone on each city path. The amount of pheromone deposited by each ant is proportional to the length of the path traveled by the given ant.