A Genetic Solution to the Travelling Salesman Problem Ryan Honig
What is the Travelling Salesman Problem? Traveling Salesman Problem (TSP) Definition: Given a set of points, find the shortest path that visits each point exactly once and returns to the starting point.
My Goal Main Things I want to do: Create an algorithm that can find near- optimal solutions for symmetric TSPs. Create a way of heuristically generating a pool Build off of the first algorithm to allow it to find near-optimal solutions for asymmetric TSPs.
What is the Travelling Salesman Problem? (Cont.) Two Types of Problems: Symmetric Asymmetric
What is the Travelling Salesman Problem? (Cont.) Symmetric AB Distance = 100
Genetic Algorithm Genetic algorithm: an algorithm that has a pool of solutions, and will at random pick two solutions and combine them to create a child solution, then a fitness function is used to rank the solutions
Genetic Algorithm (Cont) AABB C C D D EE Parent AParent B
AB C D E Genetic Algorithm (Cont) A A A A A B B B B B Combined Path
Genetic Algorithm (Cont) B AB C D E A A B B Child
Mutations Chance of 1 in 50 to introduce a mutation to the next generation (the child if it replaces a parent, or the first parent) EBFDGAC R1R2 EAGDFBC
Pool Creating Heuristic AB C D E A ABA E AB C AB D A D E AB E
Pool Creating Heuristic (Cont) After testing the two different versions of my program, I found that while the heuristic program was still slightly better than the random-pool program, the time it took to run still did not justify its improvement.
Pool Creating Heuristic (Testing) Average Run Time Average (of 5 runs) Average Run time Average (of 5 runs) Data Set / Best solution Heuristic ProgramRandom Pool Program A280: 2579 ATT48: BAYG29: 1610 BAYS29: 2020 CH130: sec 2.31 sec 1.33 sec 1.86 sec 2.76 sec 5.11 sec 7.32 sec 4.32 sec 5.76 sec 6.43 sec
What is the Travelling Salesman Problem? (Cont.) Asymmetric Travelling Salesman Problem AB Distance = 100 Distance = 200
Asymmetric Travelling Salesman After testing my two versions of the symmetric program, I began work on converting the random-pool program so that it could solve asymmetric travelling salesman problems. Working with a data set that only contains 17 points, data is read in as a text file that contains a grid of distances between points rather than the coordinates of points I can successfully read the data into a matrix, but I am having a hard time converting the actual genetic algorithm
Asymmetric Travelling Salesman (cont) I attempted to use the data to create two sets of absolute coordinates depending on whether you were moving in the clockwise or counter clockwise direction, rather than just having the matrix of relative distances While this was slightly easier to work with than the relative coordinates, I was still not able to get an algorithm that can find solutions to the asymmetric problem sets in the end
The Future of my Program If anyone wants to continue this project, they can: Finish making the genetic algorithm compatible with asymmetric TSPs Make a GUI
THE END Any Questions?