A Story of Swarm Intelligence — Part 2: What Ants Know
Why can ants solve problems that defeat supercomputers?
Milan, 1991.
Marco Dorigo had a problem he couldn’t solve—which was itself the problem, because solving it was supposed to be his PhD thesis. The twenty-nine-year-old researcher at the Politecnico di Milano’s Department of Electronics and Information had been working on combinatorial optimization, the branch of mathematics concerned with finding the best arrangement among a vast number of possibilities. His advisors, Alberto Colorni and Alberto Bertoni, had pointed him toward a classic: the traveling salesman problem.
The problem sounds like a puzzle from a children’s magazine. A salesman needs to visit a list of cities, each exactly once, and return home. What’s the shortest possible route?
With four cities, this is trivial. There are only three possible routes. You can check them all in your head. But the number of routes doesn’t grow gradually. It explodes. The formula is (n−1)!/2, where n is the number of cities—and that exclamation mark is doing ferocious work. Ten cities produce 3.6 million possible routes. Fifteen cities: over 1.3 trillion. Twenty cities: more than 2.4 quintillion—a number so large that if you checked one route per nanosecond, it would take longer than the age of the universe to finish.
Mathematicians call this NP-hard, which roughly translates to: there is no known shortcut. You can’t be clever about it. You can only be exhaustive, or settle for an approximation. The traveling salesman problem had been tormenting researchers since the 1930s. The largest instance solved optimally—by a team using years of supercomputer time—would eventually reach about 86,000 cities. For anything bigger, you needed heuristics. Rules of thumb. Educated guesses.
Dorigo was looking for a new kind of guess. He’d been exploring nature-inspired algorithms—genetic algorithms, neural networks, the computational tricks that researchers were borrowing from biology. And then, through the literature on self-organizing systems, he encountered a paper from Brussels about ants.
What he read changed his career.
The Bridge Experiment
In 1989, at the Université Libre de Bruxelles, a biologist named Jean-Louis Deneubourg had designed an experiment of beautiful simplicity.
Deneubourg and his colleagues—Simon Goss, Serge Aron, and Jean-Marie Pasteels—built a double bridge connecting a colony of Argentine ants to a food source. Two paths, same destination. In the first version of the experiment, both bridges were the same length. They placed the ants at the nest, set out the food, and watched.
At first, the ants split roughly evenly between the two bridges. Each ant wandered, found food, and returned, laying a faint chemical trail—a pheromone—along its path. Other ants, encountering these trails, followed them probabilistically: the stronger the pheromone, the more likely an ant was to take that path. But since both bridges were the same length, the trails should have stayed roughly equal.
They didn’t. Small random fluctuations—a few more ants happening to choose one bridge in the first few minutes—created a slight pheromone advantage on that bridge. More ants followed. More pheromone accumulated. Within about ten minutes, the colony had converged almost entirely onto a single bridge. Which bridge it was varied randomly between trials. But the convergence itself was reliable: the colony always chose one.
This was interesting. But the second experiment was revelatory.
Deneubourg made one bridge twice as long as the other. This time, the outcome wasn’t random. In most trials, the colony converged on the shorter bridge.
The mechanism was elegantly simple. An ant taking the short bridge completed a round trip faster than an ant taking the long bridge. It returned to the nest sooner, depositing pheromone sooner, and headed out again sooner—depositing more pheromone again. In the time it took a long-bridge ant to make one round trip, a short-bridge ant could make nearly two. The short bridge accumulated pheromone faster. More ants followed. The advantage compounded.
No ant measured the bridges. No ant compared distances. No ant knew the short bridge was short. Each one simply followed a chemical gradient, laid its own trail, and walked. The colony-level optimization—finding the shorter path—emerged from the interaction of individual behaviors and the environment itself.
Deneubourg had a word for this: stigmergy. Coined by the French biologist Pierre-Paul Grassé in the 1950s to describe how termites coordinate their building, stigmergy means coordination through traces left in the environment. The ant doesn’t tell another ant which way to go. It modifies the environment—the ground, the chemical landscape—and the environment tells the next ant.
This was what grabbed Dorigo. Not the biology. The mathematics.
The Insight
Dorigo saw something in Deneubourg’s ants that the biologists hadn’t been looking for: an optimization algorithm.
Think about what the ants were actually doing. They were exploring a solution space—all possible paths between nest and food. They were evaluating solutions—shorter paths got more pheromone because ants completed them faster. And they were reinforcing good solutions—pheromone attracted more ants, which deposited more pheromone. This was a feedback loop with a direction, a system that naturally gravitated toward better answers.
But there was one more ingredient, and it was the crucial one. Pheromone evaporates.
In Deneubourg’s experiments, the chemical trails didn’t last forever. They faded over time. An ant path that was heavily traveled stayed strong; pheromone was deposited faster than it could evaporate. But a path that fell out of favor weakened and eventually disappeared. The colony could change its mind.
Dorigo realized that evaporation wasn’t a limitation. It was the entire point.
Without evaporation, the first decent path the colony found would accumulate pheromone forever. Ants would lock onto it, reinforcing it endlessly, even if a much better path existed elsewhere. The system would get stuck—what optimization researchers call premature convergence. The colony would find a local optimum and never escape.
Evaporation prevented this. It ensured that old information faded, that the colony’s collective memory was always being refreshed, that past solutions had to keep proving their worth or be forgotten. The system was simultaneously remembering and forgetting—reinforcing what worked right now while letting what used to work dissolve.
This was Dorigo’s thesis, both literally and intellectually: ants solve hard optimization problems by forgetting. Remembering good solutions is necessary but not sufficient. You also need to forget bad ones—and, critically, you need to forget them at the right rate.
Building the Ant System
Working with his colleagues Vittorio Maniezzo and Alberto Colorni, Dorigo built what he called the Ant System. The first publication appeared in 1991, as a technical report from the Politecnico di Milano and as a paper at the First European Conference on Artificial Life. The PhD thesis—titled Optimization, Learning and Natural Algorithms—followed in 1992.
The algorithm worked like this. Imagine a set of cities—the traveling salesman problem. You release a colony of artificial ants, each starting at a random city. Each ant builds a tour by choosing the next city to visit, probabilistically, based on two factors: the amount of pheromone on the edge connecting its current city to the candidate city, and a heuristic measure of how good that choice seems (typically, how close the city is). Shorter distances and stronger pheromone both increase the probability of selection.
The ant completes its tour, visiting every city exactly once and returning to the start. Its tour has a length—short or long, good or bad. Then comes the update. The ant deposits pheromone on every edge of its tour, with the amount inversely proportional to the tour’s total length. Better tours get more pheromone. Worse tours get less.
Then—and this is where Dorigo’s insight crystallizes—all pheromone on all edges evaporates by a fixed percentage. Every trail weakens. The good ones weaken too, but they’re also being replenished by the ants that keep finding them. The bad ones weaken and aren’t replenished, because fewer ants are choosing them. Over iterations, the pheromone landscape shifts: strong trails get stronger (if they deserve it), weak trails disappear.
Release another generation of ants. They read the updated pheromone landscape—a different map than the previous generation saw—and build new tours. Update. Evaporate. Repeat.
The system converges. Not instantly, and not to a guaranteed optimum, but to solutions that are remarkably good. On small instances of the traveling salesman problem, the Ant System found optimal or near-optimal routes. On larger instances, it competed respectably with established methods that had been refined over decades.
What mattered wasn’t raw performance. It was the mechanism. Dorigo had shown that a decentralized system with no central controller—where each agent made probabilistic decisions based on local information and environmental traces—could solve combinatorial optimization problems that had occupied mathematicians for sixty years.
The Evaporation Rate
Here is where the story becomes personal, the way science often does beneath its formal surface.
The evaporation rate—the percentage of pheromone that disappears each iteration—is a single number. In Dorigo’s formulation, it’s typically written as ρ (rho), ranging from 0 to 1. Set it too high, and the colony forgets too fast. Promising trails vanish before they can attract enough ants to confirm their quality. The system becomes chaotic—ants wandering randomly, no collective memory forming. Set it too low, and the colony forgets too slowly. Early trails dominate. The system freezes on mediocre solutions.
Dorigo spent months tuning this parameter. In his original experiments, values around 0.5 worked well—half the pheromone evaporating each iteration. But the right value depended on the problem, the number of ants, the relative weight of pheromone versus distance in the decision rule. It was a delicate balance, and getting it wrong could make the difference between an algorithm that converged on excellent solutions and one that wandered aimlessly.
Nature, of course, had already solved this. Over millions of years of evolution, ant species had tuned their own pheromone evaporation rates to match their environments. Argentine ants, the species Deneubourg used, had pheromones that decayed at a rate suited to their foraging range and colony size. Desert ants had different rates than forest ants. The parameter that Dorigo agonized over in his office in Milan, running simulation after simulation, was the same parameter that natural selection had been optimizing since ants diverged from wasps roughly 140 million years ago.
There’s a humbling lesson in that. A single ant has about 250,000 neurons—roughly 1/350,000th of a human brain. It can’t solve the traveling salesman problem. It can’t solve anything, really, in the way we use that word. It wanders. It lays a chemical trace. It follows the traces of others. That’s its entire repertoire.
But a colony of ants, each one doing these three things, can find the shortest path to food across a complex landscape. A colony can solve logistics problems that shipping companies pay millions to optimize—not through intelligence in any individual, but through the accumulation of simple acts over time.
Reynolds’ boids distributed intelligence across space: each bird watching its neighbors, the flock emerging from local interactions. Dorigo’s ants distributed intelligence across time: each generation of ants reading the pheromone map left by the previous generation, building on it, refining it, and—through evaporation—allowing the bad parts to fade.
From PhD to Industry
The academic world noticed slowly. Dorigo’s first publications drew moderate interest. It was his 1996 paper in IEEE Transactions on Systems, Man, and Cybernetics—titled “Ant System: Optimization by a Colony of Cooperating Agents,” co-authored with Maniezzo and Colorni—that established the algorithm formally. By then, Dorigo had moved to the Université Libre de Bruxelles, the same institution where Deneubourg had run his bridge experiments. The proximity wasn’t coincidental.
Through the late 1990s, the algorithm evolved. Dorigo and Luca Maria Gambardella developed Ant Colony System, a more aggressive variant where only the best ant updated pheromone. Thomas Stützle introduced MAX-MIN Ant System, which bounded pheromone values to prevent runaway reinforcement. By 1999, Dorigo had formalized the entire family under the umbrella of Ant Colony Optimization—ACO—a metaheuristic framework that could be applied to virtually any combinatorial problem.
And applied it was. The traveling salesman problem was only the beginning.
British Telecom became one of the first companies to apply ant-inspired algorithms to real infrastructure, as early as 1994. The application was natural: routing data through a telecommunications network is, at its core, a path optimization problem not unlike an ant colony’s foraging challenge. Data packets need to travel from source to destination through a mesh of nodes. The network is dynamic—traffic patterns shift, links fail, new nodes come online. A centralized routing algorithm must be constantly recalculated. An ant-inspired approach, by contrast, adapts continuously.
In 1998, Gianni Di Caro and Dorigo published AntNet, an algorithm for adaptive routing in IP networks. The idea was stigmergic: artificial ants traversed the network, measured delays, and updated routing tables at each node based on what they’d encountered—a digital pheromone. Nodes with faster paths accumulated stronger preferences. When tested against standard routing protocols, AntNet outperformed them across a range of network topologies and traffic patterns.
The algorithm that routed data packets through telecommunications networks was inspired by insects that predate the dinosaurs. There’s a sentence that sounds like it belongs in science fiction, but it’s engineering history.
Beyond telecommunications, ACO spread to vehicle routing—the traveling salesman problem’s angrier sibling, where fleets of trucks must serve hundreds of customers under time windows, capacity constraints, and driver schedules. It found applications in scheduling, in circuit design, in protein folding. In 2004, Dorigo and Thomas Stützle published Ant Colony Optimization with MIT Press, a comprehensive treatment that became the field’s standard reference. The book consolidated a decade of research into a mature framework.
What the Ants Actually Teach
It’s tempting to marvel at the applications and miss the deeper point. ACO is a useful algorithm. But what ants teach us isn’t just a clever optimization trick. It’s a different way of thinking about intelligence itself.
In Part 1, Reynolds showed that flocking—complex, beautiful, lifelike—emerges from three local rules with no central control. Intelligence distributed across space. In Part 2, Dorigo showed that optimization—finding good solutions to hard problems—emerges from pheromone trails that accumulate and evaporate over time. Intelligence distributed across time.
Notice what both systems share: no individual agent understands the problem being solved. A boid doesn’t know it’s flocking. An ant doesn’t know it’s optimizing. The intelligence isn’t in the agent. It’s in the interaction—between agents and agents in the case of boids, between agents and environment in the case of ants.
This is stigmergy’s real significance. An ant modifies its environment (lays pheromone), and the modified environment influences the next ant’s behavior. The environment becomes a kind of shared memory—a record of past decisions that shapes future ones. No ant stores a mental map. The map is written in the world itself.
And the map is always being erased. That’s the part that feels counterintuitive, the thesis that sounds wrong until you think it through: forgetting is essential to collective intelligence.
A system that only remembers is a system that can’t adapt. It freezes on its first decent answer and ignores all evidence that a better one exists. A system that only forgets has no memory, no learning, no direction—just random wandering. The magic happens in the space between: a system that remembers long enough for good solutions to prove themselves and forgets fast enough for bad solutions to dissolve.
This principle extends far beyond ants. Markets work this way—prices reflect collective information, but they also adjust when that information changes. Scientific communities work this way—ideas gain influence through citation and replication, but they also lose influence when new evidence contradicts them. The internet itself works this way—popular pages gain links, but irrelevant pages gradually sink.
Dorigo discovered the principle in a biology paper about ants walking across a bridge. But what he found was something more general: a theory of how collectives can be wise without any individual being smart, and how the passage of time—the fading of old information—is not a bug in this process but its most essential feature.
The Gap Between Simple and Physical
There’s one more thing the ant colony story reveals, and it matters for what comes next in this series.
Dorigo’s algorithm was a simulation. His ants were lines of code. They didn’t walk, didn’t tire, didn’t die, didn’t jam against each other in narrow corridors. They inhabited a mathematical graph where every city connected to every other city instantaneously, where pheromone deposited at iteration 50 evaporated identically to pheromone deposited at iteration 500. The algorithm worked because the world it operated in was clean and abstract.
Real ants, of course, deal with a messy physical world. They get lost. They bump into each other. Their pheromone is affected by wind, rain, and temperature. Their bridges have widths and bottlenecks—Argentine ants, remarkably, can maintain smooth traffic flow even when bridge occupancy reaches 80%, a feat human highway engineers envy. But these physical details aren’t in the algorithm. They didn’t need to be, because Dorigo was solving mathematical problems, not building robots.
This is the tension that runs through the entire history of swarm intelligence. The algorithms are simple and elegant. The principles are clear. Local rules, no central control, emergent optimization. It works beautifully in simulation. But what happens when you try to make it physical—to build actual robots that coordinate like ants or flock like birds?
That question consumed another researcher for over a decade. At Harvard, Radhika Nagpal set out to build a swarm of a thousand robots—cheap, simple, unreliable individually—and discovered that the physical world adds constraints that no simulation prepares you for.
The ants solved the traveling salesman problem by forgetting. Nagpal’s robots would have to solve something harder: remembering who they were, in a world that kept trying to make them forget.


