Hypergraph Public Goods Playground

A population of agents plays public-goods games in groups of 2 to 5 drawn from a network โ€” a hypergraph, since a single "edge" can bind more than two players. Contributions don't scale linearly: each additional cooperator in a group can be worth more than the last (synergy) or less (discounting). Agents imitate better-paying neighbors round after round. Watch cooperation stabilize โ€” or collapse to zero.

Based on arXiv:2604.07228 โ€” "Emergence of cooperation in nonlinear higher-order public goods games"

Population network

Each dot is an agent on a 20ร—20 toroidal grid. Teal = cooperator, red = defector. Edges show who can group together.

Cooperator Defector
Round
0
Cooperation
50%
Trajectory
โ€”

Controls

Drag sliders while the sim runs โ€” changes apply live, no reset needed.

w = 1.00
strong discountinglinearstrong synergy
mostly pairwise
all pairwise (2)mixedlarge groups (up to 5)
10 rounds/s

Cooperation over time

Fraction of the population currently cooperating, each round.

The payoff rule (actually simulated, not decorative)

For a group of size g with nc cooperators, each paying cost c=1:

pot = rยทcยทฮฃk=1..nc wk-1   โ†’   each member gets pot / g, cooperators additionally pay c.

w < 1: each successive cooperator's contribution is discounted (diminishing returns). w = 1: classic linear public good. w > 1: each successive cooperator amplifies the pot (synergy / increasing returns). Strategy updates use the standard Fermi rule: an agent copies a random neighbor's strategy with probability 1/(1+exp(โˆ’ฮฒยท(payoffneighbor โˆ’ payoffself))).