Evolutionary game theory
Cooperators and defectors compete on a spatial grid. In a well-mixed population, defection always wins — the Nash equilibrium is mutual betrayal. But add spatial structure, and cooperation can survive. Clusters of cooperators protect each other, boundaries form complex patterns, and the mathematics of selfishness gives way to something more interesting.
Payoff matrix: T=5, R=3, P=1, S=0 | T > R > P > S & 2R > T + S
The prisoner’s dilemma
The most famous game in mathematics. Two players each choose to cooperate or defect. If both cooperate, both receive a moderate reward (R). If both defect, both receive a meager punishment payoff (P). But if one cooperates while the other defects, the defector gets the highest payoff — the temptation T — while the cooperator gets the worst outcome, the sucker’s payoff S. The dilemma: each player is individually better off defecting regardless of what the other does, yet both would be better off if both cooperated. Rational self-interest leads to an outcome that is worse for everyone. This tension between individual and collective rationality is the central puzzle of cooperation.
Spatial structure changes everything
In a well-mixed population where anyone can interact with anyone, defection dominates. The Nash equilibrium is mutual defection — end of story. But place players on a grid where they interact only with neighbors, and something remarkable happens. Cooperators can form clusters, and within those clusters, they receive the reward payoff R from each other. Defectors on the boundary exploit some cooperators, but they also face other defectors and receive only P. If the cluster is large enough, the cooperators in the interior out-earn the defectors on the edge. This is spatial reciprocity — a mechanism for cooperation that requires no memory, no reputation, no intelligence. Just geometry. Martin Nowak and Robert May demonstrated this in their landmark 1992 paper, shocking the game theory community by showing that cooperation could survive without any of the mechanisms previously thought necessary.
The evolution of cooperation
In 1984, political scientist Robert Axelrod organized a computer tournament that changed how we think about cooperation. He invited game theorists to submit strategies for the iterated prisoner’s dilemma, and the winner was the simplest entry: Tit-for-Tat, submitted by Anatol Rapoport. It cooperates on the first move, then copies whatever the opponent did last. Axelrod identified four properties of successful strategies: be nice (never defect first), be retaliatory (punish defection immediately), be forgiving (return to cooperation after punishment), and be clear (make your strategy easy to understand). Nowak later identified five mechanisms that enable cooperation in evolution: kin selection, direct reciprocity, indirect reciprocity, group selection, and — demonstrated in this simulation — spatial selection.
Phase transitions
Adjust the temptation parameter T upward while watching the simulation. At first, cooperators hold their ground in stable clusters. But at a critical threshold — which depends on the neighborhood structure and the ratio T/R — cooperation undergoes a phase transition. It does not decline gradually. It collapses. Below the threshold, cooperators and defectors coexist in dynamic equilibrium. Above it, defection sweeps the entire grid. This is analogous to percolation thresholds and the Ising model’s Curie temperature: a qualitative change in the system’s behavior at a precise parameter value. Try it — slowly increase T and watch for the moment cooperation shatters.
Beautiful patterns at the boundary
Watch the interfaces between cooperator and defector territories. They form complex, fractal-like patterns — dynamic, evolving, never settling into a static configuration. These boundaries are not merely decorative. They are the mechanism through which spatial structure maintains cooperation. The boundary is where exploitation happens, where defectors profit, and where cooperator clusters are tested for robustness. A smooth boundary means more cooperators are exposed to exploitation. A rough, fractal boundary means more defectors are stuck next to other defectors. The geometry of the boundary determines which strategies survive. In a very real sense, the boundary is the story.
Game theory beyond games
Evolutionary game theory extends far beyond abstract matrices. The prisoner’s dilemma describes bacterial antibiotic resistance: resistant bacteria pay the metabolic cost of resistance (cooperating with the population by not over-competing) while susceptible bacteria freeload. The hawk-dove game (obtained by setting T > R > S > P in the payoff matrix) models territorial conflict in animals and market competition in economics. The stag hunt (R > T > P > S) describes coordination problems — from international climate agreements to technology standards. Adjust the four payoff parameters in this simulation to move between these different game regimes and watch how the spatial dynamics change. The slime mold experiment in this lab demonstrates a biological system where cooperation emerges through chemical signaling rather than spatial structure, and the network dynamics experiment shows how interaction topology shapes collective behavior.