The scaling of social interactions across animal species

Social animals self-organise to create groups to increase protection against predators and productivity. One-to-one interactions are the building blocks of these emergent social structures and may correspond to friendship, grooming, communication, among other social relations. These structures should be robust to failures and provide efficient communication to compensate the costs of forming and maintaining the social contacts but the specific purpose of each social interaction regulates the evolution of the respective social networks. We collate 611 animal social networks and show that the number of social contacts E scales with group size N as a super-linear power-law \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$E=CN^\beta$$\end{document}E=CNβ for various species of animals, including humans, other mammals and non-mammals. We identify that the power-law exponent \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\beta$$\end{document}β varies according to the social function of the interactions as \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\beta = 1+a/4$$\end{document}β=1+a/4, with \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$a \approx {1,2,3,4}$$\end{document}a≈1,2,3,4. By fitting a multi-layer model to our data, we observe that the cost to cross social groups also varies according to social function. Relatively low costs are observed for physical contact, grooming and group membership which lead to small groups with high and constant social clustering. Offline friendship has similar patterns while online friendship shows weak social structures. The intermediate case of spatial proximity (with \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\beta =1.5$$\end{document}β=1.5 and clustering dependency on network size quantitatively similar to friendship) suggests that proximity interactions may be as relevant for the spread of infectious diseases as for social processes like friendship.


Results
The data sets were collated using online databases of animal and human social networks previously analysed by other authors. All networks were reviewed for consistency and the data sets were standardised such that only unique pairs of social contacts were counted, i.e. self-loops, weighting, timings of contacts, and directions were removed. Social interactions were identified and labelled in the original studies by domain experts via direct observation (animal interactions), questionnaires (offline friendship), electronic devices (spatial proximity), and online platforms (online friendship) (see SI). To minimise potential ambiguities, each network was constructed based on the specific definition of social interaction in the respective original study. Table 1 shows the number of networks for each type of social interaction and animal class, including captive and free-ranging animals. The network size varies across species and social interactions because of experimental settings, characteristics and limitations of the study populations, e.g. the observation capacity of researchers, cost of technical devices, free-range vs. confined animals, online platforms, or animals living in small groups (see SI).
Scaling of social interactions. The networks of social interactions were grouped in categories following the type of social interactions as reported in the original studies (Table 1). Figure 1 shows the scaling between the number of social contacts E and size N (i.e. the number of interacting individuals) for each of the 6 original categories. We assume that the scaling of social relations is independent of species and test our hypothesis E = CN β by fitting a power-law to the data using logarithmic transformed variables to evenly distribute the data points: The fitting exercise gives super-linear power-law exponents (i.e. β > 1 ) and strong linear correlations ( 0.55 < r < 0.99 ) for all categories of social interactions ( Table 2). Assuming a small error ǫ in β , the exponents follow the general law ( β = 1 + a/4 ) with a ≈ 1 for online friendship ( ǫ = 12% ), a ≈ 2 for spatial proximity ( ǫ = 4% ), a ≈ 3 for group membership ( ǫ = 2.6% ) and offline friendship ( ǫ = 5% ), and a ≈ 4 for physical contacts ( ǫ = 1% ) and grooming ( ǫ = 6% ), despite differences in species and sample sizes (Fig. 1).
This super-linear scaling indicates increasing densification of social contacts, that is, larger social groups have on average more social contacts per-capita than the smaller ones. It is not surprising that β > 1 because the number of social connections must scale at least linearly with group size ( E ∝ N ) to maintain the social network connected; this is known as the percolation threshold in random networks 23 . If E ≈ N , small perturbations may fragment the network, breaking down the group structure. Furthermore, β > 1 suggests that a super-linear number of contacts are necessary to create and maintain the complex social network structures for the groups to function cost-efficiently irrespective of size.
Social network structure. We study the network structures for each of the six types of social interactions (see "Methods"). The clustering coefficient cc is a local measure of the level of sociality between common contacts of a focal individual (i.e. the fraction of social triangles). Its intensity indicates an evolutionary group advantage as for example fitness benefits 24,25 . Networks with higher clustering are relatively more robust since  A: physical contact 0  4  0  0  2  244  0  250   B: grooming  0  23  0  0  0  0  0  23   C: group membership  4  0  0  7  5  0  0  16   D: spatial proximity  63  58  88  9  0  12  1  231   E: offline friendship  0  0  67  0  0  0  0  67   F: online friendship  0  0  24  0  0  0  0  24   Total  67  85  179  16  7  256  1  www.nature.com/scientificreports/ the deletion of a social connection would not significantly affect interaction and communication among close contacts. In our social networks, cc is constant for varying network size for all types of social contacts (Fig. 2).
In random networks, the clustering coefficient decays with increasing network size as �cc� = �k�/N , where k is the average number of contacts (or edges) in the network 23 . The inset of Fig. 2F shows the results for the randomised versions of the same online friendship networks (see SI for the other categories). In all categories, there is a higher clustering coefficient than expected on the basis of randomised social contacts (see caption Fig. 2). Since the average degree is defined as �k� = 2E/N , we have �cc� = �k�/N = 2E/N 2 and thus would need E ∝ N 2 to have constant clustering in random networks. Evolutionary theory implies that more complex structures may emerge in such social systems to optimise resources, e.g. to reap the fitness related benefits, and thus relatively less social contacts become necessary to reach the same level of clustering across group sizes 24,25 . For example, for  Table 2. All axes are in log-scale. www.nature.com/scientificreports/ some classes of random heterogeneous networks, �cc h � = A/N , where the proportionality constant A depends on the heterogeneity of the distribution of contacts among individuals and is lower than k 23 . The average length of the shortest-paths l measures the average distance between any pairs of individuals in the social network and quantifies the communication potential between parts of the network 26 . Shorter average distances (i.e. �l� ≪ N , resulting in the small-world effect 27 ) indicate that information flows quickly over the network, which is a fundamental characteristic of efficient group organisation 28 . For physical contacts, grooming, and group membership, l is constant and slightly higher than one ( Fig. 2A-C). For spatial proximity and offline friendship, the values increase with size following quantitatively similar trends (Fig. 2D,E). The results for online friendship suggest a constant trend (Fig. 2F). In all cases, the average path-length is l < 6 , which is the small-world horizon observed empirically 23 . For all 6 categories, the random versions of the same networks give constant relations albeit generally with lower values (see SI). In theoretical random networks, the average distance increases slowly with the network size as �l� ≈ log(N)/ log(�k�) 23 . Nevertheless, the average path-length l is approximately constant across group sizes if E ∝ N β for β > 1 , since in this case �l� ≈ log(N)/ log(2N β−1 ) ≈ 1/(β − 1) . Smaller β thus leads to higher l , as observed in the analysed networks.
In some classes of heterogeneous random networks, l is also nearly constant with network size 23 . The density of contacts explains the low l for physical contact, grooming and group membership. The discrepancy of spatial proximity, offline and online friendship with the random case indicates that more complex network structures are being formed in larger groups for these types of social interactions. In sparse networks, like those, a high level of local clustering increases the distance between random pairs of network nodes because of local spots of connectivity redundancy 23 . Taken together, the constant clustering across network sizes ( Fig. 2) implies that the average distance will necessarily increase ( Fig. 3), unless followed by a sufficient increase in the number of connections (to maintain low average distances as the group increases). The growth in offline friendship followed by a seemingly constant pattern for online friendship (which has larger sizes) suggests a potential saturation in l for human friendship in line with the small-world horizon observed in previous studies 23 . Although communication remains efficient (because �l� ≪ N ), the benefits of forming larger groups do not compensate the costs of optimising certain network structures, as is the case for other types of social interactions involving physical contact. www.nature.com/scientificreports/ Multi-layer model. Multi-layer models can be used to represent the underlying generative mechanisms through which individuals combine skills and affinity to build up more complex social groups. From single individuals to the entire population, individuals may be stratified in layers (or levels) corresponding to different groups 29 . For example, living in households (layer 1) within neighbourhoods (layer 2) that in turn are part of cities (layer 3), and so on, seems natural for humans. While people mostly interact with those in the same group (e.g. within the same household), interactions across groups are less frequent 30 (e.g. between different households in the same neighbourhood). Interactions across groups at the same layer are necessary to define higher-order groups, i.e. a group at the next higher layer, as for example a neighbourhood is a result of interactions between individuals from different households. Multi-layer models have been used to explain spatial relations in vascular 31 and infrastructure 17 systems. We argue that such models are also of value for social groups, not necessarily spatially bound, since multi-layer organisation has been observed across animal species in which a relation between group sizes in different layers vary from nearly 2.5 in primates to about 3 for other mammals including humans 14,32 . This means that individuals are organised as multiples of 3, for example, in groups of 5 (layer 1), 15 (layer 2), 45 (layer 3), and so on. The model detailed below does not aim to reproduce all structures of the 611 analysed networks but focuses on the scaling exponents β.
The self-similar multi-layer group structure is mathematically represented as a branching tree with a group at layer h split into b sub-groups at layer h − 1 (Fig. 4). At the highest layer h max , all individuals belong to a single social group, i.e. N = b h max , and at the lowest layer ( h min = 0 ), each group is formed by a single unique individual. In this model, individuals i and j make a social contact (i, j) with probability p �h (i, j) dependent on the distance h between the layers that separate them. Closer individuals (e.g. at distance h = 1 because they are living in the same neighbourhood or belonging to the same social group) are more likely to interact than individuals living far apart (e.g. at distance h = 2 because they are living in different cities or belonging to different social groups), i.e. p �h (i, j) decreases with h . The multi-layer tree-like structure only defines the distance h between the groups that is in turn used to form contacts in the social network (Fig. 4); the resulting social network only has tree-like structure for sparse networks, i.e. when E ≪ N 2 . The self-similarity between layers implies that p �h (i, j)/p �h−1 (i, j) = const 33 . A power-law of the form p h ∝ c − h , with c > 1 , satisfies this relationship. The parameter c represents the cost to make social interactions across layers, that we assume is lower than the cost  For 1 ≤ c < b , the sum converges: Therefore, the total number of social connections is: The multi-layer model implies that β = 2 − log b (c) . Assuming that b = 2.5 14 , the cost of connections is thus c A = 1 for physical contact ( β A ≈ 2 ), c B = 1 for grooming ( β B ≈ 2 ), c C = 1.26 for group membership ( β C ≈ 1.75 ), c D = 1.58 for spatial proximity ( β D ≈ 1.5 ), c E = 1.26 for offline friendship ( β E ≈ 1.75 ) and c F = 1.99 for online friendship ( β F ≈ 1.25 ). This cost is associated to crossing (virtual) barriers between social groups that might cause the creation of larger groups. The low cost ( c = 1 ) for physical contact and grooming means that p h = 1 , i.e. the probability to form connections is independent of the social distance h , collapsing the assumption of multi-layer structure. For such types of social interactions, the connections within the same social group are favoured; individuals do not groom in different social groups nor make persistent physical contacts, except physical contacts for conflict that would not be reflected in our data. This effect is related to the high clustering coefficient reported in previous sections and may explain the relatively small size of such networks. The number of social contacts for such activities is limited within the same social group. Online friendship, on the other hand, is costly ( c ≈ 1.99 ) in terms of crossing social boundaries to connect individuals from different social groups 34 , e.g. with different tastes, ideas, location, age, and so on. Socially closer individuals would be favoured here as well since it is harder to be friends with dissimilar people than with those similar to each other 30 . However, given that online connections are cheap to establish and maintain (i.e. do not need nurturing and resources), the multi-layer structure becomes relevant with a non-negligible number of socially distant connections being formed. Furthermore, online friendship typically mixes (real) friends, acquaintances, relatives, and co-workers, each belonging to different social groups, with some individuals acting as social brokers. For example, online friendship is more easily established between those studying in the same school than at different schools; however, inter-school friendship is facilitated by the online platform, though socially costly (lack of face-to-face interactions, no common friends, building trust). For networks derived from mobile phone communication in urban populations, a scaling exponent β = 1.15 has been reported [35][36][37] . Such mobile communication data sets mix professional and personal relations which possibly also leads to higher costs in the sense of crossing social boundaries. In one study, a constant clustering coefficient has been also observed suggesting that similar underlying principles may explain the formation of such social or communication structures 37 . The multi-layer structure becomes less relevant for offline friendship ( c ≈ 1.32 ) that are typically more spatially constrained in our data. For example, students or prison inmates will report friendship with those around them. In schools, from where most of our data come from, the social structure is seen at the multi-layer structure social network www.nature.com/scientificreports/ class and school layers only. Given experimental limitations, it is often not possible to report friends outside the study setting, which could reveal higher social layers, e.g. neighbourhood friends. It is possible that the exponent β for friendship is thus between what we estimated for offline and online friendship if all layers of friends and not only those in the same study setting were reported. Our analysis finds an intermediate exponent ( β = 1.5 ) and cost ( c ≈ 1.58 ) for spatial proximity. Spatial proximity is a particular type of social interaction. Grooming, physical contact and human friendship are welldefined interactions identified, respectively, by observing joint activities or by directly inquiring individuals. However, spatial proximity interactions are measured by sensors or direct observation and capture a mixture of social situations. Spatial proximity might reflect affinity, trust and friendship between individuals and animals sharing the same space 30 , e.g. persistent spatial proximity between pairs of cows 38 , or behavioural or trait similarity, i.e. homophily, as for example friends visiting a museum 39 or health-care workers in hospitals 40 . On the other hand, spatial proximity interactions might simply reflect spatial constrains forcing individuals and animals to be in close proximity during periods of time, e.g. a group of visitors of an art exhibition 39 or confined animals 38 . Nevertheless, also in the later, affinity and trust are reflected in the proximity contacts. As discussed above, it is possible that friendship at the society layer likely follows patterns intermediate to those observed in the online ( β = 1.25 ) and offline ( β = 1.75 ) categories. The existing literature associating friendship to time that individuals spent together 30 and the observation that spatial proximity contacts follow an intermediate exponent ( β = 1.5 ) suggest a potential link between these social interactions. We cannot make a strong association between the two types of social interactions due to lack of data of offline friendship in larger populations. Previous modelling exercises in urban populations suggest that β B = 1.5 can be explained by mobility ( H = 2 , where H is the Hausdorff dimension of a path in space) over two dimensional ( D = 2 ) spaces based on the assumption that fully-mixed populations may fully explore a given area 17 . While this assumption may hold within, e.g. schools, museums or barns, it does not apply on larger spatial areas since humans and animals are territorial and tend to spend most of time within certain locations 41 or with certain individuals 30 . On the other hand, the same model suggests that contacts per-capita scale as 0.25 (i.e. β = 1.25 ) under the same conditions (i.e. H = D = 2 ). This fits well to our findings for offline friendship, where people may virtually explore the whole social space and potentially interact with different individuals.

Conclusions
Our findings reveal key aspects of the organisation of animal social networks. Though primates and non-primates (including humans) are more represented than other animals in our data set, the universal scaling relations E = CN β between the number of social contacts E and size N suggest common organisation principles across animal species that can be explained by multi-layer models designed to maintain the functioning of the social groups 14,32 . Different scaling exponents following the general relation β = 1 + a/4 , with a ≈ 1, 2, 3, 4 allow us to distinguish types of social interactions and to infer network structures underlying those interactions. For all types of social interactions, the local clustering remains constant for increasing network sizes albeit having different intensity in each case. Physical contacts, grooming and group membership have similar constant median values that are higher than observed for spatial proximity, offline and online friendships. The average path-length is also constant and follow the small-world pattern (i.e. �l� ≪ N ) for most cases with the exception of spatial proximity and offline friendship where a quantitatively similar positive trend is observed with values below the small-world horizon of �l� ≈ 6 previously observed in social networks 23 .
One may argue that humans differ from other animals by developing more efficient social network structures, with relatively less contacts for larger network sizes, and thus lowering the scaling exponents. There is a quantifiable relationship with brain and group sizes, along with the complexity of the interactions. Humans are able to process the cognitive demand of other forms of relationships such as friendship, rather than mating and dominance relations that often occur within other animals and species 42 . The common scaling pattern observed across species and particularly for spatial proximity weakens the hypothesis that animals differ. Our results suggest that the type of social interaction, and to a lesser extent, the group size, are more relevant to determine the scaling exponents than the animal species. We reached this conclusion by combining data from different species. More statistical power could be achieved with a larger sample of network data for specific combinations of social interactions and species in order to study these relations separately. Given the multi-layer structure of social networks and experimental constraints, offline friendship data sets are limited to relatively small social circles 30 . If one could map higher social layers, the scaling exponent could decrease, likely to the same value as observed for spatial proximity. If this is confirmed in future studies, we will be able to infer that spatial proximity is a proxy of friendship across animals species 30 .
Physical contact, grooming and group membership are associated with more robust and topologically efficient networks (since clustering is higher and path-lengths are shorter) than friendship and proximity interactions. This social cohesion is a result of homophily and coordination to maintain group functioning, which likely creates smaller groups in these categories relative to friendship and proximity categories because of the cost of nurturing contacts. The frequency and number of social interactions leading to stable social contacts are also important to regulate diffusion processes such as communication 26 , innovation 16,17 , infectious diseases 19,43 and social phenomena 30,44 . Our results suggest that physical contacts and grooming are more efficient than proximity to facilitate spread phenomena at the population (network) level. Online friendships are associated to looser social structures easier to fragment as the groups increase in size. The relatively high cost of nurturing too many online social contacts across social layers restrains the opportunities to generate higher clustering or common friends, and create redundant structures, as observed in the smaller networks related to activities necessary to keep the group functioning. www.nature.com/scientificreports/ Although we focus on temporally stable social networks 45 , the availability of temporal information and intensity of certain social interactions could also help to understand the formation and dissolution of social contacts and how particular network structures are formed. Future research should add a quality measure to social interactions (e.g. via weights or temporal dynamics) to investigate the varying importance of creating and maintaining particular structures 46 . Strong super-linear scaling implies prohibitive social costs to maintain larger groups for some types of social interactions. The questions on whether there is a maximum or optimal group size in which efficient groups can exist and fitness is maximised 47 , or whether more complex network structures are necessary to sustain larger groups, remain open.

Methods
Data. The data sets used in this study were collected using public network data repositories. A list of repositories and a full list of the original references for the 611 data sets are available in the SI. The 6 types of social interactions: physical contact, grooming, group membership, spatial proximity, offline friendship and online friendship were identified and labelled in the original studies by domain experts via direct observation (animal interactions), questionnaires (offline friendship), electronic devices (spatial proximity), and online platforms (online friendship). All 611 networks were standardised for the analysis, including the removal of self-loops, edge directions, and edge weights.

Networks.
A network G of size N is defined as a set of N nodes i and a set of E edges (i, j) connecting nodes i and j. A node represents either a person or an animal. An edge represents a social connection of a specific type. In an undirected network, edges are reciprocal, i.e. (i, j) = (j, i) . In a network without self-loops, there is no edge (i, i).
The clustering coefficient of a node i is given by: where e i is the number of edges (connections) between the n i nodes directly connected to node i. The average clustering coefficient of the network G is thus: The topological distance between the nodes i and j is the length of the shortest-path l ij in number of edges. It is calculated within the largest connected component of the network G. In the largest connected component, there is at least one path between any pairs of nodes i and j. The average shortest-path length is: Received: 2 February 2021; Accepted: 1 June 2021 (2) cc i = 2e i /(n i (n i − 1)), www.nature.com/scientificreports/ Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http:// creat iveco mmons. org/ licen ses/ by/4. 0/.