The Epidemic Mosaic
Two communities. One infection. Add a connection and see what changes.
Each shape contains people. Lines show contact between regions. Sharing a border does not create contact.
Equal regional populations: Every region starts with 100 people (3,600 in total across 36 regions). Polygon size does not represent population.
Contact links, not migration: Edges represent contact opportunities between residents. People remain assigned to their home regions; this is not a model of physical travel or migration.
What changes when two separate communities gain one connection?
A reproducible synthetic city of 36 Voronoi regions (18 in Community A, 18 in Community B, 100 people per region) begins with 5 initial infections in A5 · Market Cross and none in Community B. Adding a single undirected bridge between A6 · Foundry Quay and B3 · Canal Basin allows transmission to cross between the communities without guaranteed spread on every run.
Note: This is a synthetic city for exploring transmission. It does not predict an outbreak in a real place.
Checking article narration…
What changes when two separate communities gain one connection?
Start with the default city above. Thirty-six irregular regions are divided into two communities of eighteen regions each: Community A on the left and Community B on the right. Every region holds 100 people, giving a total city population of 3,600. Polygon size does not represent population.
Five people begin infectious in A5 · Market Cross inside Community A. Everyone else in Community A is susceptible, and Community B begins without a single infection.
Press Run comparison.
Both scenarios start from day zero with the same city geometry, the same regional populations, the same five initial infections, and the same epidemic parameters. The only difference is one undirected contact link between A6 · Foundry Quay and B3 · Canal Basin.
Without that bridge, the infection can circulate along the contact links inside Community A, yet Community B must remain completely uninfected. With that single bridge in place, each infectious person in A6 · Foundry Quay creates a small daily hazard of infecting susceptible residents across the seam in B3 · Canal Basin. Once a single transmission crosses that link, Community B’s own internal contact network can carry the outbreak through the eastern half of the city.
Why borders and contact lines are separate
On an ordinary map, it is tempting to assume that two regions touch because they share a boundary. In this mosaic, geometry and contact network are kept deliberately separate.
Sharing a polygon border does not create contact. Look closely at A5 · Market Cross, where the infection starts: it shares long physical borders with A2 · Old Wharf and A8 · St Jude’s, yet no contact line joins them. Infection cannot pass directly across those borders. Conversely, A5 · Market Cross has a direct contact connection to A16 · South Downs near the foot of Community A. Visually distant regions can be one contact apart, and line length does not affect transmission strength.
Edges represent contact opportunities between residents. People remain assigned to their home regions; this is not a model of physical travel or migration.
Inside each polygon, horizontal colour bands show how the 100 residents are divided across states. Because Voronoi polygons narrow and widen from top to bottom, splitting a polygon by equal vertical height would distort the numbers. Here, the horizontal cuts are solved geometrically so that each band’s area matches its share of the region’s 100 people.
Four compartments in plain language
Before looking at the equations, the model tracks four groups of people in every region:
- Susceptible (): People who have not had the infection and are not vaccinated; they can catch the infection from infectious people in their own region or across a drawn contact link.
- Infectious (): People who currently have the infection and can pass it on before they recover.
- Recovered (): People who have already had the infection and recovered; in this model they cannot catch it again.
- Vaccinated (): People protected at day zero before the outbreak runs. Vaccination gives immediate, complete protection in this model, and is kept separate from recovery () so that cumulative infections count only people who were actually infected.
Experiment 2: With the same number of vaccine doses, does their placement change the outcome?
Switch the instrument to 2. Place the same vaccines.
The bridge between Community A and Community B stays fixed, and the five initial infections in A5 · Market Cross remain untouched. You are given a shared budget of 540 vaccine doses—15% of the city’s 3,600 residents—and three ways to place them at day zero:
- Spread evenly: Allocate doses across all 36 regions, proportional to each region’s eligible susceptible population (15 doses per region).
- Most connections: Prioritise the regions with the greatest total contact weight, concentrating protection in the network’s busiest hubs.
- Around the bridge: Prioritise the two bridge endpoints (A6 · Foundry Quay and B3 · Canal Basin) and their directly connected neighbours.
Every strategy uses the exact same 540 doses. Yet when you run the comparison or inspect the Variation between runs (20 repetitions) panel, their behaviour diverges:
- Spreading 15% of doses evenly trims the outbreak modestly in both communities, but rarely stops transmission from crossing the bridge into Community B.
- Concentrating those same 540 doses in the most connected hubs substantially lowers the peak number of people infectious at once by dampening the highest-degree regions.
- Placing the 540 doses around the bridge endpoints and their immediate neighbours builds a local firewall across the inter-community bottleneck, keeping Community B uninfected across the 20-run ensemble at the default budget.
Neither targeted strategy is universally best under every network or parameter setting. If you raise the budget, move the bridge directly onto the initially infected region, or alter the ratio between within-region and cross-link transmission, the trade-off shifts.
Why repeated runs vary
Even when every parameter is held constant, a single stochastic run is only one possible history. With five initial infections, early recoveries can extinguish an outbreak before it leaves its starting region; in another run, early link transmissions can spark simultaneous chains in both communities.
Clicking Repeat 20 times runs the current comparison across 20 stored random seeds in a background Web Worker, retaining early extinctions alongside large outbreaks. The dot plot shows each individual run alongside the group median so you can see the variation between runs directly.
Mathematical model and allocation rules
For each region , the simulation tracks integer counts
satisfying the conservation invariant
Each susceptible person in region experiences the instantaneous infection hazard
where is the within-region transmission coefficient per day (default ), is the transmission coefficient per unit-weight connection per day (default ), is the undirected contact weight ( when a link is drawn, otherwise), and is the recovery rate per day (default infectious period ). Adding a bridge inserts one undirected link of weight without normalising existing contact weights.
Events are simulated in continuous time using Gillespie’s direct method across three explicit event channels:
At each step, let be the sum of rates across all active channels. When , the waiting time to the next event is sampled as with , and the specific channel is chosen with probability proportional to its rate using an independent uniform draw . Because each link channel is tracked separately, the simulation records the exact source and destination of every cross-region infection.
Deterministic integer vaccine allocation
At , region has eligible susceptible capacity ( in A5 · Market Cross and in all other regions, for a maximum city capacity of doses). Given a total integer budget , each strategy partitions the regions into priority tiers and distributes remaining doses within each tier using iterative largest-remainder (Hamilton) rounding subject to :
- Spread evenly (
even): All 36 regions form a single tier weighted by eligible capacity . Ties in fractional remainders are broken by descending total contact weight and then ascending region index. - Most connections (
most-connections): Regions are grouped into descending tiers of total contact weight . Doses fill the highest-weight tier first (weighted by , breaking remainder ties by shortest hop distance to the bridge and then ascending region index), overflowing into successively lower-weight tiers until all doses are placed. - Around the bridge (
around-the-bridge): Let be the unweighted graph hop distance from region to the nearer bridge endpoint. Priority tier 1 comprises the bridge endpoints (, relative weight ) together with their directly connected neighbours (, relative weight ). Any budget remaining after saturating tier 1 overflows into shells weighted by until all doses are allocated.
This is a synthetic city for exploring transmission. It does not predict an outbreak in a real place.
Inspired by J. D. Murray, Mathematical Biology I: An Introduction, Chapter 10 (Dynamics of Infectious Diseases): https://link.springer.com/chapter/10.1007/978-0-387-22437-4_10. For background on continuous-time Markov chain epidemic formulations and Gillespie simulation, see L. J. S. Allen (2017), A primer on stochastic epidemic models: Formulation, numerical simulation, and analysis.
Quick reference and FAQ
Adding a single contact link between two otherwise separate communities can turn a contained local outbreak into a city-wide epidemic, while placing the same 540 vaccine doses around that bridge or in highly connected regions changes the outcome without changing the dose count.
Word Cloud
Related reading
Selected by shared topics and section, with closer publication dates breaking ties.




Comments
Read the conversation or leave a thought for review. Comments load when this section is in view.