Épidémie sur réseau
Outil pédagogique interactif avec visualisation. SIR/SEIR spread on a contact graph with R₀ and force-directed layout.
About this tool
Select SIR or SEIR and a contact network, set the inputs, and simulate. Each run uses the same network and initially infectious people but a separate seeded random sequence. Choose a run and move the time probe, or enter an exact time. Events at that exact time are already included. These controls inspect the completed trajectories without simulating them again. Clear result keeps the inputs. The initial probe is t = 0; choosing a preset resets the probe to zero and selects Run 1. A probe beyond a reduced horizon remains invalid until corrected.
Each person has exactly one state: S is susceptible; E is infected but not yet infectious; I is infectious; R is permanently removed/recovered. SIR follows S → I → R; SEIR follows S → E → I → R. E cannot transmit. Circles, diamonds, squares and triangles represent S, E, I and R respectively; matching colors and distinct line patterns identify their time series. The layout is fixed and does not represent physical movement.
TU means an arbitrary time unit that you choose consistently. β, γ and σ are rates per TU, not per-step probabilities. A susceptible person with k infectious neighbors has infection rate β·k. Each infectious person moves to R at rate γ; in SEIR each exposed person moves to I at rate σ. Waiting times are exponential: the next event has total rate equal to the sum of all current individual rates, and its person is chosen in proportion to their rate. Each event changes one person's state. Positive γ and σ give mean individual waiting times 1/γ and 1/σ; they do not prescribe fixed durations. Zero rates are valid.
The contact graph is static, simple and undirected, with no self-contacts or duplicate edges. In a random network each pair is connected independently with probability p; isolated people and components are allowed. A ring connects neighboring people and closes at its ends; a two-person ring has just one edge. A star connects everyone to person 1 at its center. People are numbered 1 to N; initially infectious people are 1 through Initial I, so the star's center starts infectious. Mean degree is twice the number of contacts divided by N.
The seed reproduces the graph and trajectories. Changing the number of runs retains the preceding runs, including Run 1. The minimum, mean and maximum compare infected counts by the chosen horizon T across runs on this same graph. They are neither real-world uncertainty intervals nor an eventual epidemic size. Infected by t or T means N − S, including the initially infectious people. Peak I is the largest infectious count through T; its time is the earliest time that maximum occurs, including t = 0.
A run may stop because no E or I remain, because no transition has a positive rate despite E or I remaining, or because the horizon cuts off possible further events. The second situation is stalled, not an ended epidemic. The plots keep their last counts through T. This illustrative finite-network model uses identical constant rates, without births, deaths, reinfection or changing contacts. It is not a forecast of a real epidemic and does not estimate R₀.
Display limits are N = 2–80, Initial I = 1–N, each rate = 0–5 per TU, p = 0–1, T = 0.1–200 TU, 1–16 runs and an integer seed from 0 to 4294967295. These are product limits, not empirical disease parameters. All calculations stay in your browser.
Source: Vestergaard and Génois (2015), Temporal Gillespie Algorithm, with the 2019 correction. This tool uses constant competing rates on a static graph; SEIR adds the explicitly chosen noninfectious E state and its transition rate σ.