The solver uses (Mu + Lambda) Evolutionary Algorithm from DEAP framework.
pipenv install
pipenv run python -m pytest tspsolver
or
make test
with random vertices:
pipenv run python demo.py
or with specified input file:
pipenv run python demo.py -f ./data/dataset.tsv
pipenv run python demo.py --help
usage: demo.py [-h] [--file FILE] [--vertices VERTICES] [--fast]
[--generations GENERATIONS] [--verbose]
optional arguments:
-h, --help show this help message and exit
--file FILE, -f FILE input file path
--vertices VERTICES, -vert VERTICES
number of vertices to be genarated if no input file is
used
--fast use smaller population to shorten computation
--generations GENERATIONS, -gen GENERATIONS
number of generations
--verbose, -v increase output verbosity