SLIDE 1 Travelling Salesman Problem
Stewart Adam Kevin Visser May 14, 2010
SLIDE 2 The Problem
- Need to visit N cities with
smallest total distance travelled
- Thought of in the 1830s
- Mathematicians in the 1930s
realized the problem was unsolvable with the current technology
SLIDE 3 The Problem
▫ Must end at same city that we started at ▫ Cannot visit any city twice ▫ Can start the trip at any city
SLIDE 4
SLIDE 5 Conventional Approach
▫ Modeling 30 cities means 30!=2.6 x 10^32 possible solutions ▫ Equivalent to 8.4 x 10^24 years of trying at 1 solution/second
SLIDE 6 Genetic Algorithm
- Similar to wind farm problem
- Can’t use the same crossover or mutation methods, as that
may result in duplicate cities
- Must converge on good solutions, but keep enough entropy
in the solutions so we can pop out of local minimums
▫ Solution: Morph our way out with lots of mutation ▫ Solution: More elites to keep track of the better solutions
SLIDE 7
Crossover
Given the parents: [7, 2, 4, 1, 9, | 5, 6, 8, 10, 3] and [4, 9, 10, 3, 7, | 5, 8, 6, 1, 2] Copy, excluding duplicates Child 1 (pass 1): [7, 2, 4, 1, 9, X, X, 10, 3, X] Fill in blanks with cities from parent 2 (in unused order) Child 1 (pass 2): [7, 2, 4, 1, 9, 5, 8, 10, 3, 6]
SLIDE 8 Mutation
- Swap the position of two elements
- More randomness!
▫ When mutation happens, it randomly performs 1 or 2 “swap” passes ▫ Mutation 50% of the time ▫ 1% of mutations are greedy (force a better solution)
SLIDE 9 Fun stuff: Videos
Circle: Long
SLIDE 10 Fun stuff: Videos
Circle: Short
SLIDE 11 Fun stuff: Videos
Random: Local minimum
SLIDE 12 Fun stuff: Videos
Test case: Stuck
SLIDE 13 Fun stuff: Videos
Test case: Best
SLIDE 14 The best solution had a distance
- f 948.33 units (shown on left).
Results
SLIDE 15
Best solution != nearest city The best results always seems to form closed shapes Shapes are close as possible to the circumference of a circle (contours). No diagonal lines
Results
SLIDE 16