Traveling Salesman Problem (TSP) Chris Seto Andrea Smith Problem description Given a list of a cities and distance between each pair of cities, what is the shortest possible route that visits each? NP-hard problem Problem usually modeled as an undirected graph Produces a Hamiltonian Cycle History Studies started in the 1800s by Sir William Hamilton and Thomas Kirkman of related problems Icosian game invented in 1857 TSP first studied in 1930s by Karl Menger, Hassler Whitney, and Merrill Flood Solutions appeared in papers in mid-1950s Determined to be NP-hard in 1972 by Richard M. Karp Application: Pick And Place Printed circuit board (PCB) with locations where chips must be placed by robot The faster the robot can place all components, the faster the PCB will be assembled The faster the PCB can be assembled, the more PCBs can be made in the same amount of time Application: Logistics Warehouse with many parts in various locations Order is received for several parts which must be picked by robot or employee What path should the picker follow to ensure that they fill the order in smallest amount of time? Any number of TSP solutions can be applied and compared in parallel Application: UPS ORION Route optimization used by UPS Implementation started in 2008 Saves ~35 million miles per year Increased projected annual savings NP Hard Solution Methods Devise an algorithm for an exact solution, even though it may only work efficiently for a small problem Devise “Suboptimal” heuristic algorithms to yield good, but inexact solutions. Find special cases for the problem for which better or exact heuristics are developed. Possible Approaches Brute-force Best for small number of nodes Greedy Algorithm Simplest algorithm for larger number of nodes Genetic Method Algorithm Generates “close to optimal” solutions Approach: Brute Force • • • • • Best for small number of nodes Number of Hamiltonian Circuits = (n-1)! Guaranteed an Optimal Solution Complexity: ((n-1)!) Tries all possible permutations and compares cost Node Count Approximate Completion Time 20 2 Minutes 25 20 Years 30 284 Million Years Brute Force Demo Approach: Greedy • • • Prim’s Algorithm, Kruskal’s Algorithm Not guaranteed the optimal solution “Close enough” solution 𝑛 𝑛−1 • Prim’s Complexity: O( lg(𝑛)) 2 𝑛 𝑛−1 𝑛 𝑛−1 • Kruskal’s Complexity: O( lg( 2 2 )) Approach: Genetic Algorithm New approach which uses natural selection to create close to optimal solutions Hamiltonian cycles are continually “bred” with mutations Crossover occurs between solutions Relatively quickly produces a solution which is probably close to optimal Conclusion Studies originally began 1800s, again in 1950s Optimal solution found in ((n-1)!) time Close enough solution found in O( 𝑛 𝑛−1 2 lg(𝑛)) Used by… UPS in ORION system Pick and place Many other graph representable systems Questions? References http://en.wikipedia.org/wiki/Travelling_salesm an_problem https://xkcd.com/399/ (Comic) http://www.forbes.com/sites/alexkonrad/2013 /11/01/meet-orion-software-that-will-save-upsmillions-by-improving-drivers-routes/ http://www.theprojectspot.com/tutorialpost/applying-a-genetic-algorithm-to-thetravelling-salesman-problem/5