1 / 38

Genetic Algorithms with Multiple Crossovers on Traveling Salesman Problem

Paulo Lafeta Ferreira Introduction to Artificial Intelligence – CS 581 Professor: Pushpak Karnick. Genetic Algorithms with Multiple Crossovers on Traveling Salesman Problem. Introduction to Traveling Salesman Problem (TSP).

gen
Télécharger la présentation

Genetic Algorithms with Multiple Crossovers on Traveling Salesman Problem

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Paulo Lafeta Ferreira Introduction to Artificial Intelligence – CS 581Professor: PushpakKarnick Genetic Algorithms with Multiple Crossovers on Traveling Salesman Problem

  2. Introduction to Traveling Salesman Problem (TSP) • “Traveling Salesman” must visit each city exactly once and then return back to the starting point. • Complexity of the problem (NP-hard) grows exponentially. • Approximate solutions can be made using Genetic Algorithms.

  3. Djibouti Map: 89 cities: http://www.tsp.gatech.edu

  4. Djibouti Optimal solution found. Path size: 351 mi

  5. National TSPs: Argentina Map: 9,152 Cities:

  6. National TSPs: Argentina Path size found: 44,232 mi Solution non-optimal. Path found is at maximum, 0.012% greater than optimum solution.

  7. China Map:

  8. China 71,009 cities:

  9. China Best path found in a recent test:

  10. China Path size: 241,188 mi 0.024% near optimal solution

  11. World Tour • This problem has 1,904,711 cities from around the world.

  12. World Tour Best path found: 396,967,677 mi 0.04996%greater than optimal path.

  13. Bigger National TSP solved Sweden: • 24,978 cities • Path size: 45,049 mi • Used 96 clusters dual Intel Xeon 2.8 Ghz • Time running: approximately 3 years • In an usual computer: ~84 years

  14. Sweden

  15. Crossovers implemented • Adjacency • Crossovers: • Alternating Edges • Subtour-chunks • Heuristic • Path • Crossovers: • Partially Mapped (PMX) • Order (OX) • Cycle (CX) • Ordinal • Crossover: • Cut-and-splice

  16. Path crossovers • Partially Mapped crossover (PMX): p1 = [1 2 3 | 4 5 6 7 | 8 9] and p2 = [4 5 2 | 1 8 7 6 | 9 3]o1 = [x xx | 1 8 7 6 | x x] and o2 = [x x x | 4 5 6 7 | x x]o1 = [x 2 3 | 1 8 7 6 | x 9] and o2 = [x x 2 | 4 5 6 7 | 9 3]

  17. Path crossovers • Order crossover (OX): p1 = [1 2 3 | 4 5 6 7 | 8 9] and p2 = [4 5 2 | 1 8 7 6 | 9 3] • o1 = [x xx | 4 5 6 7 | x x] and • o2 = [x x x | 1 8 7 6 | x x] • o1 = [2 1 8 | 4 5 6 7 | 9 3] • o2 = [3 4 5 | 1 8 7 6 | 9 2]

  18. Path crossovers • Cycle crossover (CX):p1 = [1 2 3 4 5 6 7 8 9] and p2 = [4 1 2 8 7 6 9 3 5] o1 = [1 x x 4 x xxxx] … 01 = [1 x x 4 x xx 8 x]… o1 = [1 2 3 4 x x x 8 x]

  19. Adjacency crossovers • Alternating edges crossover: p1 = [2 3 8 7 9 1 4 5 6] and p2 = [7 5 1 6 9 2 8 4 3] o1 = [2 5 8 7 9 1 6 4 3] • Randomly choose an edge from the first parent, then select an appropriate edge from the secondparent, and so.

  20. Adjacency crossovers • Subtour-chunks crossover • Similar to “Alternating Edges”, but instead of switching only one element, switch a random-length subtour from one of the parents.

  21. Adjacency crossovers • Heuristic crossover • Choose a random city, then compares two edges that emanate from this city from both parents. • Choose the one with lower cost. • The city on the other end of this edge, is the next starting point.

  22. Ordinal crossover • Ordinal representation: • Reference C: C = [1 2 3 4 5 6 7 8 9] • List l of references, l = [1 1 2 1 4 1 3 1 1] • In path encoding, equal to: [1 2 4 3 8 5 9 6 7]

  23. Ordinal crossover • Cut-and-splice crossover • Take a part from one parent, and splice it with the remainder from the second parent.

  24. Strategies used: Elitism • Maintain the best individual found so far in the population. • Applied only if the population is equal or greater than 4.

  25. Strategies used: Getting out of Local Optima • Randomize one or two children when both are equal after reproduction. • This increased the performance of the GA in general, due to the high frequency of GA being stuck in a local optima. • Other option: randomize entire population if best solution does not change after Y iterations.

  26. Strategies used: Multiple Crossovers • After a while, single crossover methods start lacking variety in their reproductions. • Possible solutions: • Randomize part of the population. and/or: • Change crossover method in real time, during execution.

  27. Strategies used: Multiple Crossovers • During execution, switch crossover method when “best solution” doesn’t change during n iterations. • Conversion of all individuals is necessary if switch is between a Path and an Adjacency crossover. • Crossovers used: • Heuristic (Adjacency) • Partially Mapped (Path) • Order (Path) • Subtour-chunks (Adjacency)

  28. Tests - Djibouti Optimal tour: 6656

  29. Tests – W. Sahara Optimal tour: 27603

  30. Tests – Xqf131 Optimal tour: 564 Heuristic Heur+PMX+OX+Subtour

  31. Tests - Qatar Optimal tour: 9352 Num Iterations: 40000

  32. Tests - Qatar Optimal tour: 9352 Num Iterations: 10000

  33. Tests - Qatar Num. Iterations: 200000; Population = 4; Optimal tour: 9352 Multiple: 9910 Heuristic: 9830

  34. Tests - Uruguay Num. Iterations: 400000; Population: 8 Multiple: 236667 Heuristic: 423593 734 citiesOptimal tour: 79114

  35. Conclusion • Heuristic showed best performance between the 7 implemented. • Converges quickly to a “good” solution • But after an amount of iterations it gets “stuck” • Followed by the Order. • Ordinal with its Cut-and-splice is easy to implement and works well in some GA problems, but not in TSP.

  36. Conclusion • Multiple crossovers shows its advantages in long term executions. • Heuristics seems to be the best choice for low number of iterations and small number of cities. • Multiple technique showed to be a safer bet in long executions and bigger inputs, due to its continuous discovery of new solutions.

  37. Conclusion • What might improve the Multiple technique: • Store information about crossovers performance during execution and then select the current best techniques more frequently. • Vary number of iterations necessary to switch crossoverbased on their current performance.

  38. Questions?

More Related