SIR, but on a graph instead of a well-mixed population
The classic SIR model assumes everyone can infect everyone else with equal probability — a well-mixed population. Real contact patterns are nothing like that: you interact with a small, structured set of people, and that set is a network. This simulation replaces the mixing assumption with an explicit graph of nodes (people) and edges (contacts), and runs the same three-state SIR logic — Susceptible → Infected → Recovered — along those edges only.
Each infected node has, per time step, a probability β of infecting each susceptible neighbour it is connected to, and a probability γ of transitioning to Recovered (after which it is immune and inert). The basic reproduction number generalises from the mean-field R₀ = β/γ to something that depends on network structure — specifically on the degree distribution, the spread of how many contacts each node has.
Why hubs change everything
On a network with a highly skewed degree distribution — a few nodes with very many contacts (hubs or super-spreaders) and most nodes with few — the effective reproduction number is dominated by those hubs. The relevant quantity is not the mean degree ⟨k⟩ but the ratio ⟨k²⟩/⟨k⟩, which blows up as the variance of the degree distribution grows. This is the reason a handful of super-spreader events can drive an outbreak that a naive mean-field SIR model, using only the average number of contacts, would predict should fizzle out.
R0_network ≈ β/γ · (⟨k²⟩ / ⟨k⟩ - 1) // for a scale-free network ⟨k²⟩ diverges as the network grows, // so R0 can be arbitrarily large even with a small per-contact β
The epidemic threshold vanishes on scale-free networks
For a well-mixed population there is a sharp epidemic threshold: below a critical β/γ, an outbreak always dies out; above it, a finite fraction of the population gets infected. Pastor-Satorras and Vespignani showed in 2001 that on scale-free networks (degree distribution following a power law, as in many real social and technological networks) that threshold can vanish entirely in the limit of a large network — any nonzero infection probability can, in principle, sustain an epidemic, because the hubs act as amplifiers no matter how weak the individual transmission rate is. This is one of the starkest illustrations of how network topology, not just the pathogen's biology, determines whether an outbreak takes off.
Vaccination and targeted immunization
Because hubs dominate transmission, targeted immunization — vaccinating the highest-degree nodes first — is dramatically more efficient at network-level herd immunity than random vaccination, which has to cover a much larger fraction of the population to achieve the same protection. This is the graph-theoretic version of the everyday advice to prioritise vaccinating healthcare workers and people with many social contacts: removing a hub from the susceptible pool removes all the edges it would otherwise have carried infection along.
Reading the simulation
Watch how the outbreak in this simulation does not spread as a smooth wave, the way it would on a well-mixed population or a regular lattice — it jumps opportunistically through hub nodes, sometimes stalling in sparsely connected clusters and then exploding the moment it reaches a densely connected one. That irregular, clustered spreading pattern is the network's fingerprint, and it is exactly what real contact-tracing data from outbreaks like SARS, measles and COVID-19 clusters looks like.
Frequently asked questions
How is this different from the standard SIR model?
Standard SIR assumes a well-mixed population where any two people are equally likely to contact each other. This simulation instead runs the same S→I→R transitions along the edges of an explicit contact network, so infection can only spread to a node's actual neighbours — structure, not just averages, determines the outcome.
Why do a few super-spreader nodes matter so much?
The network's effective reproduction number depends on ⟨k²⟩/⟨k⟩, not the mean degree. A small number of very highly connected hub nodes inflates that ratio disproportionately, so they can single-handedly sustain an outbreak that would otherwise die out among low-degree nodes.
Does vaccinating random people work as well as targeting hubs?
No. Because transmission is concentrated on high-degree hubs, targeted immunization of the most-connected nodes reaches herd immunity with far fewer vaccinations than immunizing a random sample of the same size — removing one hub removes all the edges it would have spread infection along.
Try it live
Everything above runs in your browser — open Epidemic on a Network and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.
▶ Open Epidemic on a Network simulation