Schelling's Segregation Model, Explained

After reading this you will understand how a mild preference for similar neighbours can tip a mixed grid into stark blocks, how to compute an agent's happiness and a segregation index by hand, and where the model stops being a fair picture of real cities.

What the model is, and one hook

Thomas Schelling built this model in 1971 to answer a simple question: if individual people are only mildly picky about who lives next door, does that produce mildly mixed neighbourhoods or something sharper? The answer surprised almost everyone.

Picture a grid of cells. Some cells hold an agent of group A, some hold an agent of group B, and some are empty. Each agent looks at its neighbours and asks one thing: are enough of them like me? If yes, it stays. If no, it moves to a random empty cell. That is the entire rule.

Here is the hook. Set the threshold so every agent is happy as long as at least 30% of its neighbours share its group. That means an agent is content to be outnumbered better than two to one. No one demands a majority. No one refuses to live beside the other group. Run the model anyway and the grid pulls itself apart into large single-group regions. The final pattern looks like a policy of strict separation, but nobody wanted or chose that outcome.

This is the textbook case of emergence: the large-scale pattern (segregated blocks) looks nothing like the small-scale preference (a mild aversion to being a tiny minority) that produced it.

When to reach for it, and when not

Use this model to build intuition about one specific idea: that collective outcomes can diverge sharply from individual intentions. It is a clean demonstration that you cannot read people's preferences straight off the map they produce. A fully segregated city is consistent with residents who would each happily accept a mixed street.

Do not use it as a measurement of any real city. The model has two groups, one preference number shared by everyone, no prices, no income, no history, no discrimination by third parties such as landlords or lenders, and movement that is free and instant. Real segregation runs on all the things this model omits. Treat the model as a thought experiment made runnable, not as a forecast.

It sits in the same family as other agent and grid models on this site. If you like watching simple local rules produce global structure, the Sugarscape shows wealth concentrating from equal starts, and the Forest Fire Model shows fires tuning a forest to a critical density.

The happiness rule and the segregation index

Each agent counts its occupied neighbours. On a grid the usual neighbourhood is the eight surrounding cells (the Moore neighbourhood). Let s be the number of neighbours in the same group and d the number in the different group. Empty cells do not count. The agent's like-share is:

f = \frac{s}{s + d}

Here s is same-group neighbours, d is different-group neighbours, and f is the fraction of occupied neighbours that match. An agent with no occupied neighbours is treated as happy by convention. The agent is happy when its like-share meets the threshold \tau:

\text{happy} \iff f \ge \tau

The threshold \tau is the tolerance dial. A value \tau = 0.30 means "happy if at least 30% of my neighbours match." Unhappy agents move to a random empty cell, and the process repeats until nobody wants to move or you stop it.

To measure the result with a single number, use a segregation index. A simple one is the average like-share across all occupied agents:

S = \frac{1}{N} \sum_{i=1}^{N} f_i

Here N is the number of agents and f_i is agent i's like-share. If the two groups are equal in size and perfectly mixed, a random neighbour matches about half the time, so S \approx 0.50. If the grid separates completely, almost every neighbour matches and S climbs toward 1.0. Watching S rise from about 0.50 toward 0.85 or higher is the quantitative version of watching the blocks form.

A worked example with the demo settings

Load the demo (field defaults) and you get two groups of roughly equal size, a low tolerance threshold, and a small share of empty cells. The numbers below use a \tau = 0.30 threshold, equal groups, and enough vacancies for agents to move.

Checking one agent, then the whole grid

  1. Pick an agent of group A. Suppose its eight neighbouring cells hold 2 group-A agents, 5 group-B agents, and 1 empty cell.
  2. Count occupied neighbours: s + d = 2 + 5 = 7. The empty cell is ignored.
  3. Compute the like-share: f = 2/7 \approx 0.2857.
  4. Compare to the threshold: 0.2857 \lt 0.30, so this agent is unhappy and will try to move.
  5. Now suppose instead it had 3 group-A neighbours: f = 3/7 \approx 0.4286 \ge 0.30, so it stays. A single extra matching neighbour flips the decision.

The whole grid runs this check for every agent each round, moves the unhappy ones, and recomputes. With equal groups and \tau = 0.30, the starting index sits near S \approx 0.50 because the layout is random. Within a few dozen rounds it typically settles near S \approx 0.83. Almost nobody is unhappy at that point, yet the grid is heavily sorted.

The chart below shows the shape of that climb: a fast early rise as the most isolated agents relocate, then a slow approach to a plateau as the last few unhappy agents find comfortable spots.

The index starts near 0.50 (random mix) and rises to about 0.836, then flattens once nearly everyone is happy.

How the outcome depends on the threshold

The most instructive dial is the tolerance threshold. Small changes in \tau produce disproportionate changes in the final segregation. The table gives representative end-state values for equal groups on a mid-sized grid with moderate vacancy.

Approximate final segregation index by threshold, equal groups
Threshold \tauMeaningFinal index S
0.00never moves0.500
0.20happy at 1 in 50.71
0.30happy at 3 in 100.83
0.40happy at 2 in 50.89
0.50wants a bare majority0.94
0.72wants a strong majoritygridlock, few settle

Two features stand out. First, the jump from \tau = 0.20 to \tau = 0.30 lifts the index from 0.71 to 0.83, a large move from a small preference change. Second, at very high thresholds the model breaks in the other direction: when almost everyone demands a strong majority, agents keep bouncing between empty cells and few ever settle. That is a different failure, not stronger segregation.

Without JavaScript, use the table above: a threshold of 0.20 settles near S = 0.71, a threshold of 0.30 near 0.83, and 0.50 near 0.94. The relationship is steep at the low end, so a small rise in pickiness produces a large rise in sorting.

Reading the results without overclaiming

When you read a settled grid, keep three interpretations straight.

First, a high index does not mean agents are intolerant. At \tau = 0.30 every settled agent accepts being a minority, yet the index sits near 0.83. The pattern overstates the preference.

Second, watch the count of unhappy agents alongside the index. Segregation rises precisely because unhappy agents keep moving. Once the unhappy fraction falls near zero, the index stops climbing. If it never falls, you are in the gridlock regime, not the segregation regime.

Third, vacancy matters. With too few empty cells agents cannot move and the grid freezes near its random start. With plenty of empty cells sorting proceeds quickly. Vacancy is the lubricant, not a preference at all.

Compare two runs with the same threshold but different vacancy rates. The final index will be similar, but the number of rounds to reach it differs. Vacancy changes the speed of sorting far more than its final level.

Common mistakes when using the model

The first mistake is reading intolerance into the outcome. The whole point is that mild preferences produce stark patterns, so do not infer strong prejudice from strong separation.

The second mistake is treating the segregation index as a probability or a percentage of anything real. It is an average like-share. A value of 0.83 means the typical agent's neighbours are 83% same-group, nothing more.

Do not crank the threshold above about 0.65 and call the result "extreme segregation." At that point most agents can never satisfy themselves, so they wander and the grid never settles. That is a broken run, not a stronger version of the effect. The interesting regime is the mild one, roughly 0.20 to 0.50.

The third mistake is comparing a run that has settled with one that has not. Always let the unhappy fraction fall close to zero before you read the index, or note explicitly that the run is still moving.

Related simulations on this site

If the idea of local rules producing global order interests you, several nearby models turn the same crank in different directions. The SIR Epidemic Simulator shows a wave of infection rising and burning out from three simple states. The Predator–Prey Simulator produces boom-and-bust cycles from two coupled equations. The Traffic Jam Simulator shows jams appearing on an open road with no accident and no bottleneck, purely from car-following rules.

Frequently asked questions

Does the Schelling model prove that segregation is inevitable?

No. It shows that segregation can emerge from mild preferences, not that it must. The model omits prices, income, discrimination and law. It is a demonstration that mild preferences are sufficient for sorting, which is a claim about one possible cause, not the only cause.

Why does 30% tolerance cause almost complete separation?

Because moves are contagious. When one agent leaves a mixed area, it slightly lowers the like-share of the neighbours it left and raises it where it lands. That nudges other agents over their threshold, and the sorting cascades. A threshold of 0.30 is low per agent but enough to keep the cascade running until large single-group blocks form.

What is a "good" segregation index value?

There is no good or bad value, only the level and the baseline. Equal, well-mixed groups sit near 0.50. A fully sorted grid approaches 1.0. Judge a run by how far it moved above its 0.50 starting point: from 0.50 to 0.83 is a large, characteristic Schelling shift.

What happens if I make one group much larger than the other?

The larger group finds its threshold easy to meet almost everywhere, so it settles quickly. The smaller group is pushed into tight clusters because scattered members rarely meet the threshold. The overall index still rises, but the smaller group segregates more sharply than the larger one.

Why do some runs never settle?

Either the threshold is too high (most agents can never satisfy it, so they wander forever) or the vacancy rate is too low (unhappy agents have nowhere to move). Lower the threshold below about 0.60 and keep vacancy above roughly 5% to see clean settling.