This project is a C++ implementation of the Held-Karp algorithm for solving the Travelling Salesman Problem (TSP). The TSP is an optimization problem of finding the minimum Hamiltonian cycle in a complete weighted graph.
Run:
make
- To change the algorithm settings, edit the
settings.ini
file. - The settings file defines basic parameters of the algorithm as well as the instances which will be used by the algorithm.
- Example instance files are located in the
instances
directory - Instance files define the graphs on which the algorithm will be called. They can have two extensions:
Run:
./bin/main
The results will be saved as .csv
files in the directory specified in the settings.ini
file.
You can remove outlying results by running the rm_outlier.py
script.
(files from which outliers should be removed are wonderfully hard-coded in the script)
python3 rm_outliers
valgrind --tool=massif ./bin/main
Read "Maximum resident set size (kbytes)" value from:
/usr/bin/time -v ./bin/main