Skip to content

Latest commit

 

History

History
25 lines (20 loc) · 954 Bytes

README.md

File metadata and controls

25 lines (20 loc) · 954 Bytes

Travelling Salesman Problem

Tested on Python version: 3.7

Important: If you want to use your own coordinates for GraphicsBased TSP please note that function map_cities_onto_screen needs to be changed as it is hardcoded towards showing Poland.

Average generations to solution:

  • With graphics about 20k (population_size=20)
  • With text about 600 (population_size=100)

Text-based TSP

The program shows the cities of Poland based on a real latitude and longitude.
Possibility of adding more cities.
There are two modes available - time-bounded or repetition-bounded:

GeneticAlgorithm.run(seconds=NUMBER_OF_SECONDS)
GeneticAlgorithm.run(reps=NUMBER_OF_REPETITIONS)

Graphics-based TSP

Similar to the text-based program.
Press SPACE to toggle program PAUSE (notice that on the animation below).
TSP-gif