1 Introduction

Biological transport networks are constructed by many organisms to collect and distribute vital resources. To perform well, a network must be able to transport resources efficiently, cost little to construct and maintain, and still remain robust to disturbances. While biological networks are unable to perfectly optimize all network features, different biological systems may balance the trade-offs in distinct ways based on their functional priorities and ecological context. For example, leaf venation networks incorporate loops to prioritize dynamic efficiency and robustness over cost of construction (Katifori et al. 2010), while reconfigurable Physarum polycephalum slime mold networks prioritize low costs over robustness (Tero et al. 2010; Reid and Beekman 2013). Polydomous (multi-nest) ant colonies have become a model system for studying transportation networks because they frequently move adult ants, brood, and food between multiple spatially separated nests (Debout et al. 2007) along established trails reinforced by memory, pheromones, physical clearing, or some combination of these approaches to trail maintenance (Czaczkes et al. 2015; Anderson and McShea 2001). Previous studies on the network structures of several polydomous ant species have shown that they are able to construct low-cost networks that nonetheless achieve relatively high efficiency (Cook et al. 2014; Cabanes et al. 2015). Because biological networks like these lack centralized control, studying the mechanisms used to build such networks has inspired scalable algorithms for constructing and improving human-designed networks that balance cost, efficiency and robustness in specific ways (reviewed in Perna and Latty 2014; Nakano 2011). However, these studies have focused on a small handful of biological systems whose transport networks can expand in two-dimensional space without spatial constraints.

Spatial constraints can affect the functionality of both biological and human-designed transport networks. By restricting where pathways can be built, spatial constraints can limit the possible connections within a network and affect its ability to efficiently transport resources and respond to disruptions. For example, leaf venation patterns are constrained by the 2D plane of a leaf so that veins cannot cross without intersecting, thereby limiting the routes for nutrient transport throughout the plant vascular system (Nelson and Dengler 1997). Ant foraging trails are similarly constrained to the terrain of the ecosystem, limiting the ways food can be transported back to a colony (Fewell 1988; Cook et al. 2014). Spatial constraints can also limit the location of nodes in the network: potential sources of resources as well as the tissues, organs or nests where those resources are delivered and used. Many human-designed networks also operate under spatial constraints; for example, public transit networks and power grids need to be built around existing city infrastructure. Currently, much of the design of human-designed transport networks rely on approaches based on heuristic algorithms to optimize and balance competing network properties (Farahani et al. 2013). However, the heuristics need to be constantly improved, especially in response to changing patterns of demand, and determining the optimal heuristics proves to be an ongoing challenge (Kepaptsoglou and Karlaftis 2009). Studying biological networks which operate under varying degrees of spatial constraint on nodes and pathways, and translating their local rules into mathematical and computational models could thus provide useful heuristics to inform the construction of human-designed networks without the need for centralized planning.

Polydomous ant species are found in a wide range of ecological contexts, providing an opportunity to study inter-nest transport networks subject to varying degrees of spatial constraint. While inter-nest transport networks have been studied in a variety of distantly related polydomous ant species—including Argentine ants, Australian meat ants, and European wood ants—they all have large ground-nesting colonies which form stable networks of trails connecting nests with long-lasting food sources (Cook et al. 2014; Cabanes et al. 2015). In contrast, the structure and formation of arboreal polydomous networks are poorly characterized, though they provide the fundamental function of maintaining social cohesion and resource flow among the many nests of a colony within the complex and ever-shifting three-dimensional canopy environment (Davidson 1997; Debout et al. 2007; Powell et al. 2011). For example, colonies constantly shuttle workers and soldiers through the network in response to changing ecological contexts at individual nests, and also redistribute brood from nests with a queen to those without (Powell and Dornhaus 2013; Powell et al. 2017). These arboreal inter-nest transport networks face much stronger spatial constraints compared to their terrestrial counterparts. They are restricted by the topology of the trees they inhabit, which limits the possible structures of the networks that they construct. While terrestrial ants can potentially build new trails and nests almost anywhere, arboreal ants must establish trails along existing tree branches and often only occupy existing cavities instead of constructing their own nest sites (Carroll 1979; Powell et al. 2011; Powell 2008). Many arboreal ants never descend to the ground, and must rely on connecting vegetation to travel beyond a single tree (Powell 2009; Powell et al. 2011; Adams et al. 2019). In arboreal networks, decay and strong winds may frequently cause branches or connecting vines to break, destroying both pathways and nests—which themselves are already a limited resource (Philpott and Foster 2005; Powell et al. 2011; Gordon 2012). The high risk of these disturbances thus requires arboreal ants to respond to dynamic environments (Gordon 2017). Conversely, localized disturbances in terrestrial networks are less disruptive because terrestrial ants are not constrained to certain physical routes and can more easily re-route around the disturbances (Oberhauser et al. 2019; Burns et al. 2020). These differences between the ecological conditions for terrestrial and arboreal ants may lead them to construct networks which balance trade-offs between cost, efficiency and robustness in different ways. As such, studying arboreal ant networks can provide insight into the design of transport systems which must continually adapt to changing conditions, while subject to spatial constraints on both the location of nodes (e.g., transit stations or nests) and the pathways between them.

In this study, we examined how spatial constraints affect the inter-nest network formation of two arboreal-nesting species in the genus Cephalotes, commonly known as turtle ants: Cephalotes varians and Cephalotes texanus. These species were selected as accessible representatives of typical colony composition and nesting biology within the group. Most notably, both species have a specialized soldier caste and specialized nesting preferences, and mature colonies inhabit multiple nests in nature (Creighton 1963; Powell et al. 2020). Turtle ant colonies begin with a single nest at colony founding, and then expand into multiple nests, typically in different regions of the crown of a single tree (Powell 2009; Powell and Dornhaus 2013). In the best studied turtle ant species to date, wild colonies can occupy up to 20 nests (Powell 2009). Like many other arboreal ants, Cephalotes nest in pre-existing cavities made by wood-boring beetles (Creighton 1963), so colony growth and reproduction are dependent on their ability to find viable nest cavities and defend them from competitors (Powell 2009; Powell and Dornhaus 2013; Powell et al. 2017). Nests within a colony are connected to each other and to food sources by an established network of trails along tree branches and vines (Gordon 2012, 2017). Moreover, the frequent movement of brood, workers, and specialized defensive soldiers between nests within the network adjusts dynamically to environmental contingencies, and both nest choice and allocation are influenced by cavity volume and entrance size (Powell and Dornhaus 2013; Powell et al. 2017). Given that limited availability of nests and potential pathways impose spatial constraints on turtle ant networks, this study aims to examine how turtle ants choose which nests to occupy in constrained spaces where their movement and options are limited.

While prior studies of ant network formation have focused on the choice of pathways between nests whose location is fixed (e.g., Latty et al. 2011; Gordon 2017), here we focus on another equally important aspect of network formation: nest choice. Colony growth is dependent on adding nests to the existing network and colonies can choose among nest options based on intrinsic properties of the cavities. We therefore hypothesized that turtle ant colonies might choose which nests to occupy based on how they could contribute to properties of the network. First, we conducted two sets of laboratory experiments to determine whether spatial constraints on pathways between nests affect which nests a colony chooses to occupy. In each set of experiments, we presented turtle ant colonies with an environment that had two sections with different spatial constraints: One section was linearly connected with just a single path connecting the cavities in sequence, and the other was fully connected with all possible paths between each pair of cavities (Fig. 1). The ants were given the opportunity to explore both sections and to move from their original nests into the new cavities in these sections. The cavities in the fully connected section have the potential to be connected by a network with greater efficiency, greater robustness, and lower cost than the cavities in the linearly connected section, so we predicted that the ants would move into the cavities in the fully connected section if spatial constraints influenced nest choice.

Spatial constraints could also affect nest choice indirectly: not as a result of preference for specific network properties, but as an emergent consequence of the process of network creation within the spatial constraints of the environment. To examine this hypothesis, we constructed an agent-based simulation as a null model to demonstrate how a colony of ants might behave without basing nest preferences on network properties or making comparisons between nests. Prior models of ant movement have shown that correlated random walks reinforced with unconditionally laid trail pheromone allow ant colonies to coordinate movement along specific trails and choose efficient pathways between existing nests and food sources in a self-organizing, emergent fashion (Goss et al. 1989; Aron et al. 1990; Dussutour et al. 2004; Ma et al. 2013). However, to our knowledge, the impacts of such a process on nest choice have not yet been modelled. To model nest choice emerging from spatial properties alone, we also included a self-reinforcing local aggregation rule depending only on the number of individuals already present at a cavity. Our model thus explores how the process of random movement coupled with positive feedback loops along paths and at nests could interact with the spatial constraints of the environment to affect which nests are occupied.

2 Laboratory experiments

2.1 Laboratory methods

2.1.1 Study species

Cephalotes varians are found throughout the mangrove and Hammock forests of Southern Florida, and especially the Florida Keys (Wilson 1976). C. texanus are typically found in oak trees in southern Texas and northeastern Mexico (Creighton and Gregg 1954). Queenright colonies of C. varians were collected from state-managed Hammock forest in Key Largo, Florida, and queenright colonies of C. texanus were collected from live oaks on private property near the city of Gonzalez, Texas. Colony collections followed the procedures of Powell (2009). In brief, extensive baiting was used to locate all nests in a focal tree, and a lack of aggression among ants from different nests was used to confirm membership of nests to the same polydomous colony. The first set of experiments, performed in June to July 2017, used three colonies of C. varians (V1, V2, and V3) and three colonies of C. texanus (T1, T2, and T3). The second set of experiments, performed in October to November 2017, used four colonies of C. varians (V4, V5, V6, and V7). The colony sizes (comprising workers, soldiers, and queens) at the start of each experiment for V1 to V7 and T1 to T3 were 190, 100, 140, 184, 64, 137, 56, 43, 55, and 82, respectively.

2.1.2 Experimental setup

To examine how spatial constraints affect turtle ant nest choice, we constructed arenas that had two sections with different structural features and levels of constraint (Fig. 1). One section had cavities that were fully connected to one another (F), while the other section had cavities that were linearly connected in sequence (L), with greater distances between the cavities. The F section had cavities that were closer to each other with more possible pathways between them, so it was less constrained than the L section. The arenas were made with boxes (dimensions: 11 x 11 x 3.75 cm high) in a grid arrangement as shown in Fig. 1. Boxes were connected with arched paper bridges which went from the floor of one box to the floor of another, over their adjacent walls. Fluon was applied to the sides of each box to prevent ants from escaping. The artificial nest cavities all had the same entrance size and volume and were made as outlined in Powell and Dornhaus (2013). In the first set of experiments (June to July 2017), there were three nest cavities in each section for a total of six cavities, while in the second set of experiments (October to November 2017), there were four nest cavities in each section for a total of eight cavities (Fig. 1). Additional cavities were added in the second set of experiments to allow us to assess potential nest preferences in larger colonies that may be finding and occupying all of the cavities. For the rest of this paper, the two sets of experiments will be referred to as the limited-cavity and additional-cavity experiments, respectively.

Fig. 1
figure 1

Arena setups for laboratory experiments. Arenas were made of boxes connected by arched bridges. Rectangles within the boxes represent nest cavities. Each arena had two sections: one with fully connected cavities (F, orange) and one with linearly connected cavities (L, blue). Original cavities were put in at (O, gray), equidistant from the closest cavities in F and L. Circles represent food and water. a Diagram of the limited-cavity setup; b Diagram of the additional-cavity setup; c Picture of the limited-cavity setup with outlines drawn in for the F and L sections

2.1.3 Nest choice experiments

At the beginning of each experiment, we placed original cavities containing a single turtle ant colony in the box labeled O, equidistant from the closest cavities in the F and L sections (Fig. 1). We then opened the original cavities to force the ants to move and occupy new cavities in the arena. Colony movement was filmed for the first 12 hours and cavity occupation was checked 4 times a day at 8:00, 12:00, 16:00, and 20:00. Cavity occupation was measured by lifting the outer cover of the cavities and counting the number of workers inside with minimal disturbance. Both workers and soldiers moved between cavities, but workers were counted for simplicity and because they were much more numerous. The presence of brood was also noted. Turtle ants rapidly allocate workers and brood to new cavities and differentiate between different cavity properties (Powell and Dornhaus 2013), so both the number of workers occupying a cavity and the presence of brood can be used as indications of their preference for the cavity. The limited-cavity experiments lasted 5 days and showed that colonies occupied new cavities within the first 12 hours, with the proportions of ants in each cavity remaining stable after the second day. Thus, the additional-cavity experiments lasted only 3 days.

2.1.4 Statistical analysis

For all analyses, we considered the observation in the afternoon of the third day as being representative of the colony decision. Although later observations were in some cases available, standardizing on a single observation time makes all observations more comparable, and initial observations suggested that nest choice typically did not change after three days.

We used generalized linear mixed models to examine turtle ant occupation across the different cavities. We used a Poisson distribution to model the number of worker ants in each cavity, and a binomial distribution for the presence of brood in each cavity. For both models, cavity connectivity (whether a cavity was in section F or L) was included as a fixed effect since we were interested in the effects of structural features on nest choice. For the limited-cavity experiments, we also included species (C. varians or C. texanus) as a fixed effect, to account for consistent differences in colony size between the two species used in those experiments. For the model of worker number in the limited-cavity experiments, we also included the interaction between species and nest type, to determine whether the two species differed in the effect of structural features on nest choice. Within all models, the colony was included as a random effect to account for consistent differences between colonies, except in the case of the brood model for the additional-cavity experiments, where including it caused a singular model fit. For the Poisson models of the number of worker ants per cavity, an observation identifier (a unique identifier assigned each time occupation was counted for each cavity) was used as an additional observation-level random effect to account for overdispersion caused by the possibility that ants aggregate non-independently in cavities (Harrison 2014). We report the fixed effects along with their 95% confidence intervals, z statistics and p values, estimated with the Wald method.

We also used randomization tests to examine whether the observed effects of structural features on cavity occupation could have been due to chance. The number of adult ants (workers, soldiers, and queens) was averaged across all cavities in each section (F and L) for each colony, and the test statistic was calculated as the difference between the mean number of adult ants across the two sections, averaged across all colonies in each experiment. In each randomization, the section label for each cavity (F or L) was randomly shuffled within each colony, and the test statistic was recalculated. For each experiment, 5000 randomizations were performed to calculate the proportion of randomizations with test statistics more extreme than the observed test statistic.

All statistical analyses were performed with R version 4.0.3 (R Core Team 2020); generalized linear mixed models were constructed using package lme4 (Bates et al. 2015).

2.2 Laboratory results

2.2.1 How do spatial constraints affect turtle ant nest choice?

We assessed nest choice in the laboratory experiments by observing the number of adult ants overall, the number of workers, and the presence of brood in cavities in each section (the fully connected section or the linearly connected section) at the end of each experiment (Figs. 2 and 3). In the limited-cavity experiments, on average, colonies had 14.7 more adult ants per occupied cavity in the fully connected section than in the linearly connected section; out of 5000 randomizations, none yielded such a large difference between the sections (randomization test, \(p < 2 \times 10^{-4}\)). Furthermore, there was significantly greater occupation of the fully connected section than the linearly connected section based on the total number of workers (Poisson GLMM, effect \(= 1.97\), 95% CI [0.78, 3.16], \(z = 3.26\), \(p = 0.001\)) and the presence of brood (Binomial GLMM, effect \(= 3.66\), 95% CI [0.75, 6.58], \(z = 2.47\), \(p = 0.01\)) in each cavity. Although there were significantly more workers per cavity for C. varians than for C. texanus (Poisson GLMM, effect \(= 2.69\), 95% CI [1.37, 4.01], \(z = 4.00\), \(p = 6 \times 10^{-5}\)), the two species did not differ in the way they allocated workers across sections (Poisson GLMM, interaction effect \(=-1.25\), 95% CI \([-2.70,0.20]\), \(z = -1.69\), \(p = 0.09\)), or in the presence of brood (Binomial GLMM, effect \(= 0.44\), 95% CI \([-2.11,2.99]\), \(z = 0.34\), \(p = 0.73\)). For the second set of experiments, therefore, we included only colonies of C. varians. In the additional-cavity experiments, there was no significant difference in cavity occupation between the two sections: The experimental colonies had just 1.1 more adult ants per occupied cavity in the fully connected section on average, and over a third of the randomizations yielded a difference between sections that was greater (randomization test, \(p=0.41\)). There was also no significant effect based on the number of workers (Poisson GLMM, effect \(= 0.34\), 95% CI \([-0.63,1.32]\), \(z = 0.69\), \(p = 0.49\)) nor on the presence of brood (Binomial GLM, effect \(= -0.47\), 95% CI \([-2.62,1.46]\), \(z = -0.48\), \(p = 0.63\)). While colonies in the two sets of experiments had different patterns of cavity occupation, they had similar levels of activity, with the same number of cavities found and occupied within the first 8 hours (Fig. 3).

Fig. 2
figure 2

Final cavity occupation is affected by spatial constraints. The number of workers per cavity was observed at the end of each empirical experiment for each colony in the a limited-cavity setup and b additional-cavity setup. In the limited-cavity setup, there were always more workers in the fully connected (F) cavities, while in the additional-cavity setup only half the colonies had more workers in F cavities. Workers in the original cavity or outside any cavities are not included in this figure

Each colony typically occupied most of the cavities; however, instead of distributing workers evenly across the cavities, all colonies except for T3 (the smallest colony) either concentrated most of their workers into just one cavity, or split most of their workers between two cavities within the first day of the experiments. These cavities had at least 2.5 times as many ants as any other cavity at the end of the experiments, and they typically had most, if not all, of the brood and soldiers. We thus take these criteria as an indicator of cavity choice. In the limited-cavity experiments, all of the colonies except for T3 (Fig. 3c) chose to aggregate in one cavity, and it was always in the F section (e.g., Fig. 3a, b). In the additional-cavity experiments, all of the colonies chose to aggregate in F1, L1, or both (e.g., Fig. 3d, f). All of the chosen cavities were among the closest available cavities to the original cavities (limited-cavity experiment: F1, F2, F3 and L1; additional-cavity experiment: F1 and L1) (see Fig. 1). Since aggregation was typically observed in just one or two nests, each colony (except T3) can be assigned to one of three categories: (1) most ants aggregated in one nest in F, (2) most ants aggregated in one nest in L, or (3) the colony split between two nests, one in each section (see Fig. 3).

Fig. 3
figure 3

Ants were concentrated in one or two nest cavities. Within the first day of the empirical experiments, all colonies had concentrated most of their workers and brood into just one or two nest cavities and the trends in occupation remained the same after the first day (except for T3). Colonies in the limited-cavity experiments typically chose to aggregate in one cavity in F. Two examples are shown: a Colony V2, b Colony T1. An exception was c Colony T3. Colonies in the additional-cavity experiments chose to aggregate in F1, L1, or both. Three examples are shown: d Colony V5, e Colony V6, f Colony V7. Each colony can be assigned to one of three categories according to where most ants aggregated at the end of the experiment: (1) Single nest in F; (2) Single nest in L; and (3) Split between F and L. T3 was the only outlier to these categories. The example colonies shown here were chosen to represent the variety of aggregation patterns observed across all colonies

3 Simulation modelling

3.1 Simulation methods

While the empirical results for the limited-cavity setup seem to suggest a preference for well-connected nests, the empirical results for the additional-cavity setup do not. As an alternative, we hypothesized that nest choice could be indirectly influenced by spatial constraints, emerging from movement patterns within those constraints, even in the absence of preference. To test this hypothesis, we created a model for ant movement through arena structures based on the experimental setups. The model simulates ant movement based on self-reinforcing correlated random walks and density-dependent aggregation at nests, without preferential recruitment to specific nests.

3.1.1 Model description

The model description follows the ODD (Overview, Design concepts, Details) protocol, a standardized structure for describing agent-based models (Grimm et al. 2006, 2010).

Purpose This agent-based model simulates the movement and cavity occupation of an ant colony within a constrained space that can be designed by the user. The space (or arena) may have different structural features based on the spatial arrangement of the cavities and the bridges between them. This model is designed to explore the effects of structural constraints on turtle ant cavity occupation when the ant agents move according to a correlated random walk process reinforced by pheromone feedback loops on trails and at nests, excluding preference or memory. Specifically, we used this model to examine the cavity occupation in simulated arenas based upon the two arenas used in the laboratory experiments described above. Within each arena, we compared the cavity occupation between two sections with different spatial features. Between the two arenas, we examined how the proportional occupation of these two sections differed.

Entities, State Variables, and Scales The agent-based model has two kinds of entities: ant agents and square cells. The ant agents represent the individuals of an ant colony (mainly workers) that participate in exploration for new cavities, and there are 100 agents in each simulation. Only ants that can move by themselves are modelled, so brood are not included. Each agent has a unique ID used to track its individual movement and two state variables to track its orientation and location (described as the cell that it is on). A 2D grid represents the floor of the arena and is divided into square cells. Arched bridges exist outside of the grid and are also made up of square cells. The length of a cell corresponds to the length of a worker ant, which is about 4.5 mm for the turtle ant species we used (C. varians and C. texanus). Each cell can represent either a wall, a cavity, a bridge, or an empty space (Fig. 4). The type of each cell is determined by the user based on the design of the arena. Each cell has two state variables that track the amount of pheromone and the number of ant agents in the cell. Empty cells within the arena may also have access to a bridge; such cells, called bridge accessor cells, represent the ends of the bridge where agents can get onto the bridge. Each bridge is made of an array of bridge cells and two bridge accessor cells at the ends of the array; this array is flanked on both sides by arrays of wall cells (representing the boundaries of the bridge) (Fig. 4c).

Initialization The structure of the arena, designated by the positions of each cell type, is generated when the simulation starts. The structure depends on user input: in this study, we ran simulations with two different structures modeled after arenas from laboratory experiments (Fig. 4). All of the cells are initialized without any pheromones. One hundred ant agents, each facing a random direction, are generated in random cells within a 10 x 10 grid of cells surrounding a starting location.

Fig. 4
figure 4

Arena structures for the agent-based model. Cells in the arena can represent a wall, a nest cavity, a bridge, or an empty space; they make up the 2D grid representing the floor of the arena and the bridges that exist outside of the grid. Empty spaces that have access to a bridge are bridge accessor cells. Ant agents are generated within a random area designated by the starting location. a Floor of the arena structure (excluding the bridges) modeled after the limited-cavity setup; b Floor of the arena structure (excluding the bridges) modeled after the additional-cavity setup; c A bridge of length 5 consisting of two bridge accessor cells and 5 bridge cells, flanked on both sides by wall cells

Process Overview and Scheduling Each time step represents the amount of time an ant takes to traverse the length of a cell (i.e., its own body length) and is approximately equal to 1 second of real time. During each time step, each ant agent has a probability of turning and a probability of moving into a new cell (the details of movement are outlined under “Movement Submodel”). Agents that move into a new cell or stay in a cavity deposit pheromone into the cell (details under “Pheromone Submodel”). The movements for each agent are tracked by recording each time it enters or exits a cavity or crosses a bridge. The order of ant agent movement is randomized within each time step so that the effect of an agent’s movement on subsequent agents is randomized. After all of the agents have moved within the time step, the amount of pheromone in each cell is decreased. Each simulation lasts for 50,000 time steps, which is approximately equal to 14 hours and encompasses the initial stages of exploration according to the empirical experiments. At the end of each simulation, the number of agents in each cavity is recorded.

Design Concepts The basic principle addressed by this model is the concept of spatial constraints and how they may affect ant occupation in nest cavities by limiting possible network structures. In particular, the model examines how apparent nest preferences—examined as ant occupation in different cavities—can emerge from the movement of ant agents through cells that make up a constrained space (the arena). This behavior is modeled dynamically as the ant agents sense and react to changes in the amount of pheromone in adjacent cells, and interact with the cells by depositing pheromones. While this behavior is consistent with an adaptive response—ants tend to follow pheromone trails that can increase their fitness by leading to resources like food and nest cavities—ant agents in the simulation have no defined goals and lay pheromones unconditionally; the model thus explores how ants behave when they are solely driven by pheromones, and not by other factors that may maximize fitness (Goss et al. 1989; Deneubourg et al. 1990).

Stochasticity is used to represent variability in ant movement. Ant agents usually move in a forward direction and follow stronger pheromone trails, but they also sometimes turn or explore new paths (Garnier et al. 2009; Chandrasekhar et al. 2018). Ant agents aggregate in cavities according to a positive feedback loop, where the chance of an ant agent leaving a cavity decreases exponentially as the number of ants within the cavity increases (Deneubourg et al. 2002). In this study, we used pheromones to model local positive feedback loops at nest cavities, but such feedback loops could take different forms for real ant colonies (Pratt 2005). Additional details about movement and pheromones are outlined in “Movement Submodel” and “Pheromone Submodel”, respectively.

Throughout the simulations, agent movement is observed by recording entries into and exits from cavities, as well as crossings over bridges. At the end of the simulations, cavity occupation is observed as the total number of agents in each cavity. Since we are interested in how individual ant movement can lead to cavity occupation patterns, the transport or presence of brood is not included in the model, in contrast to the laboratory experiments.

Movement Submodel The movement submodel defines how ant agents move within the arena according to a correlated random walk process (reviewed in Codling et al. 2008) and pheromone-mediated positive feedback loops. Many species of real ants, including turtle ants, deposit chemical pheromones which can be detected by other ants within a colony (Wilson 1976). Ants following a trail of pheromones can also deposit their own pheromones, creating a positive feedback loop along the trail. Turtle ants usually move in a forward direction and presumably follow stronger pheromone trails, but they also have high rates of movement and exploration on new paths (Gordon 2017).

Ant agent movement is summarized in Fig. 5. If an agent is in a cavity at the beginning of its move, it has a probability of leaving the cavity calculated by \(q_{exit}/2^{(p_n+a_n)/p_y}\). The parameter \(p_n\) is the amount of pheromone in the nest cavity; \(a_n\) is the parameter nest cavity attractiveness, which is used to model the greater likelihood that an ant will explore a cavity compared to an empty space. The probability of leaving a cavity decreases with more pheromone in the cavity, so the the parameter \(p_y\) (the staying factor) refers to the amount of pheromone that decreases this probability by half. The value of the parameter \(q_{exit}\) is 0.5, meaning that the agent has an equal probability of staying or leaving the cavity in the absence of pheromone and when cavity attractiveness is zero. If the agent leaves the cavity or if it is not in a cavity to begin with, it has a probability of turning determined by the parameter \(q_{turn}\). If it turns, it does so within a uniform, symmetric range of degrees (e.g., -90 to 90 degrees) determined by the parameter turning range. From the new direction it is facing, the agent can perceive any adjacent non-wall cells within its field of vision, determined by the parameter vision range. Agents on bridge accessor cells can also perceive the first empty cell on a bridge, regardless of the direction they are facing. The agent then stays in its current cell or moves to any of the cells it can perceive based on a weighted random walk. The weight of any adjacent cavity cell, if present, is \(a_c + a_n + p_c\), where \(a_c\) is the parameter cell attractiveness, \(a_n\) is the parameter nest cavity attractiveness, and \(p_c\) is the amount of pheromone in the cell. The weight of adjacent non-cavity cells is \(a_c + p_c\) and the weight of the current cell is \(a_c\) because an agent is not following a pheromone trail by staying in place. Cell attractiveness refers to the intrinsic attractiveness of each cell and allows neighboring cells with no pheromone to be considered in the weighted random walk. If an agent moves onto a bridge cell, it traverses the cells of the bridge according to the same rules of movement as those in the rest of the arena.

Fig. 5
figure 5

Ant agent movement. (1) Ant agents in a cavity (blue) have a probability of leaving. 2a If they stay, they deposit pheromones in the cavity. 2b If they leave a cavity or if they were originally not in a cavity, they have a probability of turning. 3b If they turn, they randomly turn within a turning range. 4b After turning, they can perceive adjacent cells within a vision range. They can move into any cell within their range of vision or remain in their current cell. 5b They take their next step based on a weighted random walk, where each adjacent cell is weighted by the amount of pheromone (pink) it contains. Cavity, non-cavity, and current cells are weighted differently. If they move into a new cell (6b), they deposit pheromone into it (7b)

Pheromone Submodel The pheromone submodel defines how the amount of pheromone is updated as a state variable for each cell. Each time an agent enters a new cell, it increases the pheromone value by depositing an amount of pheromone determined by the parameter pheromone strength (\(p_s\)). Agents that remain in cavities also deposit pheromone in each step. The amount of pheromone in each cell is saturated at the parameter max pheromone (\(p_m\)). After each time step, the pheromone in each cell is decreased exponentially by the rate \(q_{decay}\) to model the decay of real pheromones over time.

Simulation Experiments and Data Collection The model was implemented in Java 8 and each experiment had 100 simulations (Table 1). Each simulation ran for 50,000 time steps, with each time step equal to 1 second. To examine how spatial constraints might have affected turtle cavity occupation in our laboratory experiments via limited random movement and pheromone feedback loops, we ran experiments with arena structures based on the limited-cavity and additional-cavity arenas (Figs. 14). An example video of one full simulation in the limited-cavity arena is included in Online Resource 2.

We performed preliminary analyses to determine and validate the parameters that modeled ant movement (Online Resource 1). When we varied the parameters controlling how many ant agents are needed to induce others to stay at a cavity, the model generated a variety of results, ranging from consensus choice of one nest to dispersion across all of them (see Online Resource 1, Fig. S1). We thus chose parameter values to produce levels of aggregation similar to those observed in the laboratory experiments: Simulated colonies typically occupied one or two cavities (i.e., they aggregated in one or two nests, containing at least 2.5 times as many ants as any other nest). We also investigated the effect of distance between the original and new cavities on cavity occupation by performing a set of simulations on a modified additional-cavity setup (see Online Resource 1, Fig. S4), to parse out its effects from those of spatial constraints. To further examine the effects of pheromones on ant movement, additional simulations were run that 1) removed all pheromones from the model and 2) modeled pheromones only within cavity cells.

Apart from varying the arena structure and pheromone presence, all of the experiments used the parameters outlined in Table 1. During each simulation, the time step and ant ID for each bridge crossing, cavity entrance, and cavity exit were recorded. At the end of each simulation, the number of ant agents in each cavity was recorded. As in the laboratory experiments (see Fig. 3), we assigned each simulation to one of three categories: (1) most ant agents aggregated in one nest in F, (2) most ant agents aggregated in one nest in L, or (3) the group split between two nests, one in each section. Simulations with less than a total of five ants in all of the cavities and simulations that did not fit into the categories mentioned (e.g., simulations with occupation split between three nests) were categorized as ‘Other’.

Table 1 Model parameters

3.2 Simulation results

3.2.1 Could spatial constraints indirectly affect nest choice?

We created a model to examine how nest choice could be indirectly affected by spatial constraints, by emerging from ant movement patterns within those constraints even in the absence of preference.

Fig. 6
figure 6

Cavity occupation patterns were different under different spatial constraints. Cavity occupation was recorded at the end of each simulation for the a limited-cavity arena structure and b additional-cavity arena structure. Each simulation was assigned to one of four categories according to where most ant agents aggregated at the end of the simulation: (1) Single nest in F; (2) Single nest in L; (3) Split between F and L; and (4) Other if the simulation did not fit into any of those categories. C) The average proportions of ants in the cavities of each section were similar between the laboratory and simulation experiments, in both limited-cavity and additional-cavity arenas. Error bars depict standard error

The simulations showed that patterns of cavity occupation similar to those observed in the laboratory experiments could emerge without being driven by preference. The proportion of ants in each section was not significantly different between the simulations and laboratory experiments for their respective limited-cavity (Mann Whitney U test, \(W = 162\), \(p = 0.155\)) and additional-cavity (Mann Whitney U test, \(W = 247\), \(p = 0.318\)) setups (Fig. 6c). As observed empirically, the cavities closest to the starting positions (L1 and F1-3 for the limited-cavity experiments and L1 and F1 for the additional-cavity experiments) were more likely to be occupied (Fig. 6). Like the laboratory results, the simulation results also showed greater usage of nests in the fully connected section for the limited-cavity setup, but not for the additional-cavity setup. In the limited-cavity setup, simulations were 5.9 times more likely to fall in the ‘Single nest in F’ category than in the ‘Single nest in L’ category, and there were few cases of splitting between F and L (Single nest in F: 59, Single nest in L: 10, Split between F and L: 9, out of 100 simulations). In contrast, in the additional-cavity setup, simulations were 1.5 times more likely to fall in the ‘Single nest in L’ category than in the ‘Single nest in F’ category, and the majority of simulations had splitting between F and L (Single nest in F: 16, Single nest in L: 25, Split between F and L: 52, out of 100 simulations). These patterns remained robust across a range of suitable parameter values (Online Resource 1, Fig. S2). The difference in occupation between the fully and linearly connected sections also remained the same when the distance between the original cavity and new cavities was adjusted to be the same for the limited and additional-cavity setups (Online Resource 1, Fig. S3).

3.2.2 How do spatial constraints mechanistically drive patterns in cavity occupation?

To understand the mechanisms that drive patterns in cavity occupation, we examined the distribution and movement of the simulated ants within the spatial structures. In both the additional-cavity and limited-cavity simulation experiments, the proportions of ant agents in the boxes of each section were about 50-50, but the proportions of ant agents in the cavities of each section differed between the two setups (Fig. 7a). This difference suggested that the agents moved into the boxes of the linearly connected and fully connected sections at equal rates, but moved into the cavities in proportions which differed between the two setups.

To parse out the effects of individual movement and pheromone feedback loops on movement into cavities, we examined patterns of movement in two additional sets of simulation experiments: one without any pheromones to model the effect of the individual movement process alone, and one with pheromones deposited only within nest cavity cells to model the additional effects of local aggregation at cavity cells. In the set without any pheromones at all, the rate of ant agents encountering each cavity reflected cavity occupation distribution patterns observed in both the laboratory and simulation experiments. Encounter rate was highest for the three F cavities in the limited-cavity simulations while it was highest for the L1 cavity, then the F1 cavity, in the additional-cavity simulations (Fig. 7b); these were the most populated nests in the respective laboratory experiments (Fig. 2) and simulation experiments (Fig. 8b, d). Thus, the correlated random walk process alone, interacting with spatial constraints, can explain the overall distribution of ants in the simulations. However, positive feedback—implemented with pheromones in our model—is still necessary for ants to accumulate in cavities. In the set of simulations with pheromones only within cavity cells, the limited-cavity and additional-cavity experiments showed similar proportions of ant agents in the boxes of each section but dissimilar proportions of agents in the cavities of each section, just as in the simulations with pheromones in all cells (Fig. 7a). Therefore, the observed patterns in cavity occupation can be achieved with a correlated random walk process driving ant movement outside of cavity cells and with local pheromone feedback loops driving ant movement within cavity cells.

Fig. 7
figure 7

Simulation results showing cavity occupation depends on cavity encounter rates driven by individual movement and local pheromone feedback loops at cavity cells. a Between the additional-cavity and limited-cavity simulations, the proportions of ant agents in the boxes of each section were similar, but the proportions of agents in the cavities of each section were dissimilar. These patterns held even when pheromones were restricted to nest cells, precluding trail formation. b In simulations with no pheromones at all, patterns in encounter rates for each cavity reflect patterns of cavity occupation in the other simulations, with higher rates corresponding to greater occupation

Proximity to the cavity cells is required for ant agents to be affected by local pheromone feedback loops, so we examined how spatial features can lead agents to encounter or bypass cavity cells through random movement. Specifically, we examined the behavior of the ant agents when they first enter the two structurally different sections through the boxes closest to the original cavity: L-Box 1 and F-Box 1 (Fig. 8a , c). The paths leading to these two boxes from the original cavity are exactly equivalent, but the paths leading onward are different, so this was a good place to look for sources of asymmetry between the two sections. Also, the only difference between the F sections in the limited-cavity and additional-cavity arena structures was the addition of a cavity in F-Box 1, making that box of particular interest. We thus inferred that the spatial structure surrounding F-Box 1 likely contributed to the differences observed between the simulations, and we focused on how ant agents moved at F-Box 1 and its equivalent in the other section, L-Box 1. Specifically, we documented the movement of ant agents after they entered F-Box 1 or L-Box 1 and categorized their next steps as ‘backward’ (moving back towards the original nest), ‘forward’ (moving forwards into the section), or ‘nest’ (going into a nest cavity in the box) (Fig. 8).

Fig. 8
figure 8

Simulation results showing greater forward movement from F-Box 1 compared to L-Box 1. The movement of ant agents once they entered the first box of each fully connected (F) or linearly connected (L) section was examined and their next steps were categorized as ‘backward’ (moving back to the box with the original cavity), ‘forward’ (moving forward into the section), or ‘nest’ (going into a nest cavity in the box). Average proportion of agents that took each step for the a limited-cavity arena and c additional-cavity arena. Summary diagram of movement in the b limited-cavity arena and d additional-cavity arena. Size of blue cavities is proportional to average number of agents in the cavity at the end of all simulations, and length of arrows indicates relative proportion of agents that take the step

In both the limited-cavity and the additional-cavity simulation experiments, additional forward paths in F-Box 1 compared to L-Box 1 caused greater forward movement into the fully connected section compared to the linearly connected section. In both setups, there were three forward paths from F-Box 1, compared to one forward path in L-Box 1. As such, there was a greater or equal proportion of ant agents moving forwards than backwards from F-Box 1, compared to a smaller proportion of ants moving forwards than backwards from L-Box 1 (see Fig. 8a, c). While these patterns of movement are similar between the limited-cavity and additional-cavity simulations, they have different effects on cavity occupation. In the limited-cavity simulations, greater forward movement from F-Box 1 results in less backward movement, compared to L-Box 1 (Fig. 8a). This led to greater occupation in the fully connected section, likely by allowing more agents to encounter the three F cavities that are equidistant from the original cavity (Fig. 8b). However, in the additional-cavity experiments, greater forward movement from F-Box 1 causes agents to miss the closest F nest in F-Box 1 without affecting the rate of backward movement, compared to L-Box 1 (Fig. 8c). This led to less occupation in the fully connected section, likely by reducing the rate of encounter at the closest F nest (Fig. 8d).

4 Discussion

Our empirical results show that spatial constraints can affect turtle ant nest choice, which is an important and unstudied component of the formation of their transport networks. In two sets of experiments designed to test whether colonies would preferentially occupy different physically equivalent nests based on network characteristics, we observed apparently conflicting results. The experiment with fewer cavities suggested a preference for nests with close connections to other nests, but the experiment with additional cavities did not. Taken alone, these empirical results might suggest that turtle ant colonies preferentially target well-connected nests, but only under specific conditions. One explanation for the observed differences could be changes in activity level or motivation during the different seasons in which the two sets of experiments were performed, which have been observed in other species (Heller and Gordon 2006; Stroeymeyt et al. 2014). However, colonies in the two sets of experiments showed similar patterns of exploration and occupation, both in terms of numbers of active ants and nests occupied. More importantly, simulations of ant movement based on the two sets of experiments show that the observed patterns can in fact be explained as an emergent consequence of simple rules of individual movement reinforced by unconditional pheromone feedback loops, interacting with subtle differences in the layouts of the two experimental set-ups. Since the computational simulations do not model preference or memory, the results demonstrate that the empirically observed patterns of nest choice could emerge from the imposed spatial constraints, even without individual preference for nests that improve network characteristics of efficiency and robustness. These patterns of nest choice nonetheless constrain the potential efficiency and robustness of the network used to transport resources to and between nests.

Our model of nest choice focuses on emergent effects of spatial constraints by including only quality-independent feedback processes: continuous trail-laying outside the nest, and density-dependent aggregation inside the nest. Classic models of nest choice in social insect colonies utilize quality-dependent recruitment coupled with a quorum threshold rule to balance three objectives: speed, accuracy and group cohesion (Sumpter and Pratt 2009). In the two best-studied examples, rock ants and honey bees, individuals assess site quality directly, judging characteristics like cavity volume and entrance size; quality-dependent recruitment then amplifies traffic to the best site more quickly than to other sites, allowing the group to integrate information collected by many individuals and make accurate consensus decisions (reviewed in Franks et al. 2002). We know that turtle ant colonies also choose to occupy cavities based on physical nest properties like entrance size (Powell 2009; Powell et al. 2020) and cavity volume (Powell and Dornhaus 2013). Besides quality-dependent recruitment, such preferences could emerge from quality-dependent resting time at a nest, as in cockroaches aggregating at a shelter (Jeanson et al. 2007), or even a combination of the two, as observed in the ant Messor barbarus (Jeanson et al. 2004). While our work does not rule out the possibility that nest choice is influenced by individual ants assessing the spatial characteristics of physically equivalent nests, it demonstrates that nest choice can be influenced by spatial characteristics in an emergent fashion, even without such assessment. How the interactions play out between the emergent spatial influences on nest choice and the demonstrated preferences for certain physical nest properties remains to be explored.

Of the two quality-independent feedback processes we included, trail-laying outside the nest might seem a natural candidate to produce indirect spatial effects on nest choice. Argentine ants use continuous trail-laying to choose shorter paths, leading to efficient and low-cost networks of trails linking multiple pre-established nests (Goss et al. 1989; Aron et al. 1990; Latty et al. 2011). Although nothing is known about pheromone use in C. varians or C. texanus specifically, it has been suggested that Cephalotes goniodontus may also lay pheromone continuously, allowing colonies to improve efficiency of foraging trails (Gordon 2017; Chandrasekhar et al. 2018). If so, we might expect this process to impact turtle nest choice during colony expansion into new cavities, potentially leading to the construction of efficient and low-cost networks. However, we found that simulated colonies, like real turtle ant colonies, did not always choose sets of nests leading to an efficient, low-cost network. Furthermore, since qualitatively similar results were observed with and without pheromones outside the nest, we can conclude that positive feedback along trails is not necessary to explain the qualitative patterns of nest choice we observed empirically.

Instead, the patterns of nest choice we observed in the simulations seem to be driven primarily by the second positive-feedback loop—aggregation at the nest—interacting with the movement of ant agents along constrained pathways. To induce aggregation at the nest, we included a quality-independent positive feedback rule based only on the number of individuals already present, as has been suggested for other gregarious invertebrates choosing a shelter without spatial constraints (e.g., Ame et al. 2004; Broly et al. 2016). This induces a quorum-type response, allowing us to represent a continuum of strategies—ranging from perfect consensus to dispersion across all nests—by varying the parameters controlling how many ant agents are needed to induce others to stay at a nest (Sumpter and Pratt 2009). Turtle ants seem to lie somewhere in between: a strategy of broad exploration coupled with consolidation of most workers along with soldiers and brood into a subset of nests may allow colonies to monitor a larger set of cavities without spreading their defenses too thin (Powell and Dornhaus 2013; Powell et al. 2017). It was under such conditions, where simulated colonies showed substantial cohesion without requiring complete consensus, that we observed the strongest emergent effects of spatial constraints.

While an apparent preference for closer nests could emerge naturally from quality-independent recruitment, we show that the spatial constraints of an arboreal environment could also influence nest choice via the processes of movement and aggregation in more complex ways. In both our laboratory experiments and simulations, we found that the closest nests were those most likely to be occupied. Similarly, colonies of ground-nesting rock ants consistently choose the closer of two equivalent nests, likely because they are discovered more quickly and the recruitment process amplifies more quickly (Franks et al. 2008). The quality-independent recruitment process we included in our model could lead to an apparent preference for closer nests in just the same way. Even without recruitment, closer nests may be encountered at a higher rate due to the process of random movement, so that density-dependent aggregation can proceed more quickly. However, distance is not the whole story: nests that were equidistant in our simulation experiments were not always equally likely to be chosen. This occurs because the encounter rate decreases when there are more paths leading away from a cavity, since ants that miss encountering a cavity the first time are more likely to move away from it and encounter other cavities further away. Observations of the foraging networks of C. goniodontus suggest that foraging ants take longer to find new food sources that require travel through many junctions, and that new foraging trails are made more efficient over time by reducing the number of junctions, not the total distance along the trail (Gordon 2017). Our work further supports the idea that, within arboreal transport networks, the efficiency of travel between two points is strongly influenced by the number of junctions en route to and even beyond the destination. In turn, it also shows that nest choice can be shaped by these spatial constraints.

While turtle ant colonies did not always choose new nests in a way that would lead to low-cost and efficient transport networks, it could still be the case that they utilize a process which usually leads to low-cost and efficient networks under conditions that they are likely to encounter in nature. The individual movement process coupled with aggregation at cavities with high encounter rates would typically lead ants to choose nests that are easily accessible from their starting point. Such a strategy might often lead to low-cost and efficient transport networks, particularly if the colony preferentially expands from nests that are strategically placed in the network, as observed in European wood ants (Ellis et al. 2017). In the additional-cavity experiments, however, this fundamentally myopic strategy may have caused ants within a colony to split between two cavities that were easily accessible from the original nest but less easily accessible from one another. Because the original nest was destroyed and no longer a node in the network, this resulted in a network that was less efficient and higher cost, compared to the choice of two cavities further from the original nest but close to each other. However, this initial acceptance may simply reflect the first stage in a longer-term process of network expansion, followed by nest abandonment and network restructuring, as observed in wood ants (Ellis and Robinson 2015). A related process of adding new connections, followed by selective pruning of trails, has been shown to shape the construction of low-cost, efficient trail networks between nests in Argentine ants (Latty et al. 2011) and has also been proposed to explain the dynamic structure of foraging networks in C. goniodontus (Gordon 2017; Chandrasekhar et al. 2018). Our model focuses just on the initial choice of nests needed to start building a network of nests, not on how the resulting network functions to transport goods. However, it could serve as the initialization step for a dynamic model that explores how ants distribute or transport resources between nests over time, and how they may change their nest occupation in response to that flow of resources.

By focusing on nest choice in a network context, this study adds a new perspective to the problem of transport network design. Like their human-designed counterparts, biological transport networks must balance competing priorities of cost, efficiency and robustness (Bebber et al. 2007; Tero et al. 2010; Latty et al. 2011; Cook et al. 2014; Lecheval et al. 2021). Studying biological transport networks and translating their local rules into mathematical and computational models has already begun to provide heuristics to inform the construction of human-designed transport networks without the need for centralized planning (reviewed in Teodorović (2008); Nakano (2011)). In particular, ant pheromone models demonstrate how collective path selection can allow the emergent construction of low-cost, efficient networks (Goss et al. 1989; Aron et al. 1990; Latty et al. 2011; Reid and Beekman 2013), leading to popular ant-inspired algorithms for routing and scheduling, among other optimization problems (reviewed in Dorigo et al. (2006)). Yet transportation networks consist not just of paths but also nodes: sources and sinks for the goods and individuals being transported. In situations where potential nodes are limited and the potential pathways between them are highly constrained, a network’s cost and efficiency may be strongly shaped by the choice of which nodes to include in the network. In contrast to path selection, the study of collective resource selection—for example, making a choice between alternative nests or food sources—typically focuses on the integration of quality information collected by many individuals (Seeley et al. 1991; Sumpter and Pratt 2009; Jeanson et al. 2007). In this study, we show how resource selection can shape network characteristics even without individual preferences, as a byproduct of spatial constraints shaping random movement and aggregation. Recent work on resource selection in robot swarms has shown that quality-dependent positive feedback can be used to optimize the rate of resource collection, by effectively balancing the trade-off between selecting high-quality versus nearby resources (Font Llenas et al. 2018; Talamali et al. 2020). Bringing all three processes together—quality-dependent positive feedback, aggregation, and random movement within constrained spaces—into a dynamic model of transport networks could be a powerful way to design efficient and low-cost networks for transporting resources under spatial constraints.