A pheromone is a signal ants leave as they travel. Other ants sense it and may follow the same path. In ant colony optimization (ACO), a pheromone trail is a number representing that signal’s strength on a possible path. It gives one ant a way to benefit from routes explored by others. section 6.1 section 6.5
Imagine ants choosing between two bridges to food. An ant can complete more trips on the shorter bridge, laying down pheromone more often. Its stronger trail attracts more ants, which reinforce it again. ACO uses this feedback to search for good routes, rather than requiring one ant to know the best route in advance. section 6.1
Pheromone intensity changes throughout an ACO run:
- Start every available trail at the same value, such as 1, so no path has an initial advantage. Store intensities in a matrix indexed by the two destinations. section 6.5
- When an ant chooses its next unvisited destination, combine trail intensity with a heuristic such as distance. Stronger trails and shorter paths receive larger shares of a probability-based choice; a less-favored path can still be explored. section 6.7
- After tours finish, reduce existing intensities through evaporation and reinforce trails used by ants. Better tours have greater influence. Evaporation prevents early choices from retaining their influence indefinitely. section 6.8
Choosing a carnival attraction
From the circus, the carousel is 4 meters away and has trail intensity 8; the balloons are 8 meters away and have intensity 2. Both the shorter distance and stronger trail favor the carousel. A probability-based selection makes that visit more likely, not guaranteed. section 6.3 section 6.7
pheromone_trails = [ [1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1] ]
This Python matrix shows equal initial pheromone intensities. Each row and column identifies a pair of attractions; later tours change the values. section 6.5

