/ant-colony-optimization

implementations of some optimization algorithms like Ant Colony Optimization

Primary LanguagePythonMIT LicenseMIT

Ant Colony Optimization

This script is used to solve the travelling salesman problem.

To visualize the best path & pheromone trail per iteration we can select display = True. However, the script will run much slower.

from aco import aco
from random import sample

# create 20 random nodes
x = sample(range(20), 20)
y = sample(range(20), 20)

maxiter = 20
ant_no = 10
display = True
a = aco(x, y, maxiter, ant_no, rho=0.25, alpha=1, beta=1, display=display)