Presentation is loading. Please wait.

Presentation is loading. Please wait.

A Genetic Solution to the Travelling Salesman Problem Ryan Honig.

Similar presentations


Presentation on theme: "A Genetic Solution to the Travelling Salesman Problem Ryan Honig."— Presentation transcript:

1 A Genetic Solution to the Travelling Salesman Problem Ryan Honig

2 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.

3 What is the Travelling Salesman Problem? (Cont.)‏ Two Types of Problems: Symmetric Asymmetric

4 What is the Travelling Salesman Problem? (Cont.)‏ Symmetric AB Distance = 100

5 My Goal Three Things I want to do: 1.Create an algorithm that can find near- optimal solutions for symmetric TSPs. 2.Build off of the first algorithm to allow it to find near-optimal solutions for asymmetric TSPs. 3.Create a graphic Interface to run the algorithms and visualize the set of points.

6 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

7 Genetic Algorithm (Cont)‏ AABB C C D D EE Parent AParent B

8 AB C D E Genetic Algorithm (Cont)‏ A A A A A B B B B B Combined Path

9 Genetic Algorithm (Cont)‏ B AB C D E A A B B Child

10 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

11 Pool Creating Heuristic AB C D E A ABA E AB C AB D A D E AB E

12 What I’ve done 3rd quarter First ~two weeks of the quarter spent trying to optimize my pool initializing heuristic Did some testing with the current heuristic program and the original random-pool program Worked on converting the a copy of my random pool program so that it would read in asymmetric traveling salesman problems and find near optimal solutions to them

13 Pool Creating Heuristic (Cont)‏ Last Quarter, I tested the program with the heuristic to initialize the pool (before my optimizing) against the program that has a random pool, and although I found the results to be slightly better, it ran a lot slower. This Quarter, I once again tested the two different versions of my program, but after I had worked for a bit on optimizing the heuristic. 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.

14 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: 10628 BAYG29: 1610 BAYS29: 2020 CH130: 6110 2780.54 12017.46 1750.92 2385.34 6493.65 2729.37 12104.32 1683.84 2327.77 6387.37 1.75 sec 2.31 sec 1.33 sec 1.86 sec 2.76 sec 3.03 sec 4.71 sec 2.42 sec 2.81 sec 4.54 sec

15 What is the Travelling Salesman Problem? (Cont.)‏ Asymmetric Travelling Salesman Problem AB Distance = 100 Distance = 200

16 Asymmetric Travelling Salesman After a bit of testing my two programs, 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 the distances between points rather than the coordinates of points Currently, I can successfully read in the data, and I have converted many of the functions in my program so that they can perform on asymmetric data, but I am having a hard time converting the actual genetic algorithm Hopefully I will be able to get it working by early next quarter.

17 The Future of my Program Finish making the genetic algorithm compatible with asymmetric TSPs Make a GUI

18 Plans for a GUI Allow user to input the name of the file containing the set of points Display the set of points in a graphical representation, along with the path that the algorithm will finds for it

19 THE END Any Questions?


Download ppt "A Genetic Solution to the Travelling Salesman Problem Ryan Honig."

Similar presentations


Ads by Google