Ant Colony Optimisation using Java

I am currrently working on a project to solve an 'advanced' TSP problem using ACO.

I have been unable to find any source code as yet for an implementation of ACO using Java. I intend to use some existing free to use code and build on top of this the features I need to solve the new TSP problem.

If anyone can post some links to some ACO code using Java which is available under GPL or similar agreement and can be run in Windows, I would be most grateful.

[477 byte] By [Eclipsea] at [2007-10-2 10:45:54]
# 1
http://www.math.tu-clausthal.de/Arbeitsgruppen/Stochastische-Optimierung/tspapplet/applet.htmlA german page with an ACO-applet. The download for the GPL-licensed code is at the very bottom. Iirc the code comments are in english language (although the GUI is german as well).
horstmeyera at 2007-7-13 2:58:25 > top of Java-index,Other Topics,Algorithms...
# 2
I am trying to develope the code for the Shortest Path Route, can somebody help me to find the source code?
AntExetera at 2007-7-13 2:58:25 > top of Java-index,Other Topics,Algorithms...
# 3
wikipedia...
DaanSa at 2007-7-13 2:58:25 > top of Java-index,Other Topics,Algorithms...
# 4
i was looking for source code to find shortest path route using ACO with java. please help me !! thanks before
ienxa at 2007-7-13 2:58:25 > top of Java-index,Other Topics,Algorithms...
# 5

> i was looking for source code to find shortest path

> route using ACO with java. please help me !! thanks

> before

Well you can be sure that the guys who started this thread over a year and a half ago will be checking out this late breaking request and be posting their code Real Soon Now. Presumably, since they have had a year and a half to get this assignment written and handed in, it is bound to be super-optimized code by now.

While you are waiting for the code, in order to help you understand it when it comes in, you might want to think about how you would organized the parts that have to be there so that you can recognize them when you look at their source.

So refresh me on the algorithm. How does it work exactly. You have a bunch of ants, wandering the paths between the cities. Each one sprays a pheremone on the path, and the strength of that decays with time. Ants for the most part follow the pheremone trail, choosing paths somewhat randomly prefering paths where the scent is strong to ones where it is weak.

So how is it that you prevent an ant from just backtracking down a path that it has just scented, How do you encourage ants to collect all the cities (does each ant keep track of where it has been and thus restricts its random choice to avoid backtracking - that sounds promising). What drives this to optimizing the TSP? I guess, if the scent decays with time, shorter cycles will end up with stronger scents IF you correctly model the time it takes an ant to walk the path with the scent decay.

Did your professor give you any clues, or did he just tell you, "Go solve the TSP using ACO." and expect you to look up the acronyms and everything.

I mean, if your question is about how the algorithm works, you are in the right place. Tell us the algorithm you were given and we will try to explain it. If the algorithm is clear and you are just confused about how to code it in java you belong over in the new to java forum, and finally if you just want free food I suggest trying the Salvation Army, I understand that they sometimes hand out bread and soup to those in need.

There is an amusing irony in this particular post for those of you that see it. The forum is itself organized around an ACO. Random ants hit the site and make mostly random choices about which trail to follow in the forum. True they have some purpose, either looking for the answer to a particular question, or perhaps they have a few minutes to answer a particular question, BUT the most frequently traveled paths are always brought to the top of the queues and thus those with the strongest scent are the ones that are most likely looked at and the ones most likely sprayed with a new scent layer.

When a new or an old topic pops up to the top of the chart, we cruise over and sniff the end of the trail and see if there was perhaps something new and edible at the end and then either we refresh the scent ourselves or decide that it is not really interesting and just let it die.

What we have here, and in fact what we have had in the last several posting to the algorithm portion of the forum are several quite old paths, long ago abandoned which have been recently ressurected by some poor lost ant that possibly didn't notice the date on the posting. These ants appear to be unaware that the scent is long dead on those paths and so they sprayed them and brought them back up to the front of the queue for reconsideration.

No particular point to this analogy, I mention it simply as an amusement, a little tid-bit, for those of you that were forced to sniff yet another, "Gimme da codes, plz!" pheremone.

NRN

Enjoy!

marlin314a at 2007-7-13 2:58:25 > top of Java-index,Other Topics,Algorithms...