Pheromones and Stigmergy
When traveling from their nest to food sources, a real ant deposits a chemical on the ground called a "pheromone." The ant uses this trail to find its way back to the nest, and other ants, which deposit more pheromone in turn, can then follow the trail. Over time, the colony of ants develops well-trodden paths, defined in part by the amount of pheromone left by ants that have previously traversed the same route. The ants never need to interact directly, as all the information about the actions of other ants comes from the strength of the pheromone trail. This indirect communication mechanism is called "stigmergy," a term that comes from the study of colonies of social insects.
How Does it Work?
The only features that ants in an ACO share with their real counterparts are:
- The ability to react to their local environment; specifically, to "smell" which of several trails is most attractive.
- A limited amount of vision, to see which of the trails in their immediate vicinity is shortest.
- The ability to deposit pheromone.
At no point does any ant have an overview of the entire network. Instead, it is limited to sensing its immediate environment. This makes the ability to solve global optimization problems all the more impressive.
The algorithm works as follows. Initially, all trails have a small, random amount of pheromone already in place.
A worker ant sets out from the first city on the tour. At each city, the ant decides which is the next to be visited. For all cities that have not already been visited, the ant rates the attractiveness of traveling to that city by evaluating the following expression:
Here, ai,j measures the attractiveness of the route under consideration between towns i and j. ci,j is the pheromone concentration on the route between the current city and the destination under consideration. The higher the amount of pheromone, the more attractive is this path. The concentration is weighted by a power term .
di,j is the length of the route under consideration. The longer the route, the less attractive it will be. This term is also weighted by another power term .
The form of this equation shows that a nearby node with a large amount of pheromone on its route will be very attractive as a potential destination. Conversely, a distant node with very little pheromone will be unattractive. However, a distant node with a large amount of pheromone may be equally likely to be chosen as a close node with relatively little pheromone.
Turning the attractiveness (or otherwise) of the various paths into a decision about which path to take is relatively straightforward. If you add together all the attractiveness measures for each valid route and divide each measure by this total, you produce the probability that a given route will be taken, which is: