Implementing Schelling’s segregation model / homophily in Matlab. Red and green individuals are selected at random and moved to the nearest vacant location which satisfies a certain “good neighborhood” criterion. Basically, an individual tries to move to locations where there is more of her own type present than the opposite type. Over time, we observe an emergent segregation and pattern formation.













