Kin Selection
Status
Python-backed. This page describes the moran_models/nowak_mechanisms/kin_selection/ package in the sibling EvolvedCooperation repository. It is not yet a browser replay case study.
Kin selection is the first of Nowak's five mechanisms for the evolution of cooperation. Cooperation spreads when the benefit delivered to a recipient, weighted by genetic relatedness, exceeds the private cost paid by the actor — Hamilton's rule: .
How It Is Implemented Here
Relatedness is operationalised through lineage labels. Every site carries an inherited lineage identifier. The positive routing kernel assigns higher weight to same-lineage neighbors than to other-lineage neighbors:
with row normalization applied afterward. Because offspring inherit the parent's lineage label, cooperator clusters accumulate same-lineage neighbors over time, which progressively recirculates more of the cooperative benefit back toward cooperators — the positive feedback that makes cooperation viable.
One Step
One full synchronous kin-selection update runs as follows. All sites update simultaneously.
t to step t + 1.Production
Each site produces cooperative output and pays a private cost proportional to its trait:
Kernel construction
For each producer , a raw routing weight is assigned to each neighbor based on lineage match, then row-normalized so weights sum to 1:
Routing
Each site receives the lineage-weighted share of every neighbor's production:
Fitness score
Local replacement
Each site samples a parent from its local neighborhood via softmax over . The offspring inherits the parent's trait (with small Gaussian mutation) and lineage label. Because the lineage label is inherited, same-lineage clusters grow when local cooperators outcompete their neighbors — the feedback that sustains cooperation.
Variable definitions:
- is site 's cooperation trait in [0, 1]
- is the cooperative benefit produced by site
- is the private cost paid by site
- is the normalized routing weight from producer to recipient
- is the total routed benefit received by site
- is the fitness score used for local replacement
- is the fixed baseline fitness shared by all sites, which dampens selection intensity
Key Parameters
| Parameter | Default | Role |
|---|---|---|
kin_weight_same_lineage | 0.8 | Routing weight toward same-lineage neighbors |
kin_weight_other_lineage | 0.2 | Routing weight toward other-lineage neighbors |
B_plus_scale | 1.0 | Scales cooperative benefit produced per unit trait |
C_scale | 0.2 | Private cost per unit trait |
Hamilton's rule maps onto these parameters as , B_plus_scale, C_scale.
Python Module Layout
moran_models/nowak_mechanisms/kin_selection/
__init__.py
kin_selection_model.py
kin_selection_pygame_ui.py
config/
kin_selection_config.py
utils/
sweep_kin_selection_phase.py
Usage
./.conda/bin/python -m moran_models.nowak_mechanisms.kin_selection.kin_selection_model
Live viewer:
./.conda/bin/python -m moran_models.nowak_mechanisms.kin_selection.kin_selection_pygame_ui
References
- Hamilton, W. D. (1964). The genetical evolution of social behaviour. I. Journal of Theoretical Biology, 7(1), 1–16. https://doi.org/10.1016/0022-5193(64)90038-4
- Nowak, M. A. (2006). Five rules for the evolution of cooperation. Science, 314(5805), 1560–1563. https://doi.org/10.1126/science.1133755