The app is meant as an educational, fun to watch vizualization of genetic algorithms used to solve the Travelling Salesperson Problem.
- Get/create a *.tsp file:
Sample symmetric TSP instances to test can be found on Heidelberg University's website.
Warning: TSPViz supports only instances in TSPLIB95 EUC_2D format!
- Create a config.ini file in the directory of your *.tsp file(s).
Here's a sample solver config file's content (config.ini):
algorithm_type = GA
iterations = 30000
population_size = 100
crossover_method = OX
mutation_method = SWAP
p_mutation = 0.4
-
GA - genetic algorithm
-
p_mutation - probability of mutation
- Run:
tspviz <instance>.tsp
or if you want to see the current best path cost in the terminal:
tpsviz <instance>.tsp -d
- git
- CMake >= 3.15 (for GNU/Linux also Make)
- spdlog 1.x
- SDL 2.x
- C++ toolchain with C++17 support
-
Make sure you've got all of the dependencies installed on your system.
-
Open a terminal and type:
git clone <url to this repo>
-
Go to the cloned repository's directory and create a directory named
build
-
Type:
cmake ..
then:
make
-
Test by typing:
ctest