🗳️ Voter Model & Schelling Segregation

Agents on a grid adopt neighbours' opinions. Switch between the classic Voter Model, Noisy Voter (spontaneous flips), and Schelling Segregation — watch global order emerge from purely local rules.

Model

Parameters

Stats

Blue fraction
Interface density
Largest cluster
Consensus?No
Steps0

About This Simulation

The Voter Model is one of the simplest opinion-dynamics models: at each step, a random agent copies the opinion of a random neighbour. On a finite lattice the system always reaches consensus (all red or all blue), but the time to do so scales as N². Adding spontaneous opinion flips (the Noisy Voter Model) creates a steady-state distribution rather than absorbing consensus.

The Schelling Segregation model shows how mild preferences produce strong spatial segregation. Each agent is happy if at least a fraction τ of its neighbours share its colour; unhappy agents move to a random empty cell. Even with τ = 0.30 (only 30% same-colour neighbours required), stark homogeneous clusters emerge — a classic example of "micromotives and macrobehaviour."

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.