Cyclic Pursuit
How a leaderless team surrounds a target with only local sensing
You have a wildfire to watch, or a drifting oil slick to box in, and a handful of drones. You want them spread evenly around the thing, and you want them to follow it if it moves. The catch: there is no air-traffic controller. Each drone can see only its one neighbor and the target itself.
Give each one the same two-line order and a clean ring assembles itself around the target. Nobody assigned the positions. The circle just happens.
This is cooperative target encirclement, and it is the everyday job behind the prettier idea of "cyclic pursuit." The rule each agent runs fits on a napkin and has two parts:
- Chase your one neighbor. Robot 1 pursues robot 2, robot 2 pursues robot 3, and the last closes the loop by pursuing robot 1. This is what spaces the team out evenly around the loop.
- Hold your distance from the target. Each agent senses the target on its own and nudges itself toward a fixed standoff radius: too close, back off; too far, close in. This is what pins the ring onto the target and lets the whole formation track it.
There is no map, no shared clock, no choreographer, and crucially no leader. Yet the team condenses into a regular polygon around the target (five robots trace a pentagon, eight an octagon) and a center that no robot ever computed. Below, you drive it yourself.
8 agents · encircling the target, error —
drag the target (◎) to move what the team surrounds · drag any agent to reshape the ring
Try this:
- Move the target. Grab the ringed marker (◎) and drag it. The whole formation chases after it and re-wraps around the new spot, even though no single robot was told to follow it. Each one is only holding its own distance.
- Count the sides at low
N. DropNto 5 and you get a clean pentagon; bump it to 8 for an octagon. The encircling shape always has exactly as many corners as there are robots. - Crowd it and watch the circle appear. Push
Nup to 12 or 14 and the polygon's corners blur into a near-perfect circle. A real perimeter looks like a smooth ring precisely because it has many robots on it. - Reshape the ring. Drag any robot off the formation. Its neighbors keep chasing it and it keeps holding its distance from the target, so the ring stretches and then heals back into shape the moment you let go.
Where you would actually use this
The reason this rule earns its keep is that it needs almost nothing. No robot needs a map of where the others are, no robot needs to be told "you take the north side." Each one watches a single neighbor and the target, and the even spacing falls out for free. That makes it the natural fit for any job that is fundamentally surround the thing and keep watching it:
- Perimeter patrol. Guard robots or drones walking a fence line, a building, or a no-fly boundary, evenly spaced and continuously circling so there is never a gap a watcher can slip through.
- Surrounding a target with only local sensing. Search-and-rescue or firefighting drones boxing in a wildfire front; marine robots ringing a drifting oil slick to contain it; a team caging a suspect vehicle. The target moves, the ring follows, and you never had to run a central planner that could fail or be jammed.
- Resilience by design. Because every agent runs the identical local rule, losing one or adding one does not break the formation, it just re-spaces. There is no leader to take out.
The "spinning polygon" you build below is not the point; it is the signature of a team that has spread itself evenly around a target using nothing but each robot's view of its neighbor and the thing it is guarding.
Why the team orbits instead of piling up
Here is the part that surprises people. If every robot aimed exactly at the neighbor it chases, the loop would just bunch everyone up on one side of the target. The even, endless orbit comes from a deliberate sideways tilt on the chase. We rotate each pursuit vector by an angle :
where is robot 's steering toward its neighbor, is the vector pointing at the agent it chases, is the gain, and is a rotation. Aim a hair to the side and you can never quite catch the one ahead; you spend forever wheeling around the loop. That perpetual near-miss is the orbit. (The standoff term, which pulls each robot to a fixed distance from the target, is what keeps the wheeling ring locked onto the target instead of drifting off.) The pursuit angle alone decides whether the ring sits still, slides slowly, or spins briskly around the target.
When the chase turns lethal
Nature ran this experiment long before robotics did, and the result is grim. Army ants navigate by following the pheromone trail of the ant ahead: cyclic pursuit, encoded in chemistry. Usually the trail leads somewhere. But if a group loses contact with the main column and the trail happens to close on itself, the loop has no exit.
The ants march in a closed ring, each dutifully chasing the one in front, around and around with no way out. Biologists call it an ant mill, or a death spiral: the column rotates until the ants drop from exhaustion. The same simple rule that builds a graceful rotating formation in your simulator is, in the wild, a self-organized way to march a thousand insects to death. Emergent behavior does not care whether the outcome is elegant or fatal.
Why some angles spiral in, some orbit, and some blow up
Write the rotation explicitly:
Stack all the robot positions into one big state vector and the dynamics become linear: , where is the cyclic coupling matrix that encodes "each robot is pulled toward the next one." Because the coupling is circulant, its eigenvalues are known in closed form, and the system's stability comes down to where those eigenvalues land in the complex plane.
The real part of each eigenvalue controls contraction; the imaginary part controls rotation. That split is exactly what the pursuit angle tunes:
- Negative real part: the formation contracts. With a pure straight-at-target chase, it collapses to the centroid.
- Pure imaginary: no contraction, just rotation: a fixed-radius orbit that never decays.
- Positive real part: the formation expands and the chase diverges.
For robots the formation stays bounded and well-behaved when
Push past and a robot is accelerating away from the neighbor it chases: the loop loses its grip and the swarm flies apart. The whole rich zoo of behaviors lives in that one rotated matrix.
The encirclement demo above adds one more term to this bare chase: a radial spring that pulls each agent toward a fixed standoff distance from the target. That term sets where the ring lives (locked onto the target, even as it moves), while the rotated cyclic chase still does all the even spacing and spinning. Spacing from the neighbor, position from the target, neither needing a leader.
Why the inward path is always a logarithmic spiral
The four-bug chase has a clean answer, and it is the same shape that shows up in a nautilus shell and the arms of a galaxy: the logarithmic spiral, also called the equiangular spiral.
Picture one beetle and the corner of the square as it shrinks. As the bugs march, the four of them always sit on a smaller, rotated square. Each bug keeps walking at the same fixed angle relative to the line running out from the center. For the square that angle is , because each corner of a square sits off the side it chases along. A curve that crosses every ray from a central point at one constant angle is, by definition, an equiangular spiral:
Here is the distance to the center, is the angle swept, and is that fixed crossing angle. Because stays constant the whole way in, the spiral is self-similar: zoom in on the path near the center and it looks identical to the whole thing. The bug winds around the center infinitely many times, yet covers only a finite distance, because the radius dies away exponentially.
For a general regular polygon of bugs the crossing angle is , and the length each bug walks before the meeting comes out to the starting radius divided by . For the square () that is , exactly the side of the square, which is why the four-bug walk equals one side length. More bugs means a flatter spiral, a longer winding path, and a slower collapse, the same trend you feel in the demo when straight-at-target chasing makes a crowded ring crawl toward its centroid.
Key takeaways
- A real job: surround and watch. Cyclic pursuit is how a leaderless team encircles a target (perimeter patrol, containing a fire or a spill) using only each robot's view of its one neighbor and the target itself. No map, no central planner, no assigned positions.
- One local rule, global order. Each robot chases its single successor and holds its own distance from the target, yet the group self-assembles into a regular polygon and tracks the target when it moves.
- The count sets the shape. Five robots make a pentagon, eight an octagon; the encircling polygon always has as many corners as robots. Crowd it with many robots and the corners blur into the smooth circle a real perimeter looks like.
- No leader to lose. Every agent runs the identical rule, so adding or losing one just re-spaces the ring instead of breaking it.
- Emergence is amoral. The same chasing that draws a clean patrol ring drives army ants into a death spiral when the loop has no target and no exit.
There is no architect here. No robot holds the blueprint of the pentagon it helps trace, just as no ant in the mill knows it is walking in a circle to its death. The shape, graceful or fatal, is simply what chasing adds up to.
That is the quiet lesson of swarms: order does not require a mind to design it. Sometimes it only requires that everyone agree to follow the one in front.