Introduction

Understanding urban segregation, which refers to the spatial separation and concentration of different social groups within an urban area, is of paramount importance given its impact on various social, economic, and cultural facets of our society1,2,3,4. For example, high levels of segregation lead to limited access to quality education, healthcare, and employment opportunities for marginalized communities, exacerbating socioeconomic disparities and hindering social mobility5,6,7. Additionally, concentrated poverty resulting from segregation strain public resources, contribute to higher crime rates, and foster social isolation, further impeding community development and cohesion8,9. Particularly crucial is the mathematical modelling of the mechanisms underlying segregation dynamics, as it provides a robust tool for conducting insightful what-if analyses, understanding the intricacies of social inequities, facilitating integration, and promoting social cohesion2,10. Thus, it is unsurprising that modelling urban segregation has attracted the attention and efforts of scientists from different disciplines11,12,13,14,15,16,17,18,19.

In 1971, economist Thomas Schelling proposed an agent-based model to explain how individual actions could result in global phenomena, focusing on urban segregation20,21,22,23. He observed that segregation dynamics emerge due to homophily among social groups across various demographic factors such as ethnicity, language, income, and class affiliation23. To illustrate this idea, Schelling used a simple spatial proximity model that divided the population into two groups based on a homophily threshold. Agents of two colours were placed randomly on a two-dimensional grid, and each agent preferred to live next to people in their group. If an agent is unhappy with their current location, they will move to the nearest square that satisfies them. Schelling found that segregation emerges above a homophily threshold of 1/3, and other factors affecting segregation include the ratio of individuals, the homophily threshold, and individual demands.

Numerous variants and enhancements of the Schelling model have been proposed so far, modifying agents’ behaviour11,12,13, environmental configuration24,25,26,27,28,29, considering geographical regions14,15,16, including real-world segregation data along with strategies to validate simulated behaviour with observations17,18,19, implementing agent behaviours based on psychological and sociological theories30,31,32,33, and allowing for sensitivity analysis to quantify outcome dependency on various parameters and initial conditions10,34,35,36. Other works show how even milder preferences or integration policies can eventually lead to unexpected segregation scenarios37,38, and how the introduction of venues can have an impact on segregation dynamics39.

Despite these advancements, all proposed models assume that unhappy agents move randomly on the grid without any preference for nearby or far away locations. However, recent empirical studies have shown that human movement, far from being random, follows specific statistical patterns across various spatial scales, including daily movements and migrations40,41,42,43,44,45,46,47,48,49,50,51,52,53. These individual mobility patterns are characterized by a preference for short distances and relevant places over longer distances and sparse ones40,41,42,43,44,45,48,54,55,56,57. Despite considerable interest in modelling and predicting human mobility43,52, it remains unclear how mobility patterns relate to segregation patterns. Recent empirical studies suggest a link between experienced income segregation and an individual’s tendency to explore new places and visitors from different income groups58, but this has not been systematically studied in an agent-based, Schelling-like simulation framework. At the same time, although a few simulation studies show how restricting relocation options25 and considering collective factors33,59 affect segregation dynamics, these findings have not been related to mobility constraints. Thus, we still lack a comprehensive understanding of how mobility constraints impact segregation dynamics.

This study fills this gap by designing a segregation model that considers mobility constraints and exploring how they influence segregation dynamics. Drawing on the gravity law of human mobility48,55,60,61,62,63, our model allows unhappy agents to select the next location to move based on distance and location relevance. Our findings reveal that mobility-constrained models exhibit lower levels of segregation than the Schelling model, albeit with a longer convergence time, and that agents that end in the periphery are more segregated than those in the grid centre. We attribute these phenomena to a small group of persistently unhappy agents from the minority group who gravitate towards the grid centre due to the preference for nearby and relevant locations imposed by mobility constraints.

Mobility-constrained segregation models

In our model, agents may be of two types, moving on a bi-dimensional grid of size \(m = N \times N\). As in the original Schelling model20,21,22,23, an agent is happy when it is surrounded by a number of agents of the same type above a predetermined homophily threshold. An unhappy agent located at a cell A moves to a new cell B based on a probability function, p(B), which depends on two factors: the distance d(AB) between A and B, and the relevance r(B) of destination B. This probability captures the gravity law of human mobility43,47,48,52,55,60,61,62,63,64, positing that people tend to travel to nearby and relevant locations, a concept that has been supported by extensive research in fields ranging from transport planning65 and spatial economics62,66,67 to epidemic spreading57,68,69,70,71. The distance between points A and B, represented by coordinates \((x_A, y_A)\) and \((x_B, y_B)\), is computed as their Euclidean distance on the grid, \(d(A, B)=\sqrt{(x_A-x_B)^2 + (y_A-y_B)^2}\). Mathematically, we define the probability of an agent moving to cell B, given its current cell A, as a product of two power-law functions:

$$\begin{aligned} p(B) \propto r(B)^\alpha d(A, B)^\beta \end{aligned}$$
(1)

where parameter \(\alpha > 0\) models the tendency to move preferably to relevant places, while \(\beta\) captures the tendency to prefer (\(\beta > 0\)) or avoid (\(\beta <0\)) large displacements. These two parameters govern the influence of distance and relevance on the simulation outcomes, encapsulating the essential factors that shape the dynamics of the model.

We assume a core-periphery structure to model the distribution of relevance across the grid cells72 and use a radial distribution where the relevance value of each cell decreases with its distance from the grid centre C:

$$\begin{aligned} r(A) \propto \frac{1}{d(A,C)^\kappa } \end{aligned}$$
(2)

with \(\kappa =2\). The results obtained with a uniformly random spatial distribution of relevance can be found in Supplementary Note 1. Note that since all agents share the information about cell relevance, \(\alpha = -x\) means being repelled by a cell to the same extent that \(\alpha = x\) means being attracted to it. The case where \(\alpha = 0\) and \(\beta = 0\) corresponds to the original Schelling model. The model simulation ends when all agents are happy. From the gravity segregation model, we derive two other families of models: the distance models (\(\alpha =0, \beta \ne 0\)), which only imposes constraints on distance, and the relevance models (\(\alpha \ne 0, \beta = 0\)), which only considers relevance. See Table 1 for algorithmic details about the gravity, relevance, and distance models.

Table 1 Schema of the distance, relevance, and gravity models.

We conduct a series of experiments varying the grid size (\(m \in \{25 \times 25, 50 \times 50, 75 \times 75\}\)), the ratio of occupied cells (\(\sigma \in \{50\%, 70\%\}\)), the proportion of agents in the two groups (\(\theta = \{ 10/90, 30/70, 50/50\}\)), the homophily threshold (\(h \in \{10\%, 30\%, 50\%\}\)), and the relocation policy (whether agents move to locations where they should be happy or not). Since our results are consistent across these different parameter values (see Supplementary Note 2), we present the findings for a fixed set of conditions: a grid size of \(50\times 50\), an occupancy ratio of \(70\%\), a group proportion of 30/70, and a homophily threshold of \(30\%\). We perform 100 simulations for each set of parameter values, each time using a different random distribution of agents on the grid. Each simulation terminates when all agents are happy or after a maximum of 500 simulation steps.

We quantify the level of segregation at the end of the simulation as the average segregation level of the agents, \(S = \frac{\sum _{a \in M}s(a)}{|M|}\), where M is the set of agents and \(s(a)=\frac{|\Gamma _{T}(a)|}{|\Gamma (a)|}\), with \(\Gamma _{T}(a)\) the set of neighbours of the same type of a and \(\Gamma (a)\) the set of neighbours of a of any type. \(\Gamma _{T}(a)\) is computed as the Moore neighbourhood with range \(r=1\)73. We obtain analogous results when using other segregation metrics (see Supplementary Note 3).

Results

Figure 1
figure 1

Segregation dynamics of mobility-constrained models. (ad) Final grid configuration of four simulations of the original Schelling model O (a), a distance model D (b), a relevance model R (c), and a gravity model G (d), all with a grid size of \(25 \times 25\), a cell occupancy rate of \(70\%\), a group proportion of 30/70, and a homophily threshold of \(30\%\). (eh) The mobility trajectories of four agents, one per model. (il) Graphical representation of the distribution of jump length for each model. In O, agents move randomly throughout the grid when they are unhappy, resulting in a peaked distribution of jump lengths. In D and G, agents prefer to move to nearby cells, resulting in a heavy-tailed distribution of jump lengths. In R and G, agents are directed towards the city centre, resulting in a centripetal tendency that causes empty cells to be positioned far away from the centre and a lower average distance travelled than O. We indicate the average distance travelled by agents in the four models with \({\overline{d}}_O\), \({\overline{d}}_D\), \({\overline{d}}_R\), and \({\overline{d}}_G\).

The values of parameters \(\alpha\) and \(\beta\) influence how agents move on the grid when unhappy, generating different mobility patterns. As an example, in Fig. 1, we compare three simulations with identical initial configuration but different parameter values: \(\alpha = \beta = 0\), representing the original Schelling model O; \(\alpha =0, \beta =-2\), a distance model D; \(\alpha =2, \beta =0\), a relevance model R; and \(\alpha =2, \beta =-2\), a gravity model G. In the original Schelling model (O), agents move randomly throughout the grid when they are unhappy, resulting in a distribution of jump lengths that follows a peaked distribution, indicating the existence of a typical jump length for agents (\(\overline{d_{O}} = 16.27\), the average distance between cells on the grid). On the other hand, in the distance model (D) and the gravity model (G), agents prefer to move to nearby cells, resulting in a heavy-tailed distribution of jump lengths (Fig. 1j,k) and lower average distances (\(\overline{d_{D}} = 5.30\) and \(\overline{d_{G}} = 3.10\)). In R and G, agents are directed towards the city centre, resulting in a lower average distance travelled (\(\overline{d_{R}}=11.60\)) than O and a centripetal tendency that causes the empty cells to be positioned far away from the centre of the grid (Fig. 1c,d). Indeed, in R and G, only \(4\%\) and \(7\%\) of the cells in the centre are empty, while in D and O, \(25\%\) and \(28\%\) of cells are empty, respectively. An intriguing question is what impact \(\alpha\) and \(\beta\), and thus the resulting mobility patterns, have on crucial aspects of the simulation, such as the final segregation level, S, and model convergence time, n, defined as the number of simulation steps needed for all the agents to become happy.

Effects of distance on segregation dynamics

We study the impact of varying the distance exponent \(\beta\) on the final level of segregation S and the convergence time n while holding the relevance parameter constant (\(\alpha =0\)).

Figure 2a displays the relationship between n and S for \(\beta \in [-5, 5]\). In the figure, we present only the average values of S and n over 100 simulations since the standard deviation is relatively small (see Supplementary Note 4). We find that a decrease in \(\beta\) (i.e., an increasing cost of relocating far away) leads to a decrease in S and a increase in n compared to the original Schelling model (\(\beta = 0\)). This result means that a preference to move nearby the current location slows down but mitigates the segregation behaviour. For instance, for \(\beta =-5\), S is reduced by around \(10\%\), and n increases by a factor of 30 compared to the original Schelling model (\(\beta =0\)). Conversely, an increase in \(\beta\) (lower cost of relocating far) has a negligible impact on n and marginally increases S. Indeed, for \(\beta = 5\), the segregation level increases only by around \(1\%\) compared to the original Schelling model, with no substantial change in the convergence time. As an example, Fig. 1a-d presents the final grid configurations for O, R, D, and G: note how D and G (with \(\beta = -2\)), which converge over a longer time, have a lower final segregation level compared to O and R.

Figure 2
figure 2

Effects of distance and relevance on segregation dynamics. (ac) Effects of \(\beta\) on segregation dynamics. (a) The average value of n and S over 100 simulations with the same \(\beta\) value but different initial grid configurations, colour-coded by the value of \(\beta\). The lower \(\beta\), the higher the cost of relocating far away, resulting in longer convergence time and reduced segregation levels compared to the original Schelling model. The relationship between n and S is well fitted by a power-law function \(S = \frac{a}{n^b}+c\), with \(a=4.6, b=1.5, c=0.7\). (b) \(\beta\) vs average n over 100 simulations. The relationship follows an exponential distribution \(n = a^{-b \beta }+c\), with \(a = 2.7 , b = 1.1 , c = 21.0\). The lower \(\beta\) (\(< 0\)), the longer the simulation. (c) \(\beta\) vs average S over 100 simulations. This is well approximated by a sigmoid function \(S = \frac{a}{d^{-b\beta }+c}+k\), with \(a = 0.9 , b = 3.2 , c = 11.8 , d = 1.4 , k = 0.7\) For \(\beta < 0\), there is an exponential increase in S; \(\beta > 0\), the growth is moderate. (df) Effects of \(\alpha\) on segregation dynamics. (d) The average value of n and S over 100 simulations with the same value of \(\alpha\) but different initial grid configurations, colour-coded by the value of \(\alpha\). Increasing values of \(\alpha\) elongate n and slightly increase S. The relationship follows a power-law function \(S = \frac{a}{n^b}+c\), with \(a = -8.5 , b = 2.1 , c = 0.8\). (e) \(\alpha\) vs average n over 100 simulations. The relationship follows an exponential distribution \(n = a^{b\alpha }+c\), with \(a = 7.1 , b = 0.9 , c = 19.5\). (f) \(\alpha\) vs average S over 100 simulations. The relationship is well approximated by a parabolic function \(S = a\alpha ^2 +b\alpha +c\), with \(a = -0.002, b = 0.01, c = 0.8\). (g) The average S (colour) for each combination of \(\alpha\) and \(\beta < 0\). For every value of \(\alpha\), higher \(\beta\) values lead to a higher S; for every \(\beta\), higher \(\alpha\) values lead to a higher S. (h) The average n (colour) for each combination of \(\alpha\) and \(\beta < 0\). For every value of \(\alpha\), higher \(\beta\) values lead to a lower n; for every \(\beta\), higher \(\alpha\) values lead to higher n.

We also observe that \(\beta\) influences n and S in a non-linear fashion. The dependency of n and \(\beta\), can be approximated by an exponential function:

$$\begin{aligned} n = a^{-b \beta }+c \end{aligned}$$
(3)

with \(a = 2.7, b = 1.1, c = 21\) (Fig. 2b). Equation 3 enables us to estimate the number of simulation steps required for the model to converge based solely on the value of \(\beta\), providing valuable what-if insights into the implications of mobility constraints on segregation dynamics. For example, if an incentive for relocating far away from the current location is introduced, which would result in a positive value of \(\beta\) (e.g., \(\beta =5\)), Eq. (3) suggests that it would take approximately \(n=21\) simulation steps for the city to become segregated. On the other hand, if people are incentivised to stay nearby the current location, which would result in a negative value of \(\beta\) (e.g., \(\beta =-5\)), Eq. (3) suggests that an average of \(n=256\) simulation steps (more than ten times more) would be required for the city to become segregated.

The relationship between \(\beta\) and S is well-fitted by a sigmoid function:

$$\begin{aligned} S = \frac{a}{d^{-b\beta }+c}+k \end{aligned}$$
(4)

where \(a = 8.5 \times 10^{-1} , b = 3.2 , c = 11.8 , d = 1.4 , k = 7.3 \times 10^{-1}\) have been empirically fitted (Fig. 2c). An interesting finding is a tip** point in the sigmoid curve close to \(\beta =0\) (original Schelling model), which indicates that the influence of \(\beta\) on the level of segregation depends on whether it is positive or negative (Fig. 2c). When \(\beta > 0\), agents move far way over a larger pool of choices because the number of available cells increases with distance, leading to behaviour that closely resembles the original Schelling model (see Fig. 2a). In fact, even for \(\beta =5\), the final segregation level S is only \(1\%\) higher than the original Schelling model (Fig. 2c). In contrast, when \(\beta < 0\), agents prefer to stay close to their current cells, causing the grid configuration to change slowly over time and leading to a final grid configuration that is more similar to the initial one (and therefore less segregated). For example, if \(\beta =-5\), the segregation level \(S=0.73\), about 8% lower than the original Schelling model.

The relation between S and n is well-fitted by a power-law function:

$$\begin{aligned} S = \frac{a}{n^b}+c \end{aligned}$$
(5)

with \(a=4.6\), \(b=1.5\), and \(c=0.7\) (Fig. 2a). As n increases, the overall level of segregation S decreases: the more difficult it is for the agents to find cells that meet their homophily preferences, the less segregated the final grid is, and the more steps are required to reach an equilibrium state where all agents are happy. Conversely, if the agents can quickly identify desirable locations, convergence occurs rapidly with fewer steps, resulting in greater segregation.

Effects of relevance on segregation dynamics

We study the impact of the relevance exponent \(\alpha\) on the final level of segregation S and the convergence time n by controlling for the distance parameter (\(\beta =0\)). We find that n increases exponentially with \(\alpha\) as:

$$\begin{aligned} n = a^{b \cdot \alpha } + c \end{aligned}$$
(6)

where \(a = 7.1\), \(b = 0.94\), and \(c=19.5\) are empirically fitted (Fig. 2e). This result suggests that agents tend to move closer to the opposing group when they compete for relevant cells, resulting in a more prolonged convergence process than the original Schelling model. For example, \(\alpha =3\) corresponds to an average of 261 simulation steps, almost 12 times more than the needed for \(\alpha =0\) (20 steps on average). On the other hand, S increases parabolically with \(\alpha\) as:

$$\begin{aligned} S = a \cdot \alpha ^2 + b \cdot \alpha + c \end{aligned}$$
(7)

where \(a = -0.002\), \(b=0.01\), \(c=0.8\) empirically fitted (Fig. 2f), indicating a slightly non-linear impact of \(\alpha\) on the final segregation level. When \(\alpha =3\), \(S=0.81\), a mere \(2.5\%\) higher than the original Schelling model (0.79), indicating that the relevance parameter has only a minor effect on the final segregation level.

The relationship between n and S through the relevance exponent \(\alpha\) can be approximated by power-law function:

$$\begin{aligned} S = \frac{a}{n^b}+c \end{aligned}$$
(8)

with \(a = -8.5, b = 2.1, c = 0.8\) (Fig. 2d). The longer it takes for the model to converge (larger n), the more segregated the final grid becomes (higher S, albeit only slightly). We observe that as \(\alpha\) increases, the difference in segregation levels between the periphery and centre, denoted as \(S_{\tiny \text{ diff }} = S_{\tiny \text{ periphery }} - S_{\tiny \text{ centre }}\), also increases. This means that agents that end up in the periphery are more segregated than those in the centre (see Supplementary Note 5). This can be attributed to the centripetal force that encourages agents to move towards the centre, creating a more mixed scenario than in the periphery. Since the periphery is larger and shows a higher segregation level than the centre, the final grid becomes more segregated (higher S) as \(\alpha\) increases.

Interplay of distance and relevance

Finally, we study the interplay of the relevance and distance exponents on segregation dynamics. We focus on the negative values of \(\beta\), which induce the most significant variations in S and n. For completeness, we provide an analysis of \(\beta >0\) in Supplementary Note 6.

Segregation is maximized in the relevance model (\(\beta = 0\)) and minimized when \(\beta =-5\), with a minor influence of parameter \(\alpha\) (Fig. 2g). Specifically, \(S_{\beta =0, \alpha =3}\) is approximately 11% higher than \(S_{\beta =-5, \alpha =0}\). This suggests that when the preference for short distances is strong, the impact of relevance is relatively weak. Figure 2h shows that the convergence time is maximized when \(\beta\) is low and \(\alpha\) is high (upper left corner). In particular, \(n_{\beta =-5, \alpha =3}\) is roughly 24 times higher than \(n_{\beta =0, \alpha =0}\). Distance constraints become almost irrelevant when relevant places are present in influencing convergence time. Overall, our results highlight the complexity of the interplay between \(\beta\) and \(\alpha\) and their differential impacts on segregation level and convergence time.

Figure 3
figure 3

Persistently unhappy agents. (a) Distribution of simulation steps required for the agents in the majority group to achieve happiness (100 simulations of the gravity model, \(\alpha =3, \beta =-3\)). All agents reach happiness within 17 steps. (b) Distribution of simulation steps needed for agents in the minority group to reach happiness. Most agents become happy in 50 steps, but a small percentage remain unhappy for up to 500 steps. (c) Gravity model’s grid configuration at the critical point when the centre becomes stably segregated. The boundaries of the suburbia are represented as two dark circles with a radius of 9 (small circle) and 16.6 (large circle), representing 25% of the grid’s total area. The white dots represent persistently unhappy agents who remain unhappy for more than the 95th percentile of simulation steps. Most of these agents are in the suburbia region. (d) Probability \(\rho\) of a persistently unhappy agent being in suburbia at the critical point when the centre becomes stably segregated. The dashed line indicates the probability of a random agent being in the area (0.25). The gravity and relevance models show higher probabilities than the random model, while the distance model’s probability is similar to the null model.

One intriguing aspect is the identification of agents responsible for elongating convergence time in the gravity models. Do all agents suffer prolonged unhappiness, or is there a specific group of agents responsible for the extended convergence time? Figure 3a–b illustrates the distribution of time-to-happiness, representing the number of simulation steps needed for agents to become happy. Our results indicate that most agents achieve happiness within a few steps, while a small fraction of agents, primarily from the minority group, remain unhappy for an extended duration. For example, as Fig. 3a shows, all agents of the majority group achieve happiness within 17 simulation steps. In contrast, although most minority group agents attain happiness relatively quickly, some remain unhappy for an extended period for up to 500 simulation steps (Fig. 3b). We classify these agents as persistently unhappy and denote them as set U. Specifically, we identify persistently unhappy agents as those whose unhappiness surpasses the 95th percentile of the distribution of time-to-happiness for all agents. For example, in Fig. 3c, only 9 agents out of 1750 are persistently unhappy.

We hypothesize that the combination of agents’ preferences and the distribution of relevant cells within the grid creates a situation where some agents may be trapped in an area that does not align with their preferences, resulting in persistent unhappiness. We discover that this area is a “suburbia” of the centre, i.e., an area around the centre between a radius of 9 and a radius of 16.6, representing 25% of the grid’s total area (see Fig. 3c). In detail, we compute the fraction \(\rho\) of persistently unhappy agents being located in the suburbia at a critical point when the centre becomes stably segregated (see Supplementary Note 7). For instance, Fig. 3c illustrates the grid configuration of a gravity model at this critical point: the majority of persistently unhappy agents (white dots) are concentrated in a confined region near the centre of the grid. Mathematically, we capture this aspect by defining \(\rho = \frac{|U_{sub}|}{|U|}\), where \(|U_{sub}|\) is the number of persistently unhappy agents in the suburbia at the critical point. Figure 3d shows that the gravity and the relevance models have a significantly higher \(\rho\) than a random spatial distribution of agents, with the relevance model displaying a lower probability than the gravity model. The distance model’s probability is instead similar to the null model. These findings suggest that persistently unhappy agents are located in suburbia at the critical point, and their presence can significantly prolong the simulation as they cannot escape the loosely segregated situation in the centre due to their preference for relevant locations and short-distance moves.

Discussion

This study provides a novel and insightful approach to understanding the impact of mobility constraints on urban segregation dynamics. The gravity law injected in the Schelling model allows for modelling agents’ mobility patterns based on the relevance of locations and the distance between them. We find that the influence of these two factors on segregation dynamics is significant and profoundly impacts the model outcome, both independently or in combination with each other. By analyzing the mobility patterns of agents in the gravity-constrained model, we discovered a trend in the exponential elongation of segregating times attributed to a few agents of the minority group caught in a vicious loop, constantly moving among the few locations near the segregated centre. Moreover, the centripetal force towards the centre leads to more mixing in the centre and greater segregation in the periphery.

Our findings provide valuable insights into the complex dynamics of segregation, offering a valuable tool for understanding and simulating potential scenarios through what-if analysis. The equations that relate the relevance and distance parameters with the segregation level and the convergence time can be manipulated to explore different scenarios, such as economic incentives to encourage large-scale relocations or the relocation of facilities within a city. This approach can provide policymakers with a comprehensive understanding of how these interventions may impact segregation dynamics.

It is worth noting that, in recent years, a few studies have explored the relationship between agents’ freedom to move and segregation dynamics. Notably, Fagiolo et al.25 examined the consequences of agents’ restricted movement to specific nodes within a network, Abella et al.33 explored the impact of agents develo** attachments to particular places as they spent time there, and Moro et al.58 shed light on the association between experienced income segregation and place and social exploration. However, none of these studies has thoroughly examined, within a what-if analysis, the profound effects on segregation dynamics of geographic distance, location relevance, and their interplay. Our study addresses this gap by unveiling this impact on the segregation level and model’s convergence time for the first time.

While our study provides valuable insights, it has limitations and areas for further exploration. Our model’s reliance on simplified assumptions, including a grid-like structure with core-periphery relevance distribution and agents’ satisfaction based solely on neighbour tolerance, overlooks other factors contributing to overall happiness. Future research could incorporate more complex assumptions and consider additional factors such as socioeconomic status, housing conditions, and neighbourhood composition. For example, when making relocation decisions, agents could consider several attributes of origin and destination cells, such as cell centrality and the presence of specific venues43,48, allowing for a more comprehensive assessment of happiness based on multiple factors, rather than solely relying on group homophily. In addition, there is potential for exploring alternative mechanisms of agent mobility. For instance, to capture individual mobility patterns more realistically, we could assign individual mobility networks to agents56,74, limiting their movement to specific subsets of cells on the grid. Lastly, we aim to extend the analysis to a real-world dataset of relocations to assess how simulation-based results align with empirical observations in an actual city.