Skip to main content

Network Reciprocity

GitHub code
Network reciprocity is cooperation sustained by population structure. When interactions are restricted to a local neighborhood rather than the whole population, cooperators can form clusters that shield each other from exploitation by defectors — the network does the work that memory or reputation does in reciprocity models.

How It Is Implemented Here​

The positive routing kernel is uniform over local grid neighbors with no additional bias. The mechanism relies entirely on the spatial grid structure: the von Neumann or Moore neighborhood restricts who receives cooperative benefit and who competes for reproduction. Cooperator clusters that form through local reproduction maintain higher average fitness within the cluster than the surrounding population, allowing the cluster to expand.

There is no memory, reputation, or lineage bias — the only structural ingredient is the local neighborhood.

Key Parameters​

ParameterDefaultRole
positive_kernel_mode"uniform"Uniform routing over local neighbors
initial_identity_count1Number of distinct initial lineage identities
B_plus_scale1.0Scales cooperative benefit produced per unit trait
C_scale0.2Private cost per unit trait
Display 1: Key parameters controlling spatial routing and payoff scaling in the network reciprocity model.

Simulation Results​

Proof-of-mechanism runs on a 24×24 grid, 5 seeds and 1000 steps each (utils/proof_of_mechanism.py); these hold only at the settings tested:

  • Maintenance: started common, cooperation stayed high in 5/5 seeds (mean trait 0.928) with a von Neumann neighbourhood (k = 4) and b/c = 5, above Nowak's condition b/c > k.
  • Spread from rare: 2/5 seeds (mean trait 0.536). Outcomes varied across seeds, consistent with stochastic cluster formation.
  • Below the condition: with b/c = 2.5 < k = 4, cooperation started at 90% and collapsed, surviving in 0/5 seeds (mean trait 0.012). With the same b/c = 5 but a Moore neighbourhood (k = 8), it collapsed too (0/5, mean trait 0.009): raising the number of neighbours, without changing payoffs, was enough to break it.
  • Self-routing test (2026-11-26). In this engine a producer's benefit is shared over itself and its neighbours, so a helper gets one fifth of its own benefit back (one ninth with a Moore neighbourhood). At b = 1 and c = 0.2 that return exactly covers its cost; in the below-condition case and with a Moore neighbourhood it does not. A pre-registered rerun of the low-start comparison (8 seeds, 250 steps, nine benefit-cost cells) with the producer removed from its own routing and nothing else changed: in the four cells where helping had risen, it fell in every run (0/32 successes; mean change about −0.11). So the spread from a low start reported here was weak altruism, not costly cooperation. Even at b/c 16 and 24, helping without the self-route rose only slowly (no run reached the criterion in 250 steps). Details: RESULTS.md.

Threshold Model Without Self-Benefit​

Because the engine's spread from a low start depended on the producer's self-route, a separate minimal model tests network reciprocity in its standard form, where a cooperator never receives its own benefit. One cooperator starts among defectors on a 10 × 10 torus, with von Neumann (k = 4) or Moore (k = 8) neighbours. A cooperator pays c = 1 for each neighbour and gives each neighbour b; payoffs accumulate, and fitness is 1 − w + w·payoff. Each step a random individual dies and its neighbours compete for the empty site in proportion to fitness (death-birth updating). For any finite k-regular graph of size N, under weak selection, this favours cooperation when b/c > (N − 2)/(N/k − 2) (Chen 2013): 4.26 for k = 4 and 9.33 for k = 8 at N = 100, against Ohtsuki et al.'s large-N value b/c > k. Each cell has 1,000,000 fixation runs; ρ·N = 1 means a neutral mutant.

Neighbourswb/cρ·N [99% interval]Rule predicts
40.0120.29 [0.28, 0.31]below 1
40.0130.55 [0.53, 0.57]below 1
40.0140.89 [0.87, 0.91]below 1 (near)
40.0151.35 [1.32, 1.38]above 1 (near)
40.0161.89 [1.86, 1.93]above 1
40.0183.09 [3.04, 3.13]above 1
80.002540.55 [0.53, 0.57]below 1
80.002560.70 [0.68, 0.73]below 1
80.002580.87 [0.84, 0.89]below 1
80.002590.98 [0.96, 1.01]below 1 (near)
80.0025111.18 [1.15, 1.21]above 1
80.0025141.51 [1.48, 1.54]above 1
Display 2: Fixation probability of a single cooperator on a 10 × 10 lattice with death-birth updating and no self-benefit, times N (1 = neutral). "Near" marks cells within 1 of the finite-N threshold. Details in the module's RESULTS.md.

In every cell far from the threshold, the cooperator did worse than a neutral mutant below it and better above it, so network reciprocity favoured costly cooperation here without any return to the helper. The change of sign lay between b/c = 4 and 5 with four neighbours and between 8 and 11 with eight, above the large-N value k in both, as the finite-N rule says. The registered test of the exact location did not succeed: a straight line through all six cells crossed 1 at 3.89 and 9.04, below the theoretical 4.26 and 9.33, because the response curves upward at these selection strengths. So the pre-registered verdict is "not reproduced", for the threshold's location, not for its direction.

A second pre-registered test located the threshold with four cells close to it in each graph (within 0.5 with four neighbours, within 1.0 with eight), weaker selection with four neighbours (w = 0.0025), and 4,000,000 runs per cell. All eight cells fell on the predicted side of neutral, and a straight line through each graph's four cells crossed neutral at b/c = 4.225 (95% interval 4.183–4.267) and 9.346 (9.298–9.395), against the finite-N values 4.26 and 9.33. Both intervals exclude b/c = k, so on a lattice of this size the threshold is the finite-N value. Together, the two tests reproduce the rule for network reciprocity with a real cost and no return to the helper.

Network Reciprocity And Kin Selection​

On a lattice where offspring are placed next to their parents, neighbours are often relatives, so network reciprocity and kin selection by viscosity work through the same clustering of helpers. The site's later tests could not separate them. In a separate kin-selection test series with a different wrapper (later tests), uniform local routing plus local replacement, network reciprocity in that limited sense, spread in 3/20 runs at 1000 steps but 20/20 at 3000. That shows short runs can undercount eventual spread in that implementation; it does not establish that this wrapper would reach 20/20. In those runs the helper kept a share of its own benefit equal to its cost, so that spread was weak altruism: step 1 of the kin-selection stepwise table, a warm-up, not kin selection by the site's definition. Costly help to neighbours spread with local replacement (at b/c 12 and 24) and failed at b/c 12 under global-competitor replacement, a result consistent with kin selection by viscosity that was not separated from network reciprocity (step 2 of the kin-selection stepwise table, on a full grid without ecology). In the lattice ethnocentrism model, the two are effectively descriptions of the same spatial-assortment process.

Ecological Counterpart​

The EvolvedCooperation repository also has an ecological version in continuous space, with births, deaths, energy budgets and sexual reproduction, benefits delivered to neighbours within a radius, and offspring placed near their mother. Starting from 10% rare helpers, it passed its 10 scenario checks (5 seeds, 500 steps each; three are controls that pass when cooperation does not spread). The effect was modest: in the baseline the mean helping trait rose by 0.013 and the frequency of high helpers by 0.19. The repository notes that in this model the high-helper frequency is inflated by blending inheritance in short runs, and treats mean-trait change as the reliable signal.

Its ablations pointed to offspring placement. With offspring placed at random, the mean trait fell (−0.021). With benefits spread uniformly over the whole population instead of to spatial neighbours, the high-helper frequency still rose by 0.13, but on the reliable measure, the mean trait, it was flat (+0.001 against +0.013 in the baseline), so spreading benefits uniformly removed most of the small rise. With 5 seeds and no statistical test, these runs do not establish whether local benefit routing is needed. Measured against the site's definition of kin selection, this model is step 8 of the stepwise table: costly help with no return to the helper, but no tracked relatedness and too small a rise to count.

Python Module Layout​

moran_models/nowak_mechanisms/network_reciprocity/
__init__.py
network_reciprocity_model.py
network_reciprocity_pygame_ui.py
config/
network_reciprocity_config.py
utils/
proof_of_mechanism.py
data/ # proof-of-mechanism CSVs

Usage​

./.conda/bin/python -m moran_models.nowak_mechanisms.network_reciprocity.network_reciprocity_model

Live viewer:

./.conda/bin/python -m moran_models.nowak_mechanisms.network_reciprocity.network_reciprocity_pygame_ui

Proof scenarios:

./.conda/bin/python -m moran_models.nowak_mechanisms.network_reciprocity.utils.proof_of_mechanism

See Also​

  • Spatial Altruism — a concrete historical model, Mitteldorf & Wilson (2000), that is mechanically the closest real-world relative of this page: a lattice, purely local interaction, no memory or reputation. That page's own "See Also" section goes further and argues the paper's authors actually frame their result as a Group Selection argument (patches of altruists sustaining higher density than patches of non-altruists), not a network-reciprocity one — worth reading if the mechanical similarity here seems too tidy.

References​