Travelling Salesman Problem by ACO PDF Print E-mail
Programming - java

I did this project for my class of machine learning at Mississippi State University. It is a simple demonstration of how ant colony optimization technique can be used in routing problems. This is first code i have ever written for ACO, just to understand how things work in the machine learning technique. I have several other techniques used, but ACO was my own exploration out of what we had planned for the course. I translated the code by Eric Rollins written in Python to Java Applet, thanks to Eric, I not needed to reinvent the wheel. The really liked this technique and expect to use this technique in my research at some point of time.

The code is totally academic and can be mapped with Eric's code if you know both Java and Python. I understood his code and implemented it on my own.

 

Pseudo Code for the Source Code

For each ant:

  1. Initialize the problem
    • Initialize the cities coordinates
    • Calculate distance  between cities
    • Initialize Pheromone of each edge between cities to zero
  2. Randomly generate a path ( considering current Pheromone  of the link)
  3. If the generated path is better than best found yet, increase Pheromone of each edge on the path by 5.
  4. Update the best known path.
  5. Evaporate Pheromone

Java Applet

Source Code

Last Updated on Monday, 17 May 2010 21:38