A network model of immigration: Enclave formation vs. cultural integration

Successfully integrating newcomers into native communities has become a key issue for policy makers, as the growing number of migrants has brought cultural diversity, new skills, and at times, societal tensions to receiving countries. We develop an agent-based network model to study interacting"hosts"and"guests"and identify the conditions under which cooperative/integrated or uncooperative/segregated societies arise. Players are assumed to seek socioeconomic prosperity through game theoretic rules that shift network links, and cultural acceptance through opinion dynamics. We find that the main predictor of integration under given initial conditions is the timescale associated with cultural adjustment relative to social link remodeling, for both guests and hosts. Fast cultural adjustment results in cooperation and the establishment of host-guest connections that are sustained over long times. Conversely, fast social link remodeling leads to the irreversible formation of isolated enclaves, as migrants and natives optimize their socioeconomic gains through in-group connections. We discuss how migrant population sizes and increasing socioeconomic rewards for host-guest interactions, through governmental incentives or by admitting migrants with highly desirable skills, may affect the overall immigrant experience.


I. INTRODUCTION
maintain active cooperation. Another key role will be played by the fraction of immigrants joining the total population as the immigrant-to-host ratio changes the cultural adjustment timescales. As we outline below, a high immigrant ratio increases the likelihood of in-group connections and reduces communication between immigrant and host populations.
In Section II, we introduce our network model, the mechanisms that govern the evolution of social connections, and the utility function for immigrant-host interactions. In Section III we examine the parameter dependence of our model and show how processes unfolding over different timescales lead to different outcomes of immigration integration. Finally, we conclude in Section IV with a discussion on sociological and policy implications.

II. THE MODEL
Our basic model consists of a network whose nodes symbolize immigrant or native agents connected by edges that represent social links. Each node is also associated with an attitude and a utility function that depend on its connections and that determine an agent's socioeconomic status. Over time, nodes change their connections and attitudes as they seek to increase their utility; as a result the network evolves towards integration or segregation between immigrant and host communities.

A. Network
Within our network model a node represents a social unit, such as an individual or a collection of individuals, and is labeled as a "guest" or a "host", depending on whether it belongs to the immigrant or native group. Each node, indexed by i, is characterized by an "attitude" variable x t i at time t, which varies between −1 ≤ x t i ≤ 0 for guest nodes and in 0 ≤ x t i ≤ 1 for host nodes. Hence the sign of x t i is used to distinguish the group identity of the node. The magnitude |x t i | indicates the degree of hostility that node i harbors towards those belonging to the other group. Thus, x t i → 0 ± characterizes most receptive guests or most hospitable hosts, while x t i = ±1 represents the highest level of xenophobia. Moreover, we define Ω t i as the "social circle" of node i at time t, which is a set containing all nodes directly connected to node i at time t. We assume that there are a fixed number of N h host and N g guest nodes, with varying attitudes. All nodes N = N h + N g seek to maximize their utility function as defined below.

B. Utility Function
The dynamics of our network is driven by the utility function U t i assigned to each node i. Each player seeks to maximize U t i by shifting its attitude x t i , and by forging and severing connections with other nodes. We model the utility U t i of node i at time t via two components: a reward function u t ij for interacting with node j, and a cost function c(m t i ) for maintaining m t i connections so that The pairwise reward function u t ij depends on the attitude difference |x t i − x t j | between connected nodes i and j; the smaller the attitude difference, the higher the reward. For a pair of nodes from the same group, i.e. if both i and j are hosts or immigrants, maximizing u t ij implies x t i = x t j leading to consensus within the group. If i and j are nodes from different groups, u t ij is maximized by both sides adopting more cooperative attitudes such that x t i → 0 − and x t j → 0 + . Hence, the value of x t i that will maximize U t i will depend on the composition of Ω t i and the attitudes x t j of its members. The parameter σ controls the sensitivity of the reward, while the amplitude A ij specifies the maximum reward attainable when x t i = x t j . In principle, A ij may depend on the specific socioeconomic attributes of the interacting i, j pair. For simplicity we let A ij be one of two discrete levels; A ij = A in for in-group interactions, where nodes i and j belong to the same group, both hosts or both migrants, and A ij = A out for out-group interactions between nodes i and j of different groups. The cost function c in Eq. 1 is a function of m t i = |Ω t i |, the number of connections sustained by node i at time t, which by definition is also the cardinality of the social-circle set Ω t i . We assume that the cost to maintain connections increases exponentially with m t i through a scaling coefficient α. A smaller Negative values, depicted in red, indicate guest nodes; positive values represent hosts, colored in blue. The magnitude |x t i | represents the degree of hostility of node i towards members of the other group. Each node is shaded accordingly. All nodes j, k linked to the central node i represent the green-shaded social circle Ω t i of node i at time t. The utility U t i of node i depends on its attitude relative to that of its m t i connections in Ω t i and on m t i . Nodes maximize their utility by adjusting their attitudes x t i and by establishing or severing connections, reshaping the network over time.
α value results in a steeper increase of cost, leading to fewer average connections per node. Note that such a cost function penalizes nodes with too many connections, suppressing the likelihood of "hub" nodes of high connectivity, a hallmark of small world networks that characterizes many real world social networks. In more realistic settings, the cost of maintaining social connections depends on more nuanced characteristics of each individual (wealth, fame, age, community status), allowing some to sustain higher degrees of connectivity than others. For simplicity our model does not include these considerations.
where κ is the timescale associated with attitude adjustment. Large values of κ indicate longer adaptation times. We select different nodes j = for remodeling network connections and adjusting attitudes to avoid the emergence of any systematic biases.
In the above steps, all unweighted random selections are made through a uniform probability. As presented, our algorithm alternates between remodeling network connections and making attitude adjustments. Note that when steps 1-4 are repeated on all N nodes, t advances to t+1, and that, on average, each node makes decisions once within this unitary time step. Thus, the timescale for network remodeling is one. The timescale for attitude adjustment, instead, is given by κ scaled by the probability for node i to be paired with node carrying a different attitude. We can approximate this probability as the fraction of out-group connections, N g /N for hosts and N h /N for guests, so that the guest adjustment timescale τ h can be estimated by τ h ∼ κN/N g , and the host adjustment timescale τ g by τ g ∼ κN/N h . An important observation is that U t i can reach its maximum U max i if |x t i − x t j | → 0 within connected components of the network. This can be achieved in two different ways: i) through actual consensus where all nodes carry a neutral attitude x t i → 0 so that in-group and out-group connectivities are equally likely, or ii) through a segregated network with homogeneous clusters made of all guests or all hosts, where non-zero but uniform attitudes are maintained in each cluster, so that |x i − x t j | → 0 does not necessarily imply x t i → 0. Although these two different network configurations lead to the same maximal utility, only the first one will be considered a true hallmark of harmonious integration, since attitudes are the most open on both sides, and there is minimal differentiation between intra-group or out-group connectivity. The second case instead represents the creation of parallel societies, with each group self-segregating into its own homogeneous enclave, maintaining little contact with "the other".

D. Initial Conditions
All model parameters and typical values are listed in Table I. Unless otherwise specified, our network simulations are performed using the initial conditions described here. We mostly simulate N = 2000 nodes, within which N h = 1800 are hosts and N g = 200 are guests. In Section III A we also simulate the setting of N g = 20 and N h = 1980 to examine the effect of extremely small fractions of guests. The initial attitudes are set at x 0 i = 1 for all host nodes, and x 0 i = −1 for all guest nodes, assuming that before the two groups make any contact they have minimal knowledge on how to coexist. For initial connections, we mostly use the following two extreme and opposite scenarios. One is that host and guest nodes are randomly connected with uniform probability, yielding on average ten connections per node at t = 0. Simulated network dynamics leading to (a) complete segregation, and (b) integration between guest (red) and host (blue) populations. Shading of node colors represents the degree of hostility |x t i | of node i towards those of its opposite group, according to the color scheme shown in Fig. 1. Initial conditions are randomly connected guest and host nodes with attitudes x 0 i,guest = −1 and x 0 i,host = 1. Other parameters are N h = 900, Ng = 100, α = 3, Ain = Aout = 10, σ = 1. The two panels differ only for κ, the attitude adjustment timescale, with κ = 1000 in panel (a) and κ = 100 in panel (b). (a) For slowly changing attitudes (κ = 1000), hostile attitudes persist over time, eventually leading to segregated clusters. (b) For fast changing attitudes (κ = 100), guests initially become more cooperative, as shown by the lighter red colors. Over time, a more connected host-guest cluster arises with hosts eventually adopting more cooperative attitudes as well.
The other is that hosts are connected to each other and that no guests are present. Host connectivity is determined by allowing the system to equilibrate in the absence of guests, representing the natural state of the community before the arrival of immigrants. Guests are introduced at t = 0 as nodes without any links to either hosts or fellow guests. Note that because of the definition of the utility function in Eq. 1, and because we allow the host community to equilibrate prior to inserting guests, we expect each host to be connected to an average number of α ln (αA in ) other hosts at t = 0. The first initial condition scenario represents a perfectly executed welcoming program for immigrants, providing with them sufficient social ties to connect to the native community. In the second initial condition scenario, such a welcoming program does not exist at all, and guests arrive in a completely foreign environment.
III. RESULTS Figure 2 shows two representative outcomes of our network model at steady state. In Fig. 2a guests (red circles) and hosts (blue circles) segregate and maintain highly hostile attitudes, as illustrated by the dark red and blue shades of the right hand panel. Cross-group utilities at the beginning of simulations yield low rewards which do not increase over time, leading to the severing of all ties between hosts and guests at t → ∞. In Fig. 2b guests adopt more cooperative attitudes as represented by the lighter red colors. Such attitudes increase cross-group rewards so that guests and hosts stay mixed. Hosts will also become more cooperative, although at slower timescales than guests.
The two configurations shown in Fig. 2 represent two ways through which U t i in Eq. 1 is maximized. The configuration in Fig. 2a arises by cutting all cross-group links to form enclaves, within which guests and hosts adopt uniform but different attitudes x i,guest = x i,host = 0. The configuration in Fig. 2b emerges through cooperative attitudes x i,guest = x i,host = 0 for all players. Both lead to |x t i − x t j | → 0 as t → ∞. To which of these two basins of attraction society converges, will depend on parameter choices and initial conditions as discussed below.

A. Maximizing utilities via network remodeling and attitude adjustment
For a more quantitative perspective, we now examine how the utility function U t i and the attitude profiles x t i vary over time in some sample simulations. We set the model parameters to α = 3, A in = A out = A = 10, and σ = 1, and let κ vary between 100 and 1000 with N = 2000 and N g = 200 or N g = 20. The assumption A in = A out = A leads to a maximum in the utility U t i = U max i = αA[ln(αA) − 1] which is reached if all connected nodes conform their attitude so that |x t i − x t j | → 0 for any linked i, j pair and when each node i has m t i = m opt = α ln(A in α) links. For our chosen parameters, m opt = 10 connections and U max i = 72. Since we are interested in how immigrants adapt to their host environment, we will mainly focus on quantities associated with guest nodes. Although host node properties will also dynamically evolve, relative changes to their attitudes x t i and connections will be much slower than that of guests due to their overwhelming majority. Initial conditions are chosen so that guests and hosts are randomly connected to each other as described in Section II D. For N g = 200 the relatively large number of guests allows for segregated clusters to emerge and persist with m opt = 10 in-group connections. For N g = 20 the low number of guests either leads to smaller in-group guest clusters with less-than-optimal number of connections (m opt < 10), or forces host-guest mixture to reach m opt = 10. We will first examine network remodeling and attitude adjustment independently of each other, and later the interplay between the two mechanisms. Figure 3 shows the temporal evolution of the average utility U t i guest per guest node and the average attitude of guests and hosts x t i guest x t i host for sample simulations of N g = 200 (Figs. 3a and 3b) and N g = 20 (Figs. 3c and 3d) guest nodes with N = 2000 total nodes. In the red-solid curves we only allow for network remodeling, and deactivate attitude adjustment. Vice-versa, in the blue-dashed (κ = 100) and green-dotted curves (κ = 1000) we only allow for attitude adjustment and deactivate network remodeling. Finally, the purple dotted-dashed curve (κ = 100) and the magenta-double-dotted-dashed curve (κ = 1000) are results from the full model, where both network remodeling and attitude adjustment are implemented.
As can be seen in Fig. 3a for N g = 200, U t i guest increases over time towards U max i = 72 for all five chosen cases. When only network remodeling is allowed (red-solid curve), U t i guest increases quickly at the onset of the dynamics as nodes efficiently exchange low-utility, out-group connections for high-utility, in-group ones. As the number of exchanges nears completion, U t i guest increases at a slower rate, until it converges to the steady state at U max i = 72 with optimal, high-utility connections that are mostly in-group. Guests have established their own self segregated communities and thrive within it. When only attitude adjustment is activated (blue-dashed κ = 100 and green-dotted κ = 1000 curves), nodes can only change their attitude and not their connections, hence they tend to evolve towards conformity (|x t i − x t j | → 0 for all nodes i, j). Note that if i, j are a guest-host pair respectively, conformity will only arise from i guest depends solely on attitude adjustment, its dynamics will vary on the same timescale as x t i , given by τ g = N/N h κ. In the case of fast attitude adjustment (blue-dashed curve for κ = 100), the early rise of U t i guest can be more pronounced than in the case of network remodeling (red-solid curve), as can be seen for short times (t 2000) in Fig. 3a. However, the utility at steady state U ss i guest under attitude adjustment is lower than under network remodeling, regardless of κ. This is because when only attitude adjustment is allowed, network connections cannot be rearranged, resulting in a less-than-optimal connectivity that changes to x t i can only partially alleviate. Having network adjustment as the sole mechanism at play allows for more flexibility, since, although x t i cannot change, a given node can actively search for others with similar attitude and even increase its number of connections. We verified that when only one of the two mechanisms is allowed, attitude adjustment consistently leads to less optimal outcomes compared to network remodeling for a number of parameter choices and initial conditions. These trends are confirmed and better elucidated by inspecting the average attitudes of guests −1 ≤ x t i guest ≤ 0 and hosts 0 ≤ x t i host ≤ 1 as a function of time in Fig. 3b. We use the same parameter sets and initial conditions as in Fig. 3a and the same color-coding scheme. The red-solid curves correspond to the case where we only allow for network readjustment and attitudes stay unmodified, so x t i guest = −1 and x t i host = 1 for all times. The blue-dashed and green-dotted curves, where only attitude adjustment is allowed show that as t increases, x t i guest → 0 − at a faster rate, and that x t i host → 0 + at a much slower one. This is easily understood. Since nodes are not allowed to rewire their connections, they can only adapt their attitudes as discussed above, and provided the network is connected and no isolated clusters exist, all nodes will eventually conform to x t i → 0. However, being a numerical minority in the network, guests, for which x t i,guest ≤ 0, will share a large number of connections with hosts, for which x t ,host ≥ 0. Under this condition, the adaptation rules presented in Sec. II C drive guests towards conformity more than hosts, so that x t i guest → 0 − faster than x t i host → 0 + . Hence, the early increases in U t i guest when only attitude adjustment is allowed and observed in Fig. 3a (blue-dashed κ = 100, and green-dotted κ = 1000 curves) can be attributed to fast adaptation of guests with time scale τ g = κN/N h , and the later increases to slow adaptation of hosts with time scale τ h = κN/N g τ g . The dynamics of the full model (purple-dotted-dashed κ = 100, and magenta-double-dotted-dashed κ = 1000 curves) depend on the interplay between the two mechanisms at play, attitude adjustment and network remodeling, and the respective timescales in gaining utility. From Fig. 3a, U t i guest for the full model with fast attitude adjustment (purpledotted-dashed, κ = 100) follows the attitude adjustment (blue-dashed, κ = 100) curve at early times, later shifting towards the network remodeling (red-solid) curve. Guests thus find it more advantageous to first adjust their attitudes, and then modify their network connectivity. Similarly, Fig. 3b shows x t i guest → 0 − as t → ∞, following the curve where only attitude adjustment is allowed. The convergence of x t i host → 0 + is slower because network remodeling Parameters are α = 3, Ain = Aout = 10, and σ = 1, and κ = 100 (faster) and κ = 1000 (slower) attitude adjustment. Initial attitudes are x 0 i,host = 1 and x 0 i,guest = −1, with random connections between nodes so that on average each node is connected to m 0 i = 10 others at t = 0, representing full insertion of guests into the community. Network remodeling (solid-red curve) and attitude adjustment (blue-dashed and green-dotted curves) are considered separately; their interplay is illustrated in full model simulations (purple-dot-dashed and magenta-double-dotted-dashed). Utility is increased in all cases, but attitude adjustment is more efficient at the onset due to the initially set cross-group connections. Network remodeling allows for higher utilities at longer times. For the full model, fast adjustment (κ = 100) leads to well integrated societies for Ng = 200 as t → ∞, given that x t i host → 0 + and x t i guest → 0 − ; for Ng = 20 hosts and guests segregate, with guests adopting collaborative attitudes, allows the many hosts to replace their relatively few out-group connections with conspecifics. Eventually however, both guests and hosts converge towards integration, with x t i guest → 0 − , x t i host → 0 + . In contrast, U t i guest for the full model with slow attitude adjustment (magenta-double-dotted-dashed κ = 1000) follows the network remodeling (red-solid) curve at all times. Here, guests find it more advantageous to change their connectivity, preferentially creating links to other guest nodes, rather than modify their attitudes towards host communities. Indeed attitudes converge to x t i guest → −0.34 and x t i host → 0.95 as t → ∞, with no further attitude adjustment possible. This example illustrates the central role played by κ in the dynamics: low values of κ, indicating relatively short times for attitude adjustment τ g , τ h , lead to harmonious societies with x i → 0 for all nodes, while larger values of κ, indicating longer times for attitude adjustment, lead to segregated communities.
In Figs. 3c and 3d we show U t i guest and x t i guest for a smaller immigrant population, N g = 20 and the same parameters as in Figs. 3a and 3b. We observe the same qualitative increase of utility in each of the five cases as discussed above. Discrepancies with plots obtained for N g = 200 mainly emerge when only attitude adjustment is allowed (blue-dashed κ = 100, and green-dotted κ = 1000 curves). Here, the early increase of utility is faster than for N g = 200, but steady state is reached at a much slower rate. The overwhelming majority of hosts drives guests to rapidly adjust their attitudes, increasing U t i guest at short times. By the same token, the host majority will not significantly change its attitude, so that guests can further increase their utility only by remodeling their connectivity. Indeed, the corresponding curves in Fig. 3d show guests rapidly converging to x t i guest → 0 − for all cases, while x t i host does not. Note that as long as the network is initially connected and no isolated clusters exist, when only attitude adjustment is allowed, x t i host → 0 + as t → ∞, although the process may be slow. For N g = 20, due to the low number of guests, there is a higher probability than for N g = 200 of initiating the model with isolated host-only clusters. For these clusters, if only attitude adjustment is allowed, attitudes will stay quenched at x t i host → 1. As a result, the overall x t i host will converge towards a non zero value. In the case of the full model (purple-dotted-dashed, κ = 100 and magenta-double-dotted-dashed κ = 1000) we see a similar trend x t i guest → 0 − , while x t i host → 0.93 for κ = 100, and x t i host → 0.99 for κ = 1000 as t → ∞. Segregated host communities arise, with the numerically lesser guests adapting to the majority.

B. Quantifying outcomes of integration
The above results lead us to seek measures to better understand the topology of the network as a function of time, specifically from the guest standpoint. To this end, we introduce an integration index I t int as the relative number of out-group connections of a guest node, averaged over all nodes, and scaled by the host population fraction Here, N h /N is the time independent host population fraction and m t i,out is the number of out-group connections; the ratio m t i,out /m t i is averaged over all guest nodes. A guest-only enclave for which m t i,out = 0 leads to I int = 0. Conversely, in a uniformly mixed guest-host configuration, m t i,out /m t i , should not be too dissimilar from the host population fraction N h /N , leading to I t int → 1. As defined, 0 ≤ I t int ≤ N/N h . At I max int = N/N h ≥ 1 guest nodes preferentially connect to hosts, shunning other guest nodes. We refer to this outcome as reverse segregation.
While I t int measures the connectivity between guest and host nodes, another relevant measure is the fraction of the reward u t ij that arises from cross-group interactions. This is important, as guests connecting predominantly to host nodes may not necessarily be an indicator of balanced socioeconomic growth. For example, even for large values of I t int 1 hosts may share large rewards among themselves but very little with guests, representing a two-track society where guests, although connected, are not part of the mainstream socioeconomic activity.
In a perfect scenario, guests and hosts form an all-connected network, with N g N h out-group, host-guest connections among the total N (N − 1)/2 edges. If the reward is distributed equally among all edges, the ratio of out-group connections is given by 2N g N h /N (N − 1). We thus define an out-group reward fraction v t out as follows v t out ≡ i∈guests j∈hosts u t ij i∈all nodes (j =i)∈all nodes The first term on the right-hand side is the fraction of reward shared between guests and hosts with respect to the total. We then renormalize this quantity by the ratio 2N g N h /N (N −1) derived above for the perfectly mixed scenario. As a result, v t out = 1 indicates a connected network with no isolated clusters and with rewards equally spread among all nodes. Instead, v t out = 0 points to complete segregation, where no socioeconomic reward comes from cross-group activities. Note that v t out can exceed unity if the cross-group economy is more flourishing than intra-group growth. The dynamics of I t int and v t out under the same parameter choices and mechanisms used to plot Fig. 3 are shown in Fig. 4. We first discuss the case of N g = 200, in Figs. 4a and 4b. If we allow only for network remodeling (red-solid curves), the system will evolve towards segregation (I t int → 0 in Fig. 4a and v t out → 0 in Fig. 4b).
Here, since attitudes cannot change, nodes will maximize their utility through in-group connections and by creating insular communities. In the blue-dashed and green-dotted curves we deactivate network remodeling and only allow for attitude adjustment, with κ = 100, 1000 respectively. As can be seen from Fig. 4a I t int 1 at all times since the random connections assigned at t = 0 are fixed and guest and host nodes remain well mixed in time. Fig. 4b shows that as cooperative attitudes emerge, cross-group rewards v t out increase. In the case of fast attitude adjustment κ = 100 (blue-dashed curve), when nodes are completely cooperative, v t out → 1 as t → ∞, while in the case of slow attitude adjustment κ = 1000 (green-dotted curve) convergence to v t out → 1 is slower. Results for the full model reveal the subtle interplay between network remodeling and attitude adjustment. At early times I t int follows the network remodeling case only (red-solid curve) for both κ = 100 and κ = 1000. In both scenarios guests progressively severe their ties to hosts, due to their low utility. At the same time, attitude adjustment increases cooperativity on the given initial connections and v t out temporarily increases. Eventually ineffective cross-group connections are completely eliminated under slow attitude adjustment (magenta-double-dotted-dashed, κ = 1000) where I t int → 0 and v t out → 0 as t → ∞. Under fast attitude adjustment (purple-dot dashed, κ = 100) instead cross-group connections contribute to the utility, so that I t int → 0.6 and v t out → 0.6 as t → ∞. Note that I t int and v t out converge to the same value as t → ∞ since |x t i − x t j | → 0 for both in-group and out-group connections. As a result, the distribution of rewards directly reflects the fraction of cross-group connections.
Taken together with results shown in Fig. 3a and 3b, the above dynamics confirm the crucial role played by κ, the attitude adjustment timescale, in determining societal outcomes. For the chosen parameters and when the full model is considered, more rapid attitude adjustment (κ = 100) leads to a more integrated society with I t int , v t out reaching non-zero values as t → ∞, and with x t i guest → 0 − and x t i host → 0 + . All these are hallmarks of a well-mixed, functional society, where guests and hosts share links, their socioeconomic progress is intertwined, and groups are not hostile to each other. On the other hand, slower attitude adjustment (κ = 1000) leads to a segregated society, where I t int → 0, v t out → 0, and where x t i guest and x t i host converge to non zero values as t → ∞. In this case, there are no links connecting guests and nodes, there is no shared socioeconomic interest, and groups are hostile to each other. Society is fragmented and parallel societies have emerged. Note that these two opposite outcomes emerge from the same set of parameters, with the exception of κ.
Because of their superior number, it is the attitudes of hosts in particular that play a fundamental role in determining whether a society is segregated or not. This is consistent with findings from several surveys and societal observations [11,12]. Recall that our initial conditions were set at x i,host = 1, the most inhospitable. Figs. 4a and 4b show that this hostile environment drives the immigrant population towards segregation, unless attitudes can easily change, i.e. for small κ.
Results for N g = 20 confirm the above scenario, with a small difference. Here, I t int → 0, v t out → 0 for both values of κ = 100, 1000 as t → ∞, while x t i guest → 0 − and x t i host converge to values that deviate only slightly from unity. In this case, the very few guests must initially interact with the many hosts and their attitude will become cooperative. Hosts on the other hand will not necessarily link to guests, and due to their numerical superiority can remain hostile towards them. Over time, separated enclaves of hosts and guests will emerge, with guests keeping their cooperative attitude, but in isolation from hosts, while hosts will largely remain in the same state as at the onset of the adaptation process. In this case, in order for a more cooperative society to emerge the value of κ must be even smaller. We have verified this numerically, finding that for N g = 20, κ 40 in order for a more integrated society to emerge.  Fig. 3, with initially cooperative hosts and uncooperative guests at x 0 i,host = 0 + and x 0 i,guest = −1. (a) I t int decreases at the onset, eventually rising towards integration, where I t int → 1 as t → ∞. The initial decrease is more pronounced for slow attitude adjustment (κ = 1000) and for larger guest populations (Ng = 200) as described in the text. (b) v t out increases over long times as attitude adjustment allows for more cooperation between guests and hosts. Under slow attitude adjustment (κ = 1000) and large guest populations (Ng = 200), v t out decreases at the onset, with players seeking in-group connections. As guests and hosts become more cooperative v t out increases.

C. Initially hostile host attitudes drive immigrants into enclaves
The importance of initial attitudes is further examined in Fig. 5, where at t = 0 hosts are extremely hospitable and x 0 i,host = 0. Initial guest attitudes remain uncooperative at x 0 i,guest = −1. All other parameters are set as in Figs. 3 and 4. Curves in Fig. 5a and 5b arise from the full model and should be compared to their counterparts in Fig. 4a  and 4c.
In Fig. 5a we plot I t int . As can be seen, guests and hosts are no longer completely segregated. At early times, I t int decreases due to network remodeling, however at intermediate times, guests become more cooperative so that x t i,guest → 0 − and I t int → 1 for long times. The early decrease of I t int is more significant for κ = 1000, since slow attitude adjustment leads to ineffective cross-group links and network remodeling will induce segregation. The decrease of I t int is also relatively more significant for N g = 200 than for N g = 20 under the same value of κ. This is because a larger guest population, and a larger τ g = κN/N h will more slowly evolve its initially hostile attitudes, allowing for segregation to cut cross-group, ineffective connections. In Fig. 5b, we plot v t out which increases at early times in all cases except for N g = 200 and under slow adjustment κ = 1000. This is due to network remodeling. As discussed above, the slow attitude adjustment prompts nodes to seek in-group connections at early times; the guest population is large enough to allow for this leading to segregation with I t int 0.5 and an initially decreasing v t out for the red-dashed curve. Due to the cooperative attitude of hosts however, guest eventually change their attitudes so that x t i,guest → 0 − , and I t int and v t out increase. One interesting finding is that when initial host attitudes are hostile, as shown in Figs. 4c and 4d, a larger guest population more effectively drives host attitudes towards cooperation. In contrast, when initial host attitudes are hospitable, as shown in Fig. 5a, a larger guest population results in less integration. In this case, the larger guest population is more resistant to attitude changes, and segregation may more easily emerge.

D. Higher initial connectivity facilitates better integration
The initial social connections assigned to migrants upon arrival may affect integration outcomes. As discussed in Section II D, one ideal scenario is that of welcoming programs that provide guests with prearranged social connections to hosts (I 0 int = 1), another is that of completely isolated guests arriving in an already connected native society (I 0 int = 0). In previous sections we only implemented these two extremes, perfect connectivity or total isolation. In this section we will consider more realistic, intermediate levels of initial guest connectivity. Figure. 6 illustrates the effects of three initial configurations: well connected guests, I 0 int = 0.91 (blue-solid curve), intermediately connected guests, I 0 int = 0.37 (green-dashed curve), and poorly connected guests I 0 int = 0.06 (red-dotted curve). Initial attitudes are uncooperative, x 0 i,host = 1 and x 0 i,guest = −1. All model parameters are the same as in Fig. 3 with N g = 200 and κ = 100.
The time evolution of I t int for all cases is shown in Fig. 6a. Here, I t int decreases at early times until guests and hosts begin adopting more cooperative attitudes. For the initially well connected case (blue-solid curve), I t int drops to I int 0.5 before the trend is reversed at t ∼ 1000. For the initially intermediately connected case (green-dashed curve), the decreasing trend is not reversed until t 2500 when I t int 0.1. Finally, for the initially poorly connected case (red-dotted curve) attitude adjustment cannot give rise to cooperation before I t int → 0 and host and guest communities are fully segregated. Mirroring trends are seen in Fig. 6b where we plot the out-group reward fraction v t out . When guests are poorly connected at the onset (red-dotted curve), few links exists through which attitudes can change, guests become progressively segregated, and very little socioeconomic activity is shared. Hence, v t out → 0 throughout. For the other two cases when there is more initial connectivity at the onset v t out increases at early times (blue-solid and red-dotted curves) as guests adopt cooperative attitudes (x t i,guest → 0 − ) through these initial guest-host connections. Later, network remodeling causes v t out to decline as cross-group connections are replaced with in-group ones. At longer times, host attitudes also evolve towards cooperation (x t i,host → 0 + ) from residual guest-host connections. Here, network remodeling no longer favors in-group connections, and v t out increases once more. Although these results point to the importance of an initial network of connections for immigrants, in reality very few of them will have a support system upon arrival. Many host countries may not have adequate resources or programs to foster such contact, and host and guest communities may view each other with suspicion. In the rest of this paper we attempt to identify best practices leading to integration, and look at how results vary depending on model parameters. We will consider a realistic, worst case initial condition: that of an initially equilibrated host community and a totally isolated guest cohort, as outlined in Section II D.
E. Dependence on parameters of cross-group reward, attitude adjustment rate, and sensitivity to attitude difference We now study how results from the model defined in Eqs. 1-3 depend on its main parameters α, A in , A out , σ, and κ. In earlier sections, we set A in = A out = A and determined analytically that the utility reaches a maximum U max i = αA[ln(αA) − 1] if each node has m opt = α ln(Aα) links. We have also verified this numerically for several α, A parameter choices. Note that setting α A −1/2 leads to m opt 1 indicating a network with no links, which we have verified numerically. We also briefly discussed how κ affects the dynamics by comparing results from high (κ = 1000) and a low (κ = 100) regimes. Here we will conduct a more thorough investigation of the relevant parameters.
First we examine a scenario where A out = A in and the effects of varying A out /A in while keeping other parameters fixed. In Fig. 7a we plot the steady-state integration index I * int as a function of A out /A in , with A in = 10, κ → ∞, α = 3, and σ = 1 for N g = 200 guests and a total population of N = 2000 nodes, corresponding to N/N h = 1.11. Note that setting κ → ∞ is equivalent to activating network remodeling only, since the timescale for attitude change diverges, hence attitudes x t i will remain fixed at their initial values throughout the entire course of the dynamics. We also use two different initial conditions of total guest isolation but different initial attitudes. The blue-solid triangles represent initially cooperative populations with x 0 i,host = x 0 i,guest = 0, while the red-solid circles represent initially hostile populations with x 0 i,host = 1, and x 0 i,guest = −1. In both cases, guests have no connections at t = 0. i,host = x 0 i,guest = 0. When the ratio Aout/Ain increases, the long-time state of the network changes from segregation to uniform mixture, and finally to reversed segregation. The transition for the default initial conditions occurs at larger Aout/Ain ratios, compared to the cooperative initial conditions, as the former require higher compensation from outgroup connections to overlook the hostile attitudes between guests and hosts. In panel (b) each data point corresponds to one realization. Increasing attitude adjustment time scale κ leads to increased likelihood of segregation. A bimodal regime emerges for intermediate κ.
Each data point and relative error bar in Fig. 7a represents the mean and variance over 20 realizations, respectively. For the cooperative case (blue-solid triangles) as long as A out /A in 1 in-group connections yield higher rewards and are preferred; hence the two populations are almost completely segregated and I * int → 0.1. Conversely, when A out /A in 1 out-group connections are preferred, and I * int → N/N h = 1.11, indicating reverse segregation. When A out /A in 1 out-group and in-group connections are equivalent in terms of their socioeconomic weight and integration is observed at I * int → 1. Note the sharp transitions between regimes. The progression segregation → integration → reverse segregation as a function of A out /A in also appears for the uncooperative conditions (red-solid circles). However, in this case transitions are shifted towards the right, indicating that out-group connections must yield higher socioeconomic gain to promote integration (or reverse segregation) in order to overcome the initial hostility among players. Here, segregation persists until A out /A in 6 for which I * int 0.1, full integration I * int → 1 arises for 6 A out /A in 8 and reverse segregation at I * int → N/N h = 1.11 appears only for A out /A in 8. Note that in both cases since attitudes are fixed, rewards are given by u ij = A out e −2 if through out-group connections, and by u ij = A in if through in-group ones. The two will be the same for A out /A in = e 2 = 7.39.
These results indicate that to promote integration, cross-group connections must generate higher rewards than ingroup ones. This may be realized, for example, if the immigrant population possesses skill sets that complement those of the host population. Since no attitude adjustment is allowed in the dynamics, Fig. 7a suggests that integration may occur even if groups maintain their hostility towards each other as long as the socioeconomic rewards are large enough, as seen for the uncooperative case (red-solid circles). Finally, note that the same parameter sets yields very different results for a wide range of A out /A in values, as can be seen by the bimodal values of I * int in Fig. 7a and underlying the role of initial conditions in determining integration or segregation.
We examine the effects of varying κ in Fig. 7b. Here, we use the same parameters as in Fig. 7a with A in = 10, A out = 20, α = 3, and σ = 1. The ratio A out /A in = 2 provides modest incentives for guests and hosts to collaborate. We consider initially hostile guests and hosts at x 0 i,host = 1 and x 0 i,guest = −1, and omit fully cooperative initial conditions x 0 i,host = x 0 i,guest = 0 since, in this case, changes to κ will not alter the dynamics. Each red solid circle in Fig. 7b is the result of a single simulation; for each value of κ simulations are repeated 20 times. The dot-plot shows that if attitude adjustment is sufficiently fast (κ 300) reverse segregation arises and I * int N/N h = 1.11; guests and hosts adopt cooperative attitudes before segregation can arise. For very slow attitude adjustments (κ 550), almost complete segregation as I * int → 0.1 is the only outcome. A bimodal regime instead arises for intermediate values of 300 κ 550 where segregation and reverse segregation are both likely. The bimodal feature of Fig. 7b is indicative of the different timescales between the two competing mechanisms of network remodeling and attitude adjustment. If attitude adjustment is fast compared to network remodeling (low κ) guests will quickly adopt cooperative attitudes, and guest-only enclaves will not be formed. Conversely, if attitude adjustment is slow compared to network remodeling (large κ) guest-only enclaves will form hindering cooperativity. In between these limits, is a regime where the timescales of network remodeling and attitude adjustment are comparable, and the outcomes stochastic. The last parameter we examine here is σ, which regulates the sensitivity of the reward function u t ij to attitude Finite values of σ, however large, do not determine whether in-group or out-group connections are preferred. This parameter thus will only affect the timescale of the dynamics. In particular, since larger values of σ attenuate the sensitivity of u t ij to |x t i − x t j | we expect larger values of σ to also be associated with slower dynamics. We have verified this by considering the time to reach 90% segregation, defined as I t int = 0.1, as a function of σ and for a variety of parameter choices. In Fig. 8a we plot the time to segregation, denoted by τ seg (σ), for the particular case of α = 3, A in = A out = 10, and κ = 600, with initially hostile populations x 0 i,host = 1 and x 0 i,guest = −1 and no initial link between hosts and guests. As can be seen, τ seg (σ) increases with σ. This result suggests that decreasing the sensitivity to attitude differences, particularly between guests and hosts, results in longer times to full segregation. This larger time window between migrant arrival and full segregation may provide better opportunities to implement interim policies that promote cooperation.

F. High immigrant ratios and small native populations promote segregation
In this section we examine the effects of migrant population sizes compared to that of the native community. We are particularly interested in the uncooperative, segregated case and examine how the time to segregation τ seg depends on the fraction of guests. Under parameters and conditions that favor segregation, we expect larger guest populations will more quickly evolve to the uncooperative steady state. We thus consider a scenario where at steady state guests segregate, resulting in x t i,guest → −1, x t i,host → 1, I t int → 0 as t → ∞. We then keep all parameters fixed, including the total population N , and modify only N g to study τ seg as a function of the N g /N ratio. In Fig. 8b we show τ seg (N g /N ) for the representative case of α = 3, A in = A out = 10, σ = 1, and κ = 600. Initial conditions are initially hostile populations x 0 i,host = 1 and x 0 i,guest = −1 and no initial link between hosts and guests. As can be seen, τ seg (N g /N ) is a decreasing function of its argument, as expected. Here, attitude adjustment timescales κ are not affected by N g /N , however a larger guest population makes in-group interactions more likely under the dynamics specified in Section II C. The increased guest-guest pairing allows for uncooperative attitudes to be maintained for longer times, lowering the utility reward from cross-group interactions and hastening the severing of such links. Numerically lower guest populations instead carry a higher likelihood of interacting with hosts, fostering cooperative attitudes for longer times, and allowing for socioeconomically advantageous cross-group connections to emerge. Several sociological reports show that conflicts between a majority N h and a minority N g population are less intense and frequent, if the majority population greatly exceeds that of the minority, N h N g [39]. We can conjecture that such conflicts arise when hosts and guests are extremely polarized and segregated from each other, as for the case illustrated above. Our results show that as N g /N increases segregation, and by proxy, the emergence of conflict between the two groups increases as well, confirming these sociological findings.
Finally, in Fig. 8c we plot τ seg (N ) as a function of the total population N by fixing N g = 0.1N . All other parameters and initial conditions are the same as in Fig. 8b. As can be seen, larger N populations lead to longer times to segregation τ seg (N ). This result implies that the same fraction of migrants can be more easily accommodated in larger communities.

G. Transitioning from segregation to integration
In this section we study the interplay between the two timescales, κ and τ seg , that determine whether or not guestonly enclaves will form, starting from an initially hostile and unconnected mixture of guests and hosts. In Fig. 7b we showed that fast attitude adjustment (small κ) prevents the formation of guest-only enclaves if incentives are in place to support cross-group collaborations (A out /A in > 1). As shown in Fig. 8b, increasing the guest population ratio N g /N , shortens the time to segregation τ seg and facilitates the establishment of guest-only enclaves.
To study the interplay between κ and τ seg we plot I * int in Fig. 9a as a function of κ and N g /N for the representative case of α = 3, A in = 10, A out = 20, σ = 1, and N = 2000. The populations are initiated with hostile attitudes x 0 i,host = 1 and x 0 i,guest = −1, and no cross-group initial link. As can be seen, decreasing κ induces a transition from segregation at I * int → 0 for large κ, to integration at I * int → 1, for small κ, or even reverse segregation at I * int → N/N h , for very small κ. Transitions towards integration thus are favored in societies where attitudes towards the other are less entrenched and where guests and hosts more readily adapt to each other. Fig. 9a also shows that transitions depend on the value of N g /N , and indirectly on τ g : larger values of N g /N imply shorter transition κ values. This is because increases in N g /N , and consequently decreases in τ seg , correspond to less time for attitude adjustment to affect cross-group utility gains. Larger percentages of migrants N g /N imply that individual attitudes κ must be even more open to diversity if one is to observe the same target integration index I * int . Note that in Fig. 9a we can also identify a bimodal regime, where I * int takes on values between zero and N/N h where final integration outcomes depend on stochastic events.
Finally, in Fig. 9b, we study how the integration index I * int depends on κ and α, the latter controlling the average number of connections associated with each node. We fix N g = 200 and use the same parameter values and initial conditions as in Fig. 9a. Increasing α corresponds to increasing the number of connections per node. As can be seen in Fig. 9b the same progression seen in Fig. 9a of transitioning from segregation to integration can be seen upon lowering κ for fixed α. Increasing α leads these transition points to shift towards larger values of κ, signifying that more connections per node allow for slower attitude adjustment to achieve the same integration value I * int . Beyond α 3 however, the transition regime of κ appears not to change appreciably, implying little sensitivity of I * int to the average number of connections per node.

IV. DISCUSSION AND CONCLUSIONS
As recent news reports and historical analysis attest, societal dynamics after the influx of newcomers depends on many factors, including the socioeconomic environment of the host country, the adaptability of the immigrant population, the open-mindedness of natives, and the degree of compatibility between guest and host values. Our model is based on the assumption that upon resettlement immigrants have two primary goals: socioeconomic prosperity and social acceptance. Game-theoretic rules are used to model socioeconomic gains through a utility function to be maximized, leading to network remodeling. Attitude adjustment is instead driven by opinion dynamics rules. The two processes occur at different timescales: network remodeling at a timescale of unity, and attitude adjustment at a timescale of τ g = κN/N h for guests. Due to their numerical superiority, hosts constitute a quasi-infinite bath: they greatly impact migrant dynamics, but their own characteristics change only marginally and over very long timescales, given by τ h = κN/N g τ g . The interplay between the various timescales is shown across our analysis. For low values of κ attitude adjustment is fast, cross-group socioeconomic gains are robust and immigrants are less likely to form segregated enclaves. For large values of κ, attitudes change very slowly, and the formation of isolated guest niches becomes the most efficient way for guests to advance their socioeconomic status. Our results are consistent with findings from public goods evolutionary game theory models where interactions among various social contexts, such as population diversity and cultural tolerance, lead to different ratios between the timescales for strategy evolution and network structure remodeling; such timescale difference determines whether cooperative patterns emerge [22,40]. In particular, cooperators will outweigh defectors if strategy evolution is faster than network remodeling [41].
The socioeconomic reward structure associated with guest-host collaborations also plays an important role in determining societal outcomes. As shown in Fig. 7a larger out-group versus in-group rewards, represented by the A out /A in ratio, are more conducive to integration. Out-group rewards promote the willingness among a mixed population to pursue conformity, which was identified as a key psychological factor for cooperative patterns to emerge in game theoretical models [42]. These results suggest that segregation may be avoided if newcomers carry inherent advantages, for example in the form of skill sets that are complementary to those of the native population, or if governmental incentives are established to promote cross-group interactions. Fig. 7a also reveals the fundamental role of initial conditions. If out-group rewards are much larger than in-group ones, A out A in , cooperation arises regardless of initial conditions. However, if the two are comparable, Fig. 7a shows that integrated or segregated societies can emerge from the same parameter set, and that whether one configuration prevails over the other depends on the initial conditions. Of course, integration is the more likely outcome if the initial attitudes are highly cooperative, while segregation will typically emerge from initial scenarios where guests and hosts are highly hostile to each other. This finding is also consistent with sociological observations [11,12] where the attitude of the majority population is identified as a primary determinant in minority segregation.
We also find that given the same social environment, a higher immigrant population ratio results in segregation, while a larger total population will more harmoniously absorb the same percentage of immigrants, which agrees with previous Ising-type sociophysical models of immigrant integration [43]. Our results suggest accommodating newcomers in accordance with the host population. Small, possibly rural, communities may not be optimal conduits to integration compared to more populous cities, especially if the percentage of migrants is large. Examples of countries distributing refugees in proportion to the population of receiving municipalities include Denmark, from 1986 to 1998, Sweden, from 1987 to 1991, and the United Kingdom since 2000. However, refugees were later found to relocate to larger cities [44][45][46], attracted by the presence of more co-ethnics, job opportunities and housing. Recent studies have also observed higher segregation of immigrants in rural areas, especially when the size of the migrant group is large and hosts are hostile to guests [47][48][49].
Our model does not include spatial dependence or geographical factors in making and maintaining social connections. For example, the turnover rate of social connections may be higher in denser areas, leading to inhomogeneous timescales for attitude changes in the network. We also do not consider the effects of virtual connectivity, whereby internet connections may render spatial dependence less relevant while also accelerating segregation as finding co-cultural companions is facilitated in online venues.
Our model may be generalized by introducing a continuous influx of immigrants, instead of assuming a fixed initial guest population. A continuous influx may allow us to include in-group interactions between immigrants arriving at different times, and to study cooperation or antagonism among them. To further extend our model across generations, since earlier immigrants and their descendants eventually may be considered part of the native community, the x t i = 0 barrier between hosts and guests must be relaxed in order to allow for generational crossover between groups. Similarly, long-term attitude differences between hosts and guests can lead to open conflict or violence that may curb socioeconomic rewards, including in-group ones. This mechanism would require higher order corrections and feedback mechanisms that are currently not included in our work.
Moreover, our utility function U t i carries the same form for every node and penalizes those with too many connections. As a result, all nodes converge towards an average number of connections, which is not realistic, since actual social networks take on small-world characteristics, with hub nodes having a large number of connections [50]. Our model may be improved by introducing more nuanced utility functions. For example, we may postulate that nodes with larger socioeconomic utility are able to maintain a larger number of connections, compared to those with lower utility, creating a mechanism for hubs to emerge [51]. All these factors may influence the entire society and change