Schelling Segregation

Explore how local neighbour preferences reshape two seeded groups, with reproducible rounds, population counts and neighbour-pair history.

About this tool

A seeded 48×48 grid contains two balanced groups and vacancies. Occupancy is rounded to an exact site count; group sizes differ by at most one. Neighbours are the eight surrounding sites, without wrapping at boundaries. Vacancies do not count in the neighbour denominator. An agent with no occupied neighbours is satisfied. Otherwise it is dissatisfied when its same-group neighbour fraction is strictly below τ; a larger τ demands more similar neighbours.

This variant selects dissatisfied agents from the start-of-round snapshot, shuffles their order, then moves each once to a uniformly chosen current vacancy. Vacated origins can be reused in the same round. Destinations need not satisfy the agent immediately; population counts are conserved. It stops when all agents are satisfied or vacancies are absent, and may otherwise continue without converging.

Generate/Restart repeats the seed. One round initializes if needed and advances once; Start/Resume plays rounds until paused or stopped. Changing the threshold pauses and retains the board, starting a new history segment at the current round. Occupancy or seed edits keep the old grid until Generate/Restart or an explicit round/start applies them. Rate changes pause. Hiding the tool also pauses it. The full grid, random-generator state, round, last movement count and the last 200 history points are saved locally, together with unfinished inputs and panels. Playback saves about once per second; pause and input edits save immediately. JSON backs up the numerical state; PNG includes the population legend. Imported consistency checks do not certify an entire earlier trajectory.

The same-group-pair share counts only occupied neighbour pairs. Around one-half is a typical mixed balanced board; one means all observed pairs have the same group. It is distinct from the local dissatisfied count and is hidden when no occupied pair exists. History retains the last 200 actual round numbers. This illustrative agent model is not a social prediction or an exact reconstruction of every published Schelling variant.

Only input values are remembered in this browser. Calculated results and experiment histories are not saved.