Segregation with Social Linkages: Evaluating Schelling's Model with Networked Individuals

This paper generalizes the original Schelling (1969, 1971a,b, 2006) model of racial and residential segregation to a context of variable externalities due to social linkages. In a setting in which individuals' utility function is a convex combination of a heuristic function a la Schelling, of the distance to friends, and of the cost of moving, the prediction of the original model gets attenuated: the segregation equilibria are not the unique solutions. While the cost of distance has a monotonic pro-status-quo effect, equivalent to that of models of migration and gravity models, if friends and neighbours are formed following independent processes the location of friends in space generates an externality that reinforces the initial configuration if the distance to friends is minimal, and if the degree of each agent is high. The effect on segregation equilibria crucially depends on the role played by network externalities.


Introduction
The model of racial and residential segregation by Thomas Schelling is a prominent contribution to economic theory. Outlined in a series of papers (Schelling, 1969(Schelling, , 1971a and further elaborated in Schelling (2006), the logic of Schelling's argument offers a simple and subtle intuition to racial residential segregation. 1 Schelling's main insight is that homophily -i.e. the tendency of people to associate with others who are similar to themselves -in spite of individual preferences being characterized by the desire for integration, generates a completely unexpected social equilibrium where individuals tend to live within racially homogenous communities. Schelling's simple mechanism was originally framed as a heuristic process of strategic reasoning, in which people leave their residence whenever they are a too small minority in their neighborhood. 2 Both versions of the Schelling model, the "chequerboard model" -in which a fixed number of agents belonging to two different groups (the "reds" and the "blue" ones) choose where to locate on a grid (or on a line) as a consequence of their heuristic -and the "neighborhood tipping model" -in which a small change in group composition of a neighborhood can put the heuristic in motion, and leads to an accelerating and irreversible dynamic process bringing to racial segregation -are based on the same stringent logic in which observed macrobehavior clashes with micromotives: radical racial segregation is a robust and stable equilibrium even with individual homophily preferences over moderate racial integration.
The basic intuition of Schelling is supported by a large array of evidence on the persistence and ubiquity of racial and residential segregation across several countries: namely the US (Clark, 1991;Möbius and Rosenblat, 2001;Batty, 2013;Henderson, 2014), Europe (van Ham et al., 2016), and Israel (Hatna and Benenson, 2012). However, Schelling's prediction of extreme racial spatial separation and ghettos rarely proved to be correct (Easterly, 2009). On the contrary, the conformation of cities and urban areas, as far as segregation is concerned, is as various as it possibly could be. These aspects of reality, still unexplained by Schelling's work and its extensions, cast doubts on the ineluctability of what the model posits, and call for additional research.
Complementing Schelling's rational, this paper proposes a framework to unravel what forces might contrast dramatic population moves and produce the emergence of limited segregation equilibria. To this purpose, Schelling's heuristic is put in interplay with a positive cost of moving and, more importantly, the presence of social linkages (Jackson et al., 2017). Put differently, while Schelling considers the case when 1 Quoting Schelling: "My ultimate concern of course is segregation by color in the United States" (Schelling, 1969, p.488). 2 The same reasoning has been proposed using different setups and the main findings of the model were found consistent regardless of the definition of the neighborhood and its topography (Taylor, 1984). For an account of the extensions of Schelling model to different contexts see Ioannides (2013) and Easley and Kleinberg (2010).
people identify only with one of their characteristics (e.g., ethnicity), we consider the possibility that the force of attraction determined by homophily is affected by different identities (e.g., ethnicity and social connections) and mitigated by the cost of moving. In what follows, we will show how this generalization provides a valuable insight on the formation of racially mixed neighborhoods as they result from both local inertia, generated by the incidence of moving costs, and network externalities, arising from the desire to live close to friends.
Of course, this is not the first case in which Schelling's model has been decontextualized, put in close analogy to concepts originated in other disciplines (Vinković and Kirman, 2006), and extended so that its heuristic and other choice variables (Hensher et al., 2005) could be included in a compact multivariate utility function. Among the many, Sethi and Somanathan (2004) defines a framework in which agents care about both the racial composition and the affluence of neighborhoods, showing that, in a context of multiple equilibria, a reduction in inequality can be observed both with a rise in segregation or a fall in the level of affluence, depending on the speed of income convergence. Zhang (2004) instead, considers the existence of a housing market and agents chose to move according their heuristic and the price of an empty spot. 3 In our setup, the interplay between moving costs and social linkages generates a network externality that has an effect on the segregation patterns. When the agent is able to move and simultaneously reduce the average distance from her friends, incentives to relocate to a segregated area will decrease for everyone. After the move, incentives will decrease for friends close to the agent, and will increase for all the others.
As a final note, we stress that even if the two Schelling's formalizations -the "neighborhood tipping model" and the "chequerboard model" -can be combined into one single theoretical framework (see, for instance, Young (2001) and Zhang (2011) and the excellent textbook treatment of the models by Ioannides (2013) and Easley and Kleinberg (2010)), this approach would add unnecessary complexities to our work.
By contrast, we aim at keeping the details of this work as simple as possible and, as in (Pancs and Vriend, 2007), we build our contribution around the original Schelling "chequerboard model," in which the number of individuals and their characteristics are well defined and the number of neighborhoods is higher than one.
Albeit analytically different, this paper has strong connections with the literature originated by the seminal contribution of George Akerlof and Rachel Kranton on the Economics of Identity (Akerlof and Kranton, 2000) and summarized and popularized in Akerlof and Kranton (2012). In their framework, agents make their choice according to the standard utility maximization apparatus -market prices, individual income and preferences -and an identity variable, depending on individual characteristics (e.g. being female, being white, being homosexual) and self-image, on the social context and on the behavior of others. Choices depend therefore on economic incentives and identity issues. In our context, the identity of an individual will depend on a single characteristic (e.g., color) and on a social norm determining the degree of homophily in Schelling's heuristic. The market equilibrium in residential location and the subsequent level of social segregation will depend on economic factors (the cost of moving), identity (color and social norms) and social linkages (friends, their choices and the willingness to minimize the spatial distance between individual residence and the residence of friends).
The remainder of the paper is organized as follows. In Section 2, we show how Schelling's model can be expanded so to include the effects played by network externalities and moving costs. The components of this model are further explicated in Section 3, where we detail how they can be used to investigate segregation equilibria in a simulated setting. Section 4 presents the results of such simulations. Finally, Section 5 concludes. Before moving to Section 2 however, we briefly recall Schelling's reasoning through an illustrative example for the reader's convenience, and discuss the rational underlying it.
1.1. An example: Schelling "chequerboard model" with and without social linkages Consider Figure 1, in which 74 individuals are located on a 10×10 grid. 37 of them are "reds", and 37 are "blues." The 26 spots that are not occupied neither by reds nor by blues remain empty and can be occupied in a subsequent round of play. Finally, the initial position of each individual is random.
Each individual has up to eight adjacent neighbors and has a preference over homophily. Following a heuristic process, the generic individual remains in her location as long as at least a share x of her neighbors are of the same type as she is. In this example, we set x = 1/3. Let's now consider individual 23 in Figure   1. 4 23 is red and is surrounded by six reds and two empty spots. Since empty cells are excluded from the heuristic accounting, individual 23 compares 6/6 > 1/3 and she decides not move from her position on the grid. Individual 45, instead, is red as well but is surrounded by four blues, one red and three empty spots.
Since 1/5 < 1/3 she will move from her position on the grid. Similarly, all unhappy individuals will Figure 1: The Schelling "chequerboard" model. q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q Note: The setup is similar to the one in Schelling (1969Schelling ( , 2006. move to an empty spot that satisfies the "at least one-third" heuristic. Segregation will rapidly emerge. 5 In Figure 2, individuals are located in the same places as in Figure 1. They are also similarly split in two different groups, the "reds" and the "blues," but, with respect to Schelling's original formulation, they are also characterized by a fixed number of time-invariant friends. In this setting, individual 23 is friend with 47 and 8, and individual 45 is friend with 54 and 36. Conditional on the heuristic, they both prefer to live close to their friends, who thus modifies their individual choices. Individual 23 will tend to move to get closer to 8 and 47. On the contrary, individual 45 will now tend to stay, since her friends live nearby. The effect of friends is therefore non-monotonic as far the choice of moving is concerned, and generates a variable network externality on friends: e.g. individuals 47 and 8 will tend to stay where they are after the move by 23.
The main elements of our reasoning will be detailed, generalized and formalized in the subsequent model.

Schelling model with networked individuals
For the sake of clarity, we proceed in a stepwise form.

The framework
Consider a squared grid with side n, hence containing n 2 cells. We denote the set of the cells as V .
Each cell of the grid is identified by its row and column, so that v rc ∈ V is the cell at the intersection of row r and column c, for each r, c = 1, . . . , n. For the sake of simplicity and when needed, we will scall v rc = v, where v = (r − 1)n + c. Such a definition of v labels with a real positive number all the elements of V , and it results that v = 1, . . . , n 2 . Hereafter, without loss of generality, we will use equivalently v ∈ V and v ∈ {1, . . . , n 2 }.
We assume that the grid is suitably recombined at its boundary to be shaped as a torus, so that -for every 0 < h < n -each v (n+h)c = v hc and v r(n+h) = v rh , for each r, c, h = 1, . . . , n.
We introduce two different populations in the grid: the red individuals and the blue ones. For every individual being blue or red is an immutable trait. The set collecting the reds and the blues are denoted by A and B, with |A| = A and |B| = B, respectively. We assume that the entire population belongs to the set P = A ∪ B. Each cell of the grid can be occupied by an element of P or it can be empty. Therefore, we have A + B < n 2 . The generic elements of A and B will be denoted by a and b, respectively. We will refer to them as agents, and denote the generic agents as i, j ∈ P.
All agents, also those sharing the same color, differ for the social connections they have. The social connections of agent i are represented by a star-shaped graph with i playing the role of the central hub. By merging together all the social connections of the agents in the grid, we have a unified graph composed by the individual A + B (possibly interconnected) star-shaped subgraphs. We denote by G = (P, E) the graph in the grid, where E represents the set of the edges of G.
Specifically, we say that (i, j) ∈ E if and only if there is a social connection between agent i and agent j, for each i, j ∈ P. We define The set P i is the friendship set of the agent i, and j ∈ P i is said to be friend of i. We assume that friendship disregards colors and thus, in general, P i ∩ A = ∅ and P i ∩ B = ∅, for each agent i ∈ P.
Moreover, links are assumed to be undirected, so that j ∈ P i if and only if i ∈ P j , for each i, j ∈ P. At the same time, links are not weighted. Briefly, i and j are friends.

Agents' preferences in the grid
Agents move in the grid, and their movement is driven by their level of satisfaction in occupying a given cell of the grid. Here, we discuss what are the criteria driving the preferences of an agent for a cell, while in the next subsections we will present agents' movement rule and the random assignment mechanism used to configure their initial position in the grid.
• Color. According to the classical Schelling model, we assume that agents prefer to be surrounded by people of the same color, and have a disutility in being surrounded by a majority of agents showing a color different from her own one. We formalize this assumption.
Givenr,c = 1, . . . , n and the cellv = vrc ∈ V , we define the neighborhood set ofv by By construction, we have that |Nv| = 8. For eachv ∈ V , we introduce two variables ξ Ā v and ξ B v which describe the colors of Nv as follows: For any agent i ∈ P, the color-based normalized utility function of i in being located in the cells in V is not decreasing (not increasing, respectively) with respect to ξ Ā v when i ∈ A (i ∈ B, respectively).
• Friendship. Agents prefer to locate close to their friends. To explain this extremely reasonable assumption, the introduction of a distance measure between couples of cells belonging to the squared grid is required. Without losing generality, we employ the normalized Manhattan distance d : where r 1 , r 2 , c 1 , c 2 = 1, . . . , n and v r1,c1 , v r2,c2 ∈ V and n in the normalizing factor.
With a reasonable abuse of notation, we will refer to d(i, j) as the distance between two agents i, j ∈ P, to be intended as the distance between the cells occupied by i and j and in accord to formula (2). In the same way, we will refer to d(i, v) as the distance between the agent i ∈ P and the cell v ∈ V , which represents the distance between the cell occupied by i and the cell v. If agent i occupies the cell v, Notice that when i and j are friends, then d(i, j) is the Manhattan distance between the cells representing the extremes of the edge (i, j). Moreover, by construction, d(i, j) ∈ [0, 1].
Given an agent i ∈ P, we can provide a measure of the friendship set P i . Clearly, such a measure depends on the specific cell v ∈ V from which i's friends are observed. We denote such a measure as The measure ∆ describes how an agent changes her closeness to her friends by modifying her position in the graph. As already mentioned above, we naturally assume that agent i, located in cell v, feels to be more satisfied about her connections (and surrounded by friendship) as the value of the ∆(v, P i )'s is lower. 6 For any agent i ∈ P, the friendship-based normalized utility function of i in being located in the cells • Cost of moving. Agents spend an effort in moving from a cell to another one, and such effort generates a disutility which does not decrease as the distance from the involved cells increases. 6 In the simulation in Section 3, we will provide a specific form of the ∆ metric.
Thus, for any agent i ∈ P, the distance-based normalized utility function of i in moving from her position to the cells in V is U moving The utility function U i : V → [0, 1] -which drives the movement of the agents in the grid -is a convex combination of the utility functions described above, so that where α c , α f , α d ≥ 0 such that α c + α f + α d = 1. The selection of the values of the α's explains in a clear way the relevance of color, friendship and movement effort in implementing the decision of moving from a cell to another one.
We stress that utilities have extreme zero (resp. unitary) value at the lowest possible (resp. highest possible) level of satisfaction. The range of the utility functions plays a key role here. In fact, the values of the utility function over the cells can be compared, and such comparison will drive the allocation procedure of the agents in the cells of the grid.

The movement rule
The preferences described above represent the drivers of the movement of the agents in the grid. In this section, we describe how agents change their positions among the cells.
Firstly, and without losing of generality, we assume that movements are on a sequential basis, that is the location process of the agents is with discrete time: i.e. time t ∈ N. The way in which agents move is straightforward: any moving agent changes her location cell with an empty one. In so doing, the graph G does not change, in the sense that friendships are constant over time. The component of the model which changes is represented by the set of the cells of the grid occupied by an agent and the empty ones. Given a time t ∈ N, we denote the set collecting the empty cells at time t by Em t and the set of the occupied ones by N Em t , so that V = Em t ∪ N Em t , for each t ∈ N. By construction, Em t ∩ N Em t = ∅.
We assume that only one agent moves each time. 7 For a fixed time t ∈ N, we denote the configuration of the grid at time t by V t = (EM t , N Em t ). The agents start to move at time 1. Thus, V t represents the situation of the grid at the t-th move -i.e.: after the moves of t agents -and identifies empty and occupied cells at time t.
We denote by initial configuration the grid at time t = 0, i.e. V 0 .
Of course, over time, the value of the utility functions of each agent in the cells of the grid may change.
In fact, the passage from a configuration to another one is obtained by changing the position of one agent, and this might lead to a variation of the constitutive terms of the utility function U i in (3) for some i ∈ P.
For any i ∈ P and t ∈ N, we denote the utility function of agent i of being located in the cell v at time t as We are now in the position of describing the mechanism of the movement.
An agent moves only if the change of her position leads to an improvement of her utility. The first moving agent is the saddest one, i.e. the one with the lowest level of utility of being located in her current position.
The moving agent selects the empty cell which provides her/him the maximum level of utility. 8 If more than one empty cell maximizes the utility, then the occupied one is randomly selected among the utility maximizing cells. Analogously, if more than one agent is in the position of moving, then the moving one is selected according to a uniform distribution over the available alternatives.
As an intuitive premise, we assume that any agent i ∈ P has a complete information at time t of the where v is the cell occupied by i at time t or v ∈ Em t . Moreover, each agent is also aware about the peculiar distribution at time t of the agents belonging to A and B. The agent moving at time t will be labeled as j t , whose definition is obtained according to the following two conditions: The two conditions in (4) must be jointly verified: the former one indicates that the moving agent is that with the lowest level of utility exerted from her position; the latter one specifies that the agent changes her position only if she will improve her utility.
The mechanism admits hypothetically simultaneous movements of different agents at time t, meaning that system (4) can be satisfied by more than one agent. By assuming that Q agents satisfy (4), with Q = 1, . . . , A + B, we will label the Q moving agents by j 1,t , . . . , j q,t , . . . , j Q,t . A random extraction of one element of the set {1, . . . , Q} identifies univocallyq ∈ {1, . . . , Q} such that the moving agent is j t = j q,t .
Once condition (4) is satisfied and the moving agent identified, we implement the selection of the empty cell where agent j t moves. As already mentioned above, this selection is driven by the agent's utility function.
We model the utility of an agent to move to an empty cell v t as follows: with the conventional agreement that If |Φ t | = C > 1, then there are C different cells in Em t which are indifferent -in terms of the utility function -for the moving agent j t . We will label such C utility maximizer cells by v 1,t , . . . , v c,t , . . . , v C,t .
In this case, we extract randomly one element of the set {1, . . . , C}, and identify accordinglyc ∈ {1, . . . , C} such that the selected empty cell The movement of j t induces a new configuration of the grid, which passes from V t−1 to V t . The movement process then continues according to this mechanism. A new moving agent j t+1 is identified, which changes her original position with the empty cell v t+1 .
The process stops at the first time in which all the agents cannot improve their utility when moving from their position to an empty cell. Clearly, the process can also never stop. For this reason, in the numerical experiments we will stop the process also in presence of loops, i.e. in the circumstance of an agent moving iteratively back and forth between two cells.

Simulation
The dimensionality of the problem requires the model to be solved by simulation (Axelrod, 2013;Velupillai and Zambelli, 2015). The basic elements of the model, described in Section 2, are articulated through computation 9 and mimic a process that, given basic exogenous conditions (i.e. the spatial dimension, the density of agents, the relative share of the two populations) and the social context (Akerlof and Kranton, 2000), begin with agents' moving choices and ends to the determination of stable equilibria, corresponding to a certain level of individual and social utility and of racial residential segregation. The simulation procedure can be seen as the numerical analogous to an experimental procedure (Bona and Santos, 1997), where the parameters of the model are shocked to check the response of the system and evaluate the resulting levels of utility and segregation.
In this section we details the main aspects of our simulation setup.

Generating starting positions and network connections
We consider an n×n torus with n = 10, and impose that A = B = 37, and 26 cells are left empty. Agents' initial configurations are established at random. In order to avoid spurious results, the initial configurations 9 All computation is programmed in R and is available upon request for replication purposes.
is permuted H times by using just as many random seeds, so that the h-th seed generates the h-th initial configuration of the grid V (h) 0 , with h = 1, . . . , H. We set H = 100, to get a distribution of results.
The moments of said distribution are then summarized and plotted systematically.
Next, we create the graph G. For consistency with the literature of social networks (Newman (2010); Barabási (2016) and Goyal (2009) and Jackson (2010) for applications to economics), we denote by k = 0, 1, . . . , 73 the degree centrality of each node, which in this case it is assumed to be fixed, i.e. we assume a common degree k for the hub of the star-shaped subgraphs. By considering the random seed of initial configuration, h and the degree k, we define G := G h,k = (P, E h,k ) as composition of the regular star-shaped graphs for the agents in P. Clearly, the cardinality of the set of arcs E h,k depends on k, so that e.g. graph G h,2 (m) will have 74 × 2 arcs, and all the agents will have degree centrality equal to 2 -i.e., each agent has two friends. For the sake of simplicity, and without loss of generality, we assume that E h,k1 ⊂ E h,k2 with k 1 < k 2 : i.e. an arc in a graph G h,k1 is also an arc in G h,k2 . Consequently, G h,k1 can be regarded as a subgraph of G h,k2 when k 1 < k 2 .

The utility function
We now introduce the functional form of formula (3) assumed by the simulations.
To this purpose, we begin with the component of agent's utility exerted from their location, U color . We introduce a pre-specified threshold x ∈ (0, 1) which drives Schelling's heuristic. We label x as Schelling's threshold. Specifically, x determines the maximum density of same-color neighbors required by i to be satisfied by her residential location, so that for eachv ∈ V and 1 • is the indicator function of the set •. Formula (6) gives that when x = 0, i is "color-blind" and does not benefit from any change of location when looking at the color of the surrounding agents. By contrast, when x = 1, i will enjoy any marginal increase in the number of same-color neighbours.
Next, we define the utility obtained from friendship, U f riend , as: where ∆(v, P i ) is the average Manhattan distance in (2) between i and her friends, i.e.: Then, we formalize the cost of moving, U moving , as: Wherec ∈ (0, 1) is the cost of moving between two adjacent cells and γ ∈ {0, 1} determines whether costs are fixed (γ = 1) or variable (γ = 0).
Finally, we turn to the responsiveness of i's utility to a change in U color , U f riend and U moving , and we set: where α ∈ [0, 1] and β ∈ [0, 1].
As a result, we can re-write formula 3 by using (6)-(10) and explicitating the Schelling's threshold x of the utility dependent on the color as follows:

Measures of segregation
Measuring the level of segregation adds an additional layer of complexity to our analysis. The level of agents' dissimilarity in a location is traditionally studied at the neighborhood level, where the boundaries of the residential area are exogenously defined (Massey and Denton, 1988). By contrast, here we are interested in the agent's level of segregation, which is endogenously determined by the agent's own location. For this reason, we prefer over standard metrics of segregation (Massey and Denton, 1988), the measurement provided by the Freeman Segregation Index (F SI) (Freeman, 1978), and the Moran's I index (Moran, 1950), which allow to assess the degree to which individuals with similar attributes are located close to one another when the neighborhood is self-referenced. Fagiolo et al. (2007) and Mele (2017) show that F SI can be profitably used to study agents' contiguity in a grid-like topological space, such as a torus, by using a graph perspective. Consistent with this approach and according to the model outlined above, we consider two groups of agents -the red and the blue oneswhose cardinalities are A and B, respectively, and label all the agents with an integer i = 1, . . . , A + B. We consider the friendship graph G and introduce its randomized version G h , where h = 1, . . . , H is the seed, as follows: agents represent the nodes and the generic entry w (h) i,j of the symmetric adjacency matrix W h is 1 when the two agents i and j are adjacent in the grid -according to formula (1) -and 0 otherwise. The maximum number of arcsN E in G h does not depend on h and is given by: while the maximum number of cross-group arcs is AB. Consequently, if agents are "color blind" and arcs are generated independently of each other, the probability of a given arc being a cross-group arc is: As a consequence, given the number of arcs in G, say N E , the expected number of cross-group arcs is E(N * E ) defined as follows: Given this formalization, F SI is obtained as: where N c E is the observed number of cross-group arcs. F SI varies between 0 and 1, and it may be interpreted as the proportion by which the expected number of cross-group links is reduced in observation. Specifically, a value of 0 indicates full integration, while a value of 1 corresponds to full segregation. Put differently, when F SI = 1, there is a positive autocorrelation in the spatial distribution of agents: i.e. blue and red nodes are located in different and non-contiguous areas. On the contrary, when F SI = 0, there is no autocorrelation present, i.e. blue and red nodes are distributed at random in the torus.
We complement the FSI, with the Moran's I index, which is calculated as: where z i is equal to 1 if i is red, and 0 if i is blue, andz = A+B i=1 zi A+B . The values of the Moran's I range in the interval [−1, 1]. When I = −1, then one has the maximum possible negative spatial autocorrelation: e.g. red agents are adjacent only to blue agents. When I = 1, there is the maximum level of positive spatial autocorrelation: e.g. each red agent is surrounded by red agents.
It is interesting to note that F SI and Moran's I are both correlated with another well-known index, that is Geary (1954)'s metrics G, a measure of spatial autocorrelation which goes from 0 (maximum level of positive autocorrelation) to 2 (maximum level of negative autocorrelation). Specifically, G is equal to the reciprocal of F SI, when G ∈ (0, 1) (Freeman, 1978), and it is inversely correlated with I (Anselin, 1995).
By virtue of this, F SI and Moran's I are positively correlated when I ≥ 0. However, they are not identical.
The former is more sensitive to local patterns of segregation, while the latter is better suited for detecting segregation at the global level. The reason is that F SI mimics the measurement of G, and Anselin (1995) has shown that G is more susceptible than I to local structures of segregation. We expect this difference to be preserved also when comparing F SI and I.

Simulation experiments, results and discussion
This section presents the simulation experiments, and discuss the results of our investigation. In order to disentangle the effect exerted by the different components of the utility function, as formalized in formula (11), a stepwise approach is adopted. First, we test plain Schelling's model, without moving costs and friendship connections. Next, we include the presence of moving costs, and then the presence of agents' connections. Finally, we present the case of Schelling's model and friendship, without moving costs, and in the extreme case of maximum Schelling's threshold x = 1.    (11)).
Model results are straightforward and consistent with the original Schelling model. When x = 0 (and, we stress it, agents assign no value to social connections: i.e., α = 1), homophily play no rule in agents' relocation choices. Agents are indifferent to the density of same-color people in the neighborhood, and they have no incentives to move. As a result, the initial configuration remains unchanged and social welfare is unaltered. By contrast, when there is a preference for neighborhoods characterized by a majority of samecolor agents, i.e. x ≥ 0.5, people begin to move, increasing the level of both segregation and social welfare.
Specifically, we observe that when x > 0.7, total segregation is almost reached, and approximately 50% of the population is involved in a change of location.

The Schelling's model with the moving costs
The role played by moving costs is to affect agents' location choices by mitigating the attraction force determined by their preference over homophily. In particular, this component of the agent's utility function discourages long movements and contrast the emergence of complete segregation. In order to show this effect, we simulate how the model initial configuration is changed for different levels of agents' responsiveness to either fixed or variable moving costs, i.e. with respect to β in [0, 1]. Specifically, we set x = 1, α = 1,c = 0.5 and the two extreme scenarios γ = 0 and γ = 1. The results of this exercise are presented respectively in Figure 4, where we impose a fixed cost on agents' moves, and in Figure 5, where we allow agent's moving costs to be variable. In both figures, the plots show the effect of a change in β, displayed on the x-axes, on one of the six outcomes considered, reported on the y-axis.
The robustness of these results is confirmed by further analyses presented in the Appendices, where we show that results are left qualitatively unchanged when replicating this exercise using low fixed costs  (11)).   (11)).

The Schelling's model with the moving costs and the networked individuals
In the third experiment, when α is different from 1, agents' degree centrality k is taken equals to 3, to highlight the difference between no friends and some friends. The scenarios for α are α = 1 (utility does not depend on the Schelling's heuristics) and α = 0.5, which means that agents assign equal weights to neighborhood composition and friends' distance. The value of β is set to 0.5, to represent a fair introduction of the moving costs in the utility. The impact of this parameter on the model outcome is alternatively tested by setting γ = 0 (i.e. fixed costs) and γ = 1 (i.e. variable costs). We also investigate changes in the model outcome when moving costs are removed by taking β = 1. The simulation experiments are performed by taking into account the sensitivity with respect to Schelling's threshold x.
We first refer to results in Figure 6. The introduction of the friendship network has a dramatic impact on the results. The force of attractiveness generated by the homophily preferences is now bonded by the different characteristics with which agents identify (i.e. the color and the social connection). Moreover, agents' movements are constrained by the tension exerted by friends' position, who are in turn attracted by their friends. We first focus on this latter element. When neighborhood composition is irrelevant, i.e.
x = 0, friendship drives homophily and generates two competing forces. The first is an attractive force, like a spring, which brings agents that are linked closer together. The second is a repulsive force, generated by the presence of multiple connections, which prevents long movements of people to the same area, and forces friends apart from each other. Put differently, network externalities are at play, and their effects cascade quite dramatically. As a result, agents act as if they were steel rings linked by springs, and any radical change in the original status quo is prevented: i.e., less than 25% of the population choose to change location and model convergence is reached with few iterations. It follows that total segregation is far from being reached in this setting.
However, when agents begin to care about the characteristics of their neighbors, x > 0, a significant change occurs on their preferences over the composition of their neighbors. This results in a reduction of the local inertia determined by network externalities, and the set of individual relocation choices expands.
This produces an increase of both segregation and social welfare, but interestingly, both outcomes remain significantly lower than those achieved in Figure 3, meaning that the introduction of the network has the simultaneous effect of reducing segregation and producing sub-optimal levels of welfare.
This finding provides an interesting insight. When homophily requires to combine multiple characteristics, agents find it difficult to find a neighborhood that improves her levels of welfare: e.g. a racially mixed neighborhood where the majority is composed by people of her own color, and the minority is represented by her social connections.  Bottom middle and right panels display respectively the average and the total social welfare of the agents at the end of the iteration process. Social welfare is obtained from i-th agent's utility function (equation (11)).  Bottom left panel shows the number of people who moved at least once in a simulation. Bottom middle and right panels display respectively the average and the total social welfare of the agents at the end of the iteration process. Social welfare is obtained from i-th agent's utility function (equation (11)).
When we set β = 0.5, then we observe a contribution to our analysis, regardless of whether we consider network effects or not. In fact, significant changes are registered neither when costs are fixed (Figures 7 and   8), nor when costs are variable (Figures 9 and 10), and results remain qualitatively the same. 10 All in all, the introduction of moving costs only produces a shift in the outcomes value.
The only difference found is when we consider the combination of high fixed moving costs and no friends (γ = 1, α = 1 andc = 0.99, see Figure    Bottom left panel shows the number of people who moved at least once in a simulation. Bottom middle and right panels display respectively the average and the total social welfare of the agents at the end of the iteration process. Social welfare is obtained from i-th agent's utility function (equation (11)). Each iteration is repeated 100 times by permuting the initial torus. On the abscisses, the Schelling's threshold x ranging in [0, 1]. Bold and ticked lines indicate respectively average value and standard deviation. Upper left panel indicates the number of iterations required for the model to converge. Upper middle and right panels report respectively the Moran's I and the FSI value obtained after model convergence. Bottom left panel shows the number of people who moved at least once in a simulation. Bottom middle and right panels display respectively the average and the total social welfare of the agents at the end of the iteration process. Social welfare is obtained from i-th agent's utility function (equation (11)). The color of the area indicates the two components of agents' utility after convergence is achieved: βαU color i (v; x) (lighter-colored area) and βαU f riend i (v) (darker-colored area).

An extreme case of Schelling's model and the networked individuals
The effect of the network on agents' location choice when neighborhoods composition matters is further investigated in this section. In the experiment summarized in Figure 11, Schelling's threshold is stressed by setting x equals to 1, meaning that agents are sensitive to any marginal change in their neighborhood composition. Moving costs are removed, by taking β = 1, while α = 0.5, which means that there is a fair contribution of Schelling's heuristics and friendships. Degree centrality k is let to vary iteratively, from 0 to 73. Therefore, now the abscisses of the plots reports the level of degree centrality, while the y-axes are used once again to register changes in the outcome values. For illustrative purposes, Figure 12 shows also various instances of the final torus configuration when increasing degree centrality.
As expected, when degree centrality is 0, the model replicates the last observation registered in the plots of Figure 3. Then, when agents form a friendship, a significant change occurs in the formation of individual homophily preferences. As a result, the utility exerted from positioning close to an agent is now equivalent to the utility obtained by locating in a neighborhood where all agents have the same color. In other words, we observe the configuration of a peculiar physical system unconstrained by the repulsive forces generated by the composition of the neighborhood or by multiple friendships. If agents choose a location close to their friend, this in turn has no need to relocate. Consequently, the utility obtained by the composition of the neighborhood suddenly drops, and we observe a significant decrease in the segregation indices. However, when k increases, agents begin to look for an equilibrium in between the distance from their friends and the neighborhood where they live in. In this attempt to manage multiple preferences, agents seem to give more importance to the composition of their neighborhood than to their friends location, since the utility obtained by the former factor increases, while the latter decreases. This might be due to the fact that agents find easier to locate in a neighborhood with specific characteristics and close to few friends, than finding a place that is suitable for all her friends. This is for example the case of agents 9 and 36, in the middle-left panel of Figure 12. Both of them are relatively close to one of their friends, and located in a neighborhood where all agents share her own color.
This is another important finding of this study. Competing characteristics do not equally matter in forming agents homophily preferences. Rather, certain characteristics featured by the agent tend to prevail in the definition of her own identity because it is easier to locate close to someone with that same characteristics (e.g. color over social linkages). Hence, even when agents assign the same importance to all their characteristics (e.g. α = 0.5), some of them will have a stronger impact on relocation choices. Each iteration is repeated 100 times by permuting the initial torus and network connections. On the abscisses, the degree centrality (number of friends) k, ranging from 0 to 73. Bold and ticked lines indicate respectively average value and standard deviation. Upper left panel indicates the number of iterations required for the model to converge. Upper middle and right panels report respectively the Moran's I and the FSI value obtained after model convergence. Bottom left panel shows the number of people who moved at least once in a simulation. Bottom middle and right panels display respectively the average and the total social welfare of the agents at the end of the iteration process. Social welfare is obtained from agents' utility function (equation (11)). The color of the area indicates the two components of agents' utility after convergence is achieved: βαU color i (v; x) (lighter-colored area) and βαU f riend This mechanism is even clearer if we consider the case where each individual is connected with more than a relatively small proportion of the population (c.a. 5-8%). In fact, when the number of friendships becomes too high, there is an increasing disutility in locating close to few friends: e.g. when degree centrality is 73, even if i is surrounded by all friends of her color, she is still far from 65 friends. This implies that as the degree increases, the location of friends becomes somewhat indifferent to agents, because for each friend found in one place, there will be many others left far apart, and most of the utility is obtained by the composition of the neighborhood: this is for example the case of agent 44, who despite the increase in her degree centrality, she remained consistently in her starting locations, next to 3 blue nodes, in all panels of Figure (12).
Moreover, it is worth stressing that because α = 0.5, competing characteristics counteract each other, even if one of them is producing a disutility (e.g. social connections). Put differently, agents are able to cope with the disutility derived from one of their characteristics and maintain social welfare constant by letting Schelling's heuristic prevail over other utility's components in their relocation choices.

Discussion and Conclusions
This paper presented an extension of the original racial and residential segregation model by Schelling, i.e. "chequerboard model". Specifically, the aim was to investigate whether and how model's predictions can be improved in order to incorporate solutions of limited segregation equilibria.
The evidence provided by our simulations suggests that a possible explanation for the formation of racially mixed areas might be the presence of moving costs and the effect of social linkages. Moving costs, regardless of whether they are fixed or variable, consistently determines phenomena of local inertia, preventing agents to leave their neighborhood for another that better suits with their set of preferences. Interestingly, a similar outcome is observed when agents have a stronger preference for social linkages over Schelling's heuristic. In this case, agents' movements are constrained by the tension exerted by friends' position, who are in turn constrained in their movements by their friends. Perhaps unexpectedly, local inertia is found also to be associated with lower levels of social welfare.
Another interesting insight provided by our study is that, whenever homophily effects are constrained by the existence of competing characteristics with which agents equally identify (e.g. ethnicity and social connections), certain characteristics tend to prevail in the formation relocation choices. The reason is straightforward. It is easier for agents to identify a neighborhood where only one characteristic is predominant. Future research should be dedicated to understand what are these characteristics that tend to define one's own identity and drive relocation choice. This investigation has also highlighted that whenever homophily requires to combine multiple characteristics, the generic agent finds it difficult to find a neighborhood that will improve her levels of welfare: e.g. a racially mixed neighborhood where the majority is composed by people of her own color, and the minority is represented by her social connections. This suggests that suboptimal levels of welfare might be endemic in context where multiple elements concur to the definition of one's own identity.   The very general setup of the model allows many interesting extensions that we leave for future research.
In the present model we kept Schelling's heuristic and the structure of the friendship network separated.
This was done on purpose in order not to mix the effects of the two, but this modeling choice implies that the process shaping the racial distribution of friends is purely random and is not determined by a preference for homophily. Evidence is at odd. As recalled by (Jackson, 2019, p.109), simple accounting tells us that individuals in the minority group will end up having more friends from the majority group on average than individuals from the majority have with ones in the minority group. Considering homophily this effect would be magnified, rationalizing the striking evidence reported by Jackson: "Guess how many black friends the typical white person in the U.S. has -where a friend is someone with whom that person 'regularly discussed important matters' ? Zero." If friendship formation is lead by homophily, the two processes shaping Finally, the evidence of power laws, fat tails, Pareto and scale free degree distributions is typical of social networks (Newman, 2005;Goyal, 2009). The model's assumption of a uniform distribution of friends is purely exemplificative and can be modified at no particular cost. In this case, centrality and degree heterogeneity would start to influence the segregation equilibria, since the network externality is associated to node centrality and the movement of central nodes brings a greater influence on the decision of poorly connected nodes. Similar extension can be applied to a social linkages that are directed and or weighted.

Appendix A. Figures: Low moving costs
This appendix extends our analysis and presents additional results replicating the simulations in Section (4) with lower levels of moving costs (c = 0.01) with respect to the main analysis (c = 0.5). Please, see footnote 10 for the details of the selected parameter set.
In Figures (11)). The color of the area indicates the two components of agents' utility after convergence is achieved: βαU color i (v; x) (lighter-colored area) and βαU f riend i (v) (darker-colored area).     (11)). The color of the area indicates the two components of agents' utility after convergence is achieved: βαU color i (v; x) (lighter-colored area) and βαU f riend i (v) (darker-colored area).

Appendix B. Figures: High moving costs
This appendix extends our analysis and presents additional results replicating the simulations in Section (4) with higher levels of moving costs (c = 0.99) with respect to the main analysis (c = 0.5). Please, see footnote 10 for the details of the selected parameter set.
In Figures Appendix B.1 and Appendix B.2, we progressively increase the responsiveness of i's utility to a change in moving costs (β), when these are respectively fixed and variable. The results show that most model outcome remains qualitatively unchanged with respect to the main analysis when considering fixed moving costs (see for comparison Subsection 4.2 and Figure 4): i) there is a monotonic relation between agents' level of responsiveness and the number of individual movements; ii) model outcome tends to mimic Schelling's result when the role of moving cost becomes least significant (i.e. high values of β); and iii) there is a negative relation between moving costs and social welfare. There is only a significant difference with respect to the main analysis, and this is the level of responsiveness of the model outcome when β is low and agents are most subject to moving costs. In these cases, there are no incentives to move: i.e. the process stops after one simulation and the initial configuration of the grid remains unaltered. When considering the case of variable moving costs instead (see for comparison Subsection 4.2 and Figure 5), things change radically. The choice to relocate has such a negative impact on agents' utility in this context, that relocation constraints are substantially the same regardless of the value of β. Agents move in the same way, and the same segregation dynamics are observed whenever β > 0: i.e., both number of iterations and moving people, and of segregation and welfare indexes remain constant regardless of the value of the parameter.
For comments on the rest of the figures contained in this appendix, the interested reader may refer to the end of Section 4.3, which already contains a discussion on the significant differences between the main analysis and the case of high fixed costs.  (11)).  (11)).  (11)). The color of the area indicates the two components of agents' utility after convergence is achieved: βαU color i (v; x) (lighter-colored area) and βαU f riend i (v) (darker-colored area).  (11)).  (11)). The color of the area indicates the two components of agents' utility after convergence is achieved: βαU color i (v; x) (lighter-colored area) and βαU f riend i (v) (darker-colored area).