This script is a simulation of Martin A. Nowak and Robert M. May paper about "Evolutionary Games and Spatial Chaos" 1992. It is created by N. Giakoumoglou, M. Demetriou and P. Manouselis for a presentation in Game Theory course in May 2020.
In spatial prisoner's dileman there are two players those who always cooperate, C, and those who always defect, D. We place those players on a two dimensional lattice (grid), each lattice site is occupied either by a C or a D. In each round of the game (each generation), the players play the PD game with nearest neighboring sites and with one's own site (thus we define these sites as a territory – a 3x3 grid). The score for each player is the sum of the payoffs in these encounters with neighbors. At the start of the next generation, each lattice-site is occupied by the player with the highest score among the previous owner and the immediate neighbors. Boundaries are fixed but we can also define the lattice as a torus. Conclusions we will deduct remain true if players interact only with the four orthogonal neighbors in square lattices or self-interactions are included.
The PD can be formulated in tabular form as follows, where T > R > P ≥ S
C | D | |
---|---|---|
C | R=1 | S=0 |
D | T=b>1 | P=0 |
The dynamical behavior of the system depends on the parameter b.
- (b > 1.8) 2x2 or larger cluster of D will continue to grow at the corners.
- (b < 1.8) big D cluster will shrink
- (b < 2) 2x2 or larger cluster of C will continue to grow
- (b > 2) C clusters do not grow
- (2 > b > 1) C clusters can grow in regions of D and vice versa
Chaos persists in shifting patterns C → D, D → C, D → D, C → C
Color assignments:
- C → C blue
- D → D red
- D → C yellow
- C → D green
fc = frequency of cooperators
limT→inf fc = 12log2 – 8 = 0.318 can be proven
Although this approximation always works when we have 10% random D and 1.8<b<2 we don’t know why it does so!
- “Interesting Region" is 5/3>b>8/5 (here b=1.62 with 10% random D)
- Similar symmetric patterns
- fc → 0.299
- “Interesting Region” is 2>b>5/3 (here b=1.8 with 10% random D)
- Similar symmetric patterns
- fc → 0.374
- “Interesting Region” is 3/2>b>4/3 (here b=1.4 with 10% random D)
- Similar symmetric patterns
- fc → 0.374
Although the details of the patterns depend on the value of b, a wide range of values leads to chaotic patterns whose nature is almost always independent of the initial proportions of C and D. Such deterministically generated spatial structures may model and describe pre-biotic evolution of cooperation (among molecules, cells or organisms) as well as Turing models and 2-state Ising models.
Spatial_PD_4_NN.m
: In this implementation, the spatial PD game is played among 4 orthogonal neighbours. One can define the following parameters for the PD game:b
: Defection payofftorus
: If ~0, define the lattice as a torus, 0 elsep
: Proportion of defectors in [0, 1]self_interaction
: If 0, self interaction is excluded, if ~0, includedrounds
: Number of rounds/generation/time stepn
: Squared lattice side sizeprintLattice
: If 1, prints the lattice over roundsprintFc
: If 1, prints the frequency of cooperators over roundslimit
: If >0, prints limit in fc as a horizontal line
Spatial_PD_8_NN.m
: In this implementation, the spatial PD game is played among 4 orthogonal neighbours. One can define the following parameters for the PD game:b
: Defection payofftorus
: If ~0, define the lattice as a torus, 0 elsep
: Proportion of defectors in [0, 1]self_interaction
: If 0, self interaction is excluded, if ~0, includedrounds
: Number of rounds/generation/time stepn
: Squared lattice side sizeflag
: If 1, places a single D in the center of the nxn lattice (n must be odd to work correctly)printLattice
: If 1, prints the lattice over roundsprintFc
: If 1, prints the frequency of cooperators over roundslimit
: If >0, prints limit in fc as a horizontal line
main.m
: Includes the reproduction of the figures of the paper and much more!
Reach out to me:
- Nowak, M., May, R. Evolutionary games and spatial chaos. Nature 359, 826–829 (1992). https://doi.org/10.1038/359826a0