67. Schelling’s Segregation Model#

67.1. Outline#

In 1969, Thomas C. Schelling developed a simple but striking model of racial segregation [Schelling, 1969].

His model studies the dynamics of racially mixed neighborhoods.

Like much of Schelling’s work, the model shows how local interactions can lead to surprising aggregate structure.

In particular, it shows that relatively mild preference for neighbors of similar race can lead in aggregate to the collapse of mixed neighborhoods, and high levels of segregation.

In recognition of this and other research, Schelling was awarded the 2005 Nobel Prize in Economic Sciences (joint with Robert Aumann).

In this lecture, we (in fact you) will build and run a version of Schelling’s model.

Let’s start with some imports:

import matplotlib.pyplot as plt
plt.rcParams["figure.figsize"] = (11, 5)  #set default figure size
from random import uniform, seed
from math import sqrt

67.2. The Model#

We will cover a variation of Schelling’s model that is easy to program and captures the main idea.

67.2.1. Set-Up#

Suppose we have two types of people: orange people and green people.

For the purpose of this lecture, we will assume there are 250 of each type.

These agents all live on a single unit square.

The location of an agent is just a point \((x, y)\), where \(0 < x, y < 1\).

67.2.2. Preferences#

We will say that an agent is happy if half or more of her 10 nearest neighbors are of the same type.

Here ‘nearest’ is in terms of Euclidean distance.

An agent who is not happy is called unhappy.

An important point here is that agents are not averse to living in mixed areas.

They are perfectly happy if half their neighbors are of the other color.

67.2.3. Behavior#

Initially, agents are mixed together (integrated).

In particular, the initial location of each agent is an independent draw from a bivariate uniform distribution on \(S = (0, 1)^2\).

Now, cycling through the set of all agents, each agent is now given the chance to stay or move.

We assume that each agent will stay put if they are happy and move if unhappy.

The algorithm for moving is as follows

  1. Draw a random location in \(S\)

  2. If happy at new location, move there

  3. Else, go to step 1

In this way, we cycle continuously through the agents, moving as required.

We continue to cycle until no one wishes to move.

67.3. Results#

Let’s have a look at the results we got when we coded and ran this model.

As discussed above, agents are initially mixed randomly together.

_images/schelling_fig1.png

But after several cycles, they become segregated into distinct regions.

_images/schelling_fig2.png
_images/schelling_fig3.png
_images/schelling_fig4.png

In this instance, the program terminated after 4 cycles through the set of agents, indicating that all agents had reached a state of happiness.

What is striking about the pictures is how rapidly racial integration breaks down.

This is despite the fact that people in the model don’t actually mind living mixed with the other type.

Even with these preferences, the outcome is a high degree of segregation.

67.4. Exercises#

Exercise 67.1

Implement and run this simulation for yourself.

Consider the following structure for your program.

Agents can be modeled as objects.

Here’s an indication of how they might look

* Data:

    * type (green or orange)
    * location

* Methods:

    * determine whether happy or not given locations of other agents

    * If not happy, move

        * find a new location where happy

And here’s some pseudocode for the main loop

while agents are still moving
    for agent in agents
        give agent the opportunity to move

Use 250 agents of each type.