HomeMedicine & BiophysicsEpidemic on a Network

🦠 Epidemic on a Network

Simulate SIR epidemic spreading on a contact network. See how heterogeneous connectivity, super-spreaders and transmission rate shape outbreak dynamics.

Medicine & Biophysics3DModerate60 FPS
epidemic-network ↗ Open standalone
🔗
Contact Network

Disease spreads only through existing contact links — not uniformly. The network topology is the primary driver of outbreak size and speed.

Super-spreaders

Highly-connected hub nodes (yellow rings) transmit at twice the rate and seed most secondary cases — the 20/80 rule of epidemiology.

📊
SIR Dynamics

Each node is Susceptible, Infected or Recovered. R₀ = β·<k>/γ tells you whether an epidemic takes off (R₀ > 1) or dies out.

About the Epidemic on a Network Simulation

This simulation models a classic SIR (Susceptible-Infected-Recovered) epidemic propagating across a contact network rather than through a well-mixed population. Each node represents an individual and each edge a social or physical contact through which disease can pass. When the network is built with preferential attachment (Barabasi-Albert model), it produces a scale-free degree distribution: most individuals have few contacts while a small number of highly-connected hubs — super-spreaders — accumulate dozens. These hubs are marked with yellow rings and transmit at twice the baseline rate, mirroring the empirical 20/80 rule observed in measles, SARS, and COVID-19 outbreaks.

Transmission probability β and recovery probability γ per simulated day combine with the average node degree <k> to yield the basic reproduction number R₀ = β·<k>/γ, displayed live in the panel. When R₀ > 1 an epidemic takes off; when R₀ < 1 it fizzles. Compare the scale-free network (heterogeneous hubs) with the random Erdos-Renyi graph (homogeneous connectivity) to see why network structure profoundly alters outbreak speed, peak infected count, and the fraction eventually infected. Adjust β to mimic different pathogen transmissibility and γ to model recovery time.

Frequently Asked Questions

What is the SIR model?

SIR divides a population into three compartments: Susceptible (never infected), Infected (currently contagious), and Recovered (immune). At each time step every infected individual can transmit to susceptible neighbours with probability β and recover with probability γ. The simplicity makes it the foundation of mathematical epidemiology, used for influenza, measles, and COVID-19 modelling alike.

What is a super-spreader?

A super-spreader is an individual who causes significantly more secondary infections than the average. On a contact network super-spreaders typically correspond to high-degree hub nodes — people with many social contacts. They accelerate outbreak ignition, generate large clusters of secondary cases, and are priority targets for vaccination or quarantine interventions.

What is R₀ and why does it matter?

R₀ (the basic reproduction number) is the expected number of secondary infections produced by a single case in a fully susceptible population. When R₀ > 1 the epidemic grows exponentially; when R₀ < 1 it dies out. On a network R₀ approximates β times average degree divided by γ. Reducing β (e.g., masks) or γ (faster recovery) directly lowers R₀.

What is a scale-free network?

A scale-free network has a degree distribution that follows a power law: the probability that a node has k connections is proportional to k raised to a negative exponent. A few hubs have very many links while most nodes have few. This topology emerges naturally from preferential attachment — new members join social networks by connecting to already-popular members — and is found in the Internet, citation networks, and real-world contact patterns.

How does network topology change epidemic outcomes?

In a well-mixed model all individuals are assumed equally likely to meet. On a heterogeneous network the hubs act as bridges that shortcut the population, allowing disease to travel across distant clusters quickly. Scale-free networks have no epidemic threshold for many disease parameters, meaning that even a very low transmission probability can eventually invade the whole network if hubs are not removed or immunised.

What is the epidemic threshold on a network?

For a random network the epidemic threshold is R₀ = 1. For a scale-free network with the exponent typical of social contacts the threshold approaches zero as network size grows, because the ratio of variance to mean degree diverges. In practice this means some pathogens with low transmissibility that would die out in a homogeneous population can still cause large outbreaks in scale-free contact networks.

Why does immunising hubs stop epidemics so effectively?

Removing or vaccinating the top few percent of highest-degree nodes destroys the short paths between clusters and raises the effective epidemic threshold. This targeted immunisation is far more efficient than random vaccination: protecting 5% of hubs can reduce peak infections by more than 50%, whereas random vaccination requires 60-70% coverage to achieve herd immunity on the same network.

What does the time-series chart in the panel show?

The chart plots the fractions of the population in each SIR compartment over simulated days: blue for susceptible, red for infected, and green for recovered. The infected curve typically shows a characteristic bell shape — the epidemic peak — followed by decline as susceptibles are depleted and recovered individuals accumulate. The area under the infected curve represents the total disease burden.

How does the Barabasi-Albert algorithm work?

The simulation begins with a small seed clique of nodes. Each new node joins and forms m edges, selecting existing targets with probability proportional to their current degree (preferential attachment). This rich-get-richer mechanism naturally generates the power-law degree distribution characteristic of real social, biological, and technological networks.

How can I use the simulation to explore interventions?

Lower β simulates physical distancing or mask use. Lower the network size and watch how small isolated communities slow spread. Switch to a random network to see how homogeneous connectivity changes outbreak dynamics compared with scale-free topology. Because super-spreaders are seeded first, restarting the simulation shows how early hub infection determines final epidemic size.

⚙ Under the hood

SIR epidemic spreading on a heterogeneous contact network — super-spreader dynamics.

3DSIR ModelNetwork EpidemiologyContact NetworkSuper-Spreaders

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)