This application implements a Genetic Algorithm to solve the Travelling Salesman Problem. It implements a solution for crossover proposed by Professor Eric Braude, Boston University.
-
Clone this repository
-
Start a Python environment
python3 -m venv .env
- Activate the environment
source .env/bin/activate
- Install requirements
pip3 install -r requirements.txt
- Runs the algorithm with randomly generated cities
- Creates a line chart showing the algorithm's progress after successive generations
- Parameters for altering the data and hyperparameters for modyfing the algorithm are available as constants listed at the top of the file
- City distances are calculated automatically from lat/long coordinates
From the project root:
python3 app.py
- Runs the algorithm four predefined cities
- Creates a line chart showing the algorithm's progress after successive generations
- Parameters for altering the data and hyperparameters for modyfing the algorithm are available as constants listed at the top of the file
- City distances are calculated automatically from lat/long coordinates
From the project root:
python3 boston.py