Title: A Genetic Solution to the Traveling Salesman Problem
1A Genetic Solution to the Traveling Salesman
Problem
Ryan Honig
2What is the Traveling 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.
3What is the Traveling Salesman Problem? (Cont.)
Two Types of Problems Symmetric Asymmetric
4What is the Traveling Salesman Problem? (Cont.)
Symmetric
A
B
Distance 100
Distance 100
5What is the Traveling Salesman Problem? (Cont.)
Asymmetric
A
B
Distance 100
Distance 200
6My Goal
- Three Things I want to do
- Create an algorithm that can find near-optimal
solutions for symmetric TSPs. - Build off of the first algorithm to allow it to
find near-optimal solutions for asymmetric TSPs. - Create a graphic Interface to run the algorithms
and visualize the set of points.
7Genetic 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
8Genetic Algorithm (Cont)
Parent A
Parent B
A
A
B
B
C
E
E
C
D
D
9Genetic Algorithm (Cont)
Combined Path
B
A
B
A
A
B
A
B
E
B
C
A
A
B
D
10Genetic Algorithm (Cont)
Child
B
A
B
A
B
E
C
A
B
D
11What Ive done this quarter
- Fixed the bugs in my basic genetic algorithm so
that it actually ran - Added in mutations so that the pool doesnt get
filled with entirely the same path - Added a heuristic to generate the initial pool
rather than have it be randomly generated
12Mutations
- Chance of 1 in 50 to introduce a mutation to the
next generation (the child if it replaces a
parent, or the first parent)
R1
R2
E
B
F
D
G
A
C
E
A
G
D
F
B
C
13Pool Creating Heuristic
A
A
B
A
E
A
B
A
B
A
A
B
C
E
E
D
D
14Pool Creating Heuristic (Cont)
- I tested the program with the heuristic to
initialize the pool against the program that has
a random pool, and although the results are
slightly better (errors from best known solution
around 4-4.5 rather than about 5, it runs a lot
slower. - Im not sure if I should try and develop a new
heuristic to use or just continue using the
random pool program.
15The Future of my Program
- Try and find a new heuristic to use to initialize
the pool - Make the program compatible with asymmetric TSPs
- Make a GUI
16Plans 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 some the path that the
algorithm will find for it - Allow the user to instead of reading a set of
points from a text file, click to create points
on the graphical representation to have the
algorithm run on
17THE END
Any Questions?