🗳️ Voter Model & Schelling Segregation
Voter model simulation: agents copy neighbours' opinions on a grid. Explore consensus formation, segregation (Schelling), and noisy voter dynamics with real-time statistics.
About this simulation
This lattice model shows how simple local copying rules can produce global order or persistent disorder. Each cell on the grid holds an opinion (blue or red) or, in Schelling mode, is empty. Every step, agents look only at their four nearest neighbours — there is no leader, no broadcast, no central authority — yet the whole grid can still lock into consensus, stay perpetually noisy, or self-sort into segregated neighbourhoods.
🔬 What it shows
Three related agent-based models: the classic Voter Model (an agent copies a random neighbour's opinion each step), the Noisy Voter Model (adds a random flip probability that prevents full consensus), and Schelling Segregation (agents move to empty cells when too few neighbours share their colour). Live stats track blue fraction, interface density, and largest cluster size.
🎮 How to use
Pick a mode from the model dropdown, then adjust Grid N (lattice size), Noise / flip p (randomness for the noisy voter), Schelling threshold (minimum similar-neighbour fraction before an agent relocates), and Initial blue fraction. Reset restarts the grid; Pause freezes the animation for inspection.
💡 Did you know?
The plain voter model on a 2D lattice always drifts toward one-colour consensus given enough time — there is no stable mixed equilibrium, only a random walk toward absorption. Schelling's insight, from 1971, was that even a mild preference for similar neighbours (well short of active hostility) is enough to produce strongly segregated patterns.
Frequently asked questions
What's the difference between the Voter Model and Schelling Segregation?
The Voter Model has agents copy a neighbour's opinion in place, so cells never move — only colours change. Schelling Segregation instead moves dissatisfied agents into empty cells, so the population is fixed but positions shift, producing visible clustering rather than colour consensus.
Why does the Noisy Voter Model never fully converge?
The "Noise / flip p" parameter gives each agent a small chance to adopt a random opinion instead of copying a neighbour. Even a tiny p keeps reintroducing disagreement, so the system settles into a fluctuating steady state around a mean blue fraction rather than freezing at 0% or 100%.
What does the Schelling threshold control?
It sets the minimum fraction of same-colour occupied neighbours an agent needs to feel "satisfied" and stay put. Low thresholds (near 0) rarely trigger moves, so the grid stays mixed; higher thresholds force more relocations and produce sharper, larger segregated clusters — even though agents are only mildly biased, not hostile.
What does "largest cluster" measure?
It reports the size of the biggest connected group of same-colour cells on the grid, found via a flood-fill over four-directional neighbours. Watching it grow over time shows how local copying or relocation rules snowball into large-scale spatial patterns.
Does grid size (N) change the outcome?
Larger grids take longer to reach consensus or a stable segregation pattern because information about a colour or opening has to propagate across more cells, but the underlying dynamics — consensus in the voter model, clustering in Schelling — are the same regardless of N.
Classical voter model on a 2D lattice: agents copy a random neighbour's opinion. Three modes: Classic Voter, Noisy Voter and Schelling Segregation. Real-time stats: blue fraction, interface density, largest cluster.
3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install