The Schelling model of segregation

These pages describe and explain C programs which implement Thomas Schelling's model of segregation from Micromotives and Macrobehavior, also sometimes referred to as Schelling's tipping model. There are three versions of the C program, starting from a simple one and then adding some more features. The code was written by Benedikt Stefansson and follows a Pascal program of the same model by Robert Axelrod. You can read annotated files explaining the programs:

Or you can go directly to the code. If you want to compile this code it is probably wise to shift-click on the links, and save directly to disk:

Compiling the examples

Assuming that you are compiling this on a Unix computer with the gcc compiler, issue the following statement:

where program is either schelling,schelling2 or schelling3

If you find problems with the code please contact the author.

Written by Benedikt Stefansson:
Last modified: Mon Feb 2 12:14:06 PST 1998