Public Goods Game & Social Dilemmas

Spatial evolutionary dynamics of cooperation and defection
Cooperator Defector Punisher

Game Parameters

Generation: 0
Cooperators: %
Defectors: %
Punishers: %

Public Goods Game

The public goods game captures a fundamental social dilemma: each agent decides to contribute (cooperate, cost c) or free-ride (defect). Contributions are multiplied by enhancement factor r and shared equally among all n group members.

Payoff_C = r·C/n − c    Payoff_D = r·C/n

Since defectors always earn more than cooperators (by c), defection is the Nash equilibrium — yet mutual cooperation yields more for everyone. This is the "tragedy of the commons" (Hardin, 1968).

Spatial structure helps cooperators form clusters, enabling them to outperform defectors locally. Punishment (third strategy, gold) adds a further mechanism: punishers pay γ to reduce defectors' payoff by β. With strong punishment, cooperation can be stabilized.

The time-series below shows the fraction of each strategy over generations. Watch for rock-paper-scissors cycling among the three strategies!