Shelling's Segregation Model demonstrates how small-scale individual preferences can lead to large-scale societal segregation. The model was introduced by Thomas Schelling in his 1971 paper "Dynamic Models of Segregation" (Journal of Mathematical Sociology).
It's an agent-based model, where agents (representing individuals or families) of two different types (e.g., races, religions) inhabit a grid. They prefer to move if less than a certain proportion of their neighbors are of the same type, leading to emergent segregation over time.
I was interested in writing up some simple R code that would enable the simulation of Shelling's model and animate the results.
The output is rendered to static image files and rendered to mp4 and gif format using ImageMagick and ffmpeg. (I tried using the gifski package, but I didn't think the results were as nice.)
I think it's worth noting here that I think a substantial fraction of segregation is structural and not due to individual preferences. We know that the US has a long history of redlining [1], [2], Jim Crow and slavery, and the racial segregation of American cities was anything but accidental.
The point of writing this code and animating it isn't to advocate for the beliefs and assumptions posited within Shelling's model, but rather to share code of a relatively simple spatial (pixel-based) agent-based model, that can be animated for the benefit of folks interested in rendering these kinds of animations and to hone my skills.
These are just some interesting articles that caught my eye.
- Shelling's Model on Wikipedia: https://en.wikipedia.org/wiki/Schelling%27s_model_of_segregation
- Dynamics of Segregation, Shelling (1971) https://www.tandfonline.com/doi/abs/10.1080/0022250X.1971.9989794
- Understanding the Social Context of Shelling's Model https://www.pnas.org/doi/10.1073/pnas.0708155105
- The Statistical Physics of Shelling's Model https://en.wikipedia.org/wiki/Schelling%27s_model_of_segregation
- The Schelling Model of Ethnic Residential Dynamics https://www.jasss.org/15/1/6.html
- Tipping and Residential Segregation: A Unified Shelling Model https://onlinelibrary.wiley.com/doi/abs/10.1111/j.1467-9787.2010.00671.x
- A Physical Analogue to the Shelling Model https://www.pnas.org/doi/epdf/10.1073/pnas.0609371103