Skip to content

Traveling Salesman Problem solver with Ant Colony Optimisation

License

Notifications You must be signed in to change notification settings

3-24/AntColonyTSP

Repository files navigation

AntColonyTSP

Updating Pheromone Updating Tour

Pheromone Graph (left) and Tour (right) on berlin52 as time advanced

Traveling Salesman Problem solver with Ant Colony Optimisation

TSP Problem

The problem file format is same as TSPLIB.

Usage

Clone this repository and install the Python dependencies through:

pip3 install -r requirements.txt

With prepared problem.tsp file from TSPLIB, run:

python3 tsp_solver.py {problem.tsp}

It prints the cost and the tour is saved as solution.csv file.

Advanced Usages

To debug the best cost in each stage,

python3 solver.py (problem.tsp) --debug=True

To draw the pheromone graph and best tour,

python3 solver.py (problem.tsp) --plot=True

To set the population Size and the fitness limit,

python3 solver.py (problem.tsp) -p 4 -f 50000

About

Traveling Salesman Problem solver with Ant Colony Optimisation

Resources

License

Stars

Watchers

Forks

Languages