A wolf pack switches from chasing prey to defending its den in an instant. Engineers have instilled this same versatility into an algorithm for a robot swarm. The key is a method proposed by John von Neumann: instead of chasing the target, the robots calculate its future moves and block escape routes, like beaters cutting off trails. Paradoxically, to catch the target, they often slow down: this reduces unpredictability and makes pursuit inevitable.
An internal guardian, a simple mechanism, ensures that in the heat of the chase, no one collides. By tweaking numerical settings, the swarm seamlessly flows from hunting to impenetrable defense. No reprogramming is needed: the swarm transforms on the fly.
Unexpected fact: the same principles are already used to analyze crowd movements: they predict crushes at stadiums and open emergency exits in advance.
A similar approach is used in autonomous driving systems: cars at an intersection 'negotiate' who goes first by predicting each other's actions.
In the TV series Stargate SG-1, the Replicators form a swarm that instantly reconfigures from attack to defense — almost like an embodiment of this algorithm.