Skip to main content
Advertisement
  • Loading metrics

Patience is a virtue: How nature achieves group navigation with minimal cooperativity

  • Anne M. Mayo ,

    Contributed equally to this work with: Anne M. Mayo, Craig Carrigee

    Roles Data curation, Investigation, Methodology, Writing – review & editing

    Affiliation Environmental Laboratory, U.S. Army Engineer Research and Development Center, Vicksburg, Mississippi, United States of America

    ⨯
  • Craig Carrigee ,

    Contributed equally to this work with: Anne M. Mayo, Craig Carrigee

    Roles Data curation, Formal analysis, Investigation, Methodology, Software, Writing – review & editing

    Affiliation Oak Ridge Institute for Science and Education, Oak Ridge, Tennessee, United States of America

    ⨯
  • Audrey B. Harrison,

    Roles Conceptualization, Investigation, Methodology, Writing – review & editing

    Affiliation Environmental Laboratory, U.S. Army Engineer Research and Development Center, Vicksburg, Mississippi, United States of America

    ⨯
  • Michael L. Mayo,

    Roles Conceptualization, Funding acquisition, Methodology, Supervision, Visualization, Writing – review & editing

    Affiliation Environmental Laboratory, U.S. Army Engineer Research and Development Center, Vicksburg, Mississippi, United States of America

    ⨯
  • Kevin R. Pilkiewicz

    Roles Conceptualization, Formal analysis, Funding acquisition, Investigation, Methodology, Project administration, Supervision, Visualization, Writing – original draft

    Kevin.R.Pilkiewicz@erdc.dren.mil

    Affiliation Environmental Laboratory, U.S. Army Engineer Research and Development Center, Vicksburg, Mississippi, United States of America

    ⨯

Abstract

Group navigation of a constrained environment can be difficult to achieve without jamming as the local density of the group increases. The ease with which insects and other cognitively simple organisms achieve this feat suggests that a distributed computing solution must be possible, wherein the complexities of the problem are broken down into a large number of individual decisions that each require only a small amount of information about the surrounding environment. We test this hypothesis by studying the collective navigational capabilities of social cockroaches and demonstrating that they avoid jams more effectively than asocial bristlebots. We leverage our observations to devise an agent-based model in which movement decisions require only four bits of external information to be distilled, regardless of the complexity of the environment or the local density of agents present. The social interaction we employ requires an agent who approaches another from behind to stop and wait for the agent in front to move out of the way before proceeding, resulting in a queue-forming tendency that precludes the formation of jams at the expense of slower individual egress through the environment. We define a metric called the effective mean crossing time for quantifying how efficiently a group of agents collectively navigates around a sequence of obstacles, and we demonstrate that our employed social interaction leads to marked improvement in this metric, especially as the local agent density increases.

Author summary

In a famous Chinese parable, a man is shown both heaven and hell. In the latter, a group of men sit around a lavish banquet table, unable to eat because their chopsticks are too long to reach their mouths. In the former, the exact same scenario plays out, except here the men feed each other. In this paper, we compare the behavior of cockroaches to that of vibrating brush-head robots, known as bristlebots, as groups of each attempt to squeeze through a narrow passage. Although the bots and the bugs have different means of locomotion, they navigate their environment in a similar fashion. As in the parable, however, a small of amount of regard for others leads to a much happier outcome. The robots try to push past each other and form logjams that block up the passage, whereas the roaches practice patience and stop and wait for those in front of them to move through the passage first. This result may seem innocuous, but it demonstrates how simple organisms, incapable of sophisticated decision-making, require only the slightest amount of sociality to collectively solve complex problems, such as how to smoothly navigate a challenging environment as a cohesive unit.

Introduction

As smart vacuums [1,2], self-driving cars [3,4], and delivery drones [5,6] continue to proliferate, their navigational algorithms will increasingly need to account for the presence of other automata. This entails being able to adaptively navigate dense, dynamic environments, which can disrupt group dynamics and lead to jamming and turbulence. These navigational challenges have been characterized in detail for schools of fish [7,8], crowds of humans [9,10], and swarms of robots [11–13].

At minimum, navigating a crowded environment requires some form of collision avoidance protocol, which must update frequently to account for the evolving positions of other autonomous agents. Collision avoidance typically takes the form of a short-ranged repulsive interaction, but this does not drive the sort of long-ranged spatial coordination required for a social group of agents to collectively navigate a confined environment and traverse the narrow space in an efficient manner. This group coordination is generally supplied by a reciprocal social interaction [14]. We refer to an interaction between agents as “social” or “cooperative” if it has a local character, typically constrained by the sensory range of the agents, that generates long-range spatial order across the group.

Although this definition of cooperativity is standard in physics [15], it is worth pointing out that behavioral biologists use the term to describe the why of group coordination rather than the how [16–19]. In other words, they focus on the costs and benefits to individual survivability that drive group coordination rather than the underlying physical mechanisms by which collective motion is achieved. While we will principally use “cooperativity” in the mechanistic physics sense throughout this manuscript, we will also discuss cooperative behavior in a confined environment from a game theoretic, cost-benefit framework more familiar to behaviorists [20,21].

Simple social interactions that drive orientational order within a group have been studied extensively [22–24]. Movement decisions are typically determined by computations involving the positions and orientations of all neighboring agents. In environments crowded with obstacles or large local agent densities, however, the high rate of visual occlusions will interfere with an agent’s ability to make accurate movement decisions using this kind of framework. The ease with which large insect swarms have been observed to maneuver around obstacles [25–28] suggests that an even simpler social interaction mechanism with lower computational overhead may be at work, facilitating a robust distributed computing solution to the complex problem of collective navigation.

To better understand how this kind of distributed computing is achieved by insect swarms, we elected to study the maneuverability of groups of American cockroaches (Periplaneta americana) as they navigate a sequence of cylindrical obstacles. To contrast with the social roaches, we repeated these experiments with completely asocial bristlebots that navigate exclusively via repulsive collisions. (Bristlebot is a generic term for a simple robot consisting of a vibrating brush head whose forward motility derives from the asymmetric angling of its rapidly oscillating bristles.) Based on our empirical observations of the roach and robot navigational capabilities, we devised an agent-based model that qualitatively reproduces the behavior of both experimental agent types, interpolating between them by modulating the strength of a rudimentary “stop-and-wait” social interaction, inspired by the queuing behavior exhibited by the roaches.

This social interaction requires agents to distinguish obstacles from conspecifics, attempting to maneuver around the former while waiting patiently for the latter to move out of their way. We demonstrate that when the local agent density is high, this social interaction leads to a quantitative improvement in the collective navigation of the crowd around a set of obstacles, consistent with the “slower-is-faster” effect documented in human crowds, vehicle traffic, and other systems in which a group of agents must pass through an environmental bottleneck [29–31]. These benefits are amplified further in cases where a fraction of the agents are set to move at a markedly slower speed and thereby obstruct the motion of the faster agents.

In the absence of any social interaction, our roach-inspired navigational algorithm requires that each agent only processes two bits of information at a time, regardless of the total number of agents present or the complexity of the environment. Addition of the stop-and-wait social force doubles this information cost to four bits, but it remains independent of crowd size or system topography.

Materials and methods

Obstacle navigation experiments

We acquired American cockroaches (Periplaneta americana) from Carolina Biological Supply (Burlington, NC, USA) and stored them in groups of twenty-five in ventilated plastic tubs. The roaches were given access to refugia (overturned egg cartons), water, and food (dry dog food pellets and yellow potatoes). They were maintained on a natural day/night cycle in a greenhouse setting. As our asocial control system, we utilized commercially available Hexbug Nano brand bristlebots.

The experimental enclosure consisted of a rectangular plexiglass frame and base (48 x 24 inches), with an internal set of walls that could be moved to vary the path width. We used a six-inch wide path for our experiments, in the middle of which we glued a diamond-shaped configuration of obstacles made from three-inch diameter plexiglass rods (see Fig 1A for a top-down schematic of the enclosure). The distance between the centers of the leftmost and rightmost obstacles was roughly a foot. The obstacle corridor opened up on the ends into a holding chamber on one side and a bait chamber on the other. The holding chamber was of sufficient size to hold all insects or robots participating in an experiment in a single layer, and a removable plexiglass barrier (colored green in Fig 1A) separated this chamber from the obstacle corridor.

thumbnail
Fig 1. Experimental setup.

A: A schematic view of the experimental enclosure. Roaches (or bristlebots) were confined within the inner walls (red) of the enclosure. The obstacle cylinders (blue) were affixed with hot glue to the floor of the enclosure so that they could be easily removed and reconfigured as desired. A rectangular gate (green) was used to keep the roaches/robots corralled in the holding chamber on the left. Note that the colors are for illustrative purposes only; the entire enclosure was constructed from clear poly(methyl methacrylate) (PMMA), i.e., plexiglass. B: Sample video frames captured from a roach (top) and bristlebot (bottom) experiment. To get the best resolution for our image-tracking analysis, the camera field-of-view only included the central corridor of the experimental enclosure. C: A photo of the entire experimental setup, including the plexiglass enclosure on the ground and the tripod-mounted camera, elevated on a table to capture a sufficiently wide view of the enclosure.

https://doi.org/10.1371/journal.pcsy.0000136.g001

For the roach experiments, we placed food in the bait chamber along with an overturned egg carton under which the roaches could seek cover. We darkened the bait chamber with black construction paper to further encourage the roaches to traverse the obstacle corridor, but we ultimately found that gently fanning/brushing against them in the holding chamber with a square of cardboard was the most effective means of driving groups of roaches to expediently cross the enclosure. The bristlebots were driven to traverse the obstacle corridor by using a gravitational bias. The holding chamber end was elevated by an angle of about 0.89 degrees to create a downwards incline towards the bait chamber that was steep enough to bias the bristlebot motion without causing slipping or tumbling down the slope.

A Basler CMOS camera (model number acA4112-30uc) with a Moritex 35mm SR series lens (model number ML-U3518SR-18C) was suspended from a tripod directly above the enclosure to capture a top-down view of the obstacle corridor. Video was captured under ambient lighting conditions at 30 frames-per-second (FPS). Sample frames from the recording of both a roach and a robot trial are depicted in Fig 1B. The overall experimental setup is shown in Fig 1C. The camera tripod was elevated roughly three feet above the ground to capture a sufficiently wide shot of the enclosure without reducing the image resolution.

For each trial, recording started upon removal of the holding chamber barrier and stopped once all roaches or robots reached the bait chamber. For trials involving a single agent traversing the enclosure, we performed thirty-four replicates for each type of agent. For trials featuring a group of ten agents, we performed five roach replicates and four robot replicates. Finally, for groups of twenty agents, we performed three roach and four robot replicates. Across all these experiments, the same roaches were tested no more than once per day in order to prevent adaptive learning from biasing their navigational behavior. Robots were switched on in the holding chamber prior to each trial and were tested for no more than five total minutes to ensure that wear on the bristles or battery depletion did not impact their motion.

The data from each recording was stored as an MP4 file and analyzed using the open-source tracking software package TRex [32]. This software tracks the motion of objects in the video across a static background by first generating an average background image and subtracting it from each individual frame in the video. We input information on the number of agents in each video, their average speed, and their approximate size in order to better guide the software to correctly identify and track each individual agent across consecutive frames of the video.

The software often struggles with collisions between agents. For example, if two roaches move too close together for a frame, the software will relabel the pair as a new single agent with a new label. In a later frame, when those two agents stray further apart again, the software will not recognize them as the same agents from before the collision, but rather as two newly created agents. Fortunately, TRex allows for manual corrections, wherein larger blobs of pixels identified as single entities by the software can be broken apart and properly relabeled. For each frame of a video, TRex will output, among other quantities, the x and y coordinates of the center of mass of each tracked agent. These coordinates are measured relative to an origin at the top left of the image with an inverted y-axis, but we converted these coordinates to a standard Cartesian system for our trajectory analyses with an origin located at the center of the leftmost boundary of the image frame. The known pixel resolution of the images was combined with the known diameter of the cylindrical obstacles to convert the pixel coordinates output by the software to centimeters, and the camera framerate (30 fps) was used to assign each frame a time in seconds. A link to a directory containing the raw TRex trajectory data for all tracked agents has been included as part of the supplementary information (S1 File).

Agent-based modeling

The simulation box for our agent-based model is a rectangular region of length L and width W. Two circular and two semicircular obstacles, each of radius R, are placed in the same diamond shaped configuration used in the experiments (see Fig 1A). To match the dimensions of the simulated system to those of its experimental analogue, we consistently used the values L = 81.98 cm, W = 14.12 cm, and R = 3.81 cm.

It has already been established that the antennae of the American cockroach play a central role in detecting environmental obstacles [33] and can be used to steer the roach around obstacles as it runs [34], and our experiments corroborate these findings. In Fig 2, we plot the trajectory of a roach in one of our single-agent experiments. The insets show actual frames from the recorded video, demonstrating how every major deflection in the roach’s path can be attributed to one of its antennae colliding with a wall or obstacle.

thumbnail
Fig 2. Roach collision-based antennal steering.

The red points are the tracked positions of the roach body centroid for each frame of a single roach experiment. (Some of the “points” are actually clusters of individual time points for intervals during which the roach paused to make directional decisions.) The walls and obstacles of the enclosure have been plotted in black for reference. Green boxes surround the points preceding major directional changes, and corresponding insets show how, in each case, its change in direction is precipitated by a collision of one of its antennae with a wall or obstacle. The collisions are marked with a red line for emphasis. In the upper-left inset, a dashed red line indicates a secondary antennal collision that occurred very shortly after another (solid red line). The final trajectory deflection that can be seen shortly before the far-right end of the enclosure (not shown in an inset) was likely caused by an antennal collision with a drop of water on the floor of the enclosure.

https://doi.org/10.1371/journal.pcsy.0000136.g002

Just as a whitewater rafter uses his oars to push off rocks or other obstacles in order to rotate the raft away from them, a running roach uses antennal collisions as the driving impetus to rotate its body away from obstacles. The principal difference, of course, is that the rotational torque needed to turn the roach is not supplied by the reactive force of the obstacle pushing back upon the encroaching antenna. Instead, this torque is supplied by the roach’s legs.

To achieve a simplified representation of this navigational mechanism, we coarse-grained the roaches in our model as circles of diameter d with two linear antennae of length l protruding from one side of the circle. The angle between the antennae is , and the agent’s configuration at any time t during a simulation is determined by a two-dimensional position, and a heading , which determines the orientations of the antennae (at angles from the positive x-axis). A sample frame from one of our simulations is shown in Fig 3A, and a closeup view of an agent is depicted in Fig 3B.

thumbnail
Fig 3. Agent-based simulations.

A: A plot of a typical configuration from one of our agent-based simulations. B: A closeup depiction of one of our model agents. C: Several agents are shown at time t in black, and their future positions at timestep t + 1, in accordance with the model rules, are shown in red. These examples illustrate the movement cases for no antennal collisions and one antennal collision with a wall or obstacle. D: The movement rules for the case of two antennal collisions with a wall or obstacle are illustrated. Once again, agent configurations at time t are shown in black. The two possible agent rotations considered by the algorithm are shown in red and blue, with red being the one selected in accordance with the model rules. E: The two pertinent cases of antennal collisions with another agent are considered. As in the previous panels, agent configurations at time t are in black and are in red for t + 1. The blue configuration for the leftmost agent is only selected for time t + 1 with probability . Otherwise, the agent retains its current configuration for another timestep.

https://doi.org/10.1371/journal.pcsy.0000136.g003

In all of our simulations, we set agent diameter d = 1 cm, antenna length l = 1.5 cm, and inter-antennal angle . The agent diameter was chosen by estimating each roach in our experiments as an ellipse and averaging over the major and minor axes of all specimens tracked. A similar average over the antennae lengths was used to estimate l. (When making these measurements, we ignored the segments of the antennae that curled back towards the roach’s body.)

The simulation box is initialized without any agents, then, at each timestep t > 0, a new agent is added to the simulation box with a probability , termed the emission rate. This probability drops to zero once N agents have been emitted, for some arbitrarily chosen cutoff N. Each newly emitted agent is initialized at x(t)=d/2 and y(t) chosen uniformly from the interval . Its orientation is initialized uniformly from the interval , where is some fixed angle . For our simulations we set . The left and right boundaries of the simulation box are treated as absorbing, so that any agent that crosses them is removed permanently from the simulation. The top and bottom boundaries are treated as reflecting in a sense that will be defined shortly.

Asocial agents

At the beginning of each time step, a check is made for each agent to determine whether its antennae are intersecting one of the reflecting boundaries, one of the circular or semicircular obstacles, or the circular body of one of the other agents. If an antenna is found to be intersecting one or more of those objects, then the antenna is said to be in collision with those objects, and we assign it a collision state of unity. If an antenna is not in collision with any objects, then it is assigned a collision state of zero. In the absence of the social component of the model, the Boolean collision state of an agent’s antennae uniquely determines how that agent will update its position and heading for the next timestep. Because this binary state does not depend upon the type of object intersected or where the intersection point falls upon the boundary of the object, an asocial agent makes its movement decisions based on only two bits of information (one bit per antenna).

At this point it is worth clarifying that we are only talking about the amount of information that an agent directly uses to make future movement decisions. Determining, for example, whether its antenna is touching something or not requires cognitive processing of haptic feedback signals that may also be augmented by visual or other sensory data. This input data may total to considerably more than a single bit of information. The result of all this mental processing, however, is a binary determination–contact or not–and it is this single Boolean that is used by the agent to decide whether it turns its heading or translates its position.

For ease of reference, it will help to uniquely differentiate the antennae of each agent. For the agent created during a simulation, its plus-antenna will be, at any time t, defined as the antenna with slope , where, as is standard, angular addition implies a counterclockwise rotation. Similarly, we define the minus-antenna as that with slope . The collisional state of this agent will be denoted , where .

In the simplest case wherein , the agent simply translates in space a fixed distance in the direction of its current heading, . (We conventionally set . The parameter v is the fixed speed of the agents.) This leads to the update rules , , and .

In the case , the agent does not translate its location, instead rotating its heading clockwise (away from the colliding antenna) until its antennal collision state returns to (0,0). While the minimal clockwise rotation needed to accomplish this can in principle be computed, the calculation is complicated, so we will instead iteratively rotate the agent by a small angle until both antennae are free from collision. If, for example, m successive rotations of are required to achieve this, then the agent is rotated by a total clockwise rotation of . If no rotation in the interval suffices to free both antennae, then the agent does not change its orientation during this time step. The case is handled analogously, except now the rotations in heading are performed in the counterclockwise direction. Fig 3C illustrates the update rules for the antennal collision states (0,0), (1,0), and (0,1).

The last case to consider is , in which both of an agent’s antennae are colliding with objects. In this case, the minimal clockwise and counterclockwise rotations required to return to the antennal collision state to (0,0) are both considered. If only one of the rotations results in , then this rotation is always selected, biasing the agents to move in the positive x-direction as is the case in the experiments. If both or neither rotations shift the orientation to the x > 0 half plane, then the smaller rotation is chosen. As in the previous cases, if no rotation can extricate the antennae from collisions, then the agent retains its current position and heading for another time step. The update rules for is illustrated in Fig 3D.

It is important to note that the update to the configuration of each agent is calculated from the same overall system configuration. Once the update for each agent is determined, they are all applied simultaneously to advance the system to its next temporal configuration. It should also be pointed out that while the navigational rules utilized in our model were principally inspired by roaches, they actually provide an adequate description of bristlebot navigation as well. While the vibration generated motility of bristlebots [35,36] is quite different from insect locomotion, the oblong shape of the bots causes collisions to exert a torque that tends to rotate the bot’s body away from the obstacle. The end result is that the roaches and bristlebots tend to take very similar paths through the experimental obstacle configuration. This similarity will be quantified more explicitly in the next section.

Including a social interaction

The social interaction in our model differentiates between antennal collisions with walls or obstacles and those with the bodies of other agents. For reasons that will be made clear shortly, our model also differentiates between two distinct types of collisions. We define a collision as mutual if one of the antennae of agent j intersects the body of agent k and one of the antennae of agent k intersects the body of agent j. The collision is non-mutual, on the other hand, if one of the antennae of agent j intersects the body of agent k but neither antenna of agent k reciprocally intersects the body of agent j. In this latter case, the colliding antenna of agent j is assigned a collision state (regardless of what other objects that antenna might be simultaneously intersecting). A mutual collision with another agent, on the other hand, results in an antennal state of +1.

If either of an agent’s antennae have a collision state of at time t, then there is a probability , which we denote as the waiting probability, that the agent neither translates nor rotates during the current time step. More explicitly, if , then, with probability , , , and . With probability , the agent instead updates as if its collision state(s) equal to were instead equal to +1. The probability thus characterizes the strength of the social interaction, with reducing the model to that for asocial agents.

The reason for distinguishing between mutual and non-mutual antennal contacts is to ensure that stop-and-wait queuing behavior only occurs when one agent approaches another from behind. If two agent’s meet face-to-face, waiting will do no good, since the agents block each other’s paths. Our rules for mutual contact ensure that agents in head-to-head collisions attempt to move around one another. Fig 3E illustrates the different update rules for mutual and non-mutual antennal contact between agents.

Implementing this social interaction increases the number of antennal collision states from two to four: none, obstacle, agent (mutual), and agent (non-mutual). This corresponds to two bits of information to process for each antenna and thus four bits of total information that an agent must process at each timestep to make its movement decisions. As discussed previously, the actual amount of sensory information processed by the agent may greatly exceed four bits. In fact, even more sensory data will be required for social agents in our model than asocial ones, since determining whether antennal contact with a confederate is mutual or not will require higher resolution sensory measurements capable of assessing configurational details of neighboring agents. The insect’s brain or the robot’s onboard processor will compile and analyze all of this sensory information to ultimately assign one of four collision states to each antenna. Those assignments will then entirely determine the agent’s next movement decision.

Results and discussion

To assess how well our model captures the phenomenology of both roach and bristlebot navigational algorithms, we aggregated the trajectory data from our single roach and robot experiments into heat maps. Rounding the dimensions of the experimental obstacle corridor down to cm and cm, we histogrammed the time points of each solo roach trajectory into bins of size 1 cm 1 cm. Combining the data across 34 solo roach experiments, we generated a heat map wherein larger (“hotter”) values correspond to more frequently traversed regions of the enclosure.

We repeated this calculation for the 34 solo bristlebot experiments as well, and in Fig 4A, we plot the comparative heatmap generated by subtracting the robot heatmap values from those of the roach heatmap and normalizing the results to the interval . In this plot, “colder” colors represent spatial regions more heavily sampled by the robots than the roaches, and “hotter” colors represent the opposite. One might worry that the almost ballistically propelled bristlebots would suffer unpredictable deflections after each head-on collision with the walls or one of the cylindrical obstacles, resulting in a chaotic and meandering path through the enclosure. If the robots did careen about the enclosure like self-propelled billiard balls, we would expect the comparative heatmap to be dominated by colder colors due to the robots sampling the obstacle corridor over a longer period of time before exiting. This is clearly not the case, and although some small differences manifest between the two types of agents, such as the roaches tending to approach closer to the left side of the rightmost cylindrical obstacle or the bristlebots exploring more of the right-side of the enclosure after exiting the obstacle corridor, the overall navigational efficiency of the individual robots seems at least qualitatively on par with that of the individual roaches. Indeed, averaging over the total number of trajectory time points for the 34 experimental robot trajectories and comparing that, with standard deviation error bars, to the same statistic for the 34 roach trajectories, we find an average of time points for the robots and for the roaches. The average time navigating the enclosure is not different by a statistically significant amount between the two types of agents.

thumbnail
Fig 4. Comparative Trajectory Heatmaps.

A: A comparative heatmap showing differences in the frequency with which roaches and bristlebots traversed different regions of the enclosure during single-agent experiments. Hotter colors indicate regions roaches traversed more frequently than robots and colder colors denote the opposite. B: An analogous heatmap, this time comparing the trajectories of individual model agents to the same roach trajectories as in panel A. C: Another heatmap, this time comparing the trajectories of the model agents used in panel B to those of the bristlebots used in panel A.

https://doi.org/10.1371/journal.pcsy.0000136.g004

Now that we have established that the roaches and robots individually navigate their environment in a similar fashion, albeit by disparate physical mechanisms, we next compare the experimental agents to the simulated ones. To make a fair comparison, we ran 34 replicate simulations of a single agent traversing the enclosure (using the simulation parameters specified by Fig 3) and generated a similar heatmap to those produced for the roaches and robots. In Fig 4B, we show the comparative heatmap generated by subtracting the roach heatmap from that of the simulated agents; and, in Fig 4C, we analogously compare the agent-based model to the robot data.

In both cases, the primary difference is that the model agents are funneled by the obstacles into oversampling a narrow band of trajectories, whereas the roaches and robots both explore more of the overall enclosure area. We could likely achieve better parity between the model and experiments if we added a stochastic contribution to the dynamics, but such quantitative agreement was never the fundamental objective of this study. Our goal was merely to reproduce the basic phenomenology of roach and bristlebot navigation with as simple and informationally efficient a model as possible.

To quantify the efficiency of group navigation in our model, we start by considering a simulation in which N total agents are emitted. We tabulate the fraction, , of those agents that get absorbed by the right boundary of the simulation box, i.e., the fraction of agents that enter from the left, navigate the obstacle corridor successfully, and then exit to the right. (The remaining agents are those that were absorbed on the left boundary, i.e., those that got turned around and exited from the same direction they originated.) For each of those agents, we enumerate the number of time steps, , that elapsed in the simulation between its emission and its absorption, and we compute the average crossing time:

(1)

This average crossing time alone is misleading, however, as it neglects the agents that turn around at jams rather than waiting their turn. Since we wish to measure the overall group navigational efficiency, the agents that fail to traverse the enclosure should also be accounted for in some measure. To that end, we divide by so that, if only half the agents successfully traverse the enclosure, the time it takes an agent on average to cross the enclosure is effectively twice the average crossing time. Although the quantities and are negatively correlated (see S1 Fig), their ratio in each simulation of an ensemble of replicates is still an independent, identically distributed random variable. We thus define the effective mean crossing time, , as:

(2)

where the angular brackets represent the ensemble average.

The effective mean crossing time can also be cast as a game theoretic payoff metric that the agents (the players) must attempt to minimize by optimally selecting a set of movement update rules (a strategy) [37]. The game itself involves the agents attempting to brave the dangers of an exposed, confined corridor in order to reach a food source on the other side. The average crossing time is insufficient as a payoff for the game because, while it decreases in value the more swiftly agents reach the food source, it does not include any penalty for agents that decide to turn around and scuttle back to the safety of the holding chamber. Dividing by the fraction of the agents to successfully traverse the enclosure, , is one way to incorporate this penalty into the payoff.

One particularly useful feature of this metric is that it can be computed from our experimental data. To accomplish this, we aggregate our data by agent type (roach or robot) and by agent number (ten or twenty). From the trajectory data extracted from each experimental video, we count every instance of an agent entering the camera frame from the left as a newly emitted agent. In cases where an agent exits on the left and then later reenters, we still count the reentering agent as if it were a new addition to the system. We ignore agents that reenter from the right after exiting, however, to be more consistent with our agent-based model, wherein new agents can only be minted from the left boundary. (We kept the right side of the enclosure open for the robot experiments to prevent any bristlebots from reentering from the right. This could not be feasibly done for the roaches, but roaches only rarely reentered from the right and usually only after most of the roaches had already egressed.) From the total number of agents counted in this manner (which may exceed the ten or twenty actual individuals taking part in the experiment), we calculate the fraction that successfully traversed the enclosure and exited on the right. We also compute the time interval between the emission and absorption of each of these agents. In this manner, we can easily compute the effective mean crossing time in Eq. (2), averaged over the replicate experiments for each condition.

The results of these calculations are plotted in Fig 5 with standard deviation error bars. To make the comparison between roaches and bristlebots more fair, we normalized the effective mean crossing times by the mean single-agent crossing times, as computed from our individual roach and robot experiments.

thumbnail
Fig 5. Effective mean crossing times for different agent densities.

The effective mean crossing time (see Eq. (2)) is plotted for roach and robot experiments as a function of the number of agents. For ten agents, the results were averaged over five roach and four bristlebot experiments; for twenty agents, the results were averaged over three roach and four bristlebot experiments. The effective mean crossing time is plotted as a red square for the roach results and a blue circle for the robot results, with standard deviation error bars plotted in each case.

https://doi.org/10.1371/journal.pcsy.0000136.g005

To determine whether there is a statistically significant difference between the roaches and robots in our experiments, we opted to use a permutation test [38], both because it is feasible to evaluate exactly for very small datasets and because it does not rely on any assumptions about the underlying distributions of the data. For experiments in which N agents were tested (N = 10,20), suppose we have roach experiment replicates and robot replicates. A permutation test is performed by pooling the values for both the roach and robot experiments and tabulating all possible permutations that divide the pooled dataset into subsets of size and . For each permutation, we compute the difference in between the two subsets (). The probability that the roach and robot data are generated by the same distribution (p-value) is then the fraction of permutations for which is greater than or equal to the value for the permutation corresponding to the true data.

For the ten-agent experiments, we calculate p = 0.988, indicating that there is no statistically significant difference between the navigational efficiency of the bugs and the bots. With so few agents, the local agent density is rarely high enough to cause jams, in which case the social interaction of the roaches makes little difference. When we increase the agent count to twenty, however, the roach queuing behavior begins to make a noticeable impact, resulting in a statistically significant (p = 0.029) difference in the (normalized) effective mean crossing times of the two types of agents. An increase in the number of individuals does not guarantee an increase to the local agent density in the obstacle corridor, since the emission rate from the holding chamber could, in principle, still be very slow. By fanning the roaches with a piece of cardboard to drive their egress, however, we ensure that the twenty roach experiments have a higher effective emission rate than the ten roach experiments. A similar trend holds for the robots, as they display no timidity about leaving the holding chamber, and their emission rate is therefore limited only by the width of the enclosure–a limit that is not approached by only ten or twenty agents.

To explore the effect of the stop-and-wait social interaction more robustly, we turn to our agent-based model and plot, in the left panel of Fig 6, the effective mean crossing time in seconds (assuming that, as in the experimental videos, one time step is 1/30 s) as a function of the waiting probability, , for four different emission rates. Each datapoint in the plot was generated by averaging over an ensemble of 100 replicate simulations with N = 100 emitted agents moving at a fixed speed v = 0.75 cm per time step. The error bars are one standard deviation. The emission rates are all given as integer multiples of a base rate, , estimated as the inverse average crossing time of a single agent traveling at speed v, averaged over 1000 replicate simulations. This base emission rate corresponds to the case in which each emitted agent can, on average, traverse the entire enclosure before any subsequent agents are emitted. All other simulation parameters were the same as those listed in the caption for Fig 3.

thumbnail
Fig 6. Effective mean crossing times vs. waiting probability.

The effective mean crossing time is plotted for our agent-based model as a function of waiting probability, , for different emission rates. Each data point represents an ensemble of 100 simulations in which 100 total agents were emitted. In the left panel, all 100 agents moved with the same fixed speed of 0.75 cm per time step. On the right, each agent’s speed was set to either 0.75 cm per time step (with probability 0.75) or 0.5 cm per time step (with probability 0.25). The base emission rate agents per time step, and the curves, from bottom to top, represent emission rates of , , , and .

https://doi.org/10.1371/journal.pcsy.0000136.g006

At the lowest emission rate tested (), there is no notable change in with increasing . As the emission rate, and thus the average local density of agents, increases, the waiting probability begins to have a more substantive impact, reducing the effective mean crossing time monotonically with increasing . At large values of , there is only a slight variation in across the range of emission rates studied, whereas there is a much larger variation for small . As expected, the collective navigational efficiency of the agents is improved by the addition of a simple stop-and-wait social interaction, and this effect is magnified as the local agent density increases.

Returning to our game theoretic interpretation, the results of Fig 6 demonstrate that despite the stopping-and-waiting method incurring a temporary cost to individual safety (stationary, exposed organisms are more vulnerable to predation), it ultimately benefits the individual by making expedient traversal of the obstacle corridor more likely. As the density of agents increases, the payoff only improves.

What happens, however, when not all the agents are equally motivated to reach the food source? The experimental roaches, unlike the simulated ones, do not all move at the same speed. While some roaches confidently navigate around the obstacles to reach the other end of the enclosure, others are more timid and indecisive. In a group of roaches, these slower moving individuals can serve as roadblocks that limit the speed of the group as a whole. In this circumstance, is stop-and-wait still an advantageous social strategy? To test this, we considered the case in which each emitted agent has a 25% chance to take on a slower speed of v = 0.5 cm per time step. The same four emission rates were probed, and the results are plotted in the right panel of Fig 6. When a fraction of the agents move more slowly and rate-limit the flow of traffic through a spatially confined region, the effective mean crossing time is universally increased compared with what is observed when all agents move at the same speed, but increasing the waiting probability monotonically reduces the payoff at a rate that increases more dramatically with increasing local agent density.

Conclusion

In this paper we have developed an informationally efficient model for adaptive navigation in a 2D plane inspired by the obstacle avoidance behavior of American cockroaches. By comparing the navigational abilities of groups of social roaches with those of asocial bristlebots, we found that the qualitative differences in their ability to collectively navigate a sequence of obstacles could be captured by the addition of a simple “stop-and-wait” social interaction that can interpolate between robot-like and roach-like behavior by varying a single tunable parameter.

In the limit of very high agent densities, this parameter can be related phenomenologically to the Reynolds number in fluid mechanics. At low values of the Reynolds number, viscous forces outweigh inertial forces, and the fluid “sticks” together more strongly, resulting in smooth flow around obstacles (laminar flow). This is equivalent to large values of the waiting probability, where queuing behavior rather than viscosity holds the agents together. At high Reynolds number, viscosity is insufficient to hold the fluid together, and some of the fluid reflects back off of obstacles, forming eddies and turbulent backflows. In our model, this corresponds to low values of , where many agents are repulsed by jamming and sent back the way they came. These agents in turn can collide with and interfere with the oncoming flow of agents, leading to something akin to turbulence [39,40].

We describe the social interaction in our model as an instantiation of “minimal cooperativity” because individual agents make their successive movement decisions based on a very minimal amount of information about the motion of their peers. Whereas the agents in other common flocking models, such as the extensively studied Vicsek model, require detailed knowledge of the orientations of all other agents falling within their sensory radii, the agents of our model make their movement decisions based only on knowledge of whether their antennae are poking another agent, and, if so, if that agent’s antennae are poking them back. As discussed earlier, this results in each individual only requiring four bits of information about its environment, regardless of the local density of other agents.

If we assume that the stochastic noise in the Vicsek model limits the measurement resolution of a neighbor’s heading and that agents retains no memory of past configurations, then the orientation of each neighbor can be assumed to fall within one of equally probable circular sectors, each with angular width . The average amount of information each agent requires to make decisions is then given by the Shannon entropy of the uniform orientational distribution, , multiplied by the average number of neighbors, . This information scales linearly with the local agent density; even for a single neighbor, one would need radians to compete with our model. (This is not an entirely fair comparison, as the agents in our model are emitted in an orientationally ordered manner, so our social interaction only needs to preserve this state as they maneuver around obstacles. In the Vicsek model and its derivatives, the social interaction must drive initially disordered agents into a flocked state.)

Implementing our navigational and social interaction model on an actual robotic platform is potentially tricky, since the capacity to distinguish obstacles from other agents, not to mention mutual from non-mutual contact, necessitates a complex sensory apparatus. We conclude this manuscript by proposing a simplified variation of our model that can still achieve efficient group navigation without requiring expensive sensory components.

The proposed robot would be shaped roughly like a cockroach, with two wire antennae attached to its head and three legs attached to either side of its body. Under normal operation, the legs would move in rotatory motion–like oars–propelling the robot forward. The antennae are to be connected to the circuits powering the legs such that when pressure is applied to the plus antenna (via a collision), the current to the opposing set of legs will be interrupted. This will result in the robot rotating clockwise, as in our model. Analogously, pressure on the minus antenna will cause the other set of legs to arrest, and the robot will rotate counterclockwise.

In cases where both antennae experience pressure, the robot will cease moving entirely, mimicking the stop-and-wait mechanic of our model. One antenna will have to be made shorter than the other so that the robot is not permanently arrested by head-on collisions with obstacles or walls. The length of the antennae will also have to be chosen carefully based on the environment to prevent the robot from getting stuck in narrow corridors due to its antennae colliding with both walls.

One attractive feature of the robotic platform we have just described is that it can attempt to “socialize” with any dynamically moving entity, making navigation alongside autonomous platforms of different shapes and sizes plausible. Importantly, this potential versatility does not depend upon any advanced sensory equipment or complex decision-making algorithms. If an agent can independently navigate its environment, then programmed patience may be the only additional prerequisite for navigating it as part of a group.

Supporting information

S1 Fig. Correlations between mean crossing time and crossing fraction.

For both the fixed-speed (red) and mixed-speed (blue) agent-based simulations, we have plotted the mean crossing time for each replicate simulation versus its crossing fraction. We have fit each curve to a best fit line and included the Pearson correlation score for each dataset to demonstrate that the two variables are strongly negatively correlated, especially in the fixed speed scenario.

https://doi.org/10.1371/journal.pcsy.0000136.s001

(EPS)

S1 File. Trajectory data.

The included data archive compiles the raw trajectory outputs from our experimental video analysis, as generated by the TRex software package (as discussed in the body of the manuscript). Due to its size, the archive has been uploaded to Kaggle and may be downloaded from the following link: https://www.kaggle.com/datasets/kevinpilkiewicz/roach-and-robot-trajectory-dataset. The data is partitioned into folders for each type (roach or robot) and number (1, 10, or 20) of tested agents. Within each experiment class folder, there is one subfolder for each experiment of that class performed. For each individual experiment, the corresponding folder includes the trajectory spreadsheet for each agent, a snapshot showing the average background image used for calibrating TRex for the analysis of that experiment, and a readme file containing some details about how to compare the pixel coordinates in the trajectory files for each experiment to actual physical measurements. It should be noted that in the ten and twenty agent experiments, there are typically more files than agents, as when an agent leaves the camera frame and reenters later, TRex treats it as a new entity.

https://doi.org/10.1371/journal.pcsy.0000136.s002

(ZIP)

References

  1. 1. Bhowmick S, Adhikari R, Dutta S. Algorithm Design for Navigation of Smart Floor Cleaner Robot. International Journal of Innovative Research in Electrical, Electronics, Instrumentation and Control Engineering. 2018;6(12):20–4.
  2. 2. Ayman I, Waleed N, El-Shabrawy T, Ashour M. Efficient Room Plan Navigation for Robot Vacuum Cleaner Using vSLAM Algorithms. In: 2023 2nd International Conference on Smart Cities 4.0, 2023. 370–7. https://doi.org/10.1109/smartcities4.056956.2023.10525912
  3. 3. Li C, Wang J, Wang X, Zhang Y. A model based path planning algorithm for self-driving cars in dynamic environment. In: 2015 Chinese Automation Congress (CAC), 2015. 1123–8.
  4. 4. Karangwa J, Liu J, Zeng Z. Vehicle Detection for Autonomous Driving: A Review of Algorithms and Datasets. IEEE Trans Intell Transport Syst. 2023;24(11):11568–94.
  5. 5. de Oliveira FMC, Bittencourt LF, Bianchi RAC, Kamienski CA. Drones in the Big City: Autonomous Collision Avoidance for Aerial Delivery Services. IEEE Trans Intell Transport Syst. 2024;25(5):4657–74.
  6. 6. Marek D, Biernacki P, Szygula J, Domański A, Paszkuta M, Szczygiel K, et al. Collision Avoidance Mechanism for Swarms of Drones. Sensors. 2025;25(4):1141.
  7. 7. Lemasson BH, Haefner JW, Bowen MD. Schooling increases risk exposure for fish navigating past artificial barriers. PLoS One. 2014;9(9):e108220. pmid:25268736
  8. 8. Ventéjou B, Magniez-Papillon I, Bertin E, Peyla P, Dupont A. Behavioral transition of a fish school in a crowded environment. Phys Rev E. 2024;109(6–1):064403. pmid:39020979
  9. 9. Xiaoping Z, Jiahui S, Yuan C. Analysis of crowd jam in public buildings based on cusp-catastrophe theory. Building and Environment. 2010;45(8):1755–61.
  10. 10. Moussaïd M, Helbing D, Theraulaz G. How simple rules determine pedestrian behavior and crowd disasters. Proc Natl Acad Sci U S A. 2011;108(17):6884–8. pmid:21502518
  11. 11. Penders J, Alboul L. Emerging robot swarm traffic. International Journal of Intelligent Computing and Cybernetics. 2012;5(3):312–39.
  12. 12. Hoshino S, Seki H. Multi-robot coordination for jams in congested systems. Robotics and Autonomous Systems. 2013;61(8):808–20.
  13. 13. Rozenblit A, Buzakov M, Molodtsova A, Dmitriev A, Olekhno N. Traffic Jam Formation in Swarms of Robots Moving Along a Circular Track with a Constriction. In: 2025 18th International Conference on Management of Large-Scale System Development (MLSD), 2025. 1–4. https://doi.org/10.1109/mlsd65526.2025.11220665
  14. 14. Vicsek T, Zafeiris A. Collective motion. Physics Reports. 2012;517(3–4):71–140.
  15. 15. Ferrell JE Jr. Q&A: Cooperativity. J Biol. 2009;8(6):53. pmid:19589184
  16. 16. GrÜnbaum D. Schooling as a strategy for taxis in a noisy environment. Evolutionary Ecology. 1998;12(5):503–22.
  17. 17. Viscido SV, Wethey DS. Quantitative analysis of fiddler crab flock movement: evidence for ‘selfish herd’ behaviour. Animal Behaviour. 2002;63(4):735–41.
  18. 18. Simons AM. Many wrongs: the advantage of group navigation. Trends Ecol Evol. 2004;19(9):453–5. pmid:16701304
  19. 19. Kasumyan AO, Pavlov DS. Evolution of Schooling Behavior in Fish. J Ichthyol. 2018;58(5):670–8.
  20. 20. Grover P, Bakshi K, Theodorou EA. A mean-field game model for homogeneous flocking. Chaos. 2018;28(6):061103. pmid:29960410
  21. 21. Frey S, Goldstone RL. Cognitive mechanisms for human flocking dynamics. J Comput Soc Sc. 2018;1(2):349–75.
  22. 22. Vicsek T, Czirók A, Ben-Jacob E, Cohen I I, Shochet O. Novel type of phase transition in a system of self-driven particles. Phys Rev Lett. 1995;75(6):1226–9. pmid:10060237
  23. 23. Cavagna A, Del Castello L, Giardina I, Grigera T, Jelic A, Melillo S, et al. Flocking and turning: a new model for self-organized collective motion. J Stat Phys. 2015;158:601–27.
  24. 24. Miguel MC, Parley JT, Pastor-Satorras R. Effects of Heterogeneous Social Interactions on Flocking Dynamics. Phys Rev Lett. 2018;120(6):068303. pmid:29481262
  25. 25. Robertson RM, Johnson AG. Collision Avoidance of Flying Locusts: Steering Torques and Behaviour. Journal of Experimental Biology. 1993;183(1):35–60.
  26. 26. Wystrach A, Schwarz S, Schultheiss P, Beugnon G, Cheng K. Views, landmarks, and routes: how do desert ants negotiate an obstacle course?. Journal of Comparative Physiology A. 2011;197:167–79.
  27. 27. Theobald J. Insect neurobiology: how small brains perform complex tasks. Curr Biol. 2014;24(11):R528-9. pmid:24892915
  28. 28. McCreery HF, Dix ZA, Breed MD, Nagpal R. Collective strategy for obstacle navigation during cooperative transport by ants. J Exp Biol. 2016;219(Pt 21):3366–75. pmid:27807216
  29. 29. Helbing D, Farkas I, Vicsek T. Simulating dynamical features of escape panic. Nature. 2000;407(6803):487–90. pmid:11028994
  30. 30. Gershenson C, Helbing D. When slower is faster. Complexity. 2015;21(2):9–15.
  31. 31. Pastor JM, Garcimartín A, Gago PA, Peralta JP, Martín-Gómez C, Ferrer LM, et al. Experimental proof of faster-is-slower in systems of frictional particles flowing through constrictions. Phys Rev E Stat Nonlin Soft Matter Phys. 2015;92(6):062817. pmid:26764754
  32. 32. Walter T, Couzin ID. TRex, a fast multi-animal tracking system with markerless identification, and 2D estimation of posture and visual fields. Elife. 2021;10:e64000. pmid:33634789
  33. 33. Ritzmann RE, Harley CM, Daltorio KA, Tietz BR, Pollack AJ, Bender JA, et al. Deciding which way to go: how do insects alter movements to negotiate barriers?. Frontiers in Neuroscience. 2012;6:97.
  34. 34. Baba Y, Tsukada A, Comer CM. Collision avoidance by running insects: antennal guidance in cockroaches. J Exp Biol. 2010;213(Pt 13):2294–302. pmid:20543128
  35. 35. Becker F, Börner S, Lysenko V, Zeidis I, Zimmermann K. On the mechanics of bristle-bots-modeling, simulation, and experiments. In: ISR/Robotik 2014, 41st international symposium on robotics, 2014. 1–6.
  36. 36. Cicconofri G, DeSimone A. Motility of a model bristle-bot: A theoretical analysis. International Journal of Non-Linear Mechanics. 2015;76:233–9.
  37. 37. Isaacs R. Differential Games. A Mathematical Theory with Applications to Warfare and Pursuit, Control and Optimization. John Wiley and Sons, New York, 1965.
  38. 38. Chung E, Romano JP. Exact and asymptotically robust permutation tests. Ann Statist. 2013;41(2).
  39. 39. Ma J, Song WG, Lo SM, Fang ZM. New insights into turbulent pedestrian movement pattern in crowd-quakes. J Stat Mech. 2013;2013(02):P02028.
  40. 40. Luo L, Xie S, Yin H, Peng C, Ong Y-S. Detecting and Quantifying Crowd-Level Abnormal Behaviors in Crowd Events. IEEE TransInformForensic Secur. 2024;19:6810–23.