← Society

🏘️ Schelling Segregation

Grid: 60 Density: 70% Tolerance: 30%
Blue Happy0%
Red Happy0%
Overall
Steps0
Unhappy0
🔵 Group A   🔴 Group B   ⬛ Empty

🏙️ Schelling Segregation — Emergent Social Dynamics

If each resident moves only when fewer than 30 % of their neighbours are similar to them, what neighbourhood patterns emerge? Thomas Schelling's 1971 model showed that mild individual preferences can produce extreme collective segregation — without anyone intending it.

🔬 What It Demonstrates

Agents occupy a grid, each belonging to one of two groups. An agent is unhappy if similar neighbours fall below threshold T. Unhappy agents relocate to random empty cells. Even at T = 33 %, fully segregated clusters form within hundreds of steps.

🎮 How to Use

Adjust Tolerance threshold (the minimum fraction of same-type neighbours an agent accepts). Watch the Segregation Index rise in the live chart. Try T = 0.1 for near-zero segregation and T = 0.5 for fully clustered patterns.

💡 Did You Know?

Schelling's model earned him the 2005 Nobel Prize in Economics. Urban planners use it to study school zoning, housing policy and race relations. It demonstrates that top-down mandates may need to exceed the expected level of segregation to produce integration — the 'tipping' phenomenon.

About the Schelling Segregation Model

This simulation reproduces Thomas Schelling's 1971 agent-based model of residential segregation. Two groups of agents, drawn here as blue and red squares, occupy cells on a square grid alongside empty spaces. Each agent inspects its eight surrounding cells (the Moore neighbourhood) and is content only if the fraction of occupied neighbours sharing its colour meets or exceeds a tolerance threshold T. Discontented agents relocate to randomly chosen vacant cells, and the model iterates this rule.

The Grid slider sets the lattice size from 20 to 100 cells per side, Density fills 30 to 95 per cent of cells with agents, and Tolerance sets the threshold T from 0.1 to 1.0. Each step relocates about 30 per cent of unhappy agents to empty cells. The striking result is that even a modest preference for similar neighbours produces sharply segregated clusters, illustrating how individual choices generate emergent collective patterns relevant to housing policy and urban planning.

Frequently Asked Questions

What does the Schelling model demonstrate?

It shows that large-scale residential segregation can emerge even when individuals hold only mild preferences about their neighbours. No agent demands a fully same-colour area, yet the system still settles into strongly clustered, segregated patterns. It is a classic example of emergent behaviour, where the collective outcome differs greatly from any single agent's intention.

How does an agent decide whether it is happy?

Each agent examines its eight neighbouring cells and counts how many are occupied. It then measures the fraction of those occupied neighbours that share its own colour. If that fraction is at or above the tolerance threshold T, the agent is satisfied and stays; otherwise it is unhappy and will move. Agents with no occupied neighbours are treated as unhappy in this version.

What does the Tolerance slider actually control?

Despite the name, the Tolerance slider sets the threshold T, the minimum share of like-coloured neighbours an agent requires to feel settled. A low value such as 0.3 means an agent is happy if just 30 per cent of its neighbours match, so it is in fact very tolerant. Raising the value makes agents pickier and drives stronger segregation.

Why does mild preference create extreme segregation?

Each relocation of an unhappy agent slightly changes the neighbourhoods of nearby agents, sometimes tipping previously content ones into discontent. These local moves cascade, and the only stable configurations tend to be ones where like is clustered with like. The aggregate pattern overshoots the modest individual preference, a hallmark of nonlinear, self-reinforcing dynamics.

What do the Grid and Density sliders change?

Grid sets the side length of the square lattice, from 20 up to 100 cells, so the total number of cells ranges from 400 to 10,000. Density sets the share of cells filled with agents, from 30 to 95 per cent, with the remainder left empty. Empty cells are essential, as unhappy agents need vacant destinations; very high density leaves few places to move and can slow or stall the process.

How are agents moved each step?

Each step the model scans every agent, lists the unhappy ones, and shuffles that list. It then relocates roughly 30 per cent of them (at least ten where possible) to randomly selected empty cells, swapping their positions with vacancies. This partial, randomised movement keeps the dynamics smooth rather than relocating every dissatisfied agent at once.

What do the colours and brightness mean?

Blue squares are Group A and red squares are Group B, while dark cells are empty. Brightly coloured cells indicate happy agents whose neighbourhood meets their threshold, whereas lighter, washed-out shades mark unhappy agents who are still seeking a better spot. As the simulation converges, faded cells disappear and solid blocks of colour remain.

What do the statistics at the bottom show?

Blue Happy and Red Happy give the percentage of each group that is currently satisfied, the Overall bar blends both into a single contentment measure, Steps counts iterations completed, and Unhappy reports how many agents still want to move. When the Unhappy count reaches zero the system is stable and the run automatically stops, showing the message that the configuration has settled.

Is the simulation physically accurate?

It faithfully captures the core logic of Schelling's original model: a threshold preference, a Moore neighbourhood, and relocation of dissatisfied agents to empty cells. It is a stylised social model rather than a literal map of any city, so it omits factors such as income, transport, schools and prices. Its value lies in revealing a mechanism, not in forecasting specific neighbourhoods.

What is a real-world application of the model?

Urban planners, sociologists and economists use Schelling-style models to study residential segregation, school zoning and housing policy. A key policy lesson is the tipping insight: because segregation emerges spontaneously, achieving lasting integration may require interventions stronger than one might naively expect. The framework also generalises to opinion clustering, market sorting and other systems of interacting agents.