Week 5: Simulation and Explanation
April 15, 2026
With a simulation created, now would be the ideal time to take a step back and delve into exactly what is going on, especially since a term like “Metropolis-Hastings Schelling simulation” sounds complicated when really, it’s a pretty simple concept. Consider a grid where people are either red or blue and have only one preference – having neighbors similar to themselves. If there are too many dissimilar neighbors, a person is said to be “unhappy”. Now the question that the Schelling model asks is what happens to this city in the long run if all unhappy people continue to migrate? The traditional way to tackle this question is simply moving each person at a time till there aren’t any unhappy agents left. However, such a process is highly susceptible to small changes in agent movement order and thus difficult to analyze. In contrast, our implementation proposes to use the Metropolis-Hastings algorithm, where we perform a random swap of positions of two individuals instead of moving them individually. The acceptance of that swap will be done according to whether it increases the general level of “happiness”. Those swaps that decrease the “happiness” levels have a very low probability to be accepted while those that increase such a measure are usually accepted without any problem. After a few thousand steps, you can see how Schelling’s idea takes place: the city gets organized into segregated zones although no one was striving for it intentionally.

Leave a Reply
You must be logged in to post a comment.