{'fraction_non_alphanumeric': 0.04451679554205929, 'fraction_numerical': 0.014181510816141251, 'mean_word_length': 4.396857577293462, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Altruism in populations at the extinction transition

We study the evolution of cooperation as a birth-death process in spatially extended populations. The benefit from the altruistic behavior of a cooperator is implemented by decreasing the death rate of its direct neighbours. The cost of cooperation is the increase of a cooperator’s death rate proportional to the number of its neighbors. For any benefit-cost ratio above 1, the stable stationary concentrations of agents pass through four regimes as the baseline death rate p increases: (i) defection only, (ii) coexistence, (iii) cooperation only, (iv) extinction. We investigate the transitions between these regimes. Qualitatively identical phase diagrams are obtained for populations on square lattices and in pair approximation. Spatial correlations with nearest neighbours only are thus sufficient for sustained cooperation.


I. INTRODUCTION
Altruism or cooperativity [1] describe behavior that is more in favor of others than of the actor herself. Alarm calls are an example of altruistic behavior: Increasing the risk of becoming prey itself first, one individual of a group warns the others of a predator approaching [2]. At first glance, the observation of altruism sustained over generations appears incompatible with Darwin's theory of natural selection, featuring the survival of the fittest [3,4]. If non-altruists acting only to their own benefit have an advantage over altruists in terms of reproductive success, altruistic traits eventually disappear.
The question of sustained altruism and cooperativity have been addressed in the framework of evolutionary game theory, in particular by work on the Prisoner's Dilemma and Public Goods Games [5,6]. In these and other games, the time evolution of the system is assumed to take place as a sequence of two elementary steps: (i) the combined behavioral choices of the participants lead to an assignment of a payoff to each player which (ii) determines the choice of their future strategies or roles. In the simplest case, with two possible strategies, cooperation and defection, the dilemma arises as follows. Regardless of the other agent's move, an agent's best (highest payoff) move is always defection. On the other hand, the sum of all players payoffs is maximal when all cooperate. Therefore, natural selection always favors defection [5], despite cooperation is the best global strategy.
The aforementioned social dilemma is frequently analyzed by means of the replicator equation [7][8][9] describing the time evolution of the fraction of players holding one of the two strategies. If the fitness of an individual equals its payoff, the resulting replicator equation for the Prisoner's Dilemma has only two steady-state solutions, the only-defector and the only-cooperator solutions, the former being the only stable one. Nevertheless, the prevalence of cooperation is still possible within the context of evolutionary games, provided appropriate reciprocity mechanisms are included in the dynamics [1,6,[10][11][12]: Direct reciprocity, indirect reciprocity, Kin selection, group selection, and network structure. If compared to the well-mixed situation, the new mechanisms include update rules that favor the interactions among cooperators.
The network structure mechanism was one of the first reciprocity mechanisms studied in the literature. It refers to the restriction of agents interactions among neighbours. In a two-dimensional regular network, the survival of altruists was explained in terms of their ability of preventing the exploitation of defectors through the formation of clusters [13][14][15][16]. Further progress in the field considered births and deaths: The second step of the dynamics, the one that allows a change of the strategy, is now interpreted as a death of a player followed by a birth. The new ecologic perspective allowed to assess the importance of new relevant issues, such as the fluctuation of the population density [17][18][19][20], the movement of agents [21][22][23][24][25], the spatial distribution of neighbours and their number [26,27], among others. Recent works also consider networks of interactions [7,12,[28][29][30][31][32], focus on the critical properties of the system [33][34][35], include other novel dynamic rules [36][37][38][39][40][41][42], analyze the formation of patterns [13,[43][44][45][46][47], and evaluate the effect on the population growing as external pressure rises [48]. The latter aspect has been widely analyze in the context of competing species [49,50], but has not received much attention in relation with the prevalence of altruism.
Although general considerations about the prevalence of altruism in the context of the Public Goods Games can be inferred from the numerous studies on the topic [51,52], the behavior of cooperation turns out to be very dependent on the specific dynamics considered [53,54]. This is the case when trying to evaluate the importance of the spatial heterogeneity and the formation of clusters of cooperators: Many studies [14,16,18,55,56] explain the coexistence of cooperation and defection using the so called pair approximation, an approach that goes one step beyond mean field by tracking the dynamics of pairs of neighbours. However, pair approximation still assumes spatial homogeneity of the system. Hence, there is no need for the formation of clusters of cooperators for explaining their long-term survival.
Recent works on the evolution of cooperation suggest the need of giving up on certain common statements of evolutionary game theory [57][58][59][60]. Particularly, some experiments on the dynamics of human cooperation show that people choose their strategy regardless the payoff of others [61]. Similar conclusions are given in the context of living beings [62]. See also recent experimental and numerical works on related topics [63][64][65][66].
Here we propose a birth-death agent-based model evolving in a structural environment. The model assumes agents to have fixed strategies, roles, or types (cooperator or defector), together with a dynamics driven by nonsynchronous birth and death processes, hence allowing the system to have vacant sites. This approach provides a natural framework to asses the effects of different mechanisms on the behavior of the system and on the survival of cooperativity, such as the dynamics of interactions, the fluctuation in the number population, the presence or absence of cooperation clusters, and the spatial variation of parameters, among others.
The organization of the work is as follows. In Section II we introduce the agent-based model of a population of cooperators and defectors living on a generic network. For later sections the main focus is on the square lattice, where the system has only three relevant parameters: The total number of sites N , the death parameter p, and the cost-of-altruism parameter . Section III includes stochastic simulations. We obtain the phase diagram in the parameter space (p, ) showing the steadystate configurations of the system. The effect of p being spatially dependent is also addressed. In section IV the system is described theoretically. Three complementary formulations, using main-field or pair-approximation approaches, are given. They aim at describing the system under different physical conditions. Finally, a discussion and outlook of the main results are included in Section V.

II. DEFINITION OF THE MODEL
The model describes the evolution of a population on an arbitrary network with N nodes. The set of neighbours of a node i is denoted by N i . The network is symmetric (undirected), so that j ∈ N i implies i ∈ N j ; also i / ∈ N i (no self-loops). Each agent in the population is either a cooperator C or a defector D, with c i and d i being their respective numbers at node i. A site or node of the network holds at most one agent (C or D) but it may also be empty (E), hence 0 ≤ c i + d i ≤ 1 and c i d i = 0. Thus the state of the system S is given by where X is either a cooperator or a defector, and x i its number at site i. Moreover, the number e i = 1 − (c i + d i ) gives 1 if site i is empty and 0 if x i = 1. From condition c i d i = 0 we also have e i x i = 0. A state transition is either the birth or the death of one agent at a site i. At the birth of a cooperator we set c i = 1 at a previously empty site i. Likewise for the birth of a defector, d i = 1 is set at an empty site i. These transitions occur at a rate proportional to the fraction of neighbouring sites occupied by the agent type to be born, as where k i = |N i | is the degree (number of those neighbours) of node i, andx i ≡ j∈Ni x j /k j . The death of an agent is a state transition setting c i = 0 or d i = 0 at a previously occupied site i, with rates where nowx i ≡ k −1 i j∈Ni x j . Agents die at a baseline rate p. This rate is reduced, however, by the fraction of adjacent sites occupied by a cooperator. The death rate of a cooperator, on the other hand, has an additional positive term proportional (with factor 1 − ) to the fraction of adjacent agents. This way, the parameter accounts for the cost of the altruistic act, the limit of = 0 corresponding to maximum cost where the altruist definitely loses its life for saving its neighbour's. The other limit is costless altruism at = 1.
In the absence of cooperators, or in the absence of defectors with = 0, the model is equivalent to the SIS (susceptible-infected-suscetible) model of epidemics [67,68]. The equivalence is obtained by mapping each empty site to a susceptible individual and each site with a defector to an infected individual.

III. SIMULATIONS
Let us first illustrate and numerically analyze the dynamics on periodic square lattices. As defined above, the model features non-ergodicity. Eventually both types of agents go extinct in a finite size system. In the simulations in this section, a slightly modified version of the model is employed: We set zero the death rate of an agent currently being the only one of its type (C or D). This allows us to take long-term measurements of concentrations and distributions without having to restart the dynamics. Given the rates, simulations are performed with a standard Gillespie algorithm [69,70].
A. Square lattice with homogeneous parameters Figure 1 shows the parameter dependence of the stationary mean concentrations of agents. At = 0, cooperators are absent in the whole range of p, while the concentration of defectors is positive for p < p c ≈ 0.62 and vanishes for p > p c . Now fixing 0 < < 1 and increasing p from 0 to 1, the concentration of defectors d still decreases with p. Before d reaches zero, however, the concentration of cooperators c becomes positive. Simulations on square lattices of smaller size (N = 20 2 , N = 30 2 ) and checks with N = 100 2 yield results almost identical to those of Fig. 1.
In the coexistence regime of cooperators and defectors (green area in Figure 1), the growth of cooperation outweighs the decline of defection. Here the total concentration of agents grows with p, Let us now take a closer look at the transitions between the regimes observed in Figure 1. To this end, we record the distributions in the number of agents (each type separately) and consider their changes under parameter variation. Figure 3 shows this analysis for five transitions (a)-(e), also marked in the center panel of Figure 1. Transitions in panels (a) and (e) are both extinctions of one type of agent in the absence of the other type. However, the transitions are distinguishable by the approximate exponents of the algebraic decay of distributions, giving 1/4 for the extinction of defectors versus 3/7 for cooperators.

B. Spatially dependent parameter p
Let us study a variation of the model with a spatial dependence of the parameter p, a way of mimicking ecological conditions [71,72]. For an agent at lattice site (x, y), x, y ∈ {1, . . . , L}, the death rate is based on the parameter value For L even, the minimum value 1/L is assumed by p(x) at x = 1 and x = L; its maximum value 1 − 1/L is obtained at x = L/2 and x = L/2 + 1. The parameter remains spatially homogeneous, here = 0.75. Figure 4(a) shows the concentration of agents as a function of lattice coordinate x, i.e. averaged over lattice coordinate y and time. We see that the effect of parameter p is local. The p-dependence of c and d observed under spatially homogeneous p in Section III A qualitatively matches that of the scenario with spatially dependent p.

IV. ANALYTIC APPROXIMATIONS
In this section, we derive three complementary theoretical descriptions of our model, defined in Sec. II. The first two ones are based on a mean-field approximation, while the third one uses the pair approximation. As will be shown, the different approaches have different ranges of applicability and explain the prevalence/extinction and even the coexistence of altruism and defection under different physical/biological conditions. In the case of the pair approximation, a very similar phase diagram to the numerical one shown in Fig. 1 is obtained.
Our starting point is the master equation for the probability P (S, t) of finding the system in state S at time t. By means of a probabilistic balance in the continuum time limit [73], and using the rates given by Eqs. (2)-(5), the master equation reads where the operators E ± xi act on a generic func- By taking moments of the master equation (8) we can derive equations for the mean numbers of cooperators and defectors in site i, c i and d i . After using the relation e i = 1 − c i − d i and some manipulations, we obtain for i = 1, . . . , N . Since the first moments are coupled to the second ones through correlations between neighbors, it is also convenient to derive equations for the two node correlations for neighboring sites, i.e. x i x j with j ∈ N i : wherex i andx i are defined just after Eqs. (3) and (5), respectively. The two remaining moments, c i e j and d i e j can be obtained from the previous ones by means of the identity 1 = e i +c i +d i , as Although the system of Eqs. (9)-(13) are exact and valid for any structure of neighbours (network), it is not closed, due to the presence of three nodes correlations. Therefore, in order to have a closed set of equations, three approximations are explored. The first two ones make use of the mean-field approximation, where two node correlations are ignored, and the third one uses pair approximation. Furthermore, we restrict ourselves to regular networks where k i = k for all i, so as to simplify the description (nowx i =x i = k −1 j∈Ni x j ).

A. Exact relations
Before proceeding with the approximations, some exact relations will be derived. They apply for homogeneous steady-state configurations.
Consider first the case of only defectors. Since c = 0, we also have cc = cd = ce = 0. Using Eq. (10), and, with Eq. (13) and the identity dde + ddd = dd , which implies, in order to have positive solutions, 1 − k(1 − p) ≤ 0, that is This is an overestimation of the extinction probability of defectors, for all ∈ [0, 1]. For = 0, where the model is the SIS model, and the square lattice (k = 4), the previous estimation is 0.75 while the one from the simulations is around 0.62 [74,75], see also Fig. 1.
For the only-cooperator case, it is d = 0 and dd = cd = de = 0. Using Eq. (9) together with ce = c − cc , we get and, with Eq. (11) and the identity cce + ccc = cc , Again, this is an overestimation of the critical probability extinction when there are only cooperators in the system.
The critical value here is bigger or equal to the one of Eq. (16), as expected due to the altruistic benefit. Equation (19) also provides an estimation of the dependence of the critical probability on . In particular, it tends to 1 for → 1, in agreement with the numerical simulations of Fig. 1.
Equations (16) and (19), and also the other relations, are the same for = 0 provided we interchange the types of particles, because the model with only defectors and only cooperators coincide in this limit. This can be seen from the rates defining the dynamics in Eqs. (2)-(5): The rates for defectors in the absence of cooperators are the same as the rates for cooperators in the absence of defectors at = 0.

B. Global mean-field approximation
For the global mean-field case, equivalent to the dynamics on a complete graph in the limit of infinite system size, correlations among nodes are absent. In general, assuming the mean-field approximation implies the following two approximations: This is also a good approximation when there is no correlation expected between the agents, for instance when there is one kind of agent and the distribution of empty sites is homogeneously distributed. Then, the concentrations c and d of cooperators and defectors evolve, according to Eqs. (9) and (10), as The system (22)- (23) can be used now to analyze the homogeneous steady-state solutions. Requiring stationarity, d dt c = d dt d = 0, we find the trivial solution c = d = 0 (all sites empty) and, two other, nontrivial ones, namely The trivial solution is clearly unstable, since the coefficient 1 − p of the less degree terms in Eqs. (22) and (23) is positive for p < 1. However, it is an absorbing state, and their presence becomes important for small system sizes, as already mentioned in Sec. III.
In order to asses the stability of the solution with only defectors, consider the perturbation of Eq. (24): c = 0 + c 1 and d = 1 − p + d 1 with c 1 ∼ d 1 . Then, up to linear order in the perturbations, we have The first equation, and hence the second one, have c 1 = d 1 = 0 as the steady solution, revealing the stable character of (24). Proceeding similarly with the only-cooperators solution, Eq. (25), we obtain the system which now reveals the unstable character of the solution, since the solution of Eq. (29) increases exponentially with time. According to this analysis, in well-mixed populations, cooperators go extinct.

C. Local mean-field approximation
We can go one step beyond the global mean-field approximation by considering situations where the concentrations of cooperators and defectors change from site to site. In particular, we suppose situations where the site dependence can be encoded through a vector r, which is nothing but the vector of space position in a regular graph. This way, we deduce in the sequel a macroscopic description that removes one of the approximation of the global mean field, namely that of Eq. (21), but still neglects correlations, Eq. (20). The procedure is similar to the one used in Ref. [76].
By looking at the dynamics on a length scale L much larger than the typical distance between sites l, the relevant quantities become local concentrations: In a regular graph in R d , for example, κ(r) and δ(r) give the number of cooperators and defectors inside a region of volume l d centered at position r. The new quantities are assumed to be smooth functions of r, a property that allows us to relate any density of site j ∈ N i and position l, say χ(r + l) = κ(r + l) or χ(r + l) = δ(r + l) at position r, with that of site i, χ(r), as Hence, we have where we have assumed k∈Ni l k 0, which is an exact expression for a regular square lattice and quiet a good approximation for isotropic configurations. Moreover, (34) which is valid, again, under isotropic configurations of sites.
With approximations (20), (33), and (34), the exact system (9)-(10) becomes the following reaction-diffusion system As expected, we recover the mean-field description for homogeneous solutions, hence we still have the solutions given in Eqs. (24) and (25). However, an important benefit of the present description, if compared to that of the global mean-field approximation, is the possibility of studying the latter solutions under local perturbations, in contrast to homogeneous and global ones done in the previous subsection.
Consider the homogeneous solution of Eq. (24), κ 0 = 0 and δ 0 = 1 − p. Following the standard linear stability analysis, we seek solutions of the form κ = κ 0 + κ 1 and δ = δ 0 + δ 1 , with κ 1 ∼ δ 1 δ 0 . After linearizing and seeking solutions of the form χ 1 =χ 1 e iξ·r , system (35) and (36) becomes The steady state solution for any wavelength ξ is the trivial one, meaning that the solution of only defectors is linearly stable: Any initial and small spatial perturbation in the number of defectors (and also cooperators) tends to zero as time increases.
Proceeding similarly with the solution of Eq. (25), we get In this case, the stability of the system depends on the value of ξ. Setting ξ = 2π/L, the smallest allowed value for the given boundary conditions, the solution (25) is stable for p < p * c with where we have used the approximation L/l N 1/d . This means that, under this approximation, the onlycooperators solution is stable for systems small enough. For N → ∞ it is p * c → 1, and the solution is always unstable, and we recover the result of mean field.
Although the local mean-field approximation could in principle be seen as very rude, it shows the importance of taking into account the system size while describing altruism, as already pointed out in Ref. [60]. In this case, the inclusion of spatial dependence, while sill neglecting correlations, stabilizes the only-cooperators solution for p <p c . Moreover, the results suggest the existence of other solutions, spatially non-homogeneous ones, and the possibility of discontinuous (first-order) transitions among them. This is because the only-defectors solution keeps always linearly stable, with no other stable solution close to it.

D. Pair approximation
The previous mean-field approaches are expected to fail when the concentration of defectors and cooperators are locally correlated. Since births occur among neighboring sites, correlations are expected to be important, in general. Hence, we reconsider system (9)- (13), and try to express the three nodes moments as a function of the one and two nodes mean values. Although different approaches are possible, see for instance [76], we explore here the so-called pair approximation [77], which can be translated in this context to Note that the order of appearance of the variables inside the brackets is important: x i refers to a node which is a neighbour of x j and x j is a neighbour of x k . Observe that the pair approximation keeps the correlations regardless of the occupancy of the middle node, namely xj ∈{c,d,e} x i x j x k = x i 1x k xj ∈{c,d,e} xixj xj x k xj = x i x j , in general.
For simplicity, we consider homogeneous situations for which system (9)-(13), within the pair approximation of Eq. (42), becomes where xy is for any two adjacent nodes with particles x and y. Hence, xy = yx .

Steady-state solutions
The system (43)-(47) has several steady-state solutions. The most obvious one it the trivial solution, without particles, c = d = 0. This is the absorbing state we have already mentioned.
By setting all time derivatives of Eqs. (43)-(47) to zero and c = 0, we obtain the steady-state solution for defection only: valid for Observe that the previous inequality is the same as the one in Eq. (16), derived using exact relations. However, in this case, p = 1 − 1/k is the exact critical value for the extinction of defectors in the absence of cooperators, within the pair approximation. The only-cooperators solution is obtained from Eqs.
The equality of the last relation holds for → 0. For the other limiting value of , i.e. → 1, the upper allowed value of p is 1, as we also obtained exactly.
Other steady-state solutions describing coexistence, but close to the previous ones, can also be found as follows. First, we notice that the system (43)- (47), under the steady-state condition, can be reduced to a nonlinear system of only two equations with c and d as unknown quantities. Second, we seek solutions close to the one-type ones, i.e. c with For the only-defectors case, the resulting set of equation is nonlinear, but one can still find a condition for a nontrivial solution to exist. Now, the nontrivial solutions are above d (p), which has the following approximate expression with Since c (p) ≥ d (p), the coexistence solutions are in the region in between the two lines, as shown in Fig. 5 for the square lattice (k = 4).
Finally, there may be other solutions describing coexistence not necessarily close to the only-cooperator nor only-defectors ones. This can be shown explicitly for in Equation (51). The transition between coexistence (green area) and the regime of only cooperators is described by Equation (52) using expressions (53)- (55). The transition between coexistence and the regime of only defectors (blue area) has an approximate description (dashed curve) in Equation (56) using expressions (57)- (59). The exact solution (boundary between blue and green area) has been obtained as well, details given elsewhere. = 1, for which we can obtain explicit expressions. After some algebra, we get valid for Moreover, it can be seen that this solution is linearly unstable, with only one unstable mode. However, the characteristic time of the unstable mode is much slower than the others, meaning that the system can stay close to the solution for a long time.

Stability of the steady-state solutions
The stability of the only-defectors and onlycooperators solutions have been studied by means of a modified linear stability analysis of system (43)- (47), following several steps. First, using the identities ce = c − cc − cd and de = d − cd − dd , all mean values are expressed in terms of c , d , cc , cd , and dd . Second, the homogeneous solution is linearly perturbed as with u = ( c , d , cc , cd , dd ) the vector of the homogeneous solutions, u 0 is the vector of the unperturbed solutions, u 1 is the perturbation vector, and γ a perturbative parameter. Third, the proposed solution is replaced in (43)-(47) and the resulting system is expanded up to linear order in γ. Contrary to the usual linear perturbation schemes, we obtain a nonlinear closed system of equations for the unknown perturbation quantities u 1,i , for i = 1, . . . , 5. For both, the only-cooperators and onlydefectors solutions, the equation for the perturbation can be written as with M being a matrix and β a linear function of cc / c , cd / c , cd / d , and dd / d , whose explicit form depend on the solution considered. In any case, β is a bounded function, since 0 ≤ xy / x ≤ 1 for x, y ∈ {c, d}. Finally, the asymptotic behavior of u 1 (t) for t → ∞, hence the stable/unstable character of u 0 , can be determined from the spectra of M (β) for any β, using the following lemma.
Lemma: If all eigenvalues of M (β) have negative real parts for all values of β, then u 0 is linearly stable. Proof : Given a time t > 0 and an integer n > 0, we define t i = t M i for i = 0, . . . , n. Thanks to the Mean Value Theorem, it is u 1 (t i ) = I + M Denoting by · any vector norm, we have u 1 (t) = n k=1 (I + M k t n ) u 0 ≤ (I +M t n ) n u 0 whereM is such that (I +M t n )u 0 = max k I + M k t n u 0 . Taking n → ∞, u 1 (t) ≤ eM t u 0 which tends to zero as t → ∞, as all eigenvalues ofM have negative real parts.
Using the lemma, we see that the only-cooperators solution is stable above line c (p) given by Eq. (52), and the only-defectors solution is stable below line d (p) given approximately by Eq. (56). This implies that the instability of the one-type solutions is due to the presence of coexistence solutions which become stable. Numerical evaluation of the time evolution of system (43)- (47) confirms the theoretical analysis.

V. DISCUSSION
As the root of the present work, we introduce a basic stochastic model of a spatially extended population of altrustic and non-altruistic agents, called cooperators and defectors. The population evolves by a birth-death process. In line with the considerations by Huang and colleages [19], an agents' interaction with another agent influences the death rates only. Agents' interactions are altruistic acts. They lower the death rate of the recipient while increasing the death rate of the donor, relative to a baseline death rate p for agents in isolation, p being one of two parameters of the model. The benefit-cost ratio of the altruistic is encoded in the second parameter .
Results are obained as (1) stochastic simulations of finite systems and (2) stationary solutions and their stability in approximate descriptions by rate equations. The pair approximation, neglecting all spatial correlations except those of nearest neighbours, yields our main result: For any benefit-cost ratio above 1, the stable stationary solutions in dependence of baseline death rate p display (i) a regime of co-existence of cooperators and defectors and (ii) a regime of a population of cooperators only. In the (p, ) parameter plane, these regimes and the related transitions appear as a continuation of the known extinction transition for a spatial population without cooperative interaction (also known as contact process, asynchronous SIS model). The latter case corresponds to benefit-cost ratio of exactly 1 ( = 0).
The phase diagram from pair approximation is fully qualitatively consistent with that from stochastic simulation with finite square lattices. Simulations of sufficiently large instances of k-regular random graphs yield an equivalent phase diagram (results not shown here); this holds also for preliminary simulation results on other graphs, including scale-free [78] and small-world networks [79]. Thus we speculate that the observed type of (p, ) phase diagram is generic, holding for most types of connected sparse graphs. For dense graphs, however, we expect mean-field behaviour without stable cooperation seen in section IV B.
Consider a spatially extended population subject to a decline in livability, which in reality may be a reduction of food resources or an increase of predators. In our model, this scenario is represented by increasing p and comes with the following prediction. Initially without cooperators, the concentration of agents decreases until reaching a transition point with the onset of co-existence. In this regime, the concentration of defectors further decreases; this decrease is overcompensated by the increase in cooperators. Thus in the co-existence regime, there is net population growth under increasing p [48]. Further increase of p first leads to a regime with a population containing cooperators only and then an extinction phase where zero population size is the only stable solution.
According to the rule by Ohtsuki and colleagues [51], cooperation supersedes defection when the benefit-cost ratio is larger than the agent's number of neighbours z.
While their theory assumes a population of constant size and each agent with a constant number z of neighbours, we here see cooperation enhanced when the number of neighbours (occupied adjacent sites) is reduced dynamically due to a shrinking population density. Cooperation thus appears as a stable solution when the population most "needs" it, i.e. at low density close to extinction. Future work may check if a rule relating benefit-cost ratio and neighborhood size characterizes the appearance of stable cooperation also in the present model with varying population size.
Giving up the spatial homogeneity of the baseline death rate p, we have investigated the scenario of a gradient between low p (high livability) and high p (low livability). The regimes encountered previously by tuning p for the whole system are now found simultaneously at their corresponding spatial position. In particular, high concentration of cooperators is found next to the region uninhabited due to large death rate p. There is a region of co-existence where total population concentration increases with p also spatially. Cooperation arises when and where needed to avoid extinction.