My friend explained to me the following model which comes psychology. I am fairly certain there must be mathematicians who study this type of thing because on its own right it is a very interesting mathematical object, but I do not know what it is called and would appreciate it. In psychology, I believe it is a model for segregation.
For example, we have a 50 x 50 grid. a person stands on each of the nodes. a mathematician or a philosopher. In this world, everyone can see (at most) 4 people around them.
A mathematician is unhappy if there is more than 1 philosopher around him. A philosopher is unhappy if there are more than 1 mathematician around him.
We apply the following alogrithm, while there are unhappy mathematicians or philosophers, we pick one of them and swap him with a person next to him which has a different occupation until everyone in the grid is happy. We are interested in final distribution of mathematicians/philosophers.
Of course, we can ask more interesting questions, for example, if we can see 8 people around us and what if we are willing to tolerate, say 2 people around you who are of different occupation.
what is this type of problem called and are there any type of work done in this area?