Bram van der Kroef

Genetic Algorithm

This project tries to solve the Traveling Salesman Problem using a genetic algorithm.

map.svg

Figure 1: Three solutions the algorithm goes through to get to an optimal path.

Download

Usage

This runs the algorithm with an octagon:

python TravelingSalesman.py 26,2 62,2 87,26 87,62 62,87 26,87 2,62 2,26

You can also let it use random input:

python TravelingSalesman.py -r

Output a map to an image:

python TravelingSalesman.py -r -i map.svg

Created: 2017-01-05 Thu 10:19

Emacs 25.1.1 (Org mode 8.2.10)

Validate