Swarm intelligence is collective problem-solving that emerges from decentralized agents interacting. In ant colony optimization (ACO), artificial ants make local routing choices rather than relying on a global map. Their choices combine a path’s distance-based desirability with pheromone weights that record earlier success. section 8.1 section 8.4
ACO turns those local decisions into an iterative search:
- Initialize graph distances and baseline pheromone weights, then let ants choose among unvisited nodes using weighted probabilities. section 8.1
- After each tour, evaporate pheromone across the graph and deposit more on traversed edges. Evaporation discourages premature commitment to a mediocre route; deposits reinforce successful ones. section 8.4
- Keep some randomness in path selection: it helps ants explore alternatives while favoring shorter paths with stronger pheromone trails. section 8.4
Choosing a route
Imagine ants traveling from a nest among several crumbs. At each step, an ant weighs the distance and pheromone of each available path, then chooses probabilistically. After completing a tour, it reinforces the edges it used. Repeated tours can favor a near-optimal route without exhaustively evaluating every possibility. section 8.1 section 8.4
Figure 8.1 Initializing the graph for Ant Colony Optimization. The left graph shows the physical distances (d) between the Nest and the Crumbs, which determines the heuristic desirability. The right graph shows the baseline digital pheromone weights, initialized to a flat 1 across all paths before the swarm is deployed.
Compare the graph’s physical distances with its equal baseline pheromone weights before the swarm begins. section 8.1
This approach trades a guarantee of a mathematically perfect global optimum for a faster, good-enough solution when the search space is too large for exact methods. ACO is used for problems such as the Traveling Salesman Problem, network routing, job scheduling, and logistics. section 8.1 section 8.4


