key: cord-1035670-hs8nbh7k authors: Lemanski, Natalie; Silk, Matthew; Fefferman, Nina; Udiani, Oyita title: How territoriality reduces disease transmission among social insect colonies date: 2021-11-30 journal: Behav Ecol Sociobiol DOI: 10.1007/s00265-021-03095-0 sha: 817f33ab955a18395fd9823c4db96243b24e4bba doc_id: 1035670 cord_uid: hs8nbh7k ABSTRACT: Social behavior can have a major impact on the dynamics of infectious disease outbreaks. For animals that live in dense social groups, such as the eusocial insects, pathogens pose an especially large risk because frequent contacts among individuals can allow rapid spread within colonies. While there has been a large body of work examining adaptations to mitigate the spread of infectious disease within social insect colonies, there has been less work on strategies to prevent the introduction of pathogens into colonies in the first place. We develop an agent-based model to examine the effect of territorial behavior on the transmission of infectious diseases between social insect colonies. We find that by preventing the introduction of infected foreign workers into a colony, territoriality can flatten the curve of an epidemic, delaying the introduction of an infectious disease and reducing its maximum prevalence, but only for diseases with moderate to low transmissibility. Our results have implications for understanding how pathogen risk influences the evolution of territorial behavior in social insects and other highly social animals. SIGNIFICANCE STATEMENT: Infectious disease outbreaks can impose a large fitness cost to animals that live in social groups. The frequency and pattern of contacts both within and among groups can have a large impact on the speed and extent of an epidemic. Using an individual-based model, we examined how the exclusion of foreign workers from a territory around the nest influences disease transmission between social insect colonies. We find that territoriality can protect colonies from outbreaks of low to moderately contagious pathogens by delaying the spillover from other colonies and reducing the maximum number of workers who are infected. These results suggest that the relative threat posed by infectious diseases may have played an important role in shaping the diversity of territorial behaviors seen in different social insect species. SUPPLEMENTARY INFORMATION: The online version contains supplementary material available at 10.1007/s00265-021-03095-0. Recent wide-scale infectious disease outbreaks, such as the 2009 H1N1 influenza epidemic (Coburn et al. 2009 ), the 2014 Ebola epidemic (WHO Ebola Response Team 2016), and the ongoing SARS-CoV-2 pandemic (Lewnard and Lo 2020) , have highlighted the important role social behavior plays in the dynamics of infectious disease transmission. The frequency and pattern of social contacts in a population influence both the shape and magnitude of an epidemic (Salathé and Jones 2010; Hock and Fefferman 2012; Sah et al. 2017) . For all the benefits of social living (Krause and Ruxton 2002; Purcell et al. 2012) , infectious diseases can pose an especially high risk to organisms that live in large, tightly-knit social groups (Kramer and Bressan 2021) . Eusocial insects, such as ants, termites, and social bees, have many characteristics that make them especially vulnerable to pathogen transmission (Meunier 2015) . Frequent close contacts among colony members, which are necessary for the sharing of food and information (Waters and Fewell 2012) , create many opportunities for disease transmission (Otterstatter and Thomson 2007) . A high density of genetically similar individuals means that most individuals in a colony have similar susceptibility to pathogens (Schmid-Hempel 1998) . Additionally, long-term or permanent nests can allow the buildup of pathogens in the environment (Schmid-Hempel 1998) . Unsurprisingly, therefore, social insect colonies are threatened by many infectious pathogens and parasites that impose a large fitness cost to individuals and colonies (Schmid-Hempel 1998) . For example, Varroa destructor mites and the viruses they transmit are one of the leading causes of winter colony losses in managed honey bees (Guzmán-Novoa et al. 2010; Dainat et al. 2012) . Bacterial infections, such as American Foulbrood disease, are also major threats to honey bee colonies (Genersch et al. 2010) . Ants and termites also contend with many infectious diseases that are transmitted by contact between individuals, including parasitic fungi (Andersen et al. 2009; Jouvenaz et al. 1981; Kramm et al. 1982; Rosengaus et al. 2011 ), bacteria (Schmid-Hempel 1998 , and viruses (Lester et al. 2019) . Because of the large fitness cost imposed by infectious diseases, social insects have many behavioral adaptations to reduce transmission within colonies. These behaviors, collectively termed social immunity (Cremer et al. 2007 Meunier 2015; Van Meyel et al. 2018) , include network structures and dynamics that limit the spread of pathogens (Naug 2008; Stroeymeyt et al. 2014 Stroeymeyt et al. , 2018 Udiani and Fefferman 2020) and separation of the most valuable members of the colony from individuals most likely to acquire infections (often foragers) (Durrer and Schmid-Hempel 1994; Sun and Zhou 2013) . Other disease-protective behaviors include a reduction in social contacts by infected individuals (Geffre et al. 2020 ) and exile (Kralj and Fuchs 2010; Shorter and Rueppell 2012) or avoidance of infected individuals/destruction of infected brood by nestmates (Kramm et al. 1982; Pull et al. 2018) , although the latter strategies rely on the ability of individuals to detect the presence of an infection. Self-grooming and allogrooming are also common behaviors that can function to remove external parasites and pathogens (Schmid-Hempel 1995; Sumana and Starks 2004; Wilson et al. 2020) , although for some pathogens, allogrooming can also facilitate transmission among individuals (Theis et al. 2015) . While there has been a large body of work examining adaptations to reduce the spread of parasites and pathogens within colonies (Naug and Camazine 2002; Otterstatter and Thomson 2007; Buechel and Schmid-Hempel 2016; Stroeymeyt et al. 2018; Cremer et al. 2018; Udiani and Fefferman 2020) , equally important are strategies to prevent the introduction of pathogens into the colony in the first place. Foragers can become infected outside the colony from the external environment (Durrer and Schmid-Hempel 1994; Andersen et al. 2009 ) or from contact with infected nestmates, conspecifics from other colonies, or heterospecifics (Mirabito and Rosengaus 2016; Guo et al. 2020) . Infections can also be introduced by the accidental drift of infected individuals from nearby colonies (Oi and Williams 2003; Goodwin et al. 2006; Oi 2006) . Though noncolony members are usually excluded from entering nests by guards, returning foragers are sometimes mistakenly permitted to enter a foreign nest and subsequently adopted into the colony (Bell 1974; Reeve 1989; Couvillon et al. 2013; Breed et al. 2015; Konishi and Matsuura 2021) . Once a small number of infected individuals enter a nest, a novel infection can be quickly amplified inside the colony because of high density and contact rates. Territoriality, here defined as the exclusion of non-colony members from a defined area around the nest (Adams 1990 (Adams , 2016 Traniello and Robson 1995; Krasnec and Breed 2012) , is one way for a colony to reduce contacts with infected individuals outside the nest. High colony density in an area can lead to more worker drift and a higher rate of contact with workers from other colonies (Lindström et al. 2008; Peck and Seeley 2019) . Defending a territory around the nest where non-nestmates are excluded may protect the colony from infections by reducing the contact rate with non-nestmates. Excluding non-nestmates from entering the colony may also prevent the introduction of infected workers from other colonies (Lindström et al. 2008; Peck and Seeley 2019) , especially in cases where the disease cannot be detected directly by other individuals. Different social insect taxa vary in the frequency and type of exposure to infectious agents that colonies experience, and these differences in pathogen exposure have been found to correlate with differences in the degree of territoriality displayed (Boomsma et al 2005; Cremer 2019 ). Taxa that regularly encounter a diversity of pathogen risks because they forage and/or nest in the soil (e.g., ants or termites) tend to display greater territoriality around their foraging areas than do taxa that forage by flying and/or nest arboreally (e.g., bees or wasps) for whom the external environment is relatively sterile (Boomsma et al 2005; Adams 2016 ). Territoriality is also more common in species with long-lived, perennial colonies, who would be predicted to gain greater fitness benefits from preventing the introduction of pathogens than semelparous species whose colonies only need to survive long enough to reproduce (Boomsma et al 2005) . In addition to these cross-taxa comparisons, individual colonies often display temporal differences in territoriality, such as seasonal changes in aggression toward alien conspecifics (Thurin and Aron 2008; Katzerke et al. 2006 ). If territoriality is effective in protecting colonies against pathogen introduction, differences among taxa or across time in infectious disease risk may contribute to the diversity of territorial strategies employed by social insects. In addition to the frequency of pathogen exposure, the adaptive value of territoriality and non-nestmate exclusion for disease prevention should depend on its effectiveness at preventing an infectious disease from being introduced into the colony, which may depend on the pathogen's transmissibility. For a disease with sufficiently low transmissibility, exclusion of non-nestmates may not be necessary for disease prevention, while for a disease with very high transmissibility, workers are likely enough to get infected from rare contacts outside their territory that there is no benefit of excluding non-nestmates from the nest. Therefore, the adaptive value of territoriality might be expected to peak for infections with intermediate transmissibility. The adaptive value of territoriality should also depend on the following: (i) the fitness cost of infection, which may include worker mortality or reduced productivity; (ii) the costs associated with territoriality, which could include reduced resource acquisition if workers spend time patrolling their territory instead of foraging; and (iii) losing the benefit of free additions to the workforce from worker drift. Consequently, if disease protection is a significant selective pressure in shaping territoriality in social insects, the level of territorial behavior in different species and populations should be influenced by the transmissibility and fitness cost of the pathogens they frequently encounter as well as how costly it is for them to exclude non-nestmates from their territory. It is not well understood, however, how pathogen transmissibility influences the effectiveness of territoriality as a defense against pathogen introduction. The questions we therefore sought to answer were (a) how effective is territoriality at preventing infectious disease transmission from a foreign colony, (b) what are the relative effects of territorial boundaries and worker drift on infectious disease transmission, and (c) how does the transmissibility of a pathogen influence the effectiveness of territoriality and foreign worker exclusion? To answer these questions, we developed an agent-based model of two social insect colonies foraging on a common food source. We introduced an infectious disease, transmitted by close proximity between individuals, into one colony. We modeled two types of disease dynamics: one in which workers recover from the infection and become susceptible again (SIS) and one in which workers die from the infection (SID). We modeled the disease dynamics with different enforcement of territorial boundaries, with or without worker drift between colonies (permanent adoption of foreign workers who enter the nest), and with different levels of transmissibility. We then examined how each of these factors influences the disease burden and foraging success of the uninfected colony. To explore territoriality as an adaptive behavior to reduce disease transmission, we developed an agent-based model of two social insect colonies. We introduced an infection into a non-focal colony and examined the effect of the focal colony's behavior on transmission dynamics within and across colonies (Fig. 1) . The model was coded in NetLogo v.6.1 (Wilensky, 1999) . The full list of model parameters can be found in Table 1 . Model code is provided in the Supplementary Materials (Appendix 1). At the start of the simulation, each colony begins with 50 workers. Each colony adds a total of 30 new workers every 300 time steps. We make the simplifying assumption that, over the time scale of our model, the rate of new worker production does not depend on the amount of food collected; this allows us to focus on direct effects of infection on colony productivity without needing to model allocation decisions between colony growth and defense. However, colonies do not add any new workers if the total worker population in the model exceeds the carrying capacity, k (set to 300); this assumes that once colonies reach a certain size, they allocate additional energy to reproduction or storage rather than production of more workers, a common strategy for social insects (Poitrineau et al. 2009; Rangel et al. 2013) . In the SID model, 30 random workers from each colony die every 300 time steps. Moreover, each infected worker also dies with a probability of 0.001 per time step. While the current study did not explore the effects of colony size, an initial calibration study found that increasing colony size decreased the time needed for the infection to spill over into the focal colony (Appendix 1). The two colonies have nests at opposite corners of a 71 by 71 unit square arena with a neutral zone in the middle (Fig. 1) . Each nest consists of a sector with 5 unit radius extending from the corner of the arena. Each colony also maintains a 35 unit radius territorial sector around its nest, where workers from the other colony can be prevented from entering. The dimensions of the controllable region (i.e., territory) are the same for both colonies (962 square units). The exact spatial dimensions of the arena and nests were arbitrarily chosen. We define territoriality as the probability that foreign workers are prevented from entering the other colony's territory. To simplify this model, we assume that colony territories are maintained by workers recognizing and avoiding the territory of neighboring colonies. This approach allows us to investigate the territoriality benefits hypothesis unconstrained by specific mechanisms of territorial enforcement (e.g., presence of guard workers). Note that our model does not assess direct costs of territoriality due to fighting or patrolling because these costs would not change with disease and our objective is to explore the implications of territorial boundaries for disease transmission, not to optimize the level of territoriality. To explore how the magnitude of territoriality (ρ) affects transmission dynamics, we varied the value of territoriality from 0 to 1 in increments of 0.25. To examine the effect of worker drift, we assumed that workers that reach the other colony's nest location have some probability of being permanently adopted into that colony. The adopted worker continues to return to the new colony instead of its original colony and is recognized as a nestmate by the new colony's workers. We modeled scenarios with and without the presence of worker drift for each This summary of our model follows the ODD (overview, design concepts, and details) protocol for describing individual-and agent-based models (Grimm et al. 2020) . The model contains three types of entities: agents represent workers; patches represent the locations of nests, territories, and food resources; and the observer represents the global environ-ment. Agents, nests, and territories belong to either the focal colony (purple) or the foreign colony (yellow). Infected workers are shown in red. Dark circles in the upper left and lower right corners of the landscape represent colony nests, while the lighter circles represent colony territories. Green circles represent food patches. See Supplementary Materials, Appendix 1 for full model details Table 1 Description of key parameters and default values used in simulations. Several parameters serve as inputs for stochastic processes that are used in the model to capture the effects of individual variability within the workforce. These include variability in the potential for worker drift (ρ), disease transmission (β), and spontane-ous removal due to death or recovery from infection (γ We modeled the landscape in which colonies forage as a spatially heterogeneous habitat with a non-replenishing supply of food resources. The model's spatial extent is a bounded square composed of 71 by 71 unit square cells (each grid cell is a 1 by 1 square). The arena is partitioned into three regions corresponding to different habitats. Colony nests are located at the top-left and bottom-right corners of the arena. Food items are located in three circular, overlapping patches in the neutral zone between territories (Fig. 1) . The radius of each food patch is 5 units and the center of each food patch is located equidistant from the nest entrances of both colonies. Each food patch contains approximately 10 items of food. Both colonies forage at the same food sources and bring food back to their colony's nest. Each colony uses a pheromone-based foraging system. Workers from both colonies can sense each other's pheromone trails. Foraging is simulated as follows. Upon exiting the nest, a forager performs a biased random walk to locate the nearest food source. The worker "follows the gradient" of the chemical pheromone. That is, it "senses" in three directions (ahead, left, or right), then walks in the direction where the pheromone is strongest. When a food source is located, the worker removes one item of food and returns to its home nest, depositing a fixed quantity (60 units) of recruitment chemical on its current patch as it moves. When other workers detect the chemical, they follow the pheromone trail toward the food. As more workers carry food to the nest, they reinforce the pheromone trail. We assume that the pheromone evaporates at a fixed rate of 99% per time step and diffuses into neighboring patches at a constant rate of 1% per time step. At the start of the simulation, the infection starts in one colony with one infected individual. Disease transmission can occur between individuals on the same spatial patch, representative of a pathogen that is transmitted by either short-lived environmental contamination (Durrer and Schmid-Hempel 1994) or direct contact between individuals (Kramm et al. 1982) . Therefore, our model is less applicable to pathogens that are predominantly transmitted indirectly, such as bacteria or fungal spores that spread by wind and/or persist in soil (Schmid-Hempel 1998; Andersen et al. 2009 ). We assume that infections are transmitted in a probabilistic fashion based on spatial proximity of susceptible workers to infectious individuals. During a given time step t, we define the "social neighborhood" for each susceptible worker as the set of other workers that are located on the same patch. The probability of infection in time step t is equal to the number of infected neighbors on the same patch times the transmissibility of the pathogen (β). We assume that individuals do not acquire immunity once they recover from the infection; each infected individual either dies (SID model) or recovers to become susceptible again (SIS model) with a probability of γ = 0.001 per time step. Because the basic reproduction number (R0) of a pathogen is directly proportional to transmissibility, β, and inversely related to the recovery/ death rates (Guerra et al. 2017 ), we chose a single, reasonable value of the death/recovery rate, γ. We then calibrated the epidemiological parameter β in the full model to obtain reasonable estimates for contagious diseases where colony territorial behavior would be protective. The resulting range of values are shown in Table 1 . For each scenario, we ran 40 simulation replicates. We examined several outcomes relevant to colony fitness: (i) the time for the focal colony to first become infected, (ii) the maximum number of infected individuals in the focal colony at any point in the simulation, (iii) the total number of individuals in the focal colony remaining susceptible at the end of the simulation, and (iv) the total amount of food collected by each colony. The simulation continues until one of the following events occur: (i) there are no infected workers, (ii) there are no remaining food items in the landscape, (iii) colony A goes extinct, or (iv) colony B goes extinct. The results of our SIS model demonstrate that the effects of territoriality on infectious disease dynamics depend on the pathogen's transmissibility (β). For a disease with moderate to low transmissibility (β < 0.05), territoriality had a strong protective effect against disease transmission between colonies. Specifically, the highest value of territoriality resulted in > 50% reduction in the maximum disease prevalence ( Fig. 2A) and reduced the likelihood of an epidemic occurring ( Figure S1 ). Territoriality also flattened the curve of the epidemic, increasing the time it took for the uninfected colony to first become infected (Fig. 2B) . In contrast, for a disease with high transmissibility (β > 0.05), territoriality had very little effect on maximum disease prevalence ( Fig. 2A) or time to first infection (Fig. 2B) . Regardless of the value of β, territoriality had little effect on the final number of susceptible individuals (Fig. 2C) or colony productivity in the SIS model (Fig. 2D ). Compared to the SIS model, the SID model showed a larger range of disease transmissibility (β) in which territoriality is protective against disease transmission. When infection resulted in worker mortality, increased territoriality reduced the maximum disease prevalence (Fig. 3A) ,decreased the probability of an epidemic occurring ( Figure S2) , and increased the number of remaining susceptibles (Fig. 3C) for all but the highest value of transmissibility (β = 0.2). Territoriality also increased the time for the uninfected colony to first become infected (Fig. 3B) , but not as strongly as in the SIS model. Unlike in the SIS model, in the SID model, territoriality increased colony productivity for all values of β (Fig. 3D) . In general, the impact of territoriality was much stronger when it was 100% effective; i.e., no drifters could enter the colony's territory. In the absence of worker drift, territoriality had little effect on the maximum disease prevalence or the total number of workers to remain susceptible (Figs. 4 and 5) . Notably, in the SID model without drift, increased territoriality no longer resulted in higher colony productivity (Fig. 4D) . These results suggest that the main protective effect of territoriality is preventing the introduction of foreign infected workers into the colony, rather than a reduction in contacts with infected workers outside the colony. Our results show a clear benefit of territoriality in preventing infectious disease transmission among social insect colonies. However, the protective effects of territoriality depend on Fig. 2 The influence of territoriality on epidemic dynamics for a pathogen with susceptible-infected-susceptible dynamics when workers occasionally drift between colonies. A The maximum prevalence declines at high levels of territoriality for less transmissible pathogens. B The time step at which spillover between colonies occurs is much later for pathogens with the lowest transmissibility when ter-ritoriality is strongest. C The number of remaining susceptible individuals at the end of the simulation is unaffected by territoriality. D Relative task productivity of the two colonies is unaffected by territoriality. In each plot, lines are colored according to the transmission rate of the pathogen and error bars represent the standard error (5% cutoff) from 40 runs of the simulation both colony behavior and characteristics of the pathogen. When there is the occasional drift of workers between colonies, increased territoriality flattens the epidemic curve by reducing the maximum disease prevalence in a population and increasing the time taken for a pathogen to spill over into previously unaffected colonies. Territoriality also reduces the size of the epidemic, increasing the number of workers that are never infected during the outbreak. An exception only occurs when pathogens are highly transmissible and require few opportunities to spread. The benefits of territoriality are also at their greatest for more deadly pathogens; in these cases, delaying the arrival of a pathogen into the colony and reducing its prevalence allows territorial colonies in our models to be more productive than those that are more accepting of foreign individuals. Overall, we find that the protective effect of territoriality is greatest for infectious diseases with low to moderate transmissibility (β = 0.05-0.1 in our study). When pathogens are highly contagious (e.g., β > 0.1), territoriality does not have the same consistent protective effect. This is because workers would be just as likely to catch (and spread) the disease from rare encounters with other workers outside the colony territory as the common encounters with fellow nestmates (or occasional drifters) close to the nest (Fries and Camazine 2001) . This result has clear parallels to the spread of infections through highly structured populations (Cross et al. 2005; Fefferman and Ng 2007; Hock and Fefferman 2012) or modular social networks (Pastor-Satorras et al. 2015; Sah et al. 2017; Valdez et al. 2020) . When transmissibility is low, it is easy for an infection to become trapped within a single colony (or network module) because contacts, and therefore potential transmission opportunities, with other colonies are very rare. However, as transmissibility increases, even these rare contacts are sufficient to allow transmission to occur. An example of this interaction between transmissibility and territoriality was seen in a study of Serengeti lion contact Fig. 3 The influence of territoriality on epidemic dynamics for a pathogen with susceptible-infected-dead dynamics when workers occasionally drift between colonies. A The maximum prevalence declines at high levels of territoriality for all but the most transmissible pathogen. B The time step at which spillover between colonies occurs increases at high levels of territoriality regardless of transmis-sibility. C The number of remaining susceptible individuals at the end of the simulation increases when territoriality is high for all but the most transmissible pathogens. D Relative task productivity increases as territoriality increases. In each plot, lines are colored according to the transmission rate of the pathogen and error bars represent the standard error (5% cutoff) from 40 runs of the simulation networks, which found that increased connectivity between prides did not increase their vulnerability to a highly infectious virus because rare long-range contacts already allowed for inter-group transmission (Craft et al. 2011 ). In the case of foraging workers, transmissibility may also lead to a change in where the bulk of infections occur. As transmissibility increases, rare encounters with foreign workers outside the colony's territory become an important source of pathogen transmission. As a result of this enhanced transmission risk outside the nest, preventing infected drifters from entering the nest loses its importance as a strategy for avoiding infection. Similarly, for pathogens that are able to persist longer in the environment and infect workers without direct contact (e.g., Durrer and Schmid-Hempel 1994; Andersen et al. 2009 ), territoriality is likely less influential on disease dynamics. Our model found a protective effect of territoriality only when workers could accidentally drift into the foreign colony when they approached. This suggests that the protective effect of territoriality is driven by a reduction in the chance of a foreign worker introducing the infection into the uninfected colony, rather than a reduction in contacts with infected workers outside the nest. Given that workers' contact rates are much higher within the nest than when foraging outside it (Fries and Camazine 2001) , this link between drift and territoriality is unsurprising. However, the importance of worker drift suggests that the role of infectious disease in the evolution of territoriality in eusocial insects will be closely tied to how much drift of workers occurs among colonies. While territoriality could be expected to increase with worker drift for a number of reasons (Holzer et al. 2008; Wittwer and Elgar 2018) , if territoriality is important as a protective behavior against disease, then it might be plastically expressed in response to emerging disease threats. As a protective behavior, we find that territoriality is particularly effective when the infection terminates in host death rather than recovery. This occurs partly because delaying the infection and reducing its maximum prevalence Fig. 4 The influence of territoriality on epidemic dynamics for a pathogen with susceptible-infected-susceptible dynamics in the absence of worker drift. Without worker drift epidemic dynamics, as measured through A maximum prevalence, B the time step at which spillover between colonies occurs, C the number of remaining sus-ceptible individuals at the end of the simulation, and D relative task productivity of the two colonies, are unaffected by the level of territoriality. In each plot, lines are colored according to the transmission rate of the pathogen and error bars represent the standard error (5% cutoff) from 40 runs of the simulation reduces disease-induced mortality, enabling the colony to remain more productive. However, we also find an interaction between transmissibility and deadliness whereby the maintenance of territorial boundaries is protective over a greater range of transmissibility when the disease is deadly. This pattern is likely driven by demographic stochasticity. As the deadliness of a disease increases, the likelihood of an infected foreign worker (or a low number of infected local workers) dying before they are able to spread the infection is expected to increase. Consequently, more introductions of the pathogen are required before an epidemic occurs within the colony, increasing the relative importance of preventing new pathogen introductions. An outcome of this interaction is that social insect populations with higher levels of territoriality might be better protected against novel emerging diseases that would otherwise have the capacity to cause substantial population declines. This finding suggests that the use of pathogens as a biocontrol strategy may be particularly effective for invasive species, such as the argentine ant (Linepithema humile), that have lost their territorial behavior outside their native range (Giraud et al. 2002) . It also suggests that selection for reduced aggressiveness to intruders, as has occurred in managed populations of the western honey bee (Apis mellifera), may inadvertently increase infectious disease transmission among colonies. This result may partly explain previous findings that lower aggression in honey bees is associated with higher vulnerability to parasites (Rittschof et al. 2015) . In our simulations, territoriality enhanced foraging effectiveness in colonies at risk from acquiring a deadly disease from neighbors by buffering the workforce against stochastic epidemic shocks (Figures S1 and S2 in Supplementary Materials). By reducing disease-induced mortality, territoriality resulted in a larger, more robust workforce and consequently higher productivity. In contrast, for a pathogen that does not result in worker mortality, territoriality had little effect on productivity, even when it prevented the colony from adopting foreign workers. This result suggests that for Fig. 5 The influence of territoriality on epidemic dynamics for a pathogen with susceptible-infected-dead dynamics in the absence of worker drift. Without worker drift epidemic dynamics, as measured through A maximum prevalence, B the time step at which spillover between colonies occurs, C the number of remaining susceptible indi-viduals at the end of the simulation, and D relative task productivity of the two colonies, are unaffected by the level of territoriality. In each plot, lines are colored according to the transmission rate of the pathogen and error bars represent the standard error (5% cutoff) from 40 runs of the simulation a wide range of pathogens, the benefits of protecting the colony against disease introduction outweigh the opportunity cost of not benefiting from the added labor of adopted workers. Because of the asymmetry between the substantial benefits obtained through territoriality when diseases are deadly and the negligible costs when a disease is benign, disease prevention could play an important role in the evolution of territorial behavior. However, because we did not directly model territorial interactions in our simulation, our results do not account for other possible costs of territory defense, such as injuries to workers or time spent patrolling territorial boundaries rather than foraging (Rivera-Marchand et al. 2008) , which would be expected to increase the cost of territoriality. Another possible cost of territoriality that our model does not include is workers mistakenly rejecting their own nestmates, a possible trade-off in any imperfect recognition system (Stokke et al. 2016) . However, because we assume in our model that foreign workers behave just like natal workers once accepted into the colony, mistakenly rejecting colony mates would have essentially the same cost as rejecting non-colony mates who are uninfected. As a result, including the possibility of mistakenly rejecting nestmates should not qualitatively change our results. Territorial defense and the rejection of foreign workers from the nest are widespread among eusocial animals. Different species have evolved a variety of mechanisms by which foreign workers are identified and refused entry to the nest, with some taxa having specialized guards that specifically perform this role (Breed et al. 1990 ; Powell and Dornhaus 2013; Baracchi et al. 2015) . However, there is considerable variation, both within and among species, in the strength of territoriality and how much effort workers make to reject non-nestmates from the colony (Katzerke et al. 2006; Arechavaleta-Velasco and Hunt 2003; Boomsma et al 2005) . Our results suggest that protection against the introduction of pathogens may contribute to the evolution of territoriality in eusocial animals. We would therefore predict a positive association between the frequency and virulence of pathogens that a social insect species faces and the level of territoriality it expresses. This positive association has been suggested as an explanation for the higher territoriality typical of ants and termites compared to social bees and wasps (Boomsma et al 2005) . However, variation in territorial behavior also exists within these broader taxonomic groups. Further work comparing levels of territoriality between closely related species that differ in pathogen exposure is needed to test this hypothesis. In addition, we would predict that populations of the same species under higher pathogen pressure would have evolved to be more territorial. A way to test this hypothesis would be comparing the strength of workers' defensive responses to non-nestmates between populations that differ in pathogen pressure. As discussed above, we would also expect these evolutionary associations to be tied to how often worker drift occurs between colonies and the costs of excluding foreign individuals. Where colonies incur a higher cost of territorial defense, we would also predict plasticity in territoriality to evolve, so that colonies reject only diseased individuals or elevate their level of territoriality when the local prevalence of disease increases. However, for this plastic response to occur, guards or colonies would need to be able to detect cues of infection. Direct detection of pathogens, based on chemical or physical cues, may occur for diseases that are endemic in the population, but is less likely for novel, emerging diseases. On the other hand, behavioral indicators of sickness may provide cues for the rejection of infected individuals without requiring workers to detect pathogens directly (Kazlauskas et al. 2016; Stockmaier et al. 2020) . Overall our findings support the hypothesis that territoriality limits pathogen transmission among colonies in eusocial insects. Many other group-living animals may also benefit from territoriality reducing opportunities for transmission between groups (e.g., Loehle 1995; Craft et al. 2011; Rozins et al. 2018) , which may make aspects of our findings relevant beyond eusocial animals. Our findings also complement those of a recent computational model, which showed that increased territoriality (through stigmergy) in a solitary species resulted in less severe outbreaks but could promote the persistence of infection within the population as a whole (White et al. 2020) . In that study, territoriality had the greatest impact when individuals recovered more slowly from infection and the population density of hosts was higher (White et al. 2020) . These findings suggest that extending our model to consider larger populations that differ in density and overlap in foraging range could provide further insights into the influence of territoriality on population-wide disease dynamics in eusocial animals. We show that territoriality is protective against infectious disease in colonies of eusocial insects for a wide range of disease characteristics. By reducing risky, within-colony contacts with foreign workers who may be carrying infection, territoriality can delay the introduction of an infectious disease and flatten the epidemic curve. When infectious diseases are deadly but not highly contagious, this protective effect is enhanced and can substantially buffer colony productivity against stochastic epidemic shocks. We suggest that a combination of empirical work to test the association between infectious disease and territoriality in eusocial insects and modelling work to build on our findings would contribute greatly to understanding how disease acts as a selection pressure in eusocial societies. Boundary disputes in the territorial ant Azteca trigona: effects of asymmetries in colony size Territoriality in ants (Hymenoptera: Formicidae): a review The life of a dead ant: the expression of an adaptive extended phenotype Genotypic variation in the expression of guarding behavior and the role of guards in the defensive response of honey bee colonies Speed and accuracy in nest-mate recognition: a hover wasp prioritizes face recognition over colony odour cues to minimize intrusion by outsiders Recognition of resident and non-resident individuals in intraspecific nest defense of a primitively eusocial halictine bee Nestmate recognition in eusocial insects: the honeybee as a model system Division of labor during honey bee colony defense Life histories and parasite pressure across the major groups of social insects Colony pace: a life-history trait affecting social insect epidemiology Modeling influenza epidemics and pandemics: insights into the future of swine flu (H1N1) Context affects nestmate recognition errors in honey bees and stingless bees Disease transmission in territorial populations: the small-world network of Serengeti lions Social immunity Social immunity: emergence and evolution of colony-level disease protection Pathogens and disease defense of invasive ants Duelling timescales of host movement and disease recovery determine invasion of disease in structured populations Predictive markers of honey bee colony collapse Shared use of flowers leads to horizontal pathogen transmission How disease models in static networks can fail to approximate disease in dynamic networks Disease prevention and resistance in social insects: modeling the survival consequences of immunity, hygienic behavior, and colony organization Implications of horizontal and vertical pathogen transmission for honey bee epidemiology Honey bee virus causes context-dependent changes in host social behavior The German bee monitoring project: a long term study to understand periodically high winter losses of honey bee colonies Evolution of supercolonies: the Argentine ants of southern Europe Drift of Varroa destructor-infested worker honey bees to neighbouring colonies The ODD protocol for describing agent-based and other simulation models: a second update to improve clarity, replication, and structural realism The basic reproduction number (R0) of measles: a systematic review Dynamics of social interactions, in the flow of information and disease spreading in social insect colonies: effects of environmental events and spatial heterogeneity Varroa destructor is the main culprit for the death and reduced populations of overwintered honey bee (Apis mellifera) colonies in Ontario Social organization patterns can lower disease risk without associated disease avoidance or immunity Stay or drift? Queen acceptance in the ant Formica paralugubris Transmission and infectivity of spores of Burenella dimorpha (Microsporida: Burenellidae) Seasonal nestmate recognition in the ant Formica exsecta Sickness behavior in honey bees Royal presence promotes worker and soldier aggression against non-nestmates in termites Nosema sp. influences flight behavior of infected honey bee (Apis mellifera) foragers Infection threat shapes our social instincts Termite pathogens: transfer of the entomopathogen Metarhizium anisopliae between Reticulitermes sp. termites Eusocial evolution and the recognition systems in social insects Different bacterial and viral pathogens trigger distinct immune responses in a globally invasive ant Scientific and ethical basis for socialdistancing interventions against COVID-19 Horizontal transmission of Paenibacillus larvae spores between honey bee (Apis mellifera) colonies through robbing Social barriers to pathogen transmission in wild animal populations Social immunity and the evolution of group living in insects A double-edged sword? The cost of proctodeal trophallaxis in termites Structure of the social network and its influence on transmission dynamics in a honeybee colony The role of colony organization on pathogen transmission in social insects Effect of mono-and polygyne social forms on transmission and spread of a microsporidium in fire ant populations Thelohania solenopsae (Microsporidia: Thelohaniidae) infection in reproductives of red imported fire ants (Hymenoptera: Formicidae) and its implication for intercolony transmission Contact networks and transmission of an intestinal pathogen in bumble bee (Bombus impatiens) colonies Epidemic processes in complex networks Mite bombs or robber lures? The roles of drifting and robbing in Varroa destructor transmission from collapsing honey bee colonies to their neighbors Workers, sexuals, or both? Optimal allocation of resources to reproduction and growth in annual insect colonies Soldier-based defences dynamically track resource availability and quality in ants Destructive disinfection of infected brood prevents systemic disease spread in ant colonies Co-evolution between sociality and dispersal: the role of synergistic cooperative benefits Optimal colony fissioning in social insects: testing an inclusive fitness model with honey bees The evolution of conspecific acceptance thresholds Early-life experience affects honey bee aggression and resilience to immune challenge The cost of defense in social insects: insights from the honey bee Ecology, behavior and evolution of disease resistance in termites Social structure contains epidemics and regulates individual roles in disease transmission in a group-living mammal Unraveling the disease consequences and mechanisms of modular structure in animal social networks Dynamics and control of diseases in networks with community structure Parasites and social insects A review on self-destructive defense behaviors in social insects Sickness effects on social interactions depend on the type of behaviour and relationship Disappearance of eggs from nonparasitized nests of brood parasite hosts: the evolutionary equilibrium hypothesis revisited Organisational immunity in social insects Social network plasticity decreases disease transmission in a eusocial insect Grooming patterns in the primitively eusocial wasp Polistes dominulus Corpse management in social insects Opposing effects of allogrooming on disease transmission in ant societies Seasonal nestmate recognition in the polydomous ant Plagiolepis pygmaea Trail and territorial communication in social insects How disease constrains the evolution of social systems Epidemic spreading on modular networks: the fear to declare a pandemic Social immunity: why we should study its nature, evolution and functions across all social systems Information processing in social insect networks A mechanistic, stigmergy model of territory formation in solitary animals: territorial behavior can dampen disease prevalence but increase persistence How emergent social patterns in allogrooming combat parasitic infections Cryptic castes, social context and colony defence in a social bee The online version contains supplemen-