This Project Solves the Traveling Sales Person Problem using genetic algorithm with the following properties:
- Chromosomes decoded as cycles (solutions) of traveling
- Order 1 crossover
- Swap mutation
- Complete generation replacement
- Roulette Wheel Technique for choosing parents
- Negative of cycle distance as fitness
The code is documented using Google Style Docstring but for a detailed documentation read the documentation.md
- Python Version 3+
- numpy
- matplotlib
Run the project by running TSPG.py
Here is the results for input1.txt :
and input2.txt :
Both runs use the following parameters:
- n = 20
- k = 100
- max_generation = 1000
- crossover_probability = 0.99
- mutation_probability = 0.01
The MIT License. Copyright (c) 2017 Amin Fadaee