Metric clusters in evolutionary games on scale-free networks

Kaj-Kolja Kleineberg1, ∗ 1Computational Social Science, ETH Zurich, Clausiusstrasse 50, CH-8092 Zurich, Switzerland (Dated: August 4, 2017) The evolution of cooperation in social dilemmas in structured populations has been studied exten- sively in recent years. Whereas many theoretical studies have found that a heterogeneous network of contacts favors cooperation, the impact of spatial effects in scale-free networks is still not well understood. In addition to being heterogeneous, real contact networks exhibit a high mean local clustering coefficient, which implies the existence of an underlying metric space. Here, we show that evolutionary dynamics in scale-free networks self-organize into spatial patterns in the underlying metric space. The resulting metric clusters of cooperators are able to survive in social dilemmas as their spatial organization shields them from surrounding defectors, similar to spatial selection in Euclidean space. We show that under certain conditions these metric clusters are more efficient than the most connected nodes at sustaining cooperation and that heterogeneity does not always favor— but can even hinder—cooperation in social dilemmas. Our findings provide a new perspective to understand the emergence of cooperation in evolutionary games in realistic structured populations. Keywords: Evolutionary , structured populations, emergence of cooperation, scale-free networks, network geometry

I. INTRODUCTION evolutionary dynamics on scale-free, highly clustered net- works lead to the formation of patterns in the underly- Cooperation among humans has been found to be ing metric space, similar to the aforementioned spatial quite common in social dilemmas [1, 2], and plays a selection in Euclidean space. Using two empirical net- major role in the emergence of complex modern soci- works, the IPv6 Internet topology and the arXiv collab- eties [3, 4]. Therefore, understanding the underlying oration network, as well as synthetic networks, we show mechanisms that can give rise to and sustain cooperation that spatial patterns play an important role in the evo- from an evolutionary perspective is key to complement- lution of cooperation. In fact, under certain conditions ing Darwin’s theory of evolution [5–9]. metric clusters can even be more effective at sustaining In reality, populations are structured, which means cooperation than the most connected nodes (hubs). As that the topology of strategic interactions is given by a consequence, heterogeneity does not always favor—but a network of contacts. In structured populations, in- can even hinder—the evolution of cooperation in social dividuals interact repeatedly with the same individuals. dilemmas. Thus, as a consequence, cooperators can survive in so- cial dilemmas by forming network clusters. This mech- anism is referred to as network reciprocity [2, 10]. In II. RESULTS the well-studied case of lattice topologies, the result- ing network clusters unfold in Euclidean space [11–13] A. Latent geometry of scale-free networks (spatial selection [14]). Realistic networks of contacts are heterogeneous rather than lattices and often scale- free, which means that their degree distribution follows a Real contact networks are usually heterogeneous, and power-law with exponent γ ∈ (2, 3), where a lower value often scale-free, as well as highly clustered [20] (we refer of γ means more heterogeneous networks. Heterogene- to a high mean local clustering coefficient, i.e. a large ity has been shown to favor cooperation [15–17], and number of closed triangles [19]). The effect of scale-free cooperating nodes form a connected (or network) clus- topologies has attracted a lot of attention, and many the- ter [18]. However, the geometric organization of these oretical studies have found that heterogeneous networks connected clusters—similarly to spatial selection in Eu- of contacts favor cooperation in social dilemmas [15–18], clidean space—remains elusive. although this behavior has not been confirmed in recent Real complex networks, in addition to being hetero- experiments with human players [22]. Importantly, the geneous, exhibit a high mean local clustering coeffi- high local clustering coefficients found in real contact net- cient [19, 20] (this means that the network contains a high works have been proven to imply the existence of a metric arXiv:1704.00952v2 [physics.soc-ph] 2 Aug 2017 number of closed triangles). This is particularly impor- space underlying the observed topology [21]. This means tant because a high clustering coefficient implies the ex- that the nodes of a given real complex network can be istence of an underlying metric space [21]. We show that mapped to coordinates in this metric space such that the probability that pairs of nodes will be connected in the observed topology depends only on their distance in the metric space. Specifically, heterogeneous networks can be ∗ [email protected] embedded into hyperbolic space [23–25]. In this repre- 2

A B C Prisoners Dilemma: S = -0.5 T = 1.5 Payoff matrix: Strategy update: P(c c ) = P(0.5-1.5) = 12% P(a a ) = 0.5 * P(1.5-0.5) = 44% Probability of choosing node c as Round of game: imita�on candidate S + 1 1 = 0.5 b a c T = 1.5

Figure 1. A: Illustration of the hyperbolic spatial structure (Poincar´eDisc) underlying a synthetic network generated by the model described in Methods. The network shown here has N = 2000 nodes, a power-law exponent γ = 2.6, mean degree hki ≈ 6, and mean local clustering coefficientc ¯ = 0.6 (temperature T¯ = 0.3 as in Eq. (6), see Methods section for details). Hubs, i.e. high degree nodes, are placed closer towards the center of the disk (lower radial coordinate). The angular space represents the similarity between nodes, such that nodes tend to connect to other nodes close to them in this space. The green line shows the hyperbolic disk of radius R (Eq. (5)) around the green node. We highlight the neighbors of the green node in red. For a highc ¯ (i.e. low T¯), as shown here, the green node is highly likely to connect to other nodes within the disc (green line), and a very unlikely to connect to nodes outside of it (the further apart, the less probable). The high mean local clustering coefficient is then a consequence of the triangle inequality in the metric space. B: Synthetic network generated with the same model but with mean local clustering coefficientc ¯ = 0.25 (temperature T¯ = 0.7). We again show the hyperbolic disk of radius R (Eq. (5)) around the green node and highlight its neighbors in red. Note that due to the higher temperature more long-range connections are formed, i.e. the green node connects to more nodes outside of the disc as compared to (A), and does not connect to some node inside of the disc. This effect reduces the mean local clustering coefficient as it induces randomness in the link formation process. C: Illustration of evolutionary game dynamics. In structured populations, individuals play with their neighbors in a network. In each game, they generate a payoff given by the payoff matrix (Eq. (1)). After each round, they choose a random neighbor and imitate her strategy with a probability (Fermi-Dirac distribution) that depends on the difference between their payoffs. sentation, each node has a radial and angular coordinate. C and Supplementary Video 1) [26, 27]. Similarly to The radial coordinate abstracts the popularity, and hence the case of lattice topologies and spatial selection in Eu- the degree of the node, such that hubs are placed closer clidean space, we observe the formation of clusters of to the center of the disk (Fig. 1A). The angular coordi- cooperators in the angular dimension of the underlying nate abstracts a similarity space, such that the angular hyperbolic space. In Fig. 2D we show the evolution of distance is a measure of the similarity between two nodes, the density of cooperators in different bins of the angu- whereby nodes tend to connect to more similar nodes. In lar coordinate θ. We observe that initially cooperation Fig. 1A and B we show an illustration of the hyperbolic decreases (see purple line in Fig. 2E) while, at the same metric structure underlying two different networks (see time, the remaining cooperators become concentrated in Methods section for further details). In the following, we clusters in the angular space (Fig. 2A). Cooperation then show that evolutionary dynamics trigger the formation increases again as it spreads in the vicinity of the clusters of stable spatial clusters in the angular dimension on the (Fig. 2B) until the system reaches a stationary state with underlying hyperbolic space. fluctuations only at the borders of the clusters (Fig. 2C and Supplementary Video 1). We quantify the degree to which cooperators and defec- B. Evolutionary dynamics and the emergence of tors cluster in the angular space using the Kolmogorov- metric clusters Smirnov (KS) statistic [28], which measures the differ- ence between two one-dimensional distributions. The Let us first consider the prisoner’s dilemma game, in KS-statistic is defined as the maximum absolute differ- particular T = 1.2 and S = −0.2 (see Eq. (1) in Meth- ence between the values of two cumulative distributions. ods) on synthetic contact networks generated with the In particular, we define the KS-statistic of the distribu- model described in Methods. This model generates re- tion of cooperation density in different angular bins, and alistic topologies based on underlying hyperbolic metric the uniform distribution at time t asρ ¯(t) (see Methods spaces, similar to Fig. 1A. We simulate the evolutionary for details). A higher value ofρ ¯(t) thus denotes more pro- game dynamics (see Methods and Fig. 1C) and find that nounced clustering of cooperators and defectors respec- the system tends to self-organize into a state in which tively. In Fig. 2F we show the evolution ofρ ¯(t) for 103 groups which are mainly cooperative are clearly separate different realizations (blue lines) and their mean (black from groups populated mainly by defectors (see Fig. 2A- line). On average,ρ ¯(t) increases initially and approaches 3

AB C D AB C

EF HG t

Figure 2. A-C: Evolution of the system (see also Supplementary Video 1) for a single realization of the prisoner’s dilemma (T = 1.2 and S = −0.2). Here, we have generated a synthetic network with N = 5000 nodes, power law exponent γ = 2.8, and mean local clusteringc ¯ ≈ 0.5. Cooperators are marked in blue, whereas red denotes defectors. The system was started with randomly selected cooperators (c(0) = 0.5). (A) shows the state of the system after 103, (B) after 104, and (C) after 105 generations. D: Density of cooperators (color coded) in different angular bins (shown on the y axis) as a function of time (shown on the x axis). Here, we have divided the angular space θ ∈ [0, 2π) into 20 equidistant bins. E-H: Results for the same synthetic networks as before but with N = 2 × 104 nodes. E: Evolution of the density of cooperation C for 103 independent realizations of the system (blue lines) and their average (black line). The purple line corresponds to the realization shown in (A-C). F: Evolution of the KS-statisticsρ ¯ for 103 independent realizations of the system (blue lines) and their average (black line). The purple line corresponds to the realization shown in (A-C). G: Evolution of the distribution of cooperation C observed in the system (colors denote time). H: Evolution of the distribution ofρ ¯ observed in the system (colors denote time). a constant value after approximately 102 ∼ 103 gener- behavior is similar to spatial selection in lattice topolo- ations. Among different realizations,ρ ¯(t) varies signifi- gies, where cooperators form spatial clusters in Euclidean cantly and we study the evolution of its distribution in space. Fig. 2H. We find that at relatively low times, the dis- tribution shows a peak atρ ¯ ≈ 0.2, which then declines. Eventually (black line), there is a high proportion of real- C. Metric clusters can be more effective than hubs izations withρ ¯ ≈ 0, which must be the case if the system approaches a state with nearly full cooperation or defec- Let us now consider two empirical networks, the Inter- tion. It can also be observed from the evolution of the net Ipv6 topology, which has N = 5162 nodes, a degree distribution of cooperation (Fig. 2G) that the probabil- distribution with power-law exponent γ = 2.1, average ity of high cooperation C ≈ 1 increases over time. In degree k¯ = 5.2, and a mean local clustering coefficient of combination, these observations indicate that the evolu- c¯ = 0.22 and the arXiv collaboration network, which has tionary path towards full cooperation includes a phase 1905 nodes, mean degree hki = 4.6, mean local cluster- of significant clustering of cooperators. The stationary ing coefficientc ¯ = 0.66, and a power-law degree exponent distribution ofρ ¯ (colored lines converge to the black line γ = 3.9. To address the question of whether spatial clus- in Fig. 2H) shows that apart from the aforementioned ters or the hubs of a network are more efficient at sustain- realizations, the values ofρ ¯ are distributed around the ing cooperation, we use the initial conditions as a proxy mean ofρ ¯ ≈ 0.2. for possible control mechanisms [26, 29–31]. Specifically, To conclude, evolutionary dynamics on scale-free net- we distribute the initial cooperators (always c(0) = 0.5) works lead to the formation of stable spatial patterns, in the system as follows: (i) we randomly assign 50% of which can be observed as metric clusters in the angular the nodes as cooperators; (ii) we assign the same number dimension of underlying hyperbolic metric spaces. This of cooperators preferentially to the hubs of the system, 4 A B 1.0 1.0 ever, final cooperation only exceeds the threshold value if Alywas c. Alywas c. the system was started with cooperators forming a met- Loc. & hubs Loc. & hubs 0.5 Only hubs 0.5 Only loc. ric cluster. Hence, whereas in the Internet IPv6 topology Never c. hubs can drive the system towards cooperation, in the

S 0.0 S 0.0 case of the arXiv network metric clusters are more effi- cient at sustaining cooperation than the most connected -0.5 -0.5 nodes. We observe a similar behavior using synthetic scale-free networks with different mean local clustering -1.0 -1.0 0.0 0.5 1.0 1.5 2.0 0.0 0.5 1.0 1.5 2.0 coefficients and power-law exponents. Fig. 3C shows a T T similar behavior to that of the Internet (i.e. the hubs C D are more efficient than metric clusters), whereby the net- 1.0 1.0 Alywas c. Alywas c. works were generated with a power-law exponent γ = 2.4 Loc. & hubs Loc. & hubs and mean local clustering coefficientc ¯ = 0.5 (here, coop- 0.5 Only hubs 0.5 Only loc. Never c. Never c. eration is sustained in none of the cases in the red re-

S 0.0 S 0.0 gion). In Fig. 3D we find a behavior similar to the arXiv (i.e. metric clusters are more efficient than the hubs), -0.5 -0.5 where we have generated synthetic networks with power- law exponent γ = 2.9 and clusteringc ¯ = 0.6. To con- -1.0 -1.0 clude, in very heterogeneous networks, hubs are efficient 0.0 0.5 1.0 1.5 2.0 0.0 0.5 1.0 1.5 2.0 at driving the system towards cooperation, whereas in T T less heterogeneous—but including scale-free—networks, metric clusters are more efficient. Figure 3. Final density of cooperators (after 2 · 105 update To investigate this effect in detail, let us now con- steps) averaged over 50 realizations of the system, as a func- sider the prisoner’s dilemma game, in particular param- tion of the game parameters T and S from Eq. 1. Colors eters S = −0.5 and T = 1.5 in the payoff matrix from denote regions in the parameter space where final coopera- Eq. (1), which is widely used as a proxy for real social tion exceeds the threshold value of 0.3. This is always the dilemma situations. We vary the network topology us- case in the blue area, only if started with either cooperative ing the model mentioned earlier. In particular, we tune hubs or a metric cluster in the green region, only if started with cooperative hubs in the yellow area, only if started with the heterogeneity in terms of the power-law exponent γ metric clusters in the gray area, and for none of the consid- and the mean local clustering coefficient,c ¯, which is a ered initial conditions in the red region. A: Results for the measure of the strength of the underlying metric struc- IPv6 Internet topology. B: Results for the arXiv collabora- ture [32]. We consider the different strategies of allocat- tion network. C: Synthetic network with N = 2 · 104 nodes, ing the initial cooperators discussed before. power-law exponent γ = 2.4, mean degree hki ≈ 6, and clus- The combination of the initial conditions and the net- teringc ¯ = 0.5. D: The same as before but for networks with work topology yields particularly interesting insights. If power-law exponent γ = 2.9 and clusteringc ¯ = 0.6. the initial cooperators are distributed randomly, final cooperation is always very low for the chosen parame- ters T and S (Fig. 4A). We find the same result (see i.e. we select nodes proportional to their degree; (iii) Fig. S4 in the Supplementary Materials) if the initial co- we assign the same number of cooperators into a metric operators are assigned into a connected (i.e. unique net- cluster in the similarity space (see Methods). The first work [18]) cluster (see Methods). However, if the initial strategy serves as a null model, the second mimics the cooperators are distributed among the hubs of the sys- potential of the hubs to drive the system towards coop- tem and the network is sufficiently heterogeneous, they eration, while the last strategy serves as a proxy for the are able to drive the system to a highly cooperative state ability of metric clusters of cooperators to survive. (see blue region Fig. 4B, and Supplementary Video 2). Fig. 3A shows the result for the Internet IPv6 topol- Large mean local clusteringc ¯, which implies a strong ogy, where we show the regions in the T − S plane, in metric structure, adds to this effect (cf. green region in which the degree of final cooperation exceeds an arbitrar- Fig. 4D and Fig. 4E), in agreement with [33]. Impor- ily chosen threshold value of 0.3. In the blue area, this tantly, if the network is not sufficiently heterogeneous, is always the case. In the green region, this holds if the but still scale-free, the hubs lose their ability to control system began with cooperative hubs or a metric cluster. the system and defection eventually prevails (red region In the yellow region, the cooperative threshold is only in Fig 4B, Supplementary Video 3). In contrast, if we exceeded if the system began with cooperative hubs (see begin with the initial cooperators clustered in the met- Supplementary Materials for details). This behavior is ric space, this will allow for sustained cooperation even significantly different in the case of the arXiv collabora- in scale-free networks, but only if the metric structure is tion network (Fig. 3B). In contrast to the previous case, sufficiently strong (see Fig. 4C, blue region in Fig. 4D, there is no region where only initially cooperative hubs and Supplementary Video 4). If the network becomes allow for sustained cooperation. In the gray region, how- too heterogeneous, the clusters are no longer sustained 5 AB C D

EF G H

Figure 4. A-C: Final (after 2 · 105 update steps) density of cooperators (color coded) for the prisoner’s dilemma game (T = 1.5 and S = −0.5) averaged over 50 realizations as a function of the degree distribution power-law exponent γ and mean local clusteringc ¯. Networks have N = 2 · 104 nodes and a mean degree hki ≈ 6. The initial density of cooperators is always c(0) = 0.5. A: Randomly assigned initial cooperators. B: Hubs are assigned as initial cooperators with a probability p ∝ k. C: Initial cooperators are localized in the angular space. D: Regions where the final cooperation exceeds a threshold value of 0.3 for the cases presented in (A-C). E: Final cooperation as a function of the network heterogeneity for different values of c¯ starting with preferential hub assignment, representing different cuts through (B). Errorbars denote one standard deviation from top to bottom. F: Final cooperation as a function of the network heterogeneity for different values ofc ¯ starting with cooperators assigned into a metric cluster, representing different cuts through (C). G: Final cooperation density as a function of the network size for synthetic networks with power-law exponent γ = 2.9,c ¯ = 0.6, and mean degree hki ≈ 6. H: Final cooperation for different network sizes (see legend) and the same parameters as before. Initial cooperators (c(0) = 0.5) are assigned into different numbers of disjoint metric clusters, whose number is plotted on the x-axis in the top panel. The bottom panel shows on the x-axis the resulting absolute size of each cluster, given by the number of nodes divided by twice the number of cooperating clusters.

(see Fig. 4F and Supplementary Video 5). D. Fraction of intercluster links explains the survival of metric clusters We also investigate whether network and cluster size affect the ability of metric clusters of cooperators to sur- vive. In Fig. 4G we show that the final cooperation den- The survival of metric clusters of cooperators can be sity increases with the system size and saturates to a understood as analogous to spatial selection in Euclidean value close to C = 0.5. For a fixed network size, coop- space in lattice topologies. In this case, clusters of coop- eration decreases if we assign cooperators into a larger erators survive because they are shielded from surround- number of smaller clusters (see Methods), as shown in ing defectors, such that the interactions between cooper- Fig. 4H (top). However, if plotted as a function of the ators and defectors only occur at the border of the clus- absolute size of the individual clusters (which can be cal- ters. Similarly, in heterogeneous networks, metric clus- culated by dividing the number of nodes by twice the ters survive because they are shielded from surrounding number of clusters), the curves that correspond to differ- defectors and their spatial organization reduces the num- ent network sizes collapse, see Fig. 4H (bottom). This ber of interactions between cooperating and defecting in- suggests that the survival of a metric cluster of coopera- dividuals. For larger clusters, the relative surface area of tors is directly related to its absolute size. the border in contact with adjacent defectors decreases, Finally, we can formulate approximatively conditions which shields them more effectively and hence explains for the survival of cooperating metric clusters. Their sur- why they are more likely to survive (see Fig. 5A). For a vival is favored if they are large enough, i.e. their size given size, two different mechanisms determine the num- 3 is nc > 10 (see Fig. 4G), if the mean local clustering is ber of links between spatially clustered cooperators and high enough, i.e.c ¯ > 0.5 (see Fig. 4F), and if the network defectors. Firstly, the greater the degree of heterogene- is not too heterogeneous, i.e. γ > 2.5. ity, the larger the number of hubs, i.e. high degree nodes. 6

AB ture), metric clusters can be more efficient at sustain- ing cooperation than the most connected nodes, which is the case in the arXiv collaboration network. Only when the network is very heterogeneous, such as in the case of the Internet IPv6 topology, are hubs more effective at promoting cooperation. We have shown that if coop- erators are clustered in the metric space, heterogeneity can hinder cooperation in the prisoner’s dilemma. Fi- nally, one could argue that such a configuration is more realistic than random initial conditions, as for example the nodes in the Internet network that correspond to Figure 5. A: Fraction of links between nodes in a met- the same countries are naturally clustered in the metric ric cluster spanning half of the network to nodes outside of space (see [25]), and different countries adopt different the cluster compared to the total number of links in the net- attitudes towards mitigating climate change [34]. work as a function of the network size for synthetic networks Our findings reveal that heterogeneity does not always with power-law exponent γ = 2.9,c ¯ = 0.6, and mean degree favor cooperation in evolutionary games on structured hki ≈ 6. The shaded area denotes one standard deviation from top to bottom. B: The same fraction of links (color populations, but can even have the opposite effect, thus coded) for synthetic networks with N = 2 · 104 nodes and complementing existing studies about the impact of het- hki ≈ 6 as a function of the power-law exponent γ and mean erogeneity of realistic contact networks. Furthermore, local clusteringc ¯. our framework unifies the description of spatial effects and the heterogeneity of contact networks. This frame- work can be applied to different games and extended to These nodes are connected to many other nodes, and multiplex networks, opening promising new lines of re- therefore form long-range connections in the metric rep- search. resentation, which are likely to connect cooperators and defectors. This is the reason why more heterogeneity hin- ders the survival of metric clusters (Fig. 5B). For a fixed ACKNOWLEDGMENTS level of heterogeneity, increasing the mean local cluster- ing coefficient will reduce the temperature T¯, which re- We thank Stefano Duca for interesting and helpful dis- duces the amount of long-range connections due to ran- cussions. We thank Heinrich Nax for feedback on the domness, cf. Fig. 1A and B. Therefore, a higher degree of manuscript. We thank Eoin Jones for proofreading the mean local clustering reduces the number of intercluster manuscript. K-K. K. acknowledges support by the ERC links, which in turn favors the survival of metric clusters Grant “Momentum” (324247). as explained before (see Fig. 5B).

METHODS III. DISCUSSION Evolutionary game dynamics Structured populations play an important role in the evolution of cooperation in social dilemmas. Real con- In the evolutionary game dynamics considered here, in- tact networks are heterogeneous (often scale-free) and dividuals play strategic games with their contacts where, exhibit a high mean local clustering coefficient. The lat- for instance, they have two strategic choices: they can ter implies the existence of an underlying geometry [21]. either cooperate (C) or defect (D). The payoff of each Specifically, real heterogeneous networks can be embed- two-player game is then described by the payoff matrix ded into hyperbolic space comprised of a popularity (ra- dial) dimension and a similarity (angular) dimension. CD We have shown that this underlying metric space plays M = C 1 S . (1) an important role in the evolution of cooperation in het- D T 0 erogeneous contact networks. Specifically, evolutionary dynamics lead to the formation of clusters of cooperators Parameters T and S define different games [6]. T < 1 and in the angular dimension of the underlying metric space, S > 0 defines the “harmony” game, T < 1 and S < 0 akin to spatial selection in Euclidean space [13, 14]. This corresponds to the “stag hunt” game, T > 1 and S < 0 behavior can be understood in terms of the fraction of in- yields the “prisoner’s dilemma”, and finally for T > 1 tercluster links that determines how well metric clusters and S > 0 we obtain the “snowdrift” game. of cooperators are shielded from surrounding defectors. One round of the game consists of each individual play- Depending on the power-law exponent γ of the degree ing one game with each of her neighbors in the net- distribution and the mean local clustering coefficientc ¯ work of contacts. For each game, nodes collect pay- (which is proportional to the strength of the metric struc- offs given by Eq. 1, which depend on the strategies of 7 the involved players. Here, we consider the evolution of where N denotes the number of nodes, γ is the power- the system to be governed by imitation dynamics [35–37] law exponent of the degree distribution, and T denotes (Fig. 1C), reflecting that individuals tend to adopt the the temperature. Finally, we connect pairs of nodes i strategy of more successful neighbors. After each round and j with probability p(xij), which depends exclusively of the game (synchronous updates) each node i chooses on the hyperbolic distance xij between nodes i and j. one neighbor j at random and copies her strategy with The connection probability is given by the Fermi-Dirac probability Pi←j, specified by the Fermi-Dirac distribu- distribution tion [15, 38, 39] 1 p(x ) = , (6) ij 1 (x −R) 1 1 + e 2T¯ ij Pi←j = , (2) 1 + e−(πj −πi)/K where the aforementioned temperature T¯ controls the motivated by maximum entropy principles in Glauber- strength of the metric structure and the level of mean like dynamics [35, 40]. πi and πj measure the payoffs of local clustering,c ¯. This is illustrated in Figs. 1A and B. nodes i and j, while K denotes the irrationality of the Finally, given a real network, coordinates of the nodes players, which we set to 0.5. After all nodes have updated can be inferred using maximum likelihood estimation their strategy simultaneously, we reset all payoffs. techniques [41, 42]. This enables us to identify the set In this contribution, games are played only on the giant of coordinates that maximize the probability that the connected component (GCC) of the network of contacts. observed real-world network was generated using the de- scribed model. The inferred hyperbolic maps have proven to be very accurate in the case of scale-free, clustered net- works [25, 43, 44]. Complex networks embedded into underlying metric spaces Mean local clustering and relation to the spatial Metric spaces underlying complex networks provide structure a fundamental explanation of their observed topolo- gies [23, 24]. In the class of models used here, each node The local clustering coefficient of node i is defined i is mapped into the hyperbolic disk where it is repre- as [45] sented by the polar coordinates ri, θi. These coordinates abstract the popularity and similarity of nodes [24]. The Number of closed triangles i participates in c = , (7) radial coordinate ri is related to the expected degree of i k (k − 1) node i and therefore abstracts its popularity. More pop- i i ular nodes are located closer to the center of the disk where ki denotes the degree of node i. The maximal (lower radial coordinate). The angular distance between number of closed triangles a node with degree ki can nodes i and j, ∆θij = π − |π − |θi − θj||, is an abstract participate in is ki(ki − 1). The mean local clustering measure of their similarity. Lower distance implies higher coefficient of a given network is then the average of ci similarity. The hyperbolic distance [23], over all nodes with k > 1 (nodes with k = 1 cannot

−1 participate in any triangles). xij = cosh (cosh ri cosh rj − sinh ri sinh rj cos ∆θij) , In the framework introduced in the previous section, a (3) low temperature T¯ implies a high mean local clustering, which is the consequence of the triangle inequality in the combines information about both popularity and similar- underlying metric space (Fig. 1A). A high temperature, ity of nodes i and j, such that the connection probability however, induces more randomness in the form of long- for a given pair of nodes depends only on their hyperbolic range connections (see Eq. (6)), which reduces the mean distance. local clustering coefficient (Fig. 1B). See [23] for further To generate networks based on hidden hyperbolic details. space, we distribute nodes on the hyperbolic disk by as- signing polar coordinates (ri, θi) to each node. In par- ticular, we draw θ from the uniform distribution U i [0,2π) KS-statistic and radial coordinates ri from the distribution

1 1 (γ−1)(r−R) The Kolmogorov-Smirnov (KS) statistic [28], which ρ(r) = (γ − 1)e 2 , (4) 2 we denote asρ ¯, is defined as the maximum absolute difference between the values of two cumulative distri- where R denotes the disk radius given by [23] bution. We are interested in measuring the difference between the distribution of cooperators in the angular " 2# 2TN γ − 1 space, c(θ), whose cumulative distribution is given by R = 2 ln , (5) k¯ sin T¯ π γ − 2 R θ 0 0 C(θ) = 0 dθ c(θ ), and the uniform distribution. Then, 8 the KS statistic is given by This procedure ensures that the initial cooperators form a unique connected cluster. Note that a network cluster

θ in general is not the same as a metric cluster. ρC = max C(θ) − (8) θ∈{0,2π} 2π and analogously Empirical networks

θ The arXiv data is taken from [46] and contains co- ρD = max D(θ) − , (9) authorship networks from the free scientific repository θ∈{0,2π} 2π arXiv. The nodes are authors that are connected if they have co-authored a paper. In arXiv, each paper is as- where D(θ) = θ − C(θ) denotes the cumulative distribu- signed to one or more relevant categories. The data only tion of defectors in the angular space. Finally, we define covers papers containing the word “networks” in the ti- tle or abstract from different categories up to May 2014. ρ¯ = cρ + (1 − c)ρ , (10) C D Here, we consider the category “Molecular Networks” (q- bio.MN). The network has approx. 1905 nodes, mean where c denotes the density of cooperators at the current degree hki = 4.6, clustering coefficientc ¯ = 0.66, and a timestep. Note that here we omitted the time depen- power-law degree exponent γ = 3.9. dency. The IPv6 Autonomous Systems (AS) Internet topology was extracted from the data collected by the Archipelago active measurement infrastructure (ARK) developed by Assignment of initial cooperators CAIDA [47]. The connections in each topology are not physical but logical, representing AS relationships. An AS is a part of the Internet infrastructure administrated In this contribution, we always start with an initial by a single company or organization. Pairs of ASs peer cooperation density of C(0) = 0.5. However, the distri- to exchange traffic. These peering relationships in the bution of initial cooperators in the network can be differ- AS topology are represented as links between AS nodes. ent. In particular, we distinguish between the following CAIDA’s IPv6 [48] datasets provide regular snapshots of procedures. AS links derived from ongoing traceroute-based IP-level Random assignment: Each node is initialized as a topology measurements. The considered topology was cooperator with 50% probability and as a defector oth- constructed by merging the AS link snapshots during the erwise. first 15 days of January 2015, which are provided at [49]. Hubs: We preferentially assign hubs as initial coop- The network consists of N = 5162 nodes, has a power erators. To this end, we assign N/2 cooperators which law degree distribution with exponent γ = 2.1, average we select proportional to their degree, i.e. p (k) ∝ k. N ¯ c node degree k = 5.2, and average clusteringc ¯2 = 0.22. denotes total number of nodes in the network. The hyperbolic maps for both datasets have been taken Metric cluster: We sort all nodes by their angular from [44]. coordinate θ, and assign the first N/2 nodes as coopera- Supplementary Fig. S2 shows the final density of coop- tors. erators for both networks and for the different allocation Multiple metric clusters: We again sort all nodes strategies described in the main text. by their angular coordinate θ. We now fix a number of distinct clusters, nc, and assign the first N/(2nc) nodes as cooperators, the second N/(2nc) nodes as defectors, Data and code availability the third N/(2nc) as cooperators and so on. See Supple- mentary Materials for an explicit example. To facilitate the application of our framework for Connected cluster: We assign N/2 nodes into a con- future work, we enclose the empirical datasets and nected cluster, or unique network cluster [18]. To this their inferred hyperbolic maps as well as an imple- end, we start from the initial graph and randomly re- mentation of the model networks used in this pa- move nodes until the size of the giant connected compo- per (figshare.com/articles/DataAndModel zip/4817947). nent (GCC) reaches N/2. The nodes that are now in the An implementation of the technique to construct hyper- GCC are assigned as cooperators in the original graph, bolic maps for real networks [41, 42] is publicly available and the remaining N/2 nodes are assigned as defectors. at [50].

[1] Roger Highfield , SuperCooperators: Altru- (Free Press, New York, 2011). ism, Evolution, and Why We Need Each Other to Succeed 9

[2] M. A. Nowak, “Five rules for the evolution of coopera- [23] Dmitri Krioukov, Fragkiskos Papadopoulos, Maksim Kit- tion,” Science 314, 1560–1563 (2006). sak, Amin Vahdat, and Mari´anBogu˜n´a,“Hyperbolic ge- [3] John Maynard Smith and Eors Szathmary, The Major ometry of complex networks,” Phys. Rev. E 82, 036106 Transitions in Evolution (Oxford University Press, 1995). (2010). [4] E. Pennisi, “How did cooperative behavior evolve?” Sci- [24] Fragkiskos Papadopoulos, Maksim Kitsak, M. Angeles´ ence 309, 93–93 (2005). Serrano, Mari´anBogu˜n´a, and Dmitri Krioukov, “Popu- [5] Josef Hofbauer and Karl Sigmund, Evolutionary Games larity versus similarity in growing networks,” Nat. 489, and Population Dynamics (Cambridge University Press, 537–540 (2012). 1998). [25] Mari´anBogu˜n´a,Fragkiskos Papadopoulos, and Dmitri [6] Martin A. Nowak, Evolutionary Dynamics: Exploring the Krioukov, “Sustaining the Internet with hyperbolic map- Equations of Life ( Press, 2006). ping.” communications 1, 62 (2010). [7] John Maynard Smith, Evolution and the Theory of [26] Kaj-Kolja Kleineberg and Dirk Helbing, “Collective nav- Games (Cambridge University Press, 1982). igation of complex networks: Participatory greedy rout- [8] Robert M. Axelrod, The evolution of cooperation (Basic ing,” Scientific Reports 7, 2897 (2017). Books, 1984). [27] Roberta Amato, Albert D´ıaz-Guilera, and Kaj-Kolja [9] J¨orgen W. Weibull, Evolutionary game theory (MIT Kleineberg, “Interplay between social influence and com- Press, 1995). petitive strategical games in multiplex networks,” Scien- [10] Benjamin Allen, Gabor Lippner, Yu-Ting Chen, Babak tific Reports 7, 7087 (2017). Fotouhi, Naghmeh Momeni, Shing-Tung Yau, and Mar- [28] Konstantin Zuev, Mari´anBogu˜n´a, Ginestra Bianconi, tin A. Nowak, “Evolutionary dynamics on any population and Dmitri Krioukov, “Emergence of soft communities structure,” Nature 544, 227–230 (2017). from geometric preferential attachment,” Scientific Re- [11] Jelena Gruji´c,Carlos Gracia-L´azaro,Manfred Milinski, ports 5, 9421 (2015). Dirk Semmann, Arne Traulsen, Jos´eA. Cuesta, Yamir [29] Yang-Yu Liu and Albert-L´aszl´oBarab´asi,“Control prin- Moreno, and Angel S´anchez, “A comparative analysis ciples of complex systems,” Reviews of Modern Physics of spatial prisoner’s dilemma experiments: Conditional 88 (2016). cooperation and payoff irrelevance,” Scientific Reports 4 [30] Dirk Helbing, “Globally networked risks and how to re- (2014). spond,” Nat. 497, 51–59 (2013). [12] M. Perc, J. Gomez-Gardenes, A. Szolnoki, L. M. Floria, [31] Dirk Helbing, Social Self-Organization (Springer, 2012). and Y. Moreno, “Evolutionary dynamics of group inter- [32] Dmitri Krioukov, “Clustering implies geometry in net- actions on structured populations: a review,” Journal works,” Physical Review Letters 116 (2016). of The Royal Society Interface 10, 20120997–20120997 [33] Salvatore Assenza, Jes´usG´omez-Garde˜nes,and Vito La- (2013). tora, “Enhancement of cooperation in highly clustered [13] David G. Rand, Martin A. Nowak, James H. Fowler, and scale-free networks,” Phys. Rev. E 78, 017101 (2008). Nicholas A. Christakis, “Static network structure can sta- [34] Tien Ming Lee, Ezra M. Markowitz, Peter D. Howe, bilize human cooperation,” Proceedings of the National Chia-Ying Ko, and Anthony A. Leiserowitz, “Predictors Academy of Sciences 111, 17093–17098 (2014). of public climate change awareness and risk perception [14] Martin A. Nowak and Robert M. May, “Evolutionary around the world,” Nature Climate Change 5, 1014–1020 games and spatial chaos,” Nature 359, 826–829 (1992). (2015). [15] F. C. Santos and J. M. Pacheco, “Scale-free networks [35] Gy¨orgySzab´oand G´abor F´ath,“Evolutionary games on provide a unifying framework for the emergence of coop- graphs,” Physics Reports 446, 97–216 (2007). eration,” Physical Review Letters 95, 9:098104 (2005). [36] Ross Cressman and Yi Tao, “The replicator equation and [16] F. C. Santos, J. M. Pacheco, and T. Lenaerts, “Evolu- other game dynamics,” Proc. R. Soc. Lond. 111, 10810– tionary dynamics of social dilemmas in structured het- 10817 (2014). erogeneous populations,” Proceedings of the National [37] Dirk Helbing, “A stochastic behavioral model and a Academy of Sciences 103, 9:3490–3494 (2006). microscopic foundation of evolutionary game theory,” [17] Attila Szolnoki, MatjaˇzPerc, and Zsuzsa Danku, “To- Theor. Decis. 40, 149–179 (1996). wards effective payoffs in the prisoner’s dilemma game [38] Gy¨orgySzab´oand Csaba T˝oke, “Evolutionary prisoner’s on scale-free networks,” Physica A: Statistical Mechan- dilemma game on a square lattice,” Phys. Rev. E 58, ics and its Applications 387, 2075–2082 (2008). 69–73 (1998). [18] J. G´omez-Garde˜nes,M. Campillo, L. M. Flor´ıa, and [39] Marco A. Amaral, Lucas Wardil, Matjaz Perc, and Jaf- Y. Moreno, “Dynamical organization of cooperation in ferson K. L. da Silva, “Evolutionary mixed games in complex topologies,” Phys. Rev. Lett. 98, 108103 (2007). structured populations: Cooperation and the benefits of [19] M. E. J. Newman, Networks: an introduction (Oxford heterogeneity,” Phys. Rev. E 93, 042304 (2016). University Press, Oxford; New York, 2010). [40] Matjaz Perc, “Coherence resonance in a spatial prisoner’s [20] Mark Newman, Albert-L´aszl´oBarab´asi, and Duncan J. dilemma game,” New Journal of Physics 8, 22 (2006). Watts, The Structure and Dynamics of Networks (Prince- [41] Fragkiskos Papadopoulos, Constantinos Psomas, and ton, NJ: Princeton University Press, 2006). Dmitri Krioukov, “Network mapping by replaying hyper- [21] Dmitri Krioukov, “Clustering implies geometry in net- bolic growth,” IEEE/ACM Transactions on Networking works,” Phys. Rev. Lett. 116, 208302 (2016). 23, 198–211 (2015). [22] C. Gracia-Lazaro, A. Ferrer, G. Ruiz, A. Tarancon, [42] Fragkiskos Papadopoulos, Rodrigo Aldecoa, and Dmitri J. A. Cuesta, A. Sanchez, and Y. Moreno, “Heteroge- Krioukov, “Network geometry inference using common neous networks do not promote cooperation when hu- neighbors,” Phys. Rev. E 92, 022807 (2015). mans play a prisoners dilemma,” Proceedings of the Na- tional Academy of Sciences 109, 12922–12926 (2012). 10

[43]M. Angeles´ Serrano, Mari´an Bogu˜n´a, and Francesc [47] K. Claffy, Young Hyun, K. Keys, M. Fomenkov, and Sagu´es, “Uncovering the hidden geometry behind D. Krioukov, “Internet mapping: From art to science,” in metabolic networks,” Mol. BioSyst. 8, 843–850 (2012). Conference For Homeland Security, 2009. CATCH ’09. [44] Kaj-Kolja Kleineberg, Mari´anBogu˜n´a,M. Angeles´ Ser- Cybersecurity Applications Technology (2009) pp. 205– rano, and Fragkiskos Papadopoulos, “Hidden geometric 211. correlations in real multiplex networks,” Nat. Phys. 12, [48] “The IPv4 and IPv6 Topology Datasets,” 1076–1081 (2016). (2015), http://www.caida.org/data/active/ [45] Mark Newman, Networks: An Introduction (Oxford Uni- ipv4_routed_topology_aslinks_dataset.xml and versity Press, Inc., New York, NY, USA, 2010). https://www.caida.org/data/active/ipv6_allpref_ [46] Manlio De Domenico, Andrea Lancichinetti, Alex Are- topology_dataset.xml. nas, and Martin Rosvall, “Identifying modular flows on [49] “IPv4 and IPv6 Topology Data,” (January 2015), multilayer networks reveals highly overlapping organiza- http://data.caida.org/datasets/topology/ark/ tion in interconnected systems,” Phys. Rev. X 5, 011027 ipv6/as-links/2015/01/ and http://data.caida. (2015). org/datasets/topology/ark/ipv4/as-links/. [50] “HyperMap-CN Software Package,” https: //bitbucket.org/dk-lab/2015_code_hypermap.