Axelrod – A research tool for the Iterated Prisoner's Dilemma
Axelrod is a Python library designed for conducting research on the Iterated Prisoner's Dilemma, allowing users to simulate and analyze strategies in repeated game theory scenarios.
Background
- This is a Python library for running tournaments of the Iterated Prisoner's Dilemma (IPD), a classic game-theory scenario where two players repeatedly choose to cooperate or defect, and each round's payoff depends on both choices.
- The library is named after political scientist Robert Axelrod, who in the 1980s ran landmark computer tournaments showing that simple "nice, retaliatory, forgiving" strategies like Tit-for-Tat outperform more complex or aggressive ones — a finding that shaped fields from evolutionary biology to international relations.
- The Axelrod library lets researchers and hobbyists define and pit strategies against each other, reproduce classic results, and develop new ones. It includes hundreds of built-in strategies and supports deterministic, stochastic, and machine-learning-based players.
- The project highlights an active open-source research community: as of 2025, the library has been used in published papers, has its own academic journal (the Journal of Open Source Software), and the original Axelrod tournaments are a staple example of how simple rules can produce emergent cooperation.