## Introduction

Being an essential ingredient of evolution, cooperation has played a key role in the shaping of species, from the simplest organisms to vertebrates (Hammerstein, 2003). In this context, one of the most fascinating challenges has been to understand how cooperation may survive in communities of self-regarding agents, a problem which has been typically formalized in the framework of Evolutionary Game Theory (Maynard-Smith, 1982; Hofbauer & Sigmund, 1998; Gintis, 2000), adopting the Prisoner's Dilemma (PD) as a metaphor for studying cooperation between unrelated individuals (Axelrod & Hamilton, 1981; Axelrod, 1989; Milinski, 1987; Nowak & Sigmund, 1992; Nowak & May, 1992).

A community is efficiently modelled as a set of *n* agents, each one endowed with one of two strategies – cooperator or defector. In the one-shot PD, each pair of agents interacts only once. A defector exploiting a cooperator gets an amount *T* and the exploited cooperator receives *S*, both agents receiving *R* upon mutual cooperation and *P* upon mutual defection, such that *T > R > P > S*. Therefore, it is best to defect regardless of the opponent's decision. In well-mixed populations, in which each agent interacts with all other agents, evolution under replicator dynamics (Hofbauer & Sigmund, 1998; Gintis, 2000) shows that cooperators are unable to resist invasion by defectors. The fate of cooperators is somewhat alleviated whenever the PD evolves on a spatially structured population (Nowak & May, 1992), such that agents are constrained to play with their nearest–neighbours. Indeed, in spatially structured populations cooperators are now able to resist invasion by defectors, but only for a very limited range of game parameters (see discussion in connection with Fig. 3). Nevertheless, the impact of topological constraints is known to induce profound evolutionary effects, as beautifully demonstrated experimentally in the study of the evolution of different strains of *Escherichia coli* (Kerr *et al.*, 2002).

The two scenarios described above may be naturally associated with regular graphs (Fig. 1a), in which agents occupy the vertices and the Network Of Contacts (NOCs) is defined by the edges linking the vertices. They correspond to homogeneous NOCs, in the sense that all agents are topologically equivalent, having the same number of neighbours, such that the associated graphs exhibit a characteristic single-peak shape for the degree distribution *d(k)*, defined and illustrated in Fig. 1.

Recently, compelling evidence has been accumulated that a plethora of natural, social and technological real-world NOCs are heterogeneous (Barabási & Albert, 1999; Amaral *et al.*, 2000; Albert & Barabási, 2002; Dorogotsev & Mendes, 2003), exhibiting multi-peaked degree distributions (Fig. 1), reflecting the diversity of connections of different agents. Moreover, they often portray the coexistence of local connections (spatial structure) with nonlocal connections (or shortcuts). The celebrated small-world graphs (Watts, 1998) and scale-free graphs (Barabási & Albert, 1999) illustrated in Fig. 1 provide examples of such NOCs, which have been recently associated with realistic NOCs.

The heterogeneity of NOCs is known to have a strong impact in different fields, notably epidemiology, the case of AIDS constituting a paradigmatic example (May *et al.*, 2001). At the heart of the theory, heterogeneity leads to an ubiquitous modification of the basic reproductive number *R*_{0}, which ultimately defines the threshold for epidemic outbreaks (Anderson & May, 1991; May & Lloyd, 2001; May *et al.*, 2001). Compared to its homogeneous counterpart, the modified *R*_{0} grows proportionally to the second moment of the degree distribution, so that on extreme heterogeneous NOCs, such as scale-free NOCs, the likelihood of epidemic outbreaks dramatically increases. This, in turn, is associated with the fact that, since now different individuals undergo different numbers of contacts, highly connected individuals will naturally acquire higher chance of infecting others (becoming infected) whenever they are infected (susceptible).

How does heterogeneity affect the co-evolution of defectors and cooperators under natural selection?

In heterogeneous populations, different agents will typically undergo a different number of interactions, which in turn will proceed along different patterns of connectivity. Since the payoff accumulated by each agent throughout one generation (see below) will be used as its fitness, dictating the success with which the agent's strategy will be replicated in the next generation, heterogeneity will certainly have an impact on the co-evolution of defectors and cooperators.

Figure 2 illustrates a detail of a typical heterogeneous community. We concentrate on two focal agents, a cooperator with *N*_{1} neighbours (*N*_{1} = 7), and a defector with *N*_{2} neighbours (*N*_{2} = 5), and let us imagine that both have the same number of defectors, say (*N*_{D} = 2). After interacting with all their neighbours, the cooperator accumulates a payoff of *P*_{C} = (*N*_{1} −* N*_{D})*R* + *N*_{D}*S* whereas the defector ends up with *P*_{D} =(*N*_{2} −* N*_{D})*T* + *N*_{D}*P*. If the NOCs were homogeneous, all one needs to do is to make *N*_{1} = *N*_{2} = *z*, the average connectivity of the population, in the previous expressions. This, however, leads to very different outcomes in what concerns the accumulated payoffs in homogeneous and heterogeneous NOCs. Indeed, whereas in homogenous NOCs the answer to whether *P*_{D} > *P*_{C} relies *exclusively* on the relative ordering of (*T, R, P, S*), in heterogeneous NOCs the answer depends now on the fact that *N*_{1} ≠ *N*_{2}. In other words, the pattern of connectivity also contributes to define the accumulated payoff of each individual, a feature, which, being natural, is absent in homogeneous NOCs. Indeed, heterogeneity embeds the intuition that agents pertaining to different neighbourhoods are involved in different patterns of connectivity, opening a new route to the evolution of cooperation: Cooperators will increase their fitness to the extent they succeed in maximizing their amount of cooperative interactions per generation. However, defectors will also increase their fitness by exploiting more cooperators per generation. Therefore, it remains an open problem who – defectors or cooperators – will be able to profit from heterogeneity, and to which extent.

Because no analytic solutions exist for this problem, agent-based simulations (Nowak & May, 1992; Hauert & Doebeli, 2004) provide a viable alternative to study the evolution of cooperation in realistic populations, a framework we shall adopt here.