Long back I introduced Wordle word clouds as part of Java gallery and then completely forgot about the gallery category. Today I was reading about ant colony optimization and came across a nice implementation of it in Java. Thought of sharing this Java application to you as part of Java gallery.
Ant colony optimization is an awesome algorithm inspired by ant’s natural intelligence. Like cockroaches, ants are extremely successful insects surviving for millions of years. Ants live in colonies and they have hierarchies among them. Physical castes are, like worker ants have responsibilities divided based on their size.
Ants communicate within themselves effectively. Their form of communication is efficient enough to help them survive for millions of years. Apart from sound, touch they use a secreted chemical called pheromone to communicate. Ants go out in search of food and once it finds a food source, on its return back to home ants spit pheromone on the trail. If it comes across obstacles during its way back, the group gets dispersed to find a shortest route.
Ants use pheromones to find the shortest path between home and food source. Pheromones evaporate quickly. Assume that there are two path trails formed by ants between its home and food source.
When an ant walks out looking for food, it will choose the path where the pheromone is denser. Since the shortest path will have denser pheromone.
Christian Borgelt has created a nice implementation of ant colony optimization in Java. It is worth having a look at it. He has used Java Swing, Awt, for UI using which the traversal for shortest path is shown.