Public Goods Games on Coevolving Social Network Models

Public good games are a metaphor for modeling cooperative behavior in groups in the presence of incentives to free ride. In the model presented here agents play a public good game with their neighbors in a social network structure. Agents' decision rules in our model are inspired by elementary learning observed in laboratory and online behavioral experiments involving human participants with the same amount of information, i.e., when individuals only know their own current contribution and their own cumulated payoff. In addition, agents in the model are allowed to severe links with groups in which their payoff is lower and create links to a new randomly chosen group. Reinforcing the results obtained in network scenarios where agents play Prisoner's Dilemma games, we show that thanks to this relinking possibility, the whole system reaches higher levels of average contribution with respect to the case in which the network cannot change. Our setup opens new frameworks to be investigated, and potentially confirmed, through controlled human experiments.


INTRODUCTION
Public Good Games (PGG) are a well-known model for describing situations that require people or institutions to cooperate to achieve a goal that is considered beneficial to all. For instance, threats, such as global climate change, overfishing, deforestation, and natural resources depletion in general are fundamental social issues in which cooperation and self-restrain are required to achieve the best collective results [1]. However, cooperation is vulnerable to free-riding and, perhaps more commonly, fear to be exploited which in turn leads to selfish behavior. In fact, the best theoretical course of action from an individual point of view is to not cooperate [2,3]. More precisely, linear PGG are multi-player games in which N ≥ 2 agents have the choice of voluntarily contribute to a common pool that will have an added value for each agent through a multiplication, also called enhancement, factor 1 < r < N and it will be enjoyed by all. Rationally, the best course of action and the dominant strategy for an agent is to avoid any contribution and to free-ride on the contribution of others. But if the number of non-contributing agents is large enough there will be no benefit from contributing and hence no public good provision. Indeed, the unique Nash equilibrium corresponds to zero contribution all around. Evolutionary game theory approaches [4] also have full defection as the stable state of the dynamics. However, game theory notwithstanding, it has been found in many controlled experiments conducted in the laboratory, or online, that subjects do contribute about half of their endowment in a one-shot game. If the game is iterated contributions decrease but, instead of vanishing, there is always a residual contribution of about 10-20% on the average. Literally hundreds of experiments have been performed to date on various aspects of PGG and it is almost impossible to cite them all. The following are some works from which further references can be found [5][6][7][8][9][10]. The general observed pattern is the steady decrease in contributions in iterated games as people learn the consequences of their actions. Variations of the basic game in which free-riders can be punished at a cost or rewards are provided to those who contribute show that contributions may again reach higher values [6,7]. The role of punishment in social dilemma experiments has been recently reexamined in Li et al. [11]. Cognitive biases, when a decoy option is available in the social dilemma may also help to promote cooperation [12]. Such behaviors have been attributed to various causes by different authors and, indeed, what people do strongly depends on the information they are given about the other players' actions [13][14][15][16][17][18][19]. If people know who does what in the group, then they may condition their contribution on the action of others. If subjects start to free-ride this implies a progressive reduction of the contributions and people act as if they had pro-social preferences. In particular, the willingness to punish free-riders at a cost for the punisher shows that agents take into account the welfare of others to some extent when making their decisions [6]. But when there is no feedback for a participant, except her own payoff the steady reduction in contributions can be interpreted in a different way. Along these lines, Burton-Chellew et al. [8][9][10] run some experiments and suggested that payoff-based learning is sufficient to explain the results.
In the last two decades games in populations in which individuals are structured according to a network of contacts have attracted a lot of attention. This is natural as in everyday life each one of us belongs to several social networks, ranging from face-to-face interactions to pure web-based ones. A number of numerical simulation studies of the PGG game dynamics on network-structured populations have been published (e.g., see [20][21][22][23][24][25]) for two recent reviews. In most of the previous cases the numerical simulation models used were of the replicator dynamics type [24]. The results of these works do confirm that contributions go to zero in the long term in the average, until a critical value of the enhancement factor is reached. For larger values of the enhancement factor full cooperation is the stable state and it is reached at a rate that depends on the network structure and on the particular strategy update rule. It is difficult to underestimate the importance of theoretical and numerical models for our understanding of PGG dynamics. However, they contain a few unrealistic assumptions that prevent them from being equally useful in interpreting the results of laboratory experiments with human subjects. First of all, decision rules are homogeneous across the population and quite different from the behavioral rules that agents employ in laboratory and online experiments. In addition, for simplicity and mathematical convenience, individuals either contribute their full endowment or do not contribute at all. However, in experiments, participants usually receive a number of tokens and can choose how many to contribute to the common pool, i.e., contributions are a real, or more commonly, an integer variable, not a Boolean one. In a recent work [26], we made a first step to depart from standard replicator dynamics formulations toward individual decision and learning rules that are supposed to be closer to the way people make their decisions in the laboratory when playing a standard linear PGG game. Using a social network model for the population structure, we showed that a couple of simple models are able to qualitatively reproduce the average players' behavior observed in some laboratory experiments [8,19]. As said above, the strategies effectively seen in experiments strongly depend on the kind and amount of the information available to the subjects. To keep the models as simple as possible, we targeted for inspiration experiments in which little information is provided. In Tomassini and Antonioni [26] the network was kept fixed, i.e., it was not possible to severe links or form new links. However, it has been previously shown both in simulation models [18,[27][28][29][30] as well as in experiments [13,14,17,[31][32][33] that the possibility of cutting contacts with unsuitable partners and forming new links with more promising ones is a simple mechanism that can lead to the emergence of cooperation in the two-person Prisoner's Dilemma game.
In the present study we extend the models presented in Tomassini and Antonioni [26] in such a way that unsatisfied agents have, in addition, the option of cutting a link with an unfavorable group and of joining another group and we investigate whether this possibility can lead to a higher average contribution. This extension is coherent with what we observe in society, where associations can usually be changed, and also serve as a simple form of punishment, or retaliation, that does not require complicated strategic considerations. With these elements in hand, we then proceed to a detailed numerical study of how contributions and the network itself evolve in time, and what are the main parameters governing the dynamical system. We believe that the approach presented here, given its behaviororiented nature, can also suggest interesting and feasible settings for experimental work by using cheap numerical simulations.
The manuscript is organized as follows. We first describe the PGG model on coevolving social networks. This is followed by numerical simulation results and their discussion. A final section with further discussion and conclusions ends the paper.

SIMULATIONS MODELS
In this section we present the models for the population and group structures and for the strategic decisions of the individuals belonging to the population.

Population Structure
Social networks suggest a natural way of forming groups of agents for playing PGG games. The social network is generated according to the method described in Antonioni and Tomassini [34]. The network construction starts with a small kernel of nodes to which new nodes are added incrementally. A certain average degree is set at the beginning and each incoming node will form a number of links to existing nodes that is compatible with the given average degree. A parameter 0 ≤ α ≤ 1 determines the proportion of links that are made according to linear preferential attachment or according to a distance-based criterion. For α = 0 a new link is made to the closest existing node, i.e., the network is purely spatial. For α = 1 the link is made proportional to the degree of existing nodes by preferential attachment. For 0 < α < FIGURE 1 | Visual representation of public goods games played on a network structure of seven nodes. Each PGG is centered in a focal node i and it is represented by a circle G i . For example, the node a has four direct neighbors (b, c, d, f) and it participates in five PGGs, i.e., the circle G a centered in a including its four neighbors, and other four PGGs represented by circles centered in its neighbors: G b , G c , G d , G f . Note that a node may indirectly interact with other nodes that are not direct neighbors. Colors represent the node contribution into the common pools in which it participates.
1 links are space-dependent with probability α and degreedependent with probability 1 − α. For α = 0 the clustering coefficient is high and the degree distribution function of the network is peaked around the mean value. For α = 1 on the other hand, the degree distribution is fat-tailed and tends to a scale-free one with increasing network size [34,35]. In our simulations we chose α = 0.3 which is an average value that was found in Antonioni and Tomassini [34] to lead to social network models with statistical features similar to those of some real-world social networks when the role of geographical space is taken into account. In any case, since the network will evolve in time, the particular initial state is not a critical factor. In Tomassini and Antonioni [26] we studied games on networks of mean degree four, six, and 12 in order to investigate the role of the average group size but we found that the group size distribution had little influence on the results; thus we performed our simulations for degree six only here. A recent experimental work [36] explicitly targets the influence of the group size, up to 1,000 interacting individuals, and gives further references.
Each agent in the network interacts with its first neighbors and it is the focal element in this group. The agent also participates in all the groups that have each neighbor as the focal element (see Figure 1 for a visual explanation of the group structure). If the degree of agent i in the graph is k, then the number of groups to which it participates is g = k + 1. A perhaps clearer way of dealing with multigroup membership is by using bipartite networks in which there are two disjoint sets of nodes: one set represents the agents and the other set represents the groups. An agent may have links to several groups but there cannot be links between groups or between agents (see e.g., [21,37,38]). In spite of the interest of this representation, in the present work we keep the standard agent network notation.

Public Goods Game and Behavioral Rules
We consider a standard linear PGG in which the sum of the contributions is equally shared between the members of the group independent of their respective contributions, after multiplication by the enhancement factor r > 1. The utility, or payoff, payoff π i of individual i after playing a round in all groups of which it is a member is: in which we assume that i's endowment is 1 at the beginning of a round of play in each group and i's contribution c i is the same in all g groups in which i participates. The first term is what remains after contributing the amount 0 ≤ c i ≤ 1 in each of the g groups and the second term is the sum of i's gains over all g groups after multiplying by r and sharing the total amount among the members of the group whose size is |N j |. All agents decide their contribution and compute their payoff after having played in all their groups. Initial contribution are chosen randomly among the following set of values {0.0, 0.25, 0.50, 0.75, 1.0}, where 1.0 represents the total endowment contribution. In each round, a player has the same endowment of 1.0 in each group in which it is a member. We remark that this corresponds to the case in which each member contributes a fixed amount per game [20]. There is another possibility in which an individual contributes a fixed amount per member of the group to which it participates but we will not explore it here. The above framework is qualitatively similar to many experimental settings for the PGG. The quantitative difference is that participants usually receive a capital of 20-40 tokens that they can spend in integer Algorithm 1: Play rounds procedure PLAY ROUNDS Build network of contacts of size number_of _players Initialize individual contributions randomly t ← 0 while t < max_number_of _rounds do for i = 1 → number_of _players do i plays with its neighbors i accumulates its payoff π i end for for i = 1 → number_of _players do Decide Next Action(i) end for t ← t + 1 end while end procedure Algorithm 2: Decide next action  amounts. Our simulated setting is an abstraction of those more detailed processes. This high-level process is schematized in Algorithm 1 (Play rounds).
After having played in all their groups and having got their utilities, agents must decide what to do next. To make the decision they use a number of very simple behavioral rules. Specifically, if an agent is satisfied, getting a payoff at least equal to the total contribution it made to the groups in which it is a member then, with probability 0.5 it will increase its contribution by 0.25 or, with probability 0.5, it will keep its contribution unchanged in the next step. The noisy decision helps introduce some heterogeneity in the agent's behavior and avoids mass population behavior, in agreement with what one observes in laboratory results where individual behaviors are rather variable. On the other hand, if the agent is unsatisfied because it got less than what it put in the common pool, then it will have two possible choices: either it decreases its contribution by 0.25 at the next time step, or it cuts a link to the group in which it gets the worst payoff. This is a form of escaping an unfavorable environment and it can be done freely, without paying a cost. Although the assumption of zero cost for relinking is probably not completely correct in a real world situation, it is an acceptable working hypothesis. The probabilities 1 − p of changing the contribution or p for joining another group are usually 0.5 but p can obviously be set to a different value in the simulations as a way of investigating the effect of the fluidity of connections on the system's behavior.
Once an agent a cuts a link, there are two ways to join another group: a can create a link to a random group, or to a group with probability proportional to the group's average payoff. The latter simulates uncertainty in the choice with a bias toward better groups. Clearly, the possibility of redirecting links requires more information than in the static model: besides the agent's own payoff and contribution, it is also given the identity of the player group in which it gets the worst payoff and, except in the random redirection, it also knows the average payoff of all groups but not in ranking order. The redirection is not done if the worst group is the one in which i is the focal element because in this case to change group i should cut all the links to its neighbors. It is also not done when the selected group j that i should join is already i's neighbor or it is i itself. For the sake of clarity, the above processes are summarized in pseudo-code form in Algorithms 2 (Decide next action) and 3 (Rewire link) for the random redirection case.
In our opinion, random redirection is much easier to set up in a laboratory experiment and should be the preferred choice in this case. It is also clear that the probability p should be a free parameter in an experiment in order to estimate it empirically from the observed relinking frequencies. On the whole, these rules constitute a simple reinforcement learning process in the sense that decisions that lead to better payoffs are maintained or reinforced while those that lead to negative results are weakened. Moreover, an agent can also act on its connections to try to improve its gains and, possibly, collective results.
Although the behavioral adaptation rules are extremely simple and certainly do not correspond in detail to the decisions made by human participants in an experiment, they were successful in the static network case to induce an average population behavior that was qualitatively similar to what was observed in experiments in which people had the same amount of information [26]. In the present study we extend the investigation to dynamic networks for which experimental results are lacking.

RESULTS
In this section we discuss the results obtained by numerically simulating the behavioral model presented in the previous section. We first comment on the equilibrium contribution results and then we explore the nature of the topological transformations of the initial graphs in the dynamical model. Results are averaged over 40 replicates by generating a new graph structure with the same simulation parameters and reinitializing randomly the individuals contributions before each repetition (see Algorithm 1). Figure 2A refers to the static case studied in Tomassini and Antonioni [26] while Figure 2B belongs to the dynamic case in which an unsatisfied agent can, with probability p = 0.5, cut a link to the group in which it gets the worst payoff and establish a new one to another randomly chosen group.

Evolution of the PGG Average Contribution
Initially, contributions are chosen randomly in the range [0, 1]. Therefore, in all cases the average value is about 0.5 at time step zero. This is the result of a stochastic process but it is also in line with results in experiments where subjects contribute about one-half of their endowment given that they still have no clue, or information, on the consequences of their choices. In the static case shown in Figure 2A contributions decline smoothly up to an r value of about 1.8, with a faster decay the lower r is. Again, this qualitatively also follows the trend found in experiments. And, as observed in most experiments, the pseudoequilibrium value stabilizes around 0.1 and does not go to 0 as theory would tell us, in line with the experimental results of Burton-Chellew and West [8]. Above r = 2 there is an increase in average contribution, and for all r > 2.2 the stable state tends to full contribution after a short transient. Although the goal of the model is not to reproduce any particular set of results, we can say that, qualitatively, it correctly predicts the experimental behavior in Burton-Chellew and West [8] given the same amount of information.
When freedom of redirecting links is introduced the situation changes notably (see Figure 2B). The general behavior is the same as in the static case but the transition from low contribution (<0.5) to high contribution sets in between r = 1.8 and r = 2.0 instead of r = 2.2 and r = 2.4 in the static case. Interestingly, at r = 1.8, the asymptotic average contribution remains at about 0.4 while, at r = 2.2, the final state is already one of full contribution. It is already well-known that models of the two-person PD in coevolving networks may attain states of full or almost full cooperation (see e.g., [27][28][29][30]) as a function of the strategy update rules and the game parameters. The emergence of cooperation through positive assortment between cooperators when redirecting links is allowed has been also confirmed experimentally (see e.g., [13,14,17,31,32]), and is admitted as being a reasonable explanation for the evolution of cooperation.
In Figure 3 we show how the rewiring frequency p affects the simulation results. When the rewiring probability is p = 0.2 ( Figure 3A) the results are logically closer to the static case (see also Figure 2A) although the average contribution levels are still slightly better. On the other hand, in Figure 3B the probability of redirecting a link is p = 0.8. Increasing the rewiring probability is clearly beneficial for cooperation comparing the curves with those for p = 0.5 and especially with respect to the static case. Contributions reach and go beyond the 0.5 level already for r = 1.8 and full contribution is reached for r = 2.2 after only 10 − 15 steps in the average. The results shown in Figures 2B, 3 have been obtained with random redirection of a severed link. Payoff-proportional relinking gives very similar results and it is not shown here to save space.
We are not aware of previous PGG coevolutionary models that use pseudo-behavioral adaptive rules similar to ours together with discrete amounts of contribution. However, there have been several studies on coevolutionary models of PGGs (e.g., [39][40][41][42][43]) based on replicator dynamics considerations under the form of payoff-monotone micro update rules and two-state agents. In general, these works show that switching links in unfavorable situations is a satisfactory strategy to use in PGG games for the evolution of cooperation in networks. Of course, coevolutionary rules involving factors other than the network structure are also possible and have been investigated in some cases (for a summary see Perc et al. [24]) but are not considered here.

Evolution of the Interaction Network
During a run of n playing rounds the original graph G 1 evolves as a sequence of networks {G 1 , G 2 , . . . , G n } in such a way that, in general, G i = G j for any i, j ∈ {1, . . . , n} and i = j, if the rewiring probability p > 0. In our model only the topology of the network may change. The average degree remains the same since a new connection is created only when an old one is deleted. It is useful to watch the topological changes in the evolving population of players by using standard network measures; here we use the average clustering coefficient C , the average path length L , and the degree distribution function (DDF), all of which are explained in Newman [35].
Let us begin with the degree distribution functions of initial and final network structures, shown in Figure 4. Figure 4A shows the DDF of one particular initial network which, as explained in section 2.1, is a social network model of 500 nodes, α = 0.3 and mean degree k ≈ 6. With a probability of rewiring p = 0.5, an agent represented by a network node may ask to rewire a link when unsatisfied. When cutting a link, the new connection is made at random and this means that, after a while, the graph evolves toward something that gets more  similar to a random graph. One run comprises 40 rounds in our simulations. This is not enough to transform the original graph into a fully random graph but Figure 4B, which shows the DDF of the final network of a simulation for enhancement factor r = 1.2, indicates that the DDF has become narrower and more centered around the mean than the original one, as expected. Now, the amount of rewiring depends on the satisfaction of the agent, which in turn is a function of the enhancement factor r. As r increases, agents will be less prone to rewire their connections since they will be more satisfied in the average and, in this case, they will prefer to keep or increase their current contribution, as sketched in Algorithm 2. As a result, the DDF of the final network will be closer to the initial one. An example is shown in Figure 4C for a run with r = 2.4, starting from a DDF analogous to the one shown in Figure 4A.
These trends are confirmed by the evolution of the other network metrics shown in Table 1. The values in the table refer to single treatments in which agents play the PGG for 40 rounds. It  would be more adequate to show averages over many treatments although the trends are already recognizable and thus we limit ourselves to single examples just to convey the general idea.
In Table 1 there are two entries for each line and each r value: the first refers to the initial network and the second refers to the evolved network after 40 rounds of play. The last row gives the number of link redirections for the corresponding value of r. For low values of r there is more rewiring and the average clustering coefficient C is small, following the trend in random graphs where it tends to zero when the graph size increases. When there is less rewiring as for r = 2.2, and especially r = 2.4, the final C is closer to the value of the original graph because the latter undergoes less randomization. The average path length L becomes a little shorter with the evolution but it is less affected and stays rather constant. The evolution of the average clustering coefficient during rounds is shown in more detail in Figure 5 for the same values of r as given in Table 1. Note that each curve corresponds to a single run of 40 game rounds in which a new initial graph of size 500, α = 0.3, mean degree ≈ 6, and probability of rewiring p = 0.5 is built for each value of r. This is the reason why there are some small fluctuations in the initial values of the average clustering coefficients. The shape of the curves confirm that rewiring activity stops earlier for higher values or r, as soon as players are satisfied. The curves for low r, where most players are unsatisfied, indicate that some network activity is present till the end of the run.
We conclude with some discussion of the differences in the network evolution found here with respect to the much more studied PD case, a good review of which is provided in Perc and Szolnoki [30]. Most models of PD on evolving networks start with a random network of agents and find at the end that the evolved networks are no longer random and that positive assortment of cooperators leads to cooperator clusters in which network reciprocity is at work, allowing cooperation to be widespread and stable. In order to compare with the static case, we started from a non-random network and allowed random relinking which requires minimal information. While contributions improve notably with respect to the fixed network, the topology evolves toward randomization. As a consequence, the initially existing communities tend to be destroyed progressively. It would certainly be interesting in future work to use more local rewiring rules, perhaps just limited to second neighbors in order to mitigate structure loss. Furthermore, from the point of view of the node properties, there is no analog of the cooperator clusters found in the binary PD case. The reason is 2-fold: first, we lack additivity in the multiperson PGG. A given agent plays with several players and in several groups at once and the groups are "intermingled, " as schematically shown in Figure 1. In addition, a node (agent) can no longer be characterized by a binary variable (C or D); rather, we have now several possible discrete values and this makes the concept of an assortative cluster more fuzzy.

PGG on a Real Social Network
In the previous sections we have discussed the results of playing a linear PGG with agents represented by the vertices of social network models. Those synthetic networks should be sufficiently representative of actual social networks. However, for the sake of completeness, it would be good to investigate how play evolves on a real social network. As an example, we chose a social network contained in the "Network Data Repository" [44]. The dataset contains all the Wikipedia voting data from the inception of Wikipedia till January 2008. Nodes represent Wikipedia users and an edge from node i to node j represents that user i voted on user j. The network has N = 889 nodes and 2, 914 edges, for a mean degree of 6.556 and an average clustering coefficient of 0.153. Its DDF has a rather long tail, probably representable by a stretched exponential or a power-law with an exponential cutoff, but given the size, we did not attempt to fit a function to it. Given the computational burden involved in the simulations, its relatively small size allowed us to run the PGG model with the same number of repetitions as before, i.e., 40 repetitions each one consisting of 40 rounds of play. In this way, the average results should be statistically comparable with those of section 3. Comparing results of Figures 6A,B shows that the coevolving scenario generally supports more cooperation with respect to the static one even for the real social network structure.

DISCUSSION AND CONCLUSIONS
Realistic models of PGG dynamics have been proposed, both theoretical and based on numerical simulations. These models are essentially based on replicator dynamics ideas and either solve the corresponding differential equations, or numerically compute the population evolution. These theoretically justified approaches are a necessary first step toward an understanding of the game dynamics. However, the large amount of experimental data on PGGs that has been amassed in the last 20 years cannot be fully explained by existing theory alone. In fact, subjects in the laboratory make decisions in an individual manner, based on the amount of information available to them, and this leads in general to results that do not fully agree with the theoretical prescriptions. For this reason, we believe that a new class of models that incorporate decision making under uncertainty and admit individual variability and at least elementary learning capabilities is needed. In Tomassini and Antonioni [26] we made a first attempt in this direction and, under a very simple minimal information assumption, i.e., just agents' contribution and their own current aggregated payoff, we obtained results that were in good qualitative agreement with published experimental results. In Tomassini and Antonioni [26] the population structure was a static social model network. However, in everyday life associations between agents may change for various reasons, think for instance, of friendship, office colleagues, collaboration, and so on. In our computational PGG environment this is simulated by having unsatisfied agents cutting contacts with groups in which they are exploited and form new links to other groups.
In the present work we assumed a network structure that can evolve in time as a function of the above considerations. Indeed, it is well-known that contributions in PGG groups, which typically tend to decrease rather quickly in standard conditions, may increase again if a form of costly punishment of the free-riders is introduced (e.g., see [7]). In the present model an unsatisfied agent has the choice between decreasing the contribution to the public good or simply cutting a link to the group which generates the minimum payoff. The last option can be seen as a simple and cost-free form of punishment. The possibility of link redirection has been shown to be beneficial for cooperation in the Prisoner's Dilemma game, both in simulation as well as in experimental work with human subjects (see references in section 1). It was our hope that a similar mechanism could be equally useful in our pseudo-behavioral PGG model. Indeed, the results we obtained do confirm this. The average equilibrium contribution when link redirection is allowed is always better with respect to the one obtained with a fixed network for all values of the enhancement factor r. Furthermore, the transition from a noncooperative to a cooperative system take place at lower values of r; the improvement is more substantial the larger the probability of redirecting links. We are not aware of laboratory or online experiments with the same characteristics as our model, thus we cannot compare our results with real data. However, because we kept our model particularly simple, an experiment with a similar setting would be easy to set up. In that context, having an easy way to change simulation model would be useful to facilitate parameter exploration before carrying out the actual experiment, which is usually expensive and time-consuming. In future work we plan to study other simple rule models for PGG based on different and richer information sets, such as the distribution of contributions in the group, reputational profiles and bipartite graph representation for agents and groups. Local rewiring and variants where cutting a link has a cost would also be interesting to investigate.

DATA AVAILABILITY STATEMENT
The datasets generated for this study are available on request to the corresponding author.

AUTHOR CONTRIBUTIONS
MT developed the code, performed the simulations, wrote the first draft of the manuscript. Both authors contributed the conception and design of the study, contributed to the manuscript revision, read, and approved the submitted version.