Parallel Ant Colony Optimization (ACO) algorithm applied to the Traveller Salesman Problem (TSP).
- The processing of ants was splited out into ant's chunks which are processed by the number of given processors.
.
βββ aco_parallel.py # parallel version
βββ aco.py # sequential version
βββ datasets/ # input datasets
βββ main.py
βββ output/ # output of utils/scripts_{parallel,sequential}
βββ plot.py # for plotting purpose
βββ README.md
βββ requirements.txt
βββ utils/
βββ script_parallel # get parallel execution time
βββ script_sequential # get sequential execution time
- Install openMPI
sudo apt install libopenmpi-dev python3-tk
- Create a virtualenv
virtualenv aco-tsp
source aco-tsp/bin/activate
pip install -r requirements.txt
For execution with 4 processes:
mpiexec -n 4 python main.py --parallel
To use the sequential algorithm instead, just run:
python main.py