Modeling Swarm Behavior
November 20, 2007
In recent posts, I have discussed how some MIT engineers foresee the day when energy can be “farmed” from crowd behavior [Energy from Crowds] and how designers are looking more often to nature to help them create better products [Turning to Nature to Save Energy]. One natural behavior that has long captivated scientists (and which relates to both crowd behavior and natural models) is swarm behavior. Carl Zimmer, reporting in the New York Times, talks about some of the fascinating advances being made in the study of swarm behavior [“From Ants to People, an Instinct to Swarm,” 13 November 2007].
“If you have ever observed ants marching in and out of a nest, you might have been reminded of a highway buzzing with traffic. To Iain D. Couzin, such a comparison is a cruel insult — to the ants. Americans spend a 3.7 billion hours a year in congested traffic. But you will never see ants stuck in gridlock. Army ants, which Dr. Couzin has spent much time observing in Panama, are particularly good at moving in swarms. If they have to travel over a depression in the ground, they erect bridges so that they can proceed as quickly as possible.”
As someone who spends more time trapped in Washington, DC, traffic than I care to think about, I’m inclined to agree with Couzin that we don’t give ants enough credit.
“The reason may be that the ants have had a lot more time to adapt to living in big groups. ‘We haven’t evolved in the societies we currently live in,’ Dr. Couzin said. By studying army ants — as well as birds, fish, locusts and other swarming animals — Dr. Couzin and his colleagues are starting to discover simple rules that allow swarms to work so well. Those rules allow thousands of relatively simple animals to form a collective brain able to make decisions and move like a single organism. Deciphering those rules is a big challenge, however, because the behavior of swarms emerges unpredictably from the actions of thousands or millions of individuals.”
I noted in one my posts referenced above that simple rules can create complex behavior. Ants have never been accused having massive brains that work out complicated survival strategies. Yet, when necessary, they build bridges, construct columns, and dig amazingly complex nests — all by obeying a few simple rules.
“To get a sense of swarms, Dr. Couzin builds computer models of virtual swarms. Each model contains thousands of individual agents, which he can program to follow a few simple rules. To decide what those rules ought to be, he and his colleagues head out to jungles, deserts or oceans to observe animals in action. Daniel Grunbaum, a mathematical biologist at the University of Washington, said his field was suddenly making leaps forward, as math and observation of nature were joined in the work of Dr. Couzin and others. ‘In the next 10 years there’s going to be a lot of progress.’ He said Dr. Couzin has been important in fusing the different kinds of science required to understand animal group behavior. ‘He’s been a real leader in bringing a lot of ideas together,’ Dr. Grunbaum said. ‘He has a larger vision. If it works, that’ll be a big advance.’ In the case of army ants, Dr. Couzin was intrigued by their highways. Army ants returning to their nest with food travel in a dense column. This incoming lane is flanked by two lanes of outgoing traffic. A three-lane highway of army ants can stretch for as far as 150 yards from the ant nest, comprising hundreds of thousands of insects.”
Since Couzin can’t read ant minds, he did the next best thing. He looked at ant biology, drafted a few rules that apply to that biology, and then let a computer model go to work.
“What Dr. Couzin wanted to know was why army ants do not move to and from their colony in a mad, disorganized scramble. To find out, he built a computer model based on some basic ant biology. Each simulated ant laid down a chemical marker that attracted other ants while the marker was still fresh. Each ant could also sweep the air with its antennas; if it made contact with another ant, it turned away and slowed down to avoid a collision. Dr. Couzin analyzed how the ants behaved when he tweaked their behavior. If the ants turned away too quickly from oncoming insects, they lost the scent of their trail. If they did not turn fast enough, they ground to a halt and forced ants behind them to slow down. Dr. Couzin found that a narrow range of behavior allowed ants to move as a group as quickly as possible. It turned out that these optimal ants also spontaneously formed highways. If the ants going in one direction happened to become dense, their chemical trails attracted more ants headed the same way. This feedback caused the ants to form a single packed column. The ants going the other direction turned away from the oncoming traffic and formed flanking lanes.”
Pleased with the results Couzin and his colleague, Nigel Franks, an ant expert at the University of Bristol in England, went to Panama and filmed army ants in motion. The reason they filmed the ants was so that could study them at leisure back in their offices. Just imagine trying to follow the actions of a few individual ants in real time — it simply can’t be done. In order to study individual behavior, Couzin and Franks had to study their film frame by frame.
“Eventually they found that the real ants were moving in the way that Dr. Couzin had predicted would allow the entire swarm to go as fast as possible. They also found that the ants behaved differently if they were leaving the nest or heading back. When two ants encountered each other, the outgoing ant turned away further than the incoming one. As a result, the ants headed to the nest end up clustered in a central lane, while the outgoing ants form two outer lanes. Dr. Couzin has been extending his model for ants to other animals that move in giant crowds, like fish and birds. And instead of tracking individual animals himself, he has developed programs to let computers do the work.”
One of the more exciting breakthroughs that Couzin has made is the realization that swarms, no matter the species, all tend to follow the same basic rules.
“The more Dr. Couzin studies swarm behavior, the more patterns he finds common to many different species. He is reminded of the laws of physics that govern liquids. ‘You look at liquid metal and at water, and you can see they’re both liquids,’ he said. ‘They have fundamental characteristics in common. That’s what I was finding with the animal groups — there were fundamental states they could exist in.’ Just as liquid water can suddenly begin to boil, animal swarms can also change abruptly thanks to some simple rules.”
Why, you may ask, are discovering the rules of swarm behavior so important? Consider the devastation caused by swarms of locusts. What if a way could be discovered to interrupt the rules that cause them to swarm? Locusts, it turns out, is one of the species Couzin is studying.
“The insects typically crawl around on their own, but sometimes young locusts come together in huge bands that march across the land, devouring everything in their path. After developing wings, they rise into the air as giant clouds made of millions of insects. ‘Locusts are known to be around all the time,’ Dr. Couzin said. ‘Why does the situation suddenly get out of control, and these locusts swarm together and devastate crops?’ Dr. Couzin traveled to remote areas of Mauritania in Africa to study the behavior of locust swarms. Back at Oxford, he and his colleagues built a circular track on which locusts could walk. ‘We could track the motion of all these individuals five times a second for eight hours a day,’ he said. The scientists found that when the density of locusts rose beyond a threshold, the insects suddenly began to move together. Each locust always tried to align its own movements with any neighbor. When the locusts were widely spaced, however, this rule did not have much effect on them. Only when they had enough neighbors did they spontaneously form huge bands. ‘We showed that you don’t need to know lots of information about individuals to predict how the group will behave,’ Dr. Couzin said of the locust findings, which were published June 2006 in Science.”
Zimmer points out that knowing “how” species swarm and “why” they swarm are two different questions.
“In some species, animals may swarm so that the entire group enjoys an evolutionary benefit. All the army ants in a colony, for example, belong to the same family. So if individuals cooperate, their shared genes associated with swarming will become more common. But in the deserts of Utah, Dr. Couzin and his colleagues discovered that giant swarms may actually be made up of a lot of selfish individuals. Mormon crickets will sometimes gather by the millions and crawl in bands stretching more than five miles long. Dr. Couzin and his colleagues ran experiments to find out what caused them to form bands. They found that the forces behind cricket swarms are very different from the ones that bring locusts together. When Mormon crickets cannot find enough salt and protein, they become cannibals. ‘Each cricket itself is a perfectly balanced source of nutrition,’ Dr. Couzin said. ‘So the crickets, every 17 seconds or so, try to attack other individuals. If you don’t move, you’re likely to be eaten.’ This collective movement causes the crickets to form vast swarms. ‘All these crickets are on a forced march,’ Dr. Couzin said. ‘They’re trying to attack the crickets who are ahead, and they’re trying to avoid being eaten from behind.’ Swarms, regardless of the forces that bring them together, have a remarkable ability to act like a collective mind. A swarm navigates as a unit, making decisions about where to go and how to escape predators together.”
That may be the true mystery of swarms, that they have a Borg-like collective mind. But even in the Star Trek series there was a queen directing the collective. That doesn’t seem to be the case in nature. It appears that which ever member of the swarm senses a danger or understands a situation becomes leader by default — the director of collective action.
“‘There’s a swarm intelligence,’ Dr. Couzin said. ‘You can see how people thought there was some sort of telekinesis involved.’ What makes this collective decision-making all the more puzzling is that each individual can behave only based on its own experience. If a shark lunges into a school of fish, only some of them will see it coming. If a flock of birds is migrating, only a few experienced individuals may know the route. Dr. Couzin and his colleagues have built a model of the flow of information through swarms. Each individual has to balance two instincts: to stay with the group and to move in a desired direction. The scientists found that just a few leaders can guide a swarm effectively. They do not even need to send any special signals to the animals around them. They create a bias in the swarm’s movement that steers it in a particular direction.”
What happens, however, when two individuals in the swarm feel a need to act? Sometimes, the swarm separates. You see that happen in schools of fish or birds in flight. But just as often, the swarm somehow manages collectively to decide on which leader to follow — at least in computer simulations.
“Two leaders may try to pull a swarm in opposite directions, and yet the swarm holds together. In Dr. Couzin’s model, the swarm was able to decide which leaders to follow. ‘As we increased the difference of opinion between the informed individuals, the group would spontaneously come to a consensus and move in the direction chosen by the majority,’ Dr. Couzin said. ‘They can make these decisions without mathematics, without even recognizing each other or knowing that a decision has been made.’ Dr. Couzin and his colleagues have been finding support for this model in real groups of animals. They have even found support in studies on mediocre swarmers — humans.”
By putting groups of people in a circle surrounded by numbers and then asking them to follow simple rules, Couzin and his colleagues could create swarm behavior.
“To study humans, Dr. Couzin teamed up with researchers at the University of Leeds. They recruited eight people at a time to play a game. Players stood in the middle of a circle, and along the edge of the circle were 16 cards, each labeled with a number. The scientists handed each person a slip of paper and instructed the players to follow the instructions printed on it while not saying anything to the others. Those rules correspond to the ones in Dr. Couzin’s models. And just as in his models, each person had no idea what the others had been instructed to do. In one version of the experiment, each person was instructed simply to stay with the group. As Dr. Couzin’s model predicted, they tended to circle around in a doughnut-shaped flock. In another version, one person was instructed to head for a particular card at the edge of the circle without leaving the group. The players quickly formed little swarms with their leader at the head, moving together to the target. The scientists then sowed discord by telling two or more people to move to opposite sides of the circle. The other people had to try to stay with the group even as leaders tried to pull it apart. As Dr. Couzin’s model predicted, the human swarm made a quick, unconscious decision about which way to go. People tended to follow the largest group of leaders, even if it contained only one additional person.”
As the rules become clearer for swarm behavior, and as we understand when and where interfering with or applying those rules pays dividends, we will have another “natural” tool in our kit. In the meantime, the studies continue to underscore the importance and power of rules and rule sets.