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.
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.
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.
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.