The Mind of the Swarm

Math explains how group behavior is more than the sum of its parts

Few people can fail to marvel at a flock of birds swooping through the evening sky, homing in with certainty on its chosen resting place. The natural world abounds with other spectacular examples of animals moving in concert: a school of fish making a hairpin turn, an ant colony building giant highways, or locusts marching across the plains.

Many animals, such as these anchovies, move in concert. By combining experiments and computer simulations, researchers are elucidating the principles that underlie swarming behaviors. Photodisc

ON THE TRAIL. Ants’ foraging behavior may obey simple mathematical rules. iStockphoto

RAPID RESPONSE. Mathematical modeling is explaining how a school of fish can quickly change shape in reaction to a predator. Photodisc

MIGRANT WORKERS. Positive feedback explains how a few experienced birds may lead the rest during a migration. Photodisc

Since ancient times, scientists and philosophers have pondered how animals coordinate their movements, often in the absence of any leader. Coordinated groups can range in scale from just a few individuals to billions, and they can consist of an intelligent species or one whose members have barely enough brainpower to recognize each other.

Despite these differences, similar patterns of motion appear again and again throughout the animal kingdom. This congruence in behavior has led researchers to speculate for about 70 years that a few simple rules might underpin many sophisticated group motions. However, establishing just what these rules are is no easy matter.

“Imagine a space alien looking at rush hour traffic on the L.A. freeway,” says Julia Parrish of the University of Washington in Seattle, who studies fish schooling. “It thinks the cars are organisms and wonders how they’re moving in a polarized way without collisions. The reason is that there’s a set of rules everyone knows.

“We’re the space aliens looking at fish, and we don’t have the driver’s manual,” she says.

In recent years, mathematicians and biologists have started to get glimpses of just what may be in that manual. They have constructed mathematical models of animal swarms and colonies that take inspiration from decades of physics research. In physicists’ studies of magnetism, for instance, they have elucidated how simple local interactions give rise to complex, large-scale phenomena. Using a combination of computer simulations and experiments with real animals, researchers are explicating how a trio of physics and engineering principles—nonlinearity, positive feedback, and phase transitions—may be basic ingredients from which a wide variety of animal-swarming behaviors takes shape.

“This is a more and more exciting area in which to work,” says Iain Couzin, who studies collective animal behavior at the University of Oxford in England and Princeton University. “We have the mathematical foundations to investigate phenomena quickly and effectively.”

Positive food back

Anyone who has left crumbs on the kitchen counter knows the brutal efficiency with which ants can capitalize on such a mistake. As soon as one ant discovers a tempting morsel, thousands more create and follow a trail between the food source and their nest.

“Ants follow only local rules … but the resulting trail structure is built on a scale well beyond that of a single ant,” said David Sumpter of the University of Oxford in England in an article on animal groups in the January Philosophical Transactions of the Royal Society B.

In 2001, using mathematical modeling and lab experiments, Sumpter and two colleagues studied how foraging pharaoh’s ants build trails. The researchers turned up a striking group behavior: Just as water abruptly turns to ice at the freezing point, foraging behavior undergoes a “phase transition” at a certain critical colony size.

If an ant colony is small, foragers wander about randomly and, even if some of the ants discover food, no trail persists. If a colony is large, the ants’ trails build into a superhighway to the food that they find. Somewhere in between—in the case of the experimental ants, at a colony size of 700 members—the colony’s behavior switches suddenly.

While this sharp transition might seem unexpected, the researchers weren’t altogether surprised to find it because the mathematical principles underlying their model of foraging behavior make such a transition likely. When an ant discovers a food source, it deposits chemicals called pheromones along its trail back to the nest. If another ant happens to wander across the trail, it detects the pheromones and tends to follow that trail. Once it discovers the food, it will deposit pheromones of its own along the trail, reinforcing it and making future ants that encounter it even more likely to follow it—exemplifying what engineers call a positive-feedback loop. However, pheromones gradually evaporate, so if a trail is little used, it will eventually vanish.

If a colony is small, few ants wander around and they are unlikely to happen upon a trail before the pheromones evaporate. The colony collects only as much food as each ant, working independently, can find.

By contrast, in a large colony, many ants are likely to find a given trail, and their combined deposits of pheromones have a multiplicative effect on the colony’s behavior. There’s a jump in efficiency that makes a large colony more than the sum of independently working ants, Sumpter says.

In mathematical terms, the ants’ behavior is nonlinear: If a colony, say, doubles in size, its trails more than double in strength. This happens because, at any moment, a trail’s growth reflects the product of how many ants have already found the trail and how many ants are now likely to stumble upon it.

The result of this nonlinear growth is to eliminate the middle ground. If a trail doesn’t evaporate, it will burgeon into a bustling superhighway.

In each of these extremes, the individual ants are following the same rules, points out Stephen Pratt, who studies collective animal behavior at Arizona State University in Tempe. “In the old days, the focus would have been on what has changed about the animal when it goes from one state to another,” he says. “What’s new is to move the question up a level and ask how changing a single environmental variable, like density, can cause these dramatic changes in group behavior.”

Positive feedback and nonlinearity, which are ingredients in a wide range of animal interactions, enable animal groups to generate behaviors that are more than the sum of their parts, Sumpter says.

Global swarming

Phase transitions, far from being limited to ant colonies, appear to be a ubiquitous feature of animal groups. In 2002, for instance, Couzin and his team showed that a few simple rules for fish interactions yielded phase transitions between swarming behaviors.

Basing their work on a particle-interaction model from physics, the researchers represented each fish as a single particle. They assumed three rules about how the particles interact: Each fish tries to avoid colliding with other fish, stays with the group, and aligns its swimming direction with that of nearby fish within some defined zone around itself.

Variations of these rules have been studied for decades, but only recently has computer power grown to the point where researchers can simulate the movements of, say, 10,000 fish.

The researchers also assumed that fish can modify their sensitivity to their neighbors, that is, the size of their alignment zones. The team found that as the individuals’ alignment zones grow, the school’s architecture undergoes two sharp transitions.

When the alignment zone around each fish is negligible in size, so that the fish barely pay attention to their neighbors’ directions, each fish swims in a random direction within the group. At a certain critical size of the alignment zone, the fish suddenly start following each other to produce a doughnut-shaped swarm. As the alignment zone continues to grow, the fish start swimming in parallel, as in a migration.

“The model switches very dramatically and quickly between patterns,” Couzin says.

As fish take into account more and more of their neighbors, the alignment between them grows nonlinearly, leading to the sharp transitions that the team observed. While biologists have never, to Couzin’s knowledge, studied a fish school in the act of changing from one of the three swarming patterns to another, each of the patterns has been observed frequently in nature.

“When we first saw [the doughnut] pattern in the simulations, I thought ‘That’s really weird!'” Couzin recalls. “But then we found in the literature that it really does appear in nature.”

The model shows that simple rules for how fish interact with their neighbors can give rise to complex, schoolwide patterns. Couzin reports, “There’s nothing in the individual rules that says, ‘Go in a circle,’ but it happens spontaneously.”

Likewise, the model offers an explanation for how fish schools change their behaviors on the fly—for instance, if a predator suddenly appears. “Very subtle adjustments in the rules allow you to create all these structures without complicated actions on the part of the individual,” Couzin says.

Preliminary experimental evidence suggests that fish can indeed adjust the sizes of their alignment zones. Parrish and Daniel Grunbaum, also of the University of Washington, have been filming fish schools in the lab, then using computerized sensing software to track each fish’s path. “Sometimes, they pay attention to a lot of neighbors; sometimes, to just one,” Parrish says.

However, Parrish and Grunbaum caution, considerably more experimental data are needed before researchers can say with confidence that the alignment-zone model captures what fish are doing. At present, tracking fish is so computationally intensive that Parrish and Grunbaum can follow only about 16 fish at a time in the lab.

Parrish is optimistic, though, that technological advances will soon enable researchers both to track fish in their natural habitats and to quickly crunch the resulting data.

Locusts of control

In the meantime, a team made up of Couzin, Sumpter, and several other researchers has made progress in explaining one of the most dramatic of all animal swarms: a locust plague. Locust swarms—which often appear suddenly and seemingly out of nowhere—can quickly grow to a billion insects that migrate together, eating every scrap of plant matter in their path. Even in antiquity, philosophers marveled at the insects’ ability to coordinate their motion: “The locusts have no King, yet all of them march in rank,” the Bible comments.

Couzin, Sumpter, and their colleagues suspected that locusts follow rules similar to those in the researchers’ fish model. In work published in the June 2 Science, they carried out simulations and lab experiments to test this hypothesis.

Their simulations suggested that as a locust population grows denser, its swarming behavior changes from chaos to order. When the researchers tracked locusts in a small area and gradually increased the insects’ number, the small group’s behavior mirrored the model’s predictions. When there were just a few locusts, they wandered randomly, interacting only occasionally. Once the population reached 10 locusts, the insects formed small bands that changed direction frequently. At 30 locusts, the insects suddenly started marching as one.

“I think it’s surprising that it worked out that cleanly,” Grunbaum comments. “In the overwhelming majority of biological situations, you have a nice, plausible theory, but the reality works out differently.”

The model illuminates why it’s so hard to control locust swarms once they reach the density at which the insects start to march in unison: The laws of physics overwhelm human efforts to resist the migration.

Reaching a consensus

As with the pheromone model of ant foraging, the positive feedback built into the alignment-zone model helps explain how an animal swarm achieves behavior that is more than the sum of its parts. In the Feb. 3, 2005 Nature, Couzin and a group of coauthors demonstrated, through computer simulations, how a handful of informed individuals can guide the rest of a group along a migration route or to a food source, even if the group members are incapable of recognizing which individuals have expert knowledge.

“We’re not assuming anything about what these animals know—they don’t know if anyone agrees with them, and they can’t tell anyone, ‘Follow me,'” Couzin says.

The researchers assumed, simply, that the experts’ choice of direction at any given moment is balanced between their desire to move in the correct direction and their desire to align with their neighbors; by contrast, ignorant animals simply do the latter.

These alignment rules create a positive-feedback effect: The more animals are already turned in the correct direction, the more animals are likely to turn that way in the future. As long as the number of expert animals is big enough for the correct direction to get a toehold, positive feedback amplifies the experts’ influence.

The team found that the larger the group, the smaller the proportion of experts needed to get the group moving in the correct direction. In the researchers’ simulations, for example, a group of 30 ants needed four or five experts to get the group moving in the right direction, while a group of 200 could also be led accurately by just five of its members.

The researchers also studied what happens if the experts disagree. They found that the group will quickly reach a consensus and move in the direction preferred by a slight majority of the experts—although no individual knows how the experts’ preferences stack up or even who the experts are. Once again, positive feedback amplifies the majority’s tiny edge into a commanding lead.

“For humans, to reach consensus is very complicated—it requires language and recognition capabilities,” Couzin says. “But animals can do it using very simple behavioral rules.”

This simplicity has important implications. Couzin says, “It means natural selection is much more likely to find this kind of consensus behavior” than it would if consensus building required fancy cognitive skills.

Couzin and his collaborators are now testing their model in a wide range of systems, including fish and people. For instance, they’re training a few lab-kept fish in the location of a food source and then seeing whether they lead a group there.

One of the most important contributions that the mathematical models can make, Couzin says, is to give biologists concrete, testable hypotheses to pursue. “It’s so difficult to do experiments, that starting with a good theoretical basis is important,” he says. “Theory can drive new ways of doing experiments.”

More Stories from Science News on Math