Stability and Responsiveness in a Self-Organized Living Architecture

Robustness and adaptability are central to the functioning of biological systems, from gene networks to animal societies. Yet the mechanisms by which living organisms achieve both stability to perturbations and sensitivity to input are poorly understood. Here, we present an integrated study of a living architecture in which army ants interconnect their bodies to span gaps. We demonstrate that these self-assembled bridges are a highly effective means of maintaining traffic flow over unpredictable terrain. The individual-level rules responsible depend only on locally-estimated traffic intensity and the number of neighbours to which ants are attached within the structure. We employ a parameterized computational model to reveal that bridges are tuned to be maximally stable in the face of regular, periodic fluctuations in traffic. However analysis of the model also suggests that interactions among ants give rise to feedback processes that result in bridges being highly responsive to sudden interruptions in traffic. Subsequent field experiments confirm this prediction and thus the dual nature of stability and flexibility in living bridges. Our study demonstrates the importance of robust and adaptive modular architecture to efficient traffic organisation and reveals general principles regarding the regulation of form in biological self-assemblies.


Introduction
The functional complexity of many collective biological organisations, including aggregates of cells [1], tissues [2,3] and organisms [4][5][6], derives from the integration and processing of information between system components. Tissue and organ functions emerge from mechanical, chemical and/or electrical communication among cells, and many collective activities of group-living animals result from relatively locally-mediated interactions [4][5][6][7][8]. Collective dynamics are also prevalent in human societies; networks of social interactions influence a wide range of social processes such as adoption of health behaviour [9], the spread of opinions [10,11], gossip [12] and the spontaneous formation of lanes, jamming and oscillatory flows in pedestrian crowds [13][14][15][16].
Effective traffic organisation is not only central to the success of many modern human societies -it is a crucial feature of coordinated action in many social insects [17][18][19][20]. For example under crowded conditions, the black garden ant Lasius niger maintains an optimal rate of food return by either spontaneously dividing the traffic on their foraging trails between different routes [18], or by alternating clusters of inbound and outbound ants when no other route is available [19]. Near-blind army ants of the genus Eciton offer some of the most spectacular examples of behavioural and physical adaptations to minimise congestion, and to regulate traffic flow. They live in large colonies (on average 700,000 ants [21][22][23]), and live their lives at a high tempo; Eciton burchellii workers, despite being approximately 1 cm long, form vast dendritic trail networks that can extend over 100 m with individual ants maintaining speeds of 13 cm s 21 [17] (8 cm s 21 when carrying prey items [24]).
Their high rates of traffic flow must be maintained over highly unpredictable and irregular terrain in order to maintain the preycapture rate required for colony survival [25]. They thus face challenging traffic coordination problems. An important part of their strategy is their capacity to modify their environment using their own bodies as structural components to fill holes, span gaps, pass overhanging banks and direct flow on sharply-angled turns [21][22][23][24][25][26]. These self-assemblages form by ants linking together legs and bodies with special tarsal claws (see Fig. 1a), a morphological adaptation which also allows them to form temporary nests (''bivouacs'') [26].
To date, it is neither clear how these structures form or whether, and if so how, they are regulated. However the response of individual ants to environmental heterogeneities has been investigated [24]. On uneven terrain, individual workers can use their bodies to plug 'potholes', remaining still as long as a consistent flow of traffic is maintained over their body. While offering important insights regarding the rules of thumb adopted by ants in filling holes, this study did not consider the spanning of larger gaps that would require the coordination of multiple ants. Recent experiments with fire ants have investigated collective formation of living rafts to survive flooding events [27]. Ants reaching the raft edge, and perceiving water, exhibit a small probability to attach to the edge instead of walking back. This simple rule is sufficient to generate quickly growing rafts during initial moments of flooding that can remain stable for its duration.
Army ant bridges must be consistently produced and remain coherent and functional within widely varying habitats and under variable traffic conditions. Here we employ an integrated experimental and theoretical approach to reveal how these ants, each of which has access only to relatively local sensory information, coordinate such robust, yet flexible, architectures. We identify the individual-level rules employed by ants when constructing and maintaining bridge structures and reveal how these relate to the functional properties of bridges as a collective structure including exceptional versatility, resilience and faulttolerance.

Dynamics of bridge construction
Army ant bridges are highly dynamic entities, reforming very quickly following removal (see Movie S1). We analysed the dynamics of bridge construction using the following procedure: a natural bridge was located on a trail and filmed for a 10 minute interval following which all ants in the bridge were removed with tweezers (the duration of removal being ,1 s); consequently the bridge (typically) reforms, a process we filmed for 10 mins before all ants in the bridge were again removed. This process of removal and reconstruction was repeated twice more, such that each experiment contained a baseline period (during which the ''natural'' bridge was filmed) and a total of three 10 minutes replicates in which the bridge was successively removed and reconstruction was filmed. Thirteen of twenty bridges experimented upon in this way were analysed. Of the seven excluded bridges, it was not possible to satisfactorily observe the ants in four cases, and in the three other cases the ants altered the course of flow after the removal of the first bridge, voiding subsequent trials.
The number of ants participating in the bridge structure, as well as the outward and return flow of ants across the bridge, was recorded for 120 seconds, in 10 second intervals, prior to, and after, each removal of the bridge. Flow rate was measured as the number of individuals that fully crossed the gap. Therefore, individuals that entered the bridge structure were not incorporated into the flow rate, while ants voluntarily exiting the bridge were counted in the flow rate. In addition the size of each gap spanned by a bridge was measured as the longest distance between the objects (leaves or branches) to which the ants are attached on each side of the gap (see Fig. 1a). Gap lengths ranged from 7 mm to 26 mm, with an average length of 14.92 mm. We also measured the bridge width as the longest distance between ants along a line perpendicular to the length of the gap. Bridge width ranged from 8 mm to 55 mm, with all but 2 bridges between 8 mm and 18 mm wide. Note that bridge width was never found to have a significant effect in any of the subsequent analysis and therefore will not be considered in the rest of this study.
The traffic during the two minutes before and after the removal of the bridge is shown in Fig. 1b. Since it was stable prior to removal (GLMM, traffic at 2120 vs traffic at 2120 to 210 sec: N = 936, p.0.05 in every case) we aggregated traffic occurring over a two minute period preceding the manipulation to serve as a baseline with which to compare to traffic flow following bridge removal. After bridge removal traffic recovers quickly, reaching the baseline value after only 30 seconds (GLMM, traffic at 30 sec vs. baseline traffic: N = 936, z = 0.838, p = 0.402). A small but significant excess of traffic occurs from 40 to 100 seconds after bridge removal (GLMM, traffic at 40 to 100 sec vs. baseline traffic: N = 936, z = 4.847, p,0.0001), likely due to the accumulation of ants on each side of the gap. After 110 seconds, traffic resumes its baseline value (GLMM, traffic at 110 to 120 sec vs. baseline traffic: N = 936, z = 0.664, p = 0.507).
The corresponding number of ants forming the bridge both before and after bridge removal is shown in Fig. 1c. As with traffic dynamics, bridge size is stable during the two minutes prior to the removal and thus can serve as a baseline value with which to compare the reconstruction process (GLMM, bridge size at 2120 vs bridge size at 2120 to 210 sec: N = 936, p.0.05 in every case). The number of ants participating in the structure increases with time after bridge removal, but does not reach the baseline value (GLMM, traffic at each 10-second period vs. baseline traffic: N = 936, p = ,0.0001 in every case); after two minutes, the number of ants participating in the structure represents on average 71% of the baseline value. After 30 seconds, which corresponds to the time after which the traffic over the gap has fully recovered, the number of ants participating in the structure represents on average only 43% of the baseline value. This suggests that only a minority of ants in the bridge are actually necessary to handle the traffic. We also tested the effect of three covariates on the number of ants forming the bridge: the global traffic flow over the gap; the proportion of ants returning toward the bivouac; and the gap length. Only the gap length has a significant effect (GLMM: N = 936, z = 2.409, p = 0.016), with an increase of the number of ants forming the bridge with the gap length.

The behaviour of individual ants in bridges
In order to relate individual behaviours to the dynamic properties of bridges we recorded the times of arrival and departure, and the incoming direction of the ant (from the bivouac or raiding front) and the caste, for all ants that participated in bridge construction during the 2 minutes after each bridge removal. For all ants that did not participate in bridge construction, we recorded the times of arrival and the incoming direction only, the caste being difficult to assess in moving ants due to their high speed and the low shutter speed of the camera. Individual ants participating in the structure of the bridge were classified into four separate castes, using a visual sorting method that Franks [25] developed and demonstrated to be highly accurate.

Author Summary
While migrating, the nomadic army ant Eciton burchellii forms long trails of workers that can extend over hundreds of meters in the rain forest. To facilitate the movement of sometimes millions of individuals on uneven and unpredictable terrains, part of the ant workers link together their legs and bodies to form temporary bridges over gaps along the trails. In this work we showed that these bridges were formed readily when the flow of ants hit an unspanned gap and were dismantled very quickly after traffic has ceased on the trail. However, we also observed that the bridges were formed and remained stable under a large spectrum of the traffic intensities on the trail. Using field experiments and computer simulations we discovered the construction rules used by the ants to create these living structures that are capable of enduring variations of the traffic while remaining highly responsive to its interruption. These results offer important insights about the mechanisms that regulate biological selfassemblies and they have potential applications in swarm robotics and swarm intelligence.
In addition we calculated the localised flow rate (recorded as the number of passing ants exhibiting observable tactile contact with the body or antennae of that ant) for 50 separate individual ants (10 individuals randomly selected from 5 separate experiments) that left a bridge voluntarily. These individuals were selected among those that joined the bridge after its removal and they were followed until they left the bridge (for a maximum interval of 10 minutes after which a new bridge removal was performed). To ensure that individuals were really within the bridge structure prior to determining flow rate, only ants that were immobile for at least 10 seconds in the bridge were included in this sample. As much as possible, these ants represent the full range of different durations of time spent in the bridge. The position of the observed ants (edge or centre of the bridge), and the number of surrounding ants to which the focal ant appeared connected (i.e., we could observe a direct contact between the legs of the focal individual and the surrounding ants), was also recorded. We considered ants to be in the centre of the bridge if they were surrounded by at least one other ant on each of their right and left side. Otherwise ants were considered to be on the edge of the bridge.
Ants are more likely to decide to participate in bridge formation if the traffic on the trail (GLMM: N = 15216, z = 2.767, p,0.01) and if the packing density of the bridge (the number of ants participating in the structure divided by the length of the gap) at the instant when the focal ant joins the structure (GLMM: N = 15216, z = 22.671, p,0.01) are lower. The sooner ants participate in bridge formation, the longer they remain as part of the structure (CPHM: N = 449, z = 4.002, p,0.0001). This duration also increases with the packing density of the bridge at the instant when the focal ant joins the structure (CPHM: N = 449, z = 25.337, p,0.0001; see Fig. S1, inset) and is affected by the caste of the ant (see Fig. 2a), minor ants spending more time as part of the structure than media (CPHM: N = 449, z = 2.141, p = 0.0323) and sub-major/major ants (CPHM: N = 449, z = 2.476, p = 0.0133). This suggests a specialization of minor ants in the building of self-assemblage structures, an assumption supported by the over representation of this caste in bridges and bivouacs (see Fig. 2b): the percentage of minor ants in this structures -resp. 31.8% (293/920) and 33.7% (193/573) -is considerably higher than the one found in raiding trails -22% (729/3314; data for bivouacs and raiding trails from [25]). Note that an opposite tendency is found for media ants (resp. 63.2% -582/920 -, 62.1% -356/573 -and 74.5% -2471/3314). The incoming direction of the ant (from the bivouac or from the raiding front), and the total volume of traffic over the gap, however, do not affect significantly the time spent by ants in the structure of the bridge (CPHM: N = 449, p.0.05 in every case).
A survival analysis of the time spent by ants as part of the bridge confirms the existence of a stable core of ants, with about 50% of the ants joining a bridge structure remaining part of it after two minutes. The shape of the survival curve suggests that these ants might actually stay in the bridge for much longer periods of time (see Fig. S1), and extended observations of a subset of 50 ants showed that some ants stayed in the bridge for up to 500 seconds (which corresponds to the maximum observation time, see Fig. 3a).
Unlike our previous analysis of the influence of the total volume of traffic, detailed analysis of the aforementioned subset of 50 ants demonstrates that local traffic intensity strongly (and predictably) influences the time an individual remains as part of a bridge ( Fig. 3a; GLMM: N = 50, p,0.0001). Furthermore -as suggested by the packing density -as the number of connected ants increases so does the time spent in the bridge ( Fig. 3b; GLMM: N = 50, p = 0.016). These variables (local traffic intensity and number of surrounding ants) are significantly correlated (Pearson's productmoment correlation: t = 3.3927, df = 48, p = 0.0014), but removing one or the other variable from the GLMM results in a lower goodness of fit as evaluated with the Akaike Information Criterion and the Bayesian Information Criterion. This suggests that the two effects may be additive. One explanation for the existence of this correlation comes from the spatial organisation of the bridge; ants in the middle part of a bridge experience a significantly higher overhead traffic (see

Model simulations and bridge response to traffic variations
To formalise the relationship between individual-level behaviour and the dynamics of bridge self-assembly we develop, and analyse, a data-driven, pseudo-spatial individual-based model of the ants' behavior (IBM, see Material and Methods section below for a detailed description of the model). This allows us to validate our understanding and to explore further the stability of the bridge structure under varying traffic conditions, thus allowing us to make explicit and testable predictions.
Robustness of ant bridges to typical traffic fluctuations. In order to investigate how bridges respond to regular traffic conditions we need to determine the nature of typical fluctuations in traffic flow on real trails. We analysed fifty-seven foraging trails using an automated technique employing optical flow ( [28]; see Movie S2 for . It also shows that ants joining the bridge earlier are less likely to leave it. (b) Distribution of the different castes across three different dynamic structures (bridgen = 920 -, bivouac -n = 573 -and raid -n = 3314). The proportion of minor in the bridge is similar to the one found in bivouac, but different from the one found in the raiding trail. The inverse tendency can be observed for media ants. Data for bivouacs and raiding trails from [25]. doi:10.1371/journal.pcbi.1002984.g002 an example and Fig. S3 for comparison with manually tracked data). Army ant traffic exhibits consistent periodic dynamics, an example of which is shown in Fig. 4a. The distribution of dominant frequencies of these oscillations reveals a median period of 3.4 seconds (Fig. 4b).
These oscillations likely result from physical interactions and speed differences between the ants, analogous to what happens in vehicular traffic jams [29,30] or in pedestrian crowds [14,15].
We tested the effect of the traffic intensity on the ability of the ants to bridge a gap in the parameterized simulations.   increases nonlinearly as a function of traffic intensity (Fig. 5a,  inset). As a consequence, the stability of the bridges does not increase linearly with the intensity of the traffic on the trail; instead, the transition between unstable and stable bridges as a function of the flow rate is closer to being a step function.
We can now ask the following question: how robust are bridges to naturalistic periodic fluctuations in l? To do so we simulated bridge construction under oscillatory traffic conditions, representing those found in our experimental data (see Fig. 4). Simulated traffic oscillated as a square signal of constant period and intensity; due to the 1 second time step of the simulation using a sinusoidal signal would artificially result in irregular oscillations for short periods. Investigating oscillation periods between 1 and 20 seconds, and flow between 0 and 100% of the maximum traffic intensity (3 ants/sec), we find that the proportion of time during which the gap is not empty decreases with the intensity of the oscillations (see Fig. 5a, moving along intensity axis, from left to right). However this effect does not change in a monotonic way with the oscillation period. A simulated bridge is more likely to form if the oscillations have a period of 3 seconds, whatever the traffic intensity (see Fig. 5a, moving along period axis, from top to bottom). This optimal period is very close to the dominant oscillation period we found in natural ant traffic The stability of simulated bridges decreases non-linearly with the period of the oscillations, providing evidence that bridges act as buffered systems remaining unresponsive to a range of moderate fluctuations and specifically damping the impact on bridge construction of the most frequent forms of inherent traffic oscillations, and therefore stabilizing bridges under normal foraging conditions.
Response to sudden changes in traffic intensity. The non-monotonic response to oscillation intensity is suggestive that army ants may have evolved to simultaneously be robust to moderate perturbations (such as those experienced most often) yet remain sensitive to large, sporadic variations in traffic caused by disruptions of the trail (e.g., as resulting from a branch falling on a trail, disturbance through rain [22], or when a trail comes under attack as, for example, through kleptoparasitism of prey items by ant birds [31]) or interruptions in recruitment due to food exhaustion or reduction in light levels [22,32].
To evaluate their responsiveness to abrupt interruptions in traffic, we performed series of traffic perturbation experiments on an additional 10 bridges. These were filmed for 30 seconds before artificially interrupting the traffic by sweeping ants off the raiding trails on both side of the bridge with small brooms. Sweeping points were established at a minimum distance of 2 meters from either side of the bridge to minimise release of alarm pheromone in the direct vicinity of the bridge. Traffic flow was substantially interrupted by sweeping and filming was stopped when no ant remained bridging the gap (from 80 to 630 seconds after the beginning of the sweeping). Data analysis was performed as described for our previous experiments. We emphasise that the results of traffic perturbation experiment were neither used for model design nor for the estimation of the values of the model parameters.
For each of the 10 natural bridges in the traffic perturbation experiment described above, we also performed 1,000 simulations of our model with the same starting conditions (gap size and number of ants bridging the gap when trail sweeping started) and the same traffic conditions (as measured from the experimental videos). We found a very high degree of congruence between our simulations and experiments, supporting the validity of our model (see Fig. 5b). In both the maximum correlation between the intensity of the traffic (decreasing because of the sweeping of ants off the trail) and the number of ants forming the bridge is positive and obtained for a lag of 0 seconds. Furthermore the values of the maximum correlation obtained from the simulation and experiments are indistinguishable (0.79660.071 for the experiments, 0.81760.002 for the simulations, mean 695% confidence interval). Note also that simulations and experiments are also indistinguishable for all the other tested lags, as shown in Fig. 5b.
Thus bridges, despite being operational under moderate perturbations, remain very responsive to sudden, large perturbations of the foraging activity. Both in experiment and simulation, ants reacted almost instantaneously to the interruption of the traffic on the trail by quickly dismantling the bridge. This selective flexibility is likely to be a powerful asset for army ant colonies, helping them reduce the number of foragers involved in unnecessary structures.

Discussion
Unlike inert constructions, self-assembling structures have the capacity to rapidly and autonomously adapt their form to changing conditions [33][34][35]. We demonstrate that army ant bridges are versatile and fault-tolerant living architectures whose construction relies on simple rules of thumb. Bridges spontaneously adapt to the physical environment in which the colony operates and exhibit the property of being maximally robust for an oscillation period of approximately 3 seconds (Fig. 5a), whatever the traffic oscillation intensity, a property that stabilises bridges under natural oscillatory traffic fluctuations (Fig. 4a&b). However bridges are simultaneously highly sensitive and responsive in the face of sudden alteration of traffic on the trail. Thus this living architecture filters appropriately variations in traffic, discriminating between normal operating conditions and sudden, large perturbations of the foraging activity. This allows E. burchellii colonies to spontaneously create living bridges when and where they are needed, and appropriate to the size and type of gap encountered along the trail. We show that these properties contribute considerably to the efficient operation of E. burchellii raiding trails, as do features such as lane formation [17], pothole plugging [24], specialist porter castes [25] and the division of labour among teams of carriers [36,37].
A detailed analysis of the behaviour of ants participating in bridge formation reveals the individual rules responsible for the above properties. The time spent by an individual in a bridge depends on its connectivity in the structure; highly connected ants being less likely to leave. These data support the view proposed by Schneirla [22] that interconnections among ants induce immobilisation. Highly connected ants are also more likely to occupy a central position in a bridge, where the majority of the traffic occurs thus increasing the stability of the structure and buffering the bridge to moderate fluctuations in flow. Our data suggest that not all the ants forming a bridge are absolutely necessary to ensure efficient traffic flow over a gap. It is plausible that these additional ants may give the bridge capacity to handle sudden increases in traffic.
The time spent by an individual in the bridge was also highly correlated with the caste to which this ant belongs. Ants of larger castes remained in the bridge for significantly shorter periods of time than ants of smaller castes. As a consequence the proportion of ants of each caste found in the bridge was different from the relative fraction of each caste found in the raiding trails [25]. In particular, minims were present in a higher frequency than expected, and medias were found at a lower frequency than expected (submajors and majors were found too rarely in bridges to provide accurate estimations). The relative percentages of each caste most closely approximated that found in E. burchellii bivouacs [25], which suggests that the construction principles in bridges and bivouacs are related. The amount of time each caste spent in the bridge appears to correspond with the broader context of their role in the colony. Both the specialist soldier caste (majors [22,25,32]) and the specialist porter caste (submajors [25]) spent the least amount of time in bridges. The generalist medium caste [25] stayed in the bridge longer than the specialist castes, though for less time than the minims. The role of the latters in raiding trails is not documented and our results suggest that they could be considered as bridge specialists. However it is not possible to decide whether this specialization is the result of an evolved behaviour. Perhaps, the most parsimonious explanation is that smaller castes have a higher probability of encountering gaps where they are forced to stretch their back legs and trigger their immobilizing mechanism than larger castes. This is supported by recent observations of pothole plugging in the same species showing that larger ants plug larger holes than smaller ants [24]. Therefore, minims' apparent specialization could be a simple side effect of their body length. Regardless of the exact mechanism that leads ants of smaller castes to stay in bridges longer than those of larger castes, minims function like a living pavement that fills in gaps, so that specialist nestmates may efficiently complete their transport and defence tasks.
Army ants within bridges exhibit a strong exponential relationship between the time they remain in the structure and the flow rate over them. The implications of this exponential relationship are considerable for the stability of bridges. For example, an increase in perceived flow rate of approximately 0.25 ants/sec results in doubling the time spent in the bridge. As a consequence, the stability of the bridges does not increase linearly with the intensity of the traffic on the trail. Instead, the transition between unstable and stable bridges as a function of the flow rate is closer to a step function. If the relationship between the flow over an individual and the time that individual spends in a bridge were linear, bridges would be comparatively less stable and less likely to form at high flow rate. The exponential relationship ensures that bridges are rapidly constructed, and are stable under high traffic conditions when bridges are most important to facilitate efficient movement and transportation over the trail network. At low flow rate however, when the maintaining of bridges is more costly relative to the benefits of foraging, this exponential relationship facilitates the disbandment of the unnecessary structure. Therefore, E. burchellii can considerably alter the stability of their bridges according to the conditions on the raiding trail.
The highly effective mix of stability and flexibility in this living architecture could provide valuable inspiration for technological solutions in collective robotics or swarm intelligence [38][39][40][41]. For example the ''behavioural algorithm'' implemented may be applied to develop self-reconfiguring aggregates of interconnected, or modular robots, or algorithms for dynamic allocation of connection slots in communication networks. Our work also offers insights about the adaptive value and functional design principles of biological self-assemblages [26,33,34].

Materials and Methods
All analysis and statistical tests were performed using R 2.13.0 [42]. Unless otherwise stated, comparisons between two independent samples were performed using the Mann-Withney test and correlations between variables were assessed using the Pearson's product-moment correlation test.

Analysis of bridge removal experiments
Bridges were filmed on the principal raiding trails of an E. burchellii colony during its nomadic phase in Soberania National Park, Panama. Bridges were located within 1-24 meters of the bivouac site and recorded over eight days of the dry season (12th March-20th March, 2001) using a digital video camcorder (Sony DVCAM) between 0900 and 1500 hours.
Analysis of flow over the bridge and the dynamics ants in the bridge were tested with generalised linear mixed effect models (GLMM) with a Poisson error distribution using the ''lme4'' package (version 0.999375-39). Data were nested as 10-second period per replicate per bridge.
The probability that an ant passing over the gap participate in bridge construction was analyzed with a GLMM with binomial distribution. The time spent by ants as part of the bridge during the 120 seconds after removal were analyzed using the ''survival'' analysis package (version 2. . A Cox proportional hazards model (CPHM) was fitted to the data, and data were stratified by bridge. The proportional hazards assumption was tested using the method described in [43] and no significant difference from it was found both at a global level and at the level of the different tested factors.
Effects of the localised flow rate and the number of surrounding ants on the behaviour of the subset of 50 ants were tested with a GLMM with a Gaussian error distribution. The validity of the resulting model was verified graphically for each tested factor. P values were obtained using the ''pvals.fnc'' function from the ''languageR'' package (version 1.2).

Optical flow analysis of traffic dynamics
Trails were filmed during stationery and nomadic phases in Sobernia National Park from June 14 to August 10 2009, between 0900 and 1600. At this time of day the flow rate of ants is usually bi-directional. The trails were all located within 50 m from the bivouac and filmed using a high definition camera (Panasonic HDC H300) for periods lasting from 24 to 1370 seconds.
Particle image velocimetry (PIV) [28], an optical flow technique, was used to quantify the flow of ants from a 2566256 pixels window centred on the main axis of trail (the axis being obtained by computing the average variation in intensity for all pixels in the image and fitting a straight line using a weighted regression). The temporal derivative was calculated by differentiating two successive frames, while the two spatial derivatives were calculated using 45 by 45 Sobel filters, and the products of these three derivatives were calculated and convolved with a 100 by 100 Gaussian filter. This resulted in the generation of a 'velocity field', i.e. an estimate of the direction and speed of motion for each pixel within the image. By projecting these velocity vectors on the main axis of the trail, and summing the norms of these projections, we could reliably estimate the relative variations of the traffic although due to inherently highly variable lighting and contrast under the rainforest canopy it is not possible to obtain with this method an accurate estimate of the absolute value of the traffic on the trail.

Quantifying periodicity in traffic flow
We analysed our traffic flow data with Lomb-Scargle periodograms over the frequency range 1/30 to 1 Hz (as described in [44]); statistically significant peaks of the corresponding periodogram for each dataset were averaged following weighting by their spectral power density to reveal the distribution of dominant frequencies.
Traffic perturbation experiment. These experiments were undertaken between July 31 and August 9 2011 on Barro Colorado Island, Panama, between 0900 and 1600 and filmed with a high definition camera (Panasonic HDC H300).

Model
At each time step (1 second, corresponding to the unit of time we used to analyse the individual behaviours of the ants), a random number N t of ants, drawn from a Poisson distribution with parameter l, cross a gap of a given size. Each ant has a probability L i of stopping to form/join the bridge structure. A GLMM on our experimental measurements showed that L i should decrease with the traffic on the trail and the packing density of the bridge, roughly following a sigmoidal decrease in both cases. We chose to model the effect of traffic and packing density on L i as a 3 dimensional sigmoidal function (see Fig. 6) of the form: L i~1 (1ze a(DtzbzcNtzhDtNt) ), where D t represents the packing density of ants filling the gap at time t (in ants mm 21 ). a, b, c and h are control parameters, their values estimated by fitting the previous equation to data of success/failure to join the bridge during the two minutes after the bridge removal (least squares fit: a = 0.02; b = 144.5; c = 3.258; h = 12.97).
After an ant i joins the bridge structure, it exhibits a probability L ti to leave it at time t. This probability decreases exponentially with the traffic T ti over its body at each time step (i.e., the inverse of the data represented in Fig. 3a): L ti~1 (re sTti ). r and s were estimated by fitting the previous equation to the inverse of the time spent by an ant as part of the bridge as a function of the traffic over its body (Least squares fit: r = 1.959; s = 2.789).
Finally, the value of the traffic T ti over the body of an ant at time t is obtained with the following equation: T ti~( ((1zw)y) (yzD v 0i ))(( P t t{m N t )=m). The first part accounts for the proportion of the total traffic over the bridge that passes over the body of the ant i and depends on 3 control parameters w, y and v (see below for the estimation of their respective values), and on the packing density D 0i of ants in the bridge structure at the time where the ant i joined the bridge. Since they are more likely to occupy a central position in the bridge, ants that join when the packing density is low will tend to experience a larger proportion of the future traffic than the ants that join when the packing density is already high. The second part of the equation accounts for the ability of ants to integrate the traffic flow over their body for the last m seconds (m = 5, as suggested in [24]).
Only three parameters, w, y and v, could not be obtained directly from our experimental data. Their values were estimated by minimising the difference between the average dynamics of the number of ants forming the bridge in our experiments and in Figure 6. Probability L i that an ant passing over the gap decides to participate in bridge construction as a function of the packing density of the bridge and the instantaneous traffic on the trail. Light grey stars represent the experimental data; upper stars represent ants that decided to join the bridge structure; lower stars represent ants that crossed the gap without stopping. The grey surface represent the best fit of a 3 dimensional sigmoidal function to the experimental data. doi:10.1371/journal.pcbi.1002984.g006 simulations of the model under similar conditions (bridge lengths and traffic intensity). The best fit was obtained for w,20.52, y,3 and v,2, with an average square difference between experimental and simulation data points of only 0.12 ants.

Simulations
Effect of traffic intensity. For each value of l, we ran 1000 simulations with duration of 600 seconds each. This duration corresponds to that between the destruction of a bridge in a given replicate of the bridge construction experiment and the start of the next replicate. For each value of l, we computed the proportion of time during which at least one ant was stopped in the gap (nonempty bridge time ratio).
Effect of traffic oscillations. Traffic oscillations started from the beginning of a simulation (no ants filling the gap) and the simulation ended after 100 oscillation periods. 1000 replicate simulations were run for each tested combination of period and intensity. For each combination, we computed the non-empty bridge time ratio.
Response to sudden change in traffic intensity. Initial conditions (gap size and number of ants in the bridge) were set at the same values than those measured when trail sweeping started in the traffic perturbation experiment. The value of T ti for each ant present in the bridge at the beginning of the simulation was computed with N t considered constant during the last m seconds and equal to the traffic intensity when trail sweeping started. To estimate the value of D 0i for each of these ants, we assumed that they joined the bridge sequentially, with the first one stopping as the gap was empty. At each time step of the simulation l was set to match the traffic intensity measured at the corresponding time step in the traffic perturbation experiment. Figure S1 Survival analysis of the time spent by ants as part of the bridge structure during the 2 minutes after the destruction of the bridge (main figure). A Cox Proportional Hazard Model reveals that this time increases with the overall packing fraction of the bridge (number of ants by unit length of the bridge, see inset). It also shows that ants joining the bridge earlier are less likely to leave it (not shown). (TIF) Figure S2 The traffic flow over an ant (a) and the number of surrounding ants in the structure (b) are both more important when the ant occupy a central position in the bridge rather than if it is stopped on the edge of it (Mann-Withney test, p = 0.0005 and p = 0.0164 respectively). (TIF) Figure S3 Comparison between measurements of total traffic flow by manual counting and optical flow analysis. Manual counting was performed on a total of 8 trails out of the 57 we recorded. We present here the results for 3 of these 8 trails (results are similar in the 8 trails). Each row represents: on the left, the normalized traffic flow (traffic flow divided by maximum traffic flow) measured by manual counting (black line) and by optical flow technique (red line); on the right, the cross-correlation between the manual and optical flow data with a maximum significant correlation for a time lag of zero second indicating a good match between manual and automated techniques. (TIF) Video S1 Video recording of a bridge removal experiment. The video shows the bridge structure and the traffic over the bridge before and after all ants in the bridge were removed with tweezers.