Yeast secrete invertase outside the cell to digest sucrose, and the digested sugar is shared by everyoneâand this is where it gets interesting. A cell can choose to "cheat": ride on the enzymes its neighbors secrete, while secreting none of its own. Researchers call yeast with a functional SUC2 gene "cooperators," and yeast with SUC2 deleted "cheaters," then put the two in competition.
The results are counterintuitive:
- In sparse populations (low social density), cheaters have a fitness of only 0.87âworse than cooperators.
- In dense populations (high social density), cheaters have a fitness as high as 1.19âbetter than cooperators.
Why? The higher the social density, the more likely a cooperator is to meet other cooperators. When everyone secretes enzymes together, the public pool grows, and everyone's payoff is high. But then cheaters slip in, enjoying the public goods unilaterally while paying no cost, and their payoff explodes.
At very high density, cheaters can almost always find a target, and what they steal exceeds what they would have earned by secreting. Cooperators get dragged down instead.
This fits my intuition perfectly. But I wanted to run it myselfânot to verify the paper's conclusions, but to "see" the process with my own eyes, to write the equations into a grid and watch the numbers move.
Model Setup
An $n \times n$ grid, with population density controlling the probability of placing an agent in each cell. Agents have two strategies: C (cooperate, secrete enzymes) and D (defect, don't secrete).
When two agents meet, they play a standard prisoner's dilemma with the following payoff matrix:
$$ \begin{pmatrix} R=3 & S=0 \\ T=5 & P=1 \end{pmatrix} $$R is the reward for mutual cooperation, T is the temptation to defect, S is the sucker's payoff, and P is the punishment for mutual defection. By the classic setup: $T > R > P > S$, and $2R > T + S$ (mutual cooperation beats repeated defection).
Each step:
- The agent looks at its Von Neumann neighborhood (up, down, left, right) for neighbors.
- The two play one round.
- They compare their scores $\pi$ for this step.
- They imitate the neighbor's strategy with probability proportional to the payoff difference.
- They move one cell in a random direction.
Only the current step's payoff matters. No history, no planning.
Theoretical Prediction
Replicator dynamics gives the mean-field equation:
$$\frac{dx}{dt} = x(1-x)[\pi_C - \pi_D]$$$x$ is the proportion of cooperators, and $\pi_C$ and $\pi_D$ are the expected single-step payoffs of the two strategies.
Payoff depends on encounter probability. Under the mean-field approximation, a cooperator meets another cooperator with probability $x$ and a cheater with probability $1-x$; vice versa for cheaters:
$$\pi_C = x \cdot R + (1-x) \cdot S$$$$\pi_D = x \cdot T + (1-x) \cdot P$$Substituting:
$$\pi_C - \pi_D = x(R - T) + (1-x)(S - P)$$With the concrete values $R=3, S=0, T=5, P=1$:
$$\pi_C - \pi_D = x(3-5) + (1-x)(0-1) = -2x -1 + x = -1 - x$$$\pi_C - \pi_D < 0$ holds everywhereâregardless of $x$, the cooperator's current-step payoff is always lower than the cheater's.
This means $\frac{dx}{dt} = x(1-x)(-1-x) < 0$. The cooperator proportion can only decay monotonically, eventually tending toward $x=0$âcomplete defection.
The mean-field approximation is a "well-mixed" world: every individual is equally likely to meet every other. But my grid is not. Spatial structure might be able to sustain cooperation.
Simulation and Results
The following experiments run on a $50 \times 50$ grid, with synchronous updates each step and enough rounds of play for the system to settle.
Experiment 1: Fixed density, observe the evolutionary trajectory
Set population density $\rho = 0.3$, vary the initial cooperator proportion $x_0$.
Intuitive guess: the higher $x_0$, the longer cooperators hold out; low $x_0$ collapses directly. But the grid structure might let locally high-cooperation patches hold out briefly in the early phase.
What I actually saw was that cooperators' "survival window" is very narrow. After the spatial structure lets local clustering buy a brief defensive period, the D strategy eventually seeps in from the edgesâthe periphery of a cooperator cluster is always the first to be eroded.
Experiment 2: Fixed initial proportion, observe the density effect
Set $x_0 = 0.5$, vary population density $\rho \in [0.02, 1.0]$, and after the run compute the difference of the means of $\pi_C$ and $\pi_D$.

The y-axis is $P_C - P_D$, cooperator payoff minus cheater payoff.
But this time, a big chunk of the plot is missingâthe high-density region is all blank. That's not a plotting errorâit's unmeasurable.
The reason is simple: $P_C - P_D$ only makes sense when both strategies are alive. We started measuring after 100 burn-in steps, but at high density, C doesn't even survive 100 stepsâit goes extinct by step 6. $\pi_C$ is NaN, not a missing value, but "no cooperator to measure." Filling in a number is just self-deception.
Within the measurable range ($\rho < 0.05$), $P_C - P_D$ is negative throughoutâdropping from -0.03 to -0.16. Cooperators' average payoff is lower than cheaters'. This is consistent with the replicator dynamics prediction: $\pi_C - \pi_D = -1 - x < 0$, and the spatial structure didn't reverse the sign within the measurable range.
At 2% density, the grid is sparse, and agents are mostly isolated. An isolated agent has no neighbor to pair withâno game, no payoff fluctuation; holding the current strategy means no loss. But cooperators don't survive because of "reciprocal advantage"; they survive because their strategy is frozen in isolationâD simply can't reach them. Once they occasionally meet, D's current-step payoff exceeds C's, the imitation probability tilts toward D, and C slowly leaks away.
The higher the density, the more frequent the encounters. Every encounter is an opportunity for C to be exploited by D. Even if C-C reciprocity happens more often, both sides pay the cost to feed the public poolâeffectively subsidizing that D right next door that contributes nothing.
Greig's yeast experiments show the same direction: the higher the density, the more advantageous cheating. They just took the cheater's viewâcheater fitness > 1 at high density. My plot takes the cooperator's viewâwithin the measurable range, the disadvantage grows with density. As for what happens in the high-density region, this plot can't answer.
Interestingly, the critical density never appears in this parameter setânot because it failed to reach zero, but because there was no chance to reach zero. C died out before it got to the critical point. With more extreme payoff settings (e.g., a higher T), even this small measurable range might disappear.
(Or swap Von Neumann for Mooreâeight neighbors instead of four, easier to be exposed to D. Haven't gotten around to trying it.)
Experiment 3: Cooperator persistence versus density
Experiment 2 couldn't answer; Experiment 3 picks up the slack. No reliance on steady state, no burn-inâjust directly tracking how long C lasts.
Fix $x_0 = 0.5$, vary $\rho \in [0.02, 1.0]$, run 200 steps, and record three quantities: time-averaged cooperator proportion $\bar{x}$, final-step cooperator proportion $x_{\text{final}}$, and time to first extinction $t_{\text{collapse}}$.

Three density ranges, three fates:
- Low density ($\rho < 0.03$): $t_{\text{collapse}} = \text{NaN}$âC never goes extinct within 200 steps. But $\bar{x}$ is only 0.11â0.19, and $x_{\text{final}}$ drops as low as 0.01. C survives not because it's strong, but because of isolationâagents have no neighbors most of the time, so there's no game, no imitation, and their strategies are frozen. D cannot erode a C it cannot reach.
- Medium density ($\rho \in [0.03, 0.44]$): $t_{\text{collapse}}$ decreases monotonically from 160 steps to 12 steps. The higher the density, the easier D finds C to exploit, and the faster C clusters are penetrated and dismantled. $\bar{x}$ drops from 0.11 to 0.004âthe total amount of cooperation declines with density.
- High density ($\rho > 0.54$): $t_{\text{collapse}} \approx 6$â$10$, $\bar{x} \approx 0.002$. The well-mixed approximation takes effect; D is strictly dominant, and C is cleared within 10 steps.
Experiment 2 goes completely blind at $\rho \geq 0.06$âC dies before burn-in. Experiment 3 fills in this gap.
Afterward
Greig's paper made me realize one thing: the "dilemma" of the prisoner's dilemma isn't that it's unsolvable; it's that its solution depends on structure. The same game rules yield opposite results in sparse versus dense social networks.
Replicator dynamics provides the baseline predictionâthe evolutionary direction under well-mixing and current-step-payoff-only. But the spatial structure of real systemsâwhether the neighbor radius on an agar plate, or the Von Neumann neighborhood on a gridâonce you put it in, the prediction changes.
This is where ABM's value lies: put structure in, watch what emerges.
After running Experiments 1, 2, and 3, the sense I got is that spatial structure acts like a bufferânot reversing the direction, but slowing it down. Cooperators are destined to lose to D, but on a grid they lose more slowly than the mean-field equation predicts. At low density, the collapse is delayed to the point of "never collapse" (though it's only frozen); at medium density, it's delayed by tens to hundreds of steps; at high density, by only 6 steps.
But after writing this, the more I thought about it, the more I felt a layer was missing.
Greig's experiment was run on a sucrose plate. Sucrose is the only carbon source. On a sparse plate, there's a lot of sugar and few cellsâeach cell has approximately infinite sucrose around it. On a dense plate, cells are packed together and the sugar is quickly consumedâwhat's around you depends on how much enzyme your neighbors secreted.
My ABM treats the payoff matrix as set in stone. $T=5, R=3, P=1, S=0$âregardless of density, the payoff of a single game never changes. But yeast invertase isn't a game machine that runs independently of the environment. It digests sucrose. Less sugar, less digestion. The amount of digestion depends not only on whether you secrete enzymes, but also on how much sucrose is left.
Experiment 3 lays this gap out clearly: at high density, C goes extinct by step 6. But in Greig's experiment, cooperators still exist at high density (fitness 0.87â1.19). A fixed matrix can't explain this. If C vanished that fast, Greig's yeast populations would have all become cheaters long agoâbut that's not the case.
If sucrose runs outâa crowd of cells packed together, none of them secreting enzymesâthe mutual-defection payoff might not be $P=1$, but a negative number. Nothing gets digested. Cells go hungry. By contrast, C-C has to pay the enzyme cost, but at least it gets a bit of sugar.
In other words, Greig's yeast might not always be playing the prisoner's dilemma.
In sugar-rich high-density areas, cheaters eat their fill by exploiting cooperatorsâstandard PD. But at the sugar-starved marginsâafter sparse communities deplete the local sucroseâthe underlying game slides from the prisoner's dilemma into something else. Mutual defection is no longer low payoff; it's negative payoff. The relative disadvantage of cooperation suddenly disappears.
Strategies consume resources, resources rewrite the matrix, the matrix reshapes strategies. Once the loop closes, the "dilemma" of the prisoner's dilemma is no longer an optimization problem with given boundary conditionsâits boundary conditions are themselves variables.
Experiment 3's $t_{\text{collapse}} \approx 6$ is not the endpoint, but the starting pointâit shows that under a fixed matrix, cooperation dies too fast, inconsistent with the biological experiments. To test this hypothesis, enzyme kinetics has to be written into the ABMâsugar concentration as a local variable, with payoff computed in real time from sugar concentration. Not "density determines the payoff matrix," but "density indirectly changes the payoff matrix through resource consumption."
A direction.
References
Greig, D., & Travisano, M. (2004). The Prisoner's Dilemma and polymorphism in yeast SUC genes. Proceedings of the Royal Society of London. Series B: Biological Sciences, 271, S25 - S26.