Structural trade-offs can predict rewiring in shrinking social networks

This is an open access article under the terms of the Creative Commons Attribution License, which permits use, distribution and reproduction in any medium, provided the original work is properly cited. © 2019 The Author. Journal of Animal Ecology published by John Wiley & Sons Ltd on behalf of British Ecological Society. 1Department of Collective Behavior, Max Planck Institute of Animal Behavior, Konstanz, Germany 2Department of Biology, University of Konstanz, Konstanz, Germany 3Center for the Advanced Study of Collective Behaviour, University of Konstanz, Konstanz, Germany 4Department of Zoology, Edward Grey Institute of Field Ornithology, University of Oxford, Oxford, UK


| INTRODUC TI ON
The impact of humans on the planet is widely observed through the lens of declining animal populations. These declines include the complete loss of populations (e.g. through habitat removal), and, more often, the removal of some, but not all, individuals from populations (e.g. through hunting, increased disease burden or loss of critical resources). While such removals can release the remaining individuals from competition, for many species the loss of part of the population can have profound, and sometimes complex, negative implications, for example through Allee effects (Courchamp, Clutton-Brock, & Grenfell, 1999;Stephens & Sutherland, 1999) or cascading extinctions (Dunne & Williams, 2009;Sole & Montoya, 2001). From an individuals' perspective, losing conspecifics reduces the average group size they experience, thus reducing social benefits such as dilution of predation risk (Krause & Ruxton, 2002) and access to social information (Aplin, Farine, Morand-Ferron, & Sheldon, 2012). In species that live in stable groups, long-term social affiliations have been linked to increased adult (Silk et al., 2010) and infant survival (Silk, Alberts, & Altmann, 2003). The loss of members in such groups can also have negative consequences beyond immediate survival, for example by destabilizing social hierarchies (Flack, Girvan, Waal, & Krakauer, 2006). However, despite the importance of the social environment for individuals, there is no general framework for predicting their response to the disappearance of their social contacts.
As individuals leave or disappear from populations, those that remain could respond by forming new connections (Shizuka & Johnson, 2019). In a recent experiment, Firth et al. (2017) experimentally removed great tits (Parus major) and tracked changes in the behaviour of their previous social associates. They found that removals lead to the formation of new social associations, with birds that experienced the greatest impact (losing a close associate) forming most of the new connections. Similarly, individual baboons responded to the loss of group mates by increasing the number of affiliative partners and the amount of grooming towards others (Engh et al., 2006;Seyfarth, Silk, & Cheney, 2014), and this response is stronger in those individuals that had a relationship with the previous group mate (Engh et al., 2006). Thus, the loss of individuals from group or populations resulted in rewiring (or regulation) of their social network through the formation of new connections or strengthening of existing connections (see also Barrett, Henzi, & Lusseau, 2012;Flack et al., 2006). However, such a rewiring process is not captured in past studies simulating the loss of individuals from social networks. Instead, most past studies have simply sequentially removed nodes from networks to simulate the loss of individuals from populations or groups without any updating (e.g. Chaverri, 2010;Fedurek & Lehmann, 2017;Lehmann, Andrews, & Dunbar, 2010;Leve, Sueur, Petit, Matsuzawa, & Hirata, 2016;Lusseau, 2003;Manno, 2008;Mourier, Brown, & Planes, 2017;Wey, Blumstein, Shen, & Jordan, 2008;Williams & Lusseau, 2006).
Simple node removal simulations fail to capture fundamental properties of resulting networks. For example, the removal of individual ants from colonies had less impact on the information flow properties of the tandem running network structure than predicted by simulated node removals due to remaining individuals increasing their activity (Annagiri, Kolay, Paul, & Sona, 2017), while removal of social wasps from colonies resulted in a higher network density than predicted from node removal simulations (Naug, 2009). It is clear that existing simulation studies have provided some insights into the robustness of networks that experience change (e.g. Pastor, Santamaria, Mendez, & Galeano, 2012). But we still lack predictive power about the real-world effects of shrinking networks Formica, Wood, Cook, & Brodie, 2017;Mersch, 2016) and therefore a general understanding of how animals adapt to demographic changes in their social environments (Shizuka & Johnson, 2019). Further, given the widespread evidence for the selective consequences of structural properties of networks (Cantor et al., 2019), regulatory mechanisms should be compensatory-individuals should maintain key adaptive properties of their social environment.
The study of network regulation, through forming or strengthening connections, is much more advanced among scholars interested in ecological networks (Bartley et al., 2019;Valdovinos, 2019).
5. This study highlights how developing a better mechanistic understanding of the structural properties of networks, and the consequences of adding new connections, can provide useful insights into how organisms are likely to regulate their interactions in shrinking populations.

K E Y W O R D S
animal social network analysis, ecological disturbance, population ecology, resilience, social behaviour, social stability FARINE Muff, Memmott, Muller, & Caflisch, 2010;Silva, Guimaraes, Reis, &mixed-species communities (e.g. Dorado &Vazquez, 2014;Marthy & Farine, 2018). Empirical studies across these fields further confirm that simple node removal simulations do not accurately predict the real-world dynamics of shrinking ecological networks. For example, contrary to predictions, experimental removal of strongly connected plant species resulted in almost no secondary extinctions in a plant-pollinator network (Goldstein & Zych, 2016), but did increase density (the number of edges that are present divided by the number of possible edges) of the network (Brosi, Niezgoda, & Briggs, 2017). Simulations also consistently overpredicted the observed effects of the loss of ant species on seed dispersal (Timoteo, Ramos, Vaughan, & Memmott, 2016) and the number of cascading extinctions from the extirpation of species in food webs (Barnum et al., 2015).
Observations that new edges are formed or existing edges are strengthened after the composition of an ecological network changes have led to more refined algorithms for network regulation.
It is well known that in ecological networks, such as plant-pollinator mutualism and food webs, there are tight connections of coexistence among species (Rezende, Lavabre, Guimaraes, Jordano, & Bascompte, 2007). Such coexistence has underpinned the co-evolution of specialized traits, meaning that one species is not necessarily replaceable by another (Guimaraes, Jordano, & Thompson, 2011;Morin, 2011). As a result, studies that have modelled community dynamics suggest that functionally or phylogenetically similar species should be more likely to be the targets for the formation of new connections (Pearse & Altermatt, 2013 (Gilljam, Curtsdotter, & Ebenman, 2015;Kondoh, 2003;Valdovinos, Espanes, Flores, & Ramos-Jiliberto, 2013) based the rewiring probability on estimated trait compatibility among nodes. The logic here being that the connections in ecological networks often exhibit strong phylogenetic structure (Cattin, Bersier, Banasek-Richter, Baltensperger, & Gabriel, 2004;Rohr & Bascompte, 2014), even when the communities themselves have changed (Poisot & Stouffer, 2018). However, such approaches require extensive knowledge about node traits and/or the history of connections among the nodes that form the network, which is not always the case in social networks.
Models that accurately predict properties of network regulation are important. They provide tools to predict how a given network might change, they confirm our understanding of biological mechanisms involved with how changes take place, and they allow theoret-

BOX 1 Identifying trade-offs in social decisions
Removing a node from a network will not, on average, change its density, assortment or clustering. However, for each removed node, the mean degree of the remaining nodes in the network will decrease in proportion to the network's density. As a consequence of decreased degree, we expect the remaining nodes to respond by forming new connections. This is because in animal social networks individuals generally have consistent social phenotypes (Aplin et al., 2015) and because the average group size these individuals experience is directly linked to benefits of grouping, including anti-predator benefits and increased food intake (Krause & Ruxton, 2002). However, each time a new connection is formed, the density of the network will increase.
If a network is assorted by phenotype, then there are, by definition, more connections between individuals with similar phenotype relative to connections between individuals with different phenotypes. A random new connection in an assorted network will therefore be more likely to occur between phenotypically dissimilar individuals, as such connections are more likely to be absent. Thus, rewiring will not only increase density but also decrease network assortment. In highly assorted networks, individuals' traits will generally be more correlated with the traits of its second-degree contacts (a node with a common connection) compared with traits of random nodes. Forming a connection with a second-degree node will therefore have, on average, less impact on assortment than forming a connection with a random node.
Real animal networks are also often more clustered than random networks. Such clustering could arise due to spatial proximity-if A and B are interacting, and B and C are interacting, then A and C are likely to have greater opportunity to interact (Farine, 2015). As with phenotypic assortment, adding random new connections will, on average, reduce the clustering coefficient in a clustered network because closed triads are already over-represented in the network.
Again, forming a connection with a second-degree node will, on average, maintain or increase the clustering coefficient relative to forming random connections (ultimately, a fully connected network will also be fully clustered).
would individuals in a social network choose which connection(s) to update or with whom to form new connections with? Exploring the consequences of different choices reveals some simple strategies that could underpin regulation in animal social networks.
Two considerations could yield some insights into how individuals in a social network might respond to a shrinking network.
The first is that not all individuals will be directly affected by the loss of a node and that the affected individuals are probably more likely to regulate their connections. Thus, we can first predict that, in general, it is those that were directly connected to the removed individual which should be most likely to react. The second is that not all individuals are likely to be, or become, connected or to strengthen their existing connection. In many species, individuals can disproportionately benefit from associating with particular types of conspecifics. For example, male great tits are more likely to associate with conspecifics that have a similar personality type, both during the winter (Aplin et al., 2013) and in the breeding season (Johnson et al., 2017), and the resulting social environment experienced by these individuals can be an important determinant of their fitness .
Either because of constraints on the process of network generation (Ilany & Akcay, 2016) or because of active social decisions about who to associate with (Farine, Montiglio, & Spiegel, 2015), animal social networks often have more connections between phenotypically similar individuals (resulting in assorted or, if dissimilar, in disassorted networks, Farine, 2014). Thus, in real-life shrinking networks, rewiring will likely be constrained by, or made in preference to, phenotypic similarity. However, a general model should be able to maintain phenotypic structure in predicted social networks without needing to directly encode any rules governing the formation or strengthening of links according to individual phenotypes or requiring individuals to have a broader knowledge of network structure. One reason for this is because individual animals are unlikely to be using global information in their own decision-making.
In this paper, I propose a general and simple mechanism whereby individuals that lose a connection are more likely to rewire, meaning either forming new connections or up-regulating connection strength. Such rewiring is more likely to occur between individuals that lost a connection to the same removed node. This process, herein called 'second-degree rewiring', is biologically sensible, especially when there a strong spatial component underpinning network structure (Aplin et al., 2015;Farine & Sheldon, 2019;Webber & Vander Wal, 2018). One illustrative example of second-degree rewiring is if the loss of a territory holder results in new territorial boundaries between previously unconnected neighbours when their remaining territories expand to fill the newly vacated space. The novel advance in the mechanism I propose is that it maintains phenotypic and clustering structure after social network rewiring without requiring any information about node attributes or how nodes are connected in the global network. Instead, it relies on the fact that if nodes are non-randomly distributed in a network, nodes in the second degree or existing connections will, probabilistically, be more similar than any two nodes selected at random. I first demonstrate the effectiveness of the second-degree rewiring algorithm by simulating node removals and the effectiveness of different strategies for network regulation at maintaining four key properties of widespread importance in social networks. Specifically, I use a network-generating algorithm to create social networks that vary in phenotypic structure, clustering, network density and mean degrees, and then track these properties after removing nodes from these networks (a no rewiring strategy), and after rewiring using a random strategy or a second-degree rewiring strategy. Tracking these demonstrates the ability for second-degree rewiring to maintain key properties of networks without encoding any information about these properties in the decisions that individuals make. Finally, I provide empirical evidence for the existence of a second-degree rewiring strategy by analysing data from an experiment that involved the temporary removal of individuals from a wild social network of songbirds.

| Four key network properties that may affect individuals' social decisions
The properties of an individual's patterns of connectivity can determine its success. Throughout the manuscript, I focus on four key network metrics: degree, phenotypic assortment, density and clustering. First, the number of social connections (degree) or their propensity to associate with others (their weighted degree calculated as the sum of connection strengths) is important for many social animals (Alberts, 2019); thus, individuals should aim to maintain their degree or weighted degree. Second, the phenotypic composition of the social environment, represented by network assortment, can be a major determinant of fitness Formica et al., 2011;McDonald, Farine, Foster, & Biernaskie, 2017). Third, the overall density of connections in a population can influence the rates of social evolution by determining the variance in social environments experienced by different individuals (Montiglio, McGlothlin, & Farine, 2018).
Fourth, most animal social networks exhibit high clustering, either because spatial constraints mean that forming a closed triad is often unavoidable (Farine, 2015) or because closed triads are more socially stable (Ilany, Booms, & Holekamp, 2015). While such network metrics have been widely correlated with different aspects of fitness (Cantor et al., 2019), we have little knowledge of how such patterns can emerge or be maintained in dynamic environments.

| The model: Forming new edges
Modelling the process of network regulation when nodes are removed involves two possible changes: the addition of new connections and the strengthening of existing connections. First, I describe the process of forming new connections with previously second-degree contacts, which represents a type of link prediction (Liben-Nowell & Kleinberg, 2007;Wang, Xu, Wu, & Zhou, 2015). Consider a network containing N nodes. When a node n i is removed, all of the remaining nodes that were connected to it will lose one contact (i.e. their degree will reduce by 1). Given that all of n i's previous contacts have lost a connection, these affected individuals could be more likely to seek new connections. In my model, the probability that an individual forms a new connection with a node previously in its second degree is given by P m (Figure 1a). Note that here I define P m as the independent probability for each node and allow the connection to form regardless of which node initiates the contact (i.e. if A approaches B, then A and B are in proximity regardless of B's choice), but the process could equally be modelled by defining P m as the joint probability that the contact is formed by the dyad. In addition, random new connections can be formed between n i's previous contacts and any other individual in the population, which I define as P s (Figure 1b).

| The model: Regulating connection strengths
The same principles can be followed to identify which edges could increase their connection strength in weighted networks in response to the loss of a node (Figure 1c). Here, P m determines the propensity for nodes to increase their connection strength with contacts that were shared with n i (i.e. that formed part of a triad prior to the removal of the node). In addition, n i's previous contacts can increase the strength of their connections with any of their other existing individuals across the whole population, which as above I define as P s (Figure 1d). Modelling edge weight regulation then requires the additional step of determining by how much the identified edges should increase their weight. Several strategies could be explored. One biologically plausible scenario is to increase the edge weight proportionately to the mean edge weight in the network. The exact ratio of this proportion could then be determined by the strengths of P m and Pr, as higher values mean more edges are updated, and therefore, each edge should be updated by a smaller amount.

| Modelling the trade-offs of rewiring on network traits
I simulated social network dynamics in 2,500 randomly generated networks to show how different mechanisms for forming new connections can influence the resulting properties of shrinking networks. I start by generating random Bernoulli (undirected and binary) networks containing N = 50 individuals and a density of 0.5 (that is, on average 50% of the possible connections among nodes were made), and drawing individuals' phenotypes from a normal F I G U R E 1 Illustration of second-degree rewiring mechanism for modelling regulation in shrinking social networks. Here, the network of individuals (nodes) that socially interact (connections) is phenotypically assorted by a trait (node colours). Node n i is removed, and two individuals connected to n i each lose one connection (light grey edges). These individuals could form a new connection to each other (P m , panel a) or to a random link (P s , panel b). If the network is assorted, on average nodes that share a common contact will be more likely to have a similar trait value relative to random nodes. The same algorithm can be used to model identify which connections might update their strength in weighted networks, which could be either with former members of a triad containing n i (c) or with other existing contacts (d).
Increasing the connection strength with existing contacts that also lost a connection (vs. increasing connections with existing partners that were not affected by the loss of an individual) would have less impact on network-level properties such as assortment, but would not restore clustering distribution with a mean of 0 and a standard deviation of 1. I then run 500 iterations of a network-generating model (Ilany & Akcay, 2016) as a 'burn-in' phase. This model simulates a process where individuals that are born into a network can inherit the connections of their parents. For every birth, there is a probability Pb that the newborn will be connected with its mother (where Pb ≈ 1 for many vertebrates, including most mammals and birds). If the newborn is connected to its parent, the newborn then has a probability Pn of being connected to each of its parent's contacts, that is to preferentially form new connections with second-degree contacts Appendix S1. Finally, I investigate whether the effects of P m and P s vary with network size (using N = 24 and N = 100), the results of which are also included in Appendix S1.

| Empirical evidence for 'second-degree' rewiring
Finally, I use the data from the Firth et al. (2017) study to test for evidence that wild birds were more likely to form new connections or to strengthen their connections, with conspecifics that had a shared loss of a contact. In their study, the authors temporarily removed great tits from a wild population containing over 500 individuals.
The study was conducted over four replicates, each time removing 6 randomly selected individuals and collecting social network data from before and after the removals. From this dataset, I calculate second for all dyads in which two individuals shared a common contact but did not experience the loss of any contact (i.e. to evaluate the baseline rate of connection dynamics).

| Modelling the trade-offs of rewiring on network traits
The modelled strategies produce very different outcomes and reveal average, equal to the density of the network (slope of the blue half circles in Figure 2d). Rewiring allows the mean degree to be maintained.
However, rewiring strategies have consequences for global properties of the network. They increase the density of the network, which, by definition, pushes the assortativity towards 0 (a completely connected network has an assortativity of 0). The clustering coefficient can both drop and increase depending on the original clustering of the network.
These effects are typically more extreme when forming random connections than when using second-degree rewiring, and random rewiring performs worse at maintaining the mean degree.
Different rewiring strategies can have drastically different outcomes. Low levels of rewiring (e.g. P m = 0.05 or P s = 0.01, Figure S1) provide few benefits in terms of mean degree, but can have a large cost in terms of maintaining assortativity. Combining rewiring strategies can also result in dramatically different networks. For example, rewiring with the same probabilities in Figure 2 but combining the two strategies results in a very high network density and low assortativity ( Figure S2). Applying second-degree rewiring alone, but with very high probabilities, also fails to maintain key network characteristics, resulting in low assortment, high density and too high clustering. In many cases, a low level of random rewiring will take place, and this can potentially help offset some of the negative outcomes of a high second-degree rewiring probability ( Figure S3). The results of second-degree rewiring are almost identical when removing multiple nodes at a time before nodes update their connections ( Figure   S4). Finally, the effects of P m and P s are dependent on network size.
Both have greater impact when networks are larger ( Figure S5) and weaker impacts when networks are smaller ( Figure S6). Adjusting the parameters according to network size can maintain consistency in the effects across network sizes ( Figures S7-S8).

| Empirical evidence for 'seconddegree' rewiring
Data from constructing social networks of great tits before and after experimental removal of individuals reveal evidence for the network rewiring and connection strength regulation mechanisms I propose.
Across N = 1,352 dyads that were not connected and shared a connection to one of the removed individuals prior to its removal from the population, there was a 9.91% chance that they would become connected after the removal (forming 134 new connections among them). By contrast, the baseline rate of new connections forming across dyads that shared connections to a common node that was not affected by the removals (N = 612) was only 5.2% (32 new connections). The difference in these rates of forming new connections (representing P m and P s , respectively) is significant (χ 2 = 11.938, p < .001). Similarly, dyads that were connected prior to the removal and shared loss of a social contact (N = 5,936) on average increased the strength of their connection-here, the simple ratio index representing the probability of observing two birds in the same flock (Farine & Whitehead, 2015;Hoppitt & Farine, 2018)-by 0.004 (or +5.9% of their connection strength prior to removal). By contrast, the baseline rate of change in connection strength across connected dyads that shared a common social contact that was not affected by removals (N = 2,064) showed a decrease of 0.055 (or −71.7% of the connection strength prior to the removal). This difference in the mean change in connection strength (representing P m and P s respectively) is significant (χ 2 = 123.02, p < .001).

| D ISCUSS I ON
There is increasing interest in studying, and predicting, the resil- Failing to form new connection when an individual is removed from a population will result in a sparser social environment (e.g. a smaller average group size) that could have consequences on individual's survival and/or reproduction (Krause & Ruxton, 2002).
However, the unavoidable consequence of adding new connections is that network density, or the proportion of connections that are present, will increase. This alone could have a range of biological impacts. Increasing the density of connections can change the patterns of variation in the social environment among individuals that shape the expression and evolution of social traits . For example, higher density could increase the influence of extreme individuals on processes such as decision-making (Couzin et al., 2011) and mating systems (Maldonado-Chaparro, Montiglio, Forstmeier, Kempenaers, & Farine, 2018). However, density is closely tied to mean degree, meaning that increasing density is likely to be inevitable for individuals that aim to maintain their number of social contacts.
By definition, increasing the density of connections will reduce clustering and assortment of the network, which could have major ramifications. For example, higher clustering has been widely linked to reduced transmission of disease through social networks (Volz, Miller, Galvani, & Meyers, 2011), while assortment, such as kin-based associations, is thought to be central to social evolution (McDonald et al., 2017). For example, recent studies on human hunter-gatherers suggest that cooperation is maintained through assortative interactions (Smith, Larroucau, Mabulla, & Apicella, 2018 Second-degree rewiring is a realistic mechanism for most social networks. Animals have been widely shown to regulate their behaviour, such as switching prey or plant species, in response to changing availability (Stephens, Brown, & Ydenberg, 2007), and experimental removal of nodes from wild social networks has been shown to result in an increase in density of connections . Data from the responses of individual great tits who experience the loss of conspecifics from their networks support this model: dyads that experienced a shared loss of connection were almost twice as likely to become connected relative to dyads that had a common connection to an unaffected conspecific. Further, dyads which were connected but lost a shared connection strengthened their bonds, whereas on average dyads which were not affected by removals reduced the strength of their bond from the first time period to the second. The model I present provides a useful baseline against which we can evaluate the social decisions that individuals make when observing a population. Such a baseline can be used, for example, to evaluate whether individuals make partner choice decisions based on specific traits (i.e. prioritise assortative associations) or whether they use simpler rules based on the availability of partners (and whether these are non-randomly distributed according to phenotype).
A key further question arising from this work is to determine whether the rewiring rules that individuals when faced with a shrinking social environment will change as the size of the population they live in progressively reduces. Simulations suggest that network size impacts the effects of a given strength of rewiring strategies ( Figures   S5-S8). A cue for modulating the strength of rewiring could be density. There are well-known density-dependent effects on population vital rates (Coulson, Milner-Gulland, & Clutton-Brock, 2000), and variation in population size is thought to contribute to the maintenance of within-population variation in behavioural traits (Nicolaus, Tinbergen, Ubels, Both, & Dingemanse, 2016). Further studies might test whether selection on rewiring strategies (e.g. on the value of P m ) varies as the size of the population changes. For example, does population shrinking favour increasingly larger values of P m (and/or P s )?
By also changing who interacts with whom, network regulation will alter fundamental parameters in social populations. Thus, a further question is whether network regulation plays a role in modulating observed population density-dependent effects on phenotypes and population processes.
Quantifying the impacts of regulating connections in different ways on network structure at varying biological scales generates new insights into the consequences of extinctions in different types of animal societies. Although rewiring has been considered in previous models, the majority of previous work has been based on simplistic removals (no rewiring) or used algorithms that require knowledge about the similarity among different sets of nodes (e.g. the foraging efficiency of a pollinator on a plant species). The algorithm presented in this paper provides a general tool for generating predictions by using only information about the network itself, following the principles of network self-organization (Cantor & Farine, 2018;Cattin et al., 2004). Applying this model and comparing how it predict changes in different types of animal societies could highlight potential commonalities and conceptual links in the dynamics of networks across different types of social communities.

DATA AVA I L A B I L I T Y S TAT E M E N T
This article contains no data. The R function and code to replicate the figures from the simulation are provided at: https ://doi. org/10.17617/ 3.2w (Farine, 2019).