Implementing Ant Colony Optimization (ACO) algorithm for a given Symmetric traveling salesman problem (TSP)
Taking as data the The 100-city problem A kroA100.tsp by Krolak/Felts/Nelson and additional results for 52 locations in Berlin berlin52.tsp by Groetschel
It is an optimization algorithm used to find the shortest path between points or nodes. It is developed by observing the behaviour of ants when they follow a path to their food source. Ants are essentially blind so they follow pheromone trails left behind by other ants on the path. This algorithm follows the same approach by using the probability of going to the next node as the distance to the node and the amount of pheromones.
Given a set of n nodes and distances for each pair of nodes, find a roundtrip of minimal total length visiting each node exactly once. The distance from node i to node j is the same as from node j to node i.
Yefferson Marín - (@yammadev)
Check the Jupiter notebook with details.
Generated by testing.py using library.py and stored data/*.tsp files. See results/ folder for details.
Stored in results/kroA100-results.txt
Stored in results/berlin52-results.txt
All notable changes to this project are documented in this part of the file. The format is based on Keep a Changelog.
- x for major release related to major additions or changes.
- y for minor release related to minor additions or changes in current major release.
- z for minor release related to minor additions or changes in current minor release.
- Added for new features.
- Modified for changes in existing functionality.
- Deprecated for soon-to-be removed features.
- Removed for removed features.
- Fixed for any bug fixes.
- Security in case of vulnerabilities.
Readme
edited.
Readme
edited.
aco-tsp.pdf
with paper version ofJupiter Notebook
.
Jupiter Notebook
little improvements.
aco-tsp.py
executable script exported fromJupiter Notebook
.- Code cleaning.
Jupiter Notebook
completed.- Generated files.
- Sending algorithm data to generated files, to set different values as desired.
ACO_TSP
algorithm completed.berlin52.tsp
file added -52 locations in Berlin
(Groetschel).- Testing code that output
x-space.png
,x-path-x.png
andx-results.txt
files, and store them inresults/
folder for a given.tsp
file stored indata/
. - Code optimization.
Jupiter Notebook
implementation added.
- Restructured for better code reading and implementation.
- Plotting features.
- Better code structure.
- Readme edited.
.tsp
data is readen and displayed.- Calls from
Jupiter Notebook
file.
- Initial commit with minimal
Jupiter Notebook
config. kroA100.tsp
file added - the100-city problem A
(Krolak/Felts/Nelson)