Computer Science Meets Biology in the Anternet

Stanford academics have discovered an unlikely link between the Internet and the harvesting tactics of ants.

Balaji Prabhakar and Deborah Gordon are Stanford professors of computer science and biology respectively. Gordon specialises in ants and recently figured out a pattern in the way ants collaborate together to gather food. She mentioned this to Prabhakar, who naturally viewed it as an algorithm and realised it was familiar.

Gordon’s findings involve the harvester ant, which feeds on scattered seeds. Unlike with some foods, an ant is capable of carrying individual seeds on its own without the help of colleagues. This means it doesn’t need to use tactics such as leaving pheromone trails so that other ants can find them and help carry back the harvest. In biological terms, the ants are acting without spatial information.

However, Gordon was working on previous research that showed the colony as a whole works efficiently: during a particularly bountiful period, more ants spring into action and begin harvesting, but when the pickings are slim, fewer ants venture out, avoiding wasted journeys.

She developed the theory that rather than ants passing on reports of findings, they instead operate under a wider and more effective system. Each ant only returns to the colony once it has found a seed. The ants remaining in the colony then keep track (consciously or not) of the rate at which ants return. An increased rate suggests a large harvest on offer in the surrounding areas at that time and provokes a greater outflow of ants going off to make collections.

Gordon put together a mathematical model and then tested it, finding there is indeed a predictable correlation between the rate of returning foragers and the resulting outflow of foragers from the colony. In the graph above, the red line is the actual rate of returning foragers, the green line the predicted resulting rate of outgoing foragers, and the blue line the actual resulting rate of outgoing foragers.

Some readers may have already made the computer science connection. For the rest of us, Prabhakar notes that this is similar to Transmission Control Protocol, the algorithm that makes sure data flows efficiently over the Internet. For individual ants setting out, read packets — the small pieces into which files are broken down before transmission. For returning ants, read acks — the acknowledgment transmitted by the recipient to the sender to confirm a packets has arrived. And for the flow of ants, read the transmission speed adjusting to the available bandwidth.

According to Prabhakar, the analogy works in a couple of other ways. For example, the colony begins its harvesting day by sending out a large number of ants at once and adjusts the flow according to the results, rather than sending a solitary ant and waiting for it to return. Similarly, TCP begins with a burst of packets.

And in the same way that a transmission can time-out and stop completely, the ants will abandon the current harvesting attempt if they don’t get any returners for a set period. The timescale is certainly different however: the ants will wait for up to 20 minutes before calling the whole thing off.

The pair concede they are a few decades too late for the ant behaviour to influence the design and implementation of TCP, but are now interested in exploring other lessons we could learn from ants. They point out that while individual ants only perform basic tasks, the colony as a whole can develop more complex capabilities, and note that “ant algorithms have to be simple, distributed and scalable,” which are qualities that work well in computing.