Virus on a Network
An infection spreads across a network until it either takes off or burns out.
Introduction
People are nodes wired into a network. An infection passes along links with some chance, infected nodes recover after a while, and the recovered may or may not keep their immunity. Whether a handful of cases fades or becomes an epidemic turns on the infection and recovery rates and how densely connected the network is.
Background
This is the agent-based, networked form of the SIR model introduced by Kermack and McKendrick in 1927, which split a population into Susceptible, Infected, and Recovered and predicted an epidemic threshold. Putting it on a network shows how contact structure, not just the rates, decides whether an outbreak spreads.
How it works
- Each infected node may infect each susceptible neighbour, with probability 'infection_chance'.
- Each infected node recovers with probability 'recovery_chance'.
- On recovering, a node keeps immunity with probability 'gain_resistance_chance', otherwise it becomes susceptible again.
- The outbreak ends when no infected nodes remain.
Parameters
infection_chance- Chance of passing the virus along a link each tick, the single biggest lever on whether it spreads.
recovery_chance- Chance an infected node recovers each tick. Faster recovery starves the outbreak.
avg_degree- Average number of links per node. Denser networks cross the epidemic threshold more easily.
gain_resistance_chance- Chance a recovered node stays immune rather than becoming susceptible again.
Open this model in the editor →