In the present study we address the question of how persons or families occupy specific locations according to an attractiveness function between persons and flats. We suggest a mathematically formulated model in order to find optimal distributions of persons over flats. The model maximizes the global attractiveness of the ensemble and accounts for various conflicting situations. Its solutions show that, depending on initial conditions, both optimal as well as suboptimal configurations can be reached. An interpretation of the approach in terms of mental maps is offered.