Schelling's Segregation City
Thomas Schelling's 1971 model: a 20x20 grid holds two agent types (A and B) plus empty cells. Each round, any agent with fewer than 40% same-type occupied neighbours relocates to a random empty cell. Nobody wants a segregated city - yet a mild individual preference makes the whole city segregate. Computed live at build time by OnlyCSharp.BusinessAndEconomics.BehavioralEcon.SchellingModel.
Parameters
- grid = 20 x 20 (400 cells)
- type A = 180 type B = 180 empty = 40
- tolerance = 0.40 seed = 1
Initial (random) city
HappyFraction = 0.7361 SegregationIndex = 0.5080
Convergence trace
Converged after 14 rounds (a round with zero relocations).
| Round | Relocations | HappyFraction | SegregationIndex |
|---|---|---|---|
| 1 | 95 | 0.8361 | 0.6327 |
| 2 | 59 | 0.8972 | 0.7125 |
| 3 | 37 | 0.9611 | 0.7952 |
| 4 | 14 | 0.9778 | 0.8106 |
| 5 | 8 | 0.9889 | 0.8259 |
| 6 | 4 | 0.9889 | 0.8266 |
| 7 | 4 | 0.9917 | 0.8276 |
| 8 | 3 | 0.9944 | 0.8341 |
| 9 | 2 | 0.9944 | 0.8319 |
| 10 | 2 | 0.9944 | 0.8366 |
| 11 | 2 | 0.9944 | 0.8316 |
| 12 | 2 | 0.9972 | 0.8389 |
| 13 | 1 | 1.0000 | 0.8429 |
| 14 | 0 | 1.0000 | 0.8429 |
Final city
Emergent segregation - mild preference, strong effect
| Metric | Before | After | Change |
|---|---|---|---|
| HappyFraction | 0.7361 | 1.0000 | +0.2639 |
| SegregationIndex | 0.5080 | 0.8429 | +0.3349 (65.9% rise) |
Every agent only ever demanded 40% same-type neighbours to be happy - nobody wanted a segregated city. It emerged anyway, purely from thousands of local moves.