Skip to content

Latest commit

 

History

History
48 lines (32 loc) · 1.16 KB

README.md

File metadata and controls

48 lines (32 loc) · 1.16 KB

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