Virus on a Network

An infection spreads across a network until it either takes off or burns out.

Animation of the Virus on a Network model running in Stigmery

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.

Kermack, W. O., & McKendrick, A. G. (1927). A contribution to the mathematical theory of epidemics. Proceedings of the Royal Society A, 115(772), 700-721.

How it works

  1. Each infected node may infect each susceptible neighbour, with probability 'infection_chance'.
  2. Each infected node recovers with probability 'recovery_chance'.
  3. On recovering, a node keeps immunity with probability 'gain_resistance_chance', otherwise it becomes susceptible again.
  4. 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 →

Related models