Evolution of cooperation among migrating resource-oriented agents under environmental variability
Masaaki Inaba, Eizo Akiyama

TL;DR
This study uses simulations to show that environmental variability and human mobility jointly promote cooperation among resource-seeking agents, offering insights into early human social evolution.
Contribution
It is the first to analyze the combined effects of environmental variability and mobility on cooperation evolution, revealing their role in disrupting defectors and fostering cooperators.
Findings
Agent mobility enhances cooperation under environmental variability.
Environmental variability alone can promote cooperation.
Disruption of defector groups leads to cooperative cluster formation.
Abstract
Cooperation is fundamental to human societies. While several basic theoretical mechanisms underlying its evolution have been established, research addressing more realistic settings remains underdeveloped. Drawing on the hypothesis that intensified environmental fluctuations drove early behavioral evolution in humans during the Middle Stone Age in Africa, we examine the effects of environmental variability and human mobility on the evolution of cooperation. In our model, the variability is represented by randomly moving resource-rich spots across a two-dimensional space, and the mobility is represented by resource-seeking migration of agents. These agents interact cooperatively or competitively for resources while adopting behavioral strategies from more successful neighbors. Through extensive simulations of this model, we reveal three key findings: (i) with sufficient agent mobility,…
| Parameter | Description | Value options |
|---|---|---|
| Grid dimensions | ||
| Total number of agents | ||
| Initial frequency of cooperators | ||
| Total number of SoRs | 1, 2 | |
| Probability of SoR shift | to (step: ) | |
| Payoff for mutual cooperation | ||
| Payoff for defection against cooperator | to (step: ) | |
| Payoff for mutual defection | ||
| Payoff for cooperation against defector | to (step: ) | |
| Probability of migration | to (step: ) | |
| Probability of resource-oriented migration | to (step: ) | |
| Probability of mutation |
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsEvolutionary Game Theory and Cooperation · Language and cultural evolution · Primate Behavior and Ecology
Evolution of cooperation among migrating resource-oriented agents under environmental variability
Masaaki Inaba
Eizo Akiyama
Abstract
Cooperation is fundamental to human societies. While several basic theoretical mechanisms underlying its evolution have been established, research addressing more realistic settings remains underdeveloped. Drawing on the hypothesis that intensified environmental fluctuations drove early behavioral evolution in humans during the Middle Stone Age in Africa, we examine the effects of environmental variability and human mobility on the evolution of cooperation. In our model, the variability is represented by randomly moving resource-rich spots across a two-dimensional space, and the mobility is represented by resource-seeking migration of agents. These agents interact cooperatively or competitively for resources while adopting behavioral strategies from more successful neighbors. Through extensive simulations of this model, we reveal three key findings: (i) with sufficient agent mobility, even modest environmental variability promotes cooperation, but further variability does not enhance cooperation; (ii) with any level of environmental variability, agent mobility promotes cooperation; and (iii) these effects occur because the joint effect of environmental variability and agent mobility disrupts defector groups in resource-rich areas, forming cooperator groups on those sites. Although previous studies examine environmental variability and mobility separately, to our knowledge this is the first study to analyze their joint effects on the evolution of cooperation. These findings suggest that environmental variability can promote cooperative group formation without enhanced cognitive abilities, providing new insights into the evolution of human cooperation and, by extension, sociality.
keywords:
Evolution of Cooperation , Game Theory , Complex Systems , Anthropology , Environmental Variability , Migration , Agent-Based Simulation
††journal: Chaos, Solitons & Fractals
\affiliation
[a1]organization=Graduate School of Science and Technology, University of Tsukuba, addressline=1-1-1 Tennodai, city=Tsukuba, postcode=305-8577, state=Ibaraki, country=Japan
\affiliation
[a2]organization=Institute of Systems and Information Engineering, University of Tsukuba, addressline=1-1-1 Tennodai, city=Tsukuba, postcode=305-8577, state=Ibaraki, country=Japan
{highlights}
Modeling environmental variability as a driver of Middle Stone Age human cooperation
Environmental variability and agent mobility can promote the evolution of cooperation
Environmental variability can disrupt stable defector groups in resource-rich areas
Agent interactions and mobility can foster cooperative group formation
Cooperation can evolve without requiring enhanced cognitive abilities
1 Introduction
Cooperative behavior is a fundamental feature of human societies. Yet this widespread behavior poses an evolutionary paradox: while evolutionary theory suggests that individuals act to maximize their own fitness, cooperation appears to favor the benefit of others or groups over that of individuals. A substantial body of research [1, 2, 3, 4, 5, 6] has addressed this puzzle, identifying various theoretical mechanisms that explain the evolution of cooperation. However, several influential factors on cooperation in natural settings—such as environmental variability, mobility, complex networks, norms, and memory—remain theoretically underexplored. Here, we focus on how environmental variability and agent mobility shape the evolutionary dynamics of cooperation.
Although most theoretical studies on the evolution of cooperation assume static environmental conditions, some studies [7, 8, 9, 10, 11, 12] have examined cooperation under variable environmental conditions. While these studies have primarily focused on biological and physical contexts, we approach the study of cooperation under environmental variability from an anthropological perspective, specifically drawing on the Variability Selection Hypothesis (VSH) [13, 14, 15, 16]. The VSH posits that variable and unpredictable environments during the Middle Stone Age (MSA) in Africa were crucial drivers of human evolution. This hypothesis is based on the temporal correspondence between periods of increased environmental variability and the sophistication of archaeological artifacts, though the underlying causal dynamics are not yet fully resolved. Our previous work [17] contributes to clarifying these dynamics by demonstrating that environmental variability can promote cooperation through the interplay between environmental disruptions and social network structures that support cooperation. However, this study does not incorporate mobility—an essential trait of pre-sedentary MSA human populations.
The evolution of cooperation among mobile agents has been actively studied. Dugatkin and Wilson (1991) [18] conducted pioneering research in this area, and Vainstein et al. (2007) [19] later established that mobility promotes cooperation under very minimal assumptions. More recently, various migration strategies [20, 21, 22, 23, 24, 25, 26] have been proposed that differ in the trigger and distance of migration, and the evolution of cooperation under each strategy has been investigated. Nevertheless, in the area of the evolution of cooperation with migration, research addressing exogenous environmental variability has yet to be undertaken.
In summary, although research has separately examined cooperation under environmental variability and cooperation with mobility, no studies have integrated both factors. Motivated by our interest in environmental variability and human behavioral evolution during the MSA in Africa, we investigate how environmental variability and agent mobility jointly affect the evolution of cooperation.
2 Model
We develop a multi-agent simulation model to investigate how agent mobility and environmental variability jointly influence the evolution of cooperation in spatially structured populations. Due to limited archaeological data on spatial resource distributions and hominin behavioral patterns during the MSA, we adopt a deliberately abstracted approach that prioritizes identifying fundamental mechanisms over reproducing specific historical scenarios. The model incorporates four key processes: (i) environmental variability on a two-dimensional lattice, (ii) pairwise game interactions, (iii) conditional agent migration driven by resource availability, and (iv) strategy updating.
2.1 Environmental variability
The spatial structure is represented by a two-dimensional lattice with periodic boundary conditions. agents are randomly distributed across cells, with each cell containing at most one agent. Each cell maintains a resource level that varies both spatially and temporally. We define a Source of Resources (SoR) as a focal point that generates spatial resource gradients in the environment, serving as a simplified representation of natural foraging areas commonly found near rivers, lakes, or coastlines. Each SoR creates a gradient where resource availability typically decreases with distance from it. Multiple SoRs may coexist, forming overlapping zones of resource abundance.
In this model, each agent accumulates resources (represented by its fitness value) through interactions, and local prosperity is defined by a resource threshold for each cell , where . Agents with fitness below the threshold are more likely to migrate and update strategies, while those above the threshold remain unchanged. Thus, locations with lower thresholds impose less pressure for behavioral change, indicating that the locations are resource-rich and prosperous. The threshold is determined by the cumulative influence of all SoRs and is calculated as:
[TABLE]
where denotes the Euclidean distance from cell to the -th SoR, calculated under periodic boundary conditions, and and are the minimum and maximum values of across the entire grid, respectively.
We examine two spatial configurations: 1-SoR and 2-SoR. In the 1-SoR configuration ( grid), a single SoR generates a concentric resource gradient, capturing the essential geographical pattern of oasis-like environments (Figure 1a). In the 2-SoR configuration ( grid), two SoRs generate a corridor of resource gradient, capturing the essential geographical pattern of riverine or coastal environments where resources are distributed along a line (Figure 1b).
Environmental variability is modeled through the stochastic movement of SoRs, reflecting the unpredictable nature of landscape dynamics observed during the MSA in Africa. Each SoR moves with probability to a randomly selected adjacent cell within the Moore neighborhood at each time step, with the direction chosen uniformly at random from the eight neighboring cells. The parameter governs the intensity of environmental variability: corresponds to a static environment, while higher values indicate more intense environmental variability.
Throughout this study, the neighborhood is defined as the Moore neighborhood (eight neighboring cells). This choice better approximates the continuous spatial movement of SoRs and mobile agents compared to the von Neumann neighborhood (four orthogonal cells), which restricts movement to cardinal directions only. Additionally, for distance calculations, particularly in determining resource gradients from SoRs, Euclidean distance is employed to produce smooth, circular gradients that better represent natural resource distributions than alternative metrics such as Manhattan or Chebyshev distances.
2.2 Game
Games represent cooperative or competitive interactions between agents that involve the gain or loss of resources. Each agent holds a strategy, either cooperation () or defection (), which determines its behavior in interactions. At each time step, every agent plays pairwise games with all of its neighbors and accumulates a payoff , which is then converted into fitness (, ), representing the agent’s resource level.
The payoff matrix of the game is defined as follows:
[TABLE]
where , , , and . To ensure the robustness of our results across a range of social dilemma contexts, we consider various game structures, including the Prisoner’s Dilemma (), Stag Hunt (), and Snowdrift () games.
The accumulated payoff is transformed into fitness using a sigmoid function:
[TABLE]
where determines the steepness of the sigmoid curve and sets the baseline payoff at which . We set for moderate sensitivity and to center the sigmoid around typical payoff values encountered in mixed-strategy populations. Given that agents can accumulate payoffs from up to eight neighbors, the theoretical payoff range is to for cooperators and to for defectors. With our parameter constraints, this yields a payoff range of .
2.3 Migration
Agents migrate conditionally, depending on their fitness and the local resource threshold. If an agent’s fitness falls below the resource threshold at its current location, it migrates with probability and remains with the complementary probability . The migration direction follows a resource-oriented bias: with probability (SoR orientation), the agent moves toward a neighboring cell with the lowest value, and with the complementary probability it moves randomly within the neighborhood. Cells already occupied by other agents are excluded from the candidate destinations. Agents migrate asynchronously in a randomized order to avoid movement conflicts.
2.4 Strategy update
At each time step, all agents update their strategies synchronously. Agents whose fitness falls below the local threshold adopt the strategy of the most successful individual (i.e., the one with the highest fitness) among its neighbors. This process is subject to mutation: with probability , the adopted strategy is replaced by the alternative strategy (e.g., from to , or vice versa).
2.5 Evaluation
To examine the effects of environmental variability and agent mobility on the evolution of cooperation, we perform simulations under a range of parameter configurations (Table 1).
Each configuration is evaluated through independent trials of generations each. As the primary outcome measure, we compute cooperation rate , defined as the average proportion of agents employing the strategy during the final generations, averaged over all trials.
3 Results
3.1 Influence of environmental variability and agent mobility
Figure 2 illustrates the combined effects of environmental variability () and agent mobility () on the cooperation rate . In stable environments () or with low mobility (), cooperation fails to evolve. However, with sufficient agent mobility (), even modest environmental variability () promotes cooperation, but further variability () does not enhance cooperation. Additionally, with any level of environmental variability (), agent mobility promotes cooperation.
Figure 3 further demonstrates the role of environmental variability in the evolution of cooperation. This representative simulation is presented to elucidate the temporal dynamics underlying the statistical patterns shown in Figure 2. Whereas Figure 2 considers fixed levels of variability throughout the simulation, here we apply a cyclic alternating between stable and variable conditions every generations, over a total of generations. Under these cyclic conditions, cooperation initially rises to just below during the first stable phase and then plateaus (Figure 3a). A pronounced increase is observed once the system enters the variable phase, reinforcing the conclusion that environmental variability can play a pivotal role in promoting cooperation.
The observed dynamics can be understood as a three-stage process: the formation of a few large defector groups fixed in resource-rich areas; their collapse induced by environmental variability; and the subsequent emergence of several small cooperator groups. Figures 3b–f show snapshots from the simulation in Figure 3a. A full movie is provided in the Supplementary Material. In the first stable phase (Figure 3b), agents in prosperous areas have no need to cooperate or move, whereas those in less prosperous areas must cooperate or move to prosperous areas. At the boundaries between the two areas, fixed walls are formed by defectors who need neither change their strategies nor move further. During the next variable phase (Figures 3c–e), agents that have been located on boundaries are forced to cooperate or move due to environmental changes, leading to the collapse of the stable defector group (central area of Figure 3c). In place of the defector group, agents form several small cooperator groups to survive even in severe environmental conditions (Figure 3d). Subsequently, the same process occurs in the areas at both ends of the figure (Figures 3e,f).
On the other hand, if agent mobility is insufficient relative to the intensity of environmental variability, cooperation cannot evolve (see the lower area of Figure 2). This occurs because excessively rapid SoR movement prevents the formation of both defector structures and small cooperator groups (Figure 4). Thus, together environmental variability and sufficient agent mobility promote cooperation by preventing fixed defector structures and leading agents to form cooperator groups for survival.
3.2 Influence of other parameters
To gain deeper insights into the findings presented above and assess their robustness, we explored the effects of additional parameters, including population size (), number of SoRs (), initial frequency of cooperators (), SoR orientation (), payoff parameters (, ), and mutation rate ().
3.2.1 Population size
Larger population size promotes cooperation to some extent, as shown in Figure 5. This is because cooperators can more easily find other cooperators when the population is sufficiently large.
Another notable point is that the cooperation rates for (the red dashed line) and (the blue dashed line) exhibit a crossover at around . For small populations () with low mobility, cooperation evolves more readily without environmental variability. In stable environments (), both defector groups and cooperator groups persist once established, although their formation is slow due to low mobility. In contrast, environmental variability with low mobility () creates perpetual fluidity that prevents the formation of both structures.
Larger populations alter this relationship. Larger populations raise the encounter rate among cooperators. The higher encounter rate allows cooperator group formation even under environmental variability. In stable environments, the structures remain fixed, limiting the impact of the higher encounter rate. In contrast, in fluid environments, the higher encounter rate facilitates group formation. Therefore, environmental variability becomes advantageous for cooperation above the critical population size.
A less pronounced but similar crossover occurs at around between (the red dashed line) and (the red solid line). This crossover reflects the spatial constraints of defector groups in stable environments (). For , high mobility () allows more agents to reach resource-rich areas where they do not need to cooperate. In contrast, low mobility () keeps agents in peripheral areas where they must cooperate to survive.
However, larger populations () reveal three distinct nested zones: central rich areas where agents do not need to cooperate, surrounding moderate areas where agents can survive through cooperation, and the most peripheral harsh areas where agents cannot survive even with cooperation because the resource threshold exceeds what cooperation can provide. Under these conditions, high mobility allows agents to escape from the harsh areas to the moderate cooperative areas, whereas low mobility traps agents in the harsh areas. Meanwhile, since the central rich areas have already reached their physical capacity due to the large population, further population increases have no effect within these areas. Thus, the effect of mobility on cooperation rate () reverses as population size increases.
3.2.2 Number of SoRs and initial cooperator rate
Both the number of SoRs () and the initial frequency of cooperators () have a significant impact on the results. While the 2-SoR configuration forms large band-shaped defector groups (Figure 3b), the 1-SoR configuration forms only a small, circular resource-rich area (Figure 6b). When a large defector group collapses and is replaced by small cooperator groups—as observed in the 2-SoR setting—the impact on the overall system is substantial. In contrast, when a small defector group in the 1-SoR setting undergoes the same replacement, the effect is less conspicuous compared to the 2-SoR case (Figure 6a). Regarding , starting with no cooperators () in the 2-SoR configuration leads to large defector groups, whereas intermediate or full cooperation ( or ) maintains the large structure but with higher cooperator frequency within it (Figure 7). Consequently, these conditions also mask the significant effects of defector group collapse and cooperator group formation observed in the baseline scenario.
We also confirmed that changing the distance metric from Euclidean to Chebyshev or Manhattan alters the size and shape of groups, thereby affecting the results. However, these effects are primarily attributable to differences in group size rather than shape. Therefore, comparisons among these distance metrics can be interpreted as theoretically equivalent to our comparison between the 1-SoR and 2-SoR configurations. In essence, the formation of large defector groups in stable environments is the critical prerequisite for the results described in Section 3.1.
3.2.3 SoR orientation
SoR orientation () noticeably influences cooperation levels (Figure 8). Increasing from [math] to improves cooperation rates by approximately 20–40% if . However, further increases in beyond reduce cooperation rates. This reduction occurs because excessive makes agent collisions more likely, which in turn hinders effective migration. These findings suggest that some randomness in agent mobility is necessary to maintain a high level of cooperation.
3.2.4 Payoff parameters and mutation rate
We also examined the effects of varying the payoff parameters across several game structures, as well as the mutation rate , including and . While these variations did not yield qualitatively new insights, they confirmed the robustness of the observed patterns. The corresponding results are provided in the Supplementary Material for completeness.
4 Discussion
We examine the joint effects of environmental variability and agent mobility on the evolution of cooperation to understand the causal dynamics among these factors in spatially structured populations. Our model incorporates unpredictable environmental variability by implementing SoRs that move randomly across a two-dimensional space, generating dynamic spatial heterogeneity in resource availability. Agents accumulate resources through cooperative or competitive interactions and those with lower resource level become more likely to migrate to neighboring cells and update their strategies. Using this model, we reveal three key findings: (i) with sufficient agent mobility, even modest environmental variability promotes cooperation, but further variability does not enhance cooperation; (ii) with any level of environmental variability, agent mobility promotes cooperation; and (iii) these effects occur because environmental variability disrupts a few large stable defector groups that form in resource-rich areas, and agent mobility enables the formation of numerous small cooperator groups on those sites.
These findings contribute to our understanding of the evolution of cooperation in several important ways. First, we have discovered the joint impact of environmental variability and agent mobility on cooperation, which previous studies [7, 8, 9, 10, 11, 12, 19, 20, 21, 22, 23, 24, 25, 26] examined separately. Second, in the VSH [13, 14, 15, 16], environmental variability has traditionally been understood as a selective pressure on individual cognitive abilities during the MSA in Africa [27, 28, 29], implying a pathway from the variability to enhanced intelligence and subsequently to increased sociality. However, we have shown that the variability can also affect sociality directly. Specifically, agents in our model collectively form cooperative groups in response to environmental variability, even though they simply repeat interactions, migration, and strategy updating without becoming smarter. This discovery enriches our understanding of whether intelligence or sociality came first in human evolution and of their complementary coevolution [17, 30, 31, 32, 33]. Third, as our model and the mechanisms that we have discovered are highly general and abstract, they are not limited to our context. With suitable adaptations, there may be potential for interdisciplinary applications in areas such as biology, ecology, and understanding modern social phenomena.
Despite these contributions, our study has several limitations that suggest directions for future research. First, because our model aims to understand abstract macroscopic phenomena rather than to reproduce or predict specific real-world outcomes, it employs simplifications at various levels. Future research could address the simplifications by exploring other scenarios, for example: game structures such as public goods games [24, 26, 34] rather than pairwise interactions; migration based not only on resource levels but also on social relationships between agents [20, 25]; strategy sets beyond All-C and All-D [18]; and adaptive strategy updating that varies learning mechanisms [35, 36] based on environmental conditions. Second, this study will ultimately require a more formal mathematical foundation. As is typical of multi-agent approaches, our model—though much simpler than the real world—remains too complex for analytical treatment. Thus, we need to explore the prospects for mathematical formalization by reproducing key aspects of our results with simpler models. Third, our research relies primarily on general patterns described in the VSH rather than on empirical data from the MSA in Africa. This limitation is common of theoretical studies on the evolution of cooperation. This is because evidence from this ancient period is sparse, and more fundamentally, cooperative behaviors cannot be directly preserved in archaeological remains, leaving only indirect evidence available. Although these constraints are fundamental, we hope that theoretical studies like ours will play a crucial role in directing empirical research and providing frameworks for interpreting empirical findings.
Supporting information
Data and code availability
All data, along with the code needed to run the simulations and generate the figures, are available at
https://github.com/mas178/Inaba2025-2D.
Contributions
M.I. was responsible for designing and implementing the research, building the model, analyzing the results, and writing the manuscript. E.A. supervised the research. All authors reviewed and approved the final manuscript.
Declaration of generative AI and AI-assisted technologies in the writing process
During the preparation of this work, the authors used ChatGPT (OpenAI) and Claude (Anthropic) in order to improve the language and clarity of the manuscript. After using these tools, the authors reviewed and edited the content as needed and take full responsibility for the content of the publication.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] M. A. Nowak, Five rules for the evolution of cooperation, Science 314 (5805) (2006) 1560–1563.
- 2[2] S. A. West, A. S. Griffin, A. Gardner, Evolutionary explanations for cooperation, Curr. Biol. 17 (16) (2007) R 661–72.
- 3[3] M. Perc, A. Szolnoki, Coevolutionary games–a mini review, Biosystems 99 (2) (2010) 109–125.
- 4[4] D. G. Rand, M. A. Nowak, Human cooperation, Trends Cogn. Sci. 17 (8) (2013) 413–425.
- 5[5] M. Perc, J. J. Jordan, D. G. Rand, Z. Wang, S. Boccaletti, A. Szolnoki, Statistical physics of human cooperation, Phys. Rep. 687 (2017) 1–51.
- 6[6] S. A. West, G. A. Cooper, M. B. Ghoul, A. S. Griffin, Ten recent insights for our understanding of cooperation, Nat. Ecol. Evol. 5 (4) (2021) 419–430.
- 7[7] M. A. Brockhurst, A. Buckling, A. Gardner, Cooperation peaks at intermediate disturbance, Curr. Biol. 17 (9) (2007) 761–765.
- 8[8] M. Assaf, M. Mobilia, E. Roberts, Cooperation dilemma in finite populations under fluctuating environments, Phys. Rev. Lett. 111 (23) (2013) 238101.
