Exploring how network topology shapes epidemic dynamics
The SIR model on networks extends classical epidemiology to realistic social topologies. Each node represents an individual in one of three states: Susceptible (S), Infected (I), or Recovered (R). At each time step, an infected node infects each susceptible neighbor with probability beta, and each infected node recovers with probability gamma. The network topology - who connects to whom - critically determines how diseases spread through populations.
Three network types reveal dramatically different epidemic dynamics. Random (Erdos-Renyi) networks connect each pair of nodes with uniform probability, producing Poisson degree distributions. Small-World (Watts-Strogatz) networks start as ring lattices and rewire edges with low probability, creating high clustering with short path lengths - like real social networks. Scale-Free (Barabasi-Albert) networks grow through preferential attachment, where new nodes connect to well-connected existing nodes, producing power-law degree distributions with hub structures.
Key insight: network structure dramatically affects epidemic outcomes. Scale-free networks are highly vulnerable because hubs become superspreaders - infecting a hub early leads to explosive growth. Small-world networks enable rapid global spread through long-range shortcuts, even though most connections are local. The basic reproduction number R0 = beta * avg_degree / gamma determines whether an epidemic will spread: R0 > 1 means sustained transmission, R0 < 1 means the epidemic dies out.
Use the infection rate and recovery rate sliders to control transmission dynamics. Select different network types to observe how topology affects spread patterns. Click on any node in the network graph to manually infect it and seed an epidemic. The SIR curves plot shows how the three populations evolve over time. Try the preset scenarios to explore contrasting dynamics: Slow Burn shows a gradual epidemic, Rapid Outbreak demonstrates hub-driven explosive spread in scale-free networks, and Herd Immunity shows how high recovery rates can suppress transmission.