## Abstract

The outbreak of epidemics, the rise of religious radicalization or the motivational influence of fellow students in classrooms are some of the issues that can be described as diffusion processes in heterogeneous groups. Understanding the role that interaction patterns between groups (e.g. homophily or segregation) play in the diffusion of certain traits or behaviours is a major challenge for contemporary societies. Here, we study the impact on diffusion processes of mixing (or, alternatively, segregating) two groups that present different sensitivities or propensities to contagion. We find non-monotonic effects of mixing and inefficient segregation levels, i.e. situations where a change in the mixing level can benefit both groups, e.g. where an increase in the mixing level can reduce the expected contagion levels in both groups. These findings can have fundamental consequences for the design of inclusion policies.

### 1. Introduction

We consider a contagion process [1] in a population made up by two groups, where each group presents a different contagion propensity. Individuals regularly interact with other individuals, who may belong to the same group (intra-group interactions) or to the other group (between-group interactions). The mixing level is measured by the fraction of between-group interactions. In this paper, we study how mixing—or, alternatively, segregating—the two groups may affect the expected level of diffusion of a certain trait. We show that a particularly interesting case may arise, where a change in the mixing level can improve the well-being of both groups in the population, i.e. where there are *Pareto-inefficient mixing levels* [2]. In the case of a disease, this would imply that increasing the mixing between the two groups can reduce the infection levels in both groups.

The first model we analyse is a multi-type susceptible–infected–susceptible (SIS) model [3,4] with two groups, where each group presents a different propensity to contagion. Initially, we assume that all individuals within the same group present the same susceptibility to contagion, but this hypothesis is relaxed later. Depending on parameter values, the multi-type SIS process has been shown to converge either (i) from any initial conditions, to the situation where there is no diffusion in either group, or (ii) from any *non-null* initial fraction of infected individuals, to a positive *almost globally asymptotically stable state* [3,4]. Here we investigate the impact of mixing the two groups on their respective infection levels at the positive stable state. We also explore the robustness of our results to more general settings.

Among the most related papers in the literature^{1}, [3,4] analyse the existence of an almost globally asymptotically stable state (the endemic state [9,10]) in the multi-type SIS model, and their results constitute the starting point for our study of the effect of mixing on such state for the two-type SIS case. An extension of the analysis in [3,4] to varying population size can be found in [11]. Epidemic thresholds [12] for a multi-type contagion model with different mixing levels are studied in [13]. Their framework includes the SIS model as a particular case, so their analysis of the local stability of the no-infection state applies to the two-type SIS model too. Epidemic thresholds and endemic equilibria in a two-type SIS model considering a bipartite network (which corresponds to the highest possible level of mixing in our setting) are studied in [14,15], while the analysis in [16] deals with random mixing without bias. The models in [13–16] generalize our approach by considering different interaction frequencies or network degree distributions, but the analysis of the endemic state in those papers corresponds to one particular mixing value (either a bipartite network [14,15] or random mixing [16]), while here we consider arbitrary mixing levels and explore the sensitivity to mixing of the endemic state.^{2}

As a first illustration of our main results, consider the case of an infectious disease spreading in a population composed of two distinct groups of individuals (figure 1): one group is more sensitive to contagion (the *sensitive group*, in red) and the other group is less sensitive (the *resistant group*, in blue). Note that the two groups need not be defined by their contagion propensities: some other variable, such as race, the presence of some gene or habitat, could characterize the partition of the population into two groups. If the group-defining variable is somewhat correlated with the sensitivity to contagion, then the two groups will present different average sensitivities, which is the only condition required in our model.

We are interested in analysing the consequences of changing the level of mixing between groups. To conduct such an analysis in the simplest possible way, we keep the average frequency of individual interactions constant, and we modify the fraction of interactions between individuals belonging to different groups. One might intuitively predict that, as the level of mixing increases, the infection levels in both groups should approximate, with an increase of infections in the resistant group and a decrease of infections in the sensitive group. Thus, the sensitive group would always benefit from a higher fraction of between-group interactions, whereas the resistant group would always be harmed by it.^{3}

We show that, while the first part of the previous intuition holds true (i.e. the infection levels do approach as mixing is increased), the second part is not always true, i.e. the resistant group may benefit from interacting more with the sensitive group. In other words, there can be *inefficient mixing levels*, i.e. situations where increasing between-group interactions leads to a reduction of infections in *both* groups (figure 1*b*, case B).

The underlying reason for this paradoxical effect is the feedback loop created between groups: from an initial stable situation corresponding to a given mixing level (e.g. 60% mixing in the scenario corresponding to case B in figure 1*b*), increasing the interaction level between groups can be initially costly for the resistant group, which will initially meet more infected individuals. However, it can turn out to be beneficial for that same group once the returns from the positive effect induced on the other group are collected (i.e. the reduction in the infection level of the sensitive group), and a new equilibrium is obtained in which both groups are better off.

The infection narrative constitutes a natural motivating example, but the framework can be extended to a variety of contexts [1,20–22]. In the infection narrative, individuals may be in an infected or in a susceptible state; in other contexts, the state of infection can be interpreted as the state of adopting a particular behaviour, technology, idea or belief, versus the state of adopting another alternative. In these cases, we will use the more general term *diffusion level*, instead of *infection level*, for the fraction of individuals in a group adopting one of the states.

In the social networks literature, the question we address can be more naturally posed as: ‘how do different levels of homophily or segregation affect the diffusion of a trait?’, where ‘homophily’ refers to the tendency of individuals in one group to interact preferentially with other individuals in the same group [23]. This issue is relevant because many social interactions exhibit significant homophily based on characteristics such as race, age, profession, etc. [24,25], while some other relationships (i.e. buyer-seller networks) are characterized by a high degree of heterophily or disassortative mixing.

In a practical situation, regardless of the existing level of mixing, a decision maker or social planner could potentially influence the interaction patterns between groups by implementing specific incentives, rules or goal-directed policies. The key question, then, is how induced changes in between-group interaction patterns affect diffusion. Examples include healthcare programmes to promote interactions between individuals of similar health characteristics [26], or compositional classroom designs to encourage school students with high academic motivation to interact with students with lower motivation [27–29].^{4}

The rest of the paper is organized as follows. In §2 we present the model. Section 3 contains the formal results. In §4, motivated by some of the potential fields of application, we present and analyse a generalization of the SIS model. Finally, §5 presents a discussion and the concluding remarks. The formal proofs and a robustness analysis can be found in the electronic supplementary material.

### 2. Two-type SIS model

Our model is based on the susceptible–infected–susceptible (SIS) contagion framework, extended to a multi-type setting [3]. In particular, we focus on a population composed of two groups of equal size: one of the groups is the resistant group and the other one is the sensitive group. Individuals can be in one of two possible states: ‘susceptible’ or ‘infected’. In each time period, each individual interacts with another individual with probability *p* > 0 and, depending on the state of its partner, may become infected. Specifically, a susceptible individual in group *i* ∈ {1, 2} becomes infected with probability *υ _{i}* > 0 if it happens to interact with an infected individual. Individuals who are already infected recover and become susceptible again with probability

*δ*> 0.

_{i}Let *m* ∈ [0, 1] represent the mixing level, i.e. the probability that an interacting individual of one particular group meets an individual from the other group. Thus, *m* is the expected fraction of between-group interactions. As illustrated in figure 1, if *m* = 0, individuals interact only with individuals from their own group (which is the fully segregated case), whereas if *m* = 1, individuals interact only with individuals from the other group (which is the bipartite case).^{5}

We use a continuous-time mean-dynamic approximation to study the evolution of the adoption levels in each group. To do so, let *ρ _{i}* denote the fraction of infected individuals in group

*i*. The evolution of

*ρ*in each group over time is described by the following nonlinear system of differential equations:

_{i}*m*is the mixing level,

*i*,

*j*∈{1, 2} and

*i*≠

*j*.

To interpret these equations, note that, in order to get infected, a non-infected individual in group *i*—whose number is proportional to $(1-{\rho}_{i})$—must interact with an infected individual of either the same or the other group—which happens with probability $p[m{\rho}_{j}+(1-m){\rho}_{i}]$—and get infected—which then happens with conditional probability ${\upsilon}_{i}$. In turn, the number of recoveries per period is proportional to the number of infected individuals—whose prevalence is *ρ _{i}*—and to the probability of recovery

*δ*.

_{i}Note that parameters *p*, *υ _{i}* and

*δ*can be interpreted as rates instead of probabilities. We can rewrite these equations as

_{i}*= (*

_{i}*p υ*/

_{i}*δ*) represents the

_{i}*effective adoption rate for group i.*Thus, the equilibria and the long-run dynamics of this model can be characterized using exclusively three parameters: λ

_{1}, λ

_{2}and

*m*.

The SIS equations analysed in the paper constitute the deterministic mean-dynamic [33] of the described underlying stochastic process. These equations provide a good approximation to the actual stochastic dynamics occurring in finite populations when those populations are large enough [33,34]. In the electronic supplementary material, we show the robustness of the reported results to different population sizes, as well as to the inclusion of some heterogeneity within groups.

### 3. Formal results

In this section, we state the results obtained from the analysis of the model. Detailed proofs of the propositions can be found in the electronic supplementary material. The results in this section are graphically summarized in figure 2, where the space of plausible effective adoption rates (λ_{1}, λ_{2}) ∈ [0, ∞) × [0, ∞) has been partitioned into different regions according to the impact of the mixing level *m* on the equilibrium diffusion values in each group, and on the population average.

In region A, the no-diffusion state is a global attractor. In region B, there is a positive threshold $\overline{m}<1\hspace{0.17em}$ such that for $0<m<\overline{m}$ there is a positive almost globally asymptotically stable state (leading to positive diffusion in both groups), while for $m>\hspace{0.17em}\overline{m}$ the dynamics converge to the no-diffusion state. In the remaining regions, for any positive value of the mixing level *m* and any initial state with some infection*,* the process converges to a positive almost globally asymptotically stable state.

In regions B and C, the infection level for the resistant group is a non-monotonic function of *m*, with an interior maximum. In region B, the average infection level is monotonic decreasing. In regions C and D, the average infection level (*ρ*_{1} + *ρ*_{2})/2 is a non-monotonic function of *m*, with an interior maximum. Finally, in region E, the three infection levels are monotonic functions of *m*.

For the formal propositions, and without loss of generality, let us assume that group 2 is the sensitive group, i.e. 0 < λ_{1} < λ_{2}. We are interested in the stationary states and the dynamics of equation (2.2) for $m\in (0,\hspace{0.17em}1)$; the extreme cases *m* = 0, *m* = 1 and λ_{1} = λ_{2} are discussed in the electronic supplementary material.

The stationary states of equation (2.2) are the pairs of values $({\rho}_{1},{\rho}_{2})\in {[0,\hspace{0.17em}1]}^{2}$ such that ${\dot{\rho}}_{1}=0$ and ${\dot{\rho}}_{2}=0$. Given the specification of the model, which precludes spontaneous infection, the state where all individuals are susceptible (i.e. no individual is infected) is always stationary. Depending on the values of the parameters, the diffusion dynamics either converge from any initial state to the situation where there is no diffusion in either group, or present a positive *almost globally asymptotically stable state* to which the system converges from any *non-null* initial fraction of infections. The following result formalizes this statement.

### Proposition 3.1 (Globally asymptotically stable state).

*If* λ_{2} > 1 *and either* λ_{1}λ_{2} > 1 *or* $m<\overline{m}$, *where* $\overline{m}=1-(1-{\mathrm{\lambda}}_{1}{\mathrm{\lambda}}_{2})/({\mathrm{\lambda}}_{2}+{\mathrm{\lambda}}_{1}-2{\mathrm{\lambda}}_{1}{\mathrm{\lambda}}_{2})$*, there is a positive globally asymptotically stable state in* ${[0,\hspace{0.17em}1]}^{2}\mathrm{\setminus}\{(0,\hspace{0.17em}0)\}$*. Otherwise the no-diffusion state* (0, 0) *is globally asymptotically stable in* [0, 1]^{2}.

As an immediate corollary of proposition 3.1, if the effective adoption rate in the sensitive group is not greater than one (λ_{2} ≤ 1), then the process converges to the no-diffusion state (0, 0), which is globally asymptotically stable. The interesting cases, consequently, are those in which the effective adoption rate in at least one of the groups is greater than one.

The threshold $\overline{m}$ coincides, naturally, with the local-stability threshold of the no-diffusion state characterized in [13] for this case. Proposition 3.1 can be derived, after some adaptations, from the results in [3] or [4] for multi-type SIS models. In the electronic supplementary material, we present an alternative proof for the two-type case that is helpful to show equivalent results for some parametrizations of the general contagion model that we analyse later.

Given that there is a unique globally asymptotically stable state in our dynamics, we can proceed by conducting comparative static analyses. In particular, we can study the effect of the mixing level *m* on the stable infection levels for the sensitive and resistant groups separately, within the range of positive values of *m* where the stable positive equilibrium exists, i.e. for λ_{2} > 1, $m\in (0,\hspace{0.17em}1]$ if λ_{1}λ_{2} > 1 and $m\in (0,\hspace{0.17em}\overline{m})$ if ${\mathrm{\lambda}}_{1}{\mathrm{\lambda}}_{2}\le 1$. Let ${\rho}_{i}^{\mathrm{E}}$ denote the fraction of infected individuals in group *i* at the positive stable equilibrium (which is a function of *m*). By analysing the derivatives of ${\rho}_{i}^{\mathrm{E}}$ with respect to *m* in the considered range of values where the positive equilibrium exists, we obtain the following results for the positive equilibrium infection levels.

### Proposition 3.2 (Infection level in the sensitive group).

*The stable positive equilibrium infection level in the sensitive group* ${\rho}_{2}^{\mathrm{E}}$ *is a strictly decreasing function of the mixing level m. Its maximum level,* $1-{\mathrm{\lambda}}_{2}^{-1}$*, corresponds to m* = 0*. If* ${\mathrm{\lambda}}_{1}{\mathrm{\lambda}}_{2}\le 1$*, then* ${\rho}_{2}^{\mathrm{E}}$ *decreases to 0 as* $m\to {\overline{m}}^{-}$*, with* $\overline{m}\le 1$*. If* ${\mathrm{\lambda}}_{1}{\mathrm{\lambda}}_{2}>1$*,* ${\rho}_{2}^{\mathrm{E}}$ *obtains its minimum value* $({\mathrm{\lambda}}_{1}{\mathrm{\lambda}}_{2}-1)/(\hspace{0.17em}{\mathrm{\lambda}}_{1}{\mathrm{\lambda}}_{2}+{\mathrm{\lambda}}_{1})>0$ *at m* = 1.

Proposition 3.2 implies that, by increasing the mixing level, the infection level in the sensitive group can only decrease (figure 2). If being infected is undesirable, the sensitive group can only benefit from more mixing. Alternatively, if being infected is desirable, the sensitive group can only be harmed by more mixing. Note that if the resistant group is resistant enough (specifically, if ${\mathrm{\lambda}}_{1}<{\mathrm{\lambda}}_{2}^{-1}$, with λ_{2} > 1), then a sufficiently high level of mixing would kill the infection in the whole population. This could be either desirable or undesirable, as it can mean the disappearance of a disease, but it can also mean the disappearance of a desirable trait or behaviour from the whole population.

### Proposition 3.3 (Infection level in the resistant group).

(

*i*) For adoption rates ${\mathrm{\lambda}}_{1}>\sqrt{{\mathrm{\lambda}}_{2}}/({\mathrm{\lambda}}_{2}-\sqrt{{\mathrm{\lambda}}_{2}}+1)$, which is always the case if λ_{1}> 1, the stable positive infection level in the resistant group ${\rho}_{1}^{\mathrm{E}}$ is a strictly increasing function of the mixing level $m\in (0,\hspace{0.17em}1)$. The minimum level for ${\rho}_{1}^{\mathrm{E}}$ is $\underset{m\to {0}^{+}}{lim}{\rho}_{1}^{\mathrm{E}}=\mathrm{Max}(0,1-{\mathrm{\lambda}}_{1}^{-1})$, corresponding to*m*= 0.(

*ii*) For adoption rates ${\mathrm{\lambda}}_{1}<\sqrt{{\mathrm{\lambda}}_{2}}/({\mathrm{\lambda}}_{2}-\sqrt{{\mathrm{\lambda}}_{2}}+1)$, the stable positive infection level in the resistant group ${\rho}_{1}^{\mathrm{E}}$ is a non-monotonic function of m which increases from $\underset{m\to {0}^{+}}{lim}{\rho}_{1}^{\mathrm{E}}=0$, obtains a maximum value at some interior value of m and then decreases, either back to $\underset{m\to {\overline{m}}^{-}}{lim}{\rho}_{1}^{\mathrm{E}}=0$ if ${\mathrm{\lambda}}_{1}{\mathrm{\lambda}}_{2}\le 1$, or to $({\mathrm{\lambda}}_{1}{\mathrm{\lambda}}_{2}-1)\text{/(}{\mathrm{\lambda}}_{1}{\mathrm{\lambda}}_{2}+{\mathrm{\lambda}}_{2})0$ (obtained at*m*= 1) if ${\mathrm{\lambda}}_{1}{\mathrm{\lambda}}_{2}>1.$

Proposition 3.3 implies that, if the effective adoption rate in the resistant group is greater than one (meaning that both groups, if isolated, would sustain some infection in equilibrium), then, by increasing the mixing level, the infection level in the sensitive group decreases and the infection level in the resistant group increases. In this case, favouring one group by changing the mixing level can only harm the other.^{6} This behaviour corresponds to parameter regions D and E in figure 2, which are defined by the first condition in proposition 3.3 (which also assumes λ_{1} < λ_{2} for the sake of notational simplicity and without loss of generality).

More interesting findings are obtained in regions B and C in figure 2, wherein the effective adoption rate is greater than one in the sensitive group but lower than one in the resistant group.^{7} In these regions, corresponding to the second part of proposition 3.3, the equilibrium infection level in the resistant group is null when the group is isolated; it increases initially with more mixing and eventually decreases (possibly back to zero again, if in region B) after having obtained some interior maximum value. This implies that there are inefficient mixing levels regardless of whether being infected is desirable or undesirable, as we explain below.

If being infected is desirable, an example of an inefficient mixing level would be the bipartite situation (*m* = 1) in graph C of figure 2, where both groups would increase their equilibrium infection level by reducing the mixing level to around 70%. Again in graph C, if being infected is undesirable, all mixing levels for which the infection level in the resistant group is greater than the value corresponding to the bipartite situation (*m* = 1) would be inefficient, because, by increasing the mixing level to *m* = 1, both groups would decrease their equilibrium infection level. Finally, in region B (where ${\mathrm{\lambda}}_{1}{\mathrm{\lambda}}_{2}\le 1$), for sufficiently high mixing levels, the infection would even be eliminated from the whole population.^{8}

The following proposition concerns the average infection level in the population at the stable positive equilibrium ${\rho}^{\mathrm{E}}=({\rho}_{1}^{\mathrm{E}}+{\rho}_{2}^{\mathrm{E}})/2$, which is a function of *m* in the range where the positive equilibrium exists.

### Proposition 3.4 (Average infection level).

(

*i*)*If*${\mathrm{\lambda}}_{1}{\mathrm{\lambda}}_{2}\le 1$*, the average infection level*${\rho}^{\mathrm{E}}$*is a decreasing function of m, with*$\underset{m\to {\overline{m}}^{-}}{lim}{\rho}^{\mathrm{E}}=0$.(

*ii*)*If*${\mathrm{\lambda}}_{1}^{3/4}({\mathrm{\lambda}}_{2}+1)\ge {\mathrm{\lambda}}_{2}^{3/4}({\mathrm{\lambda}}_{1}+1)$*, which requires*λ_{1}λ_{2}> 1*and*λ_{2}> 3, ${\rho}^{\mathrm{E}}$*is an increasing function of m*.(

*iii*)*Otherwise*${\rho}^{\mathrm{E}}$*is a non-monotonic function of m, initially increasing and then decreasing, which obtains an interior maximum. In this case, the minimum average diffusion is obtained either at m*= 1,*if*${\mathrm{\lambda}}_{1}<\sqrt{{\mathrm{\lambda}}_{2}}\text{/}({\mathrm{\lambda}}_{2}-\sqrt{{\mathrm{\lambda}}_{2}}+1)$*, or at m*= 0*otherwise*.

Proposition 3.4 implies that the average infection level decreases to zero in region B, is non-monotonic in regions C and D, and is increasing in region E. This has relevant implications as to the optimal mixing level when the objective is maximizing or minimizing the average infection level. In particular, if the adoption rates lie in region B, then average diffusion is maximized in the segregated case (*m* = 0) and minimized (reaching no diffusion) whenever the mixing level is sufficiently high (i.e. $m>\hspace{0.17em}\overline{m}$). If the adoption rates lie in regions C or D, average diffusion is maximized at an intermediate level of mixing, and minimized at one of the extremes (*m* = 1 in region C, *m* = 0 in region D). Finally, if the adoption rates lie in region E, average diffusion is an increasing function of mixing, so it is maximized in the bipartite case (*m* = 1) and minimized in the segregated case (*m* = 0).

### Proposition 3.5 (Difference between infection levels).

*The difference between the stable positive infection levels in the sensitive and resistant groups* $({\rho}_{2}^{\mathrm{E}}-{\rho}_{1}^{\mathrm{E}})$ *is a strictly decreasing function of the mixing level m. This difference is always positive for* $({\rho}_{1}^{\mathrm{E}},{\rho}_{2}^{\mathrm{E}})\ne (0,0)$.

Proposition 3.5 implies that the difference between the infection levels of both groups is always minimized at the bipartite situation (*m* = 1).

### 4. General contagion model

The SIS model of contagion analysed in the previous sections can be extended to address more general situations [1,20–22,35], such as peer effects in classrooms, where it seems reasonable to assume that the probability of switching from infected (i.e. motivated student) to susceptible (i.e. non-motivated student) is affected by the current state of partners. A similar issue is how the internal organization of a work team, where some individuals are easier to motivate than others, affects the overall level of productivity. On the one hand, in these cases, as in the SIS model, an important factor for an individual to switch from one state to the other can be the state of his/her partner. On the other hand, there are some limitations of the SIS model when considering social contagion applications [36]: in a SIS model only one of the states is contagious, while the recovery rate is independent of whether one's partner is infected or not. Here we consider a more general framework which, even though it might still constitute a rough simplification for some of the motivating applications, overcomes the indicated limitations. A related though more limited generalization of the SIS model can be found in the SISa model [36] (see [1, §X], for other generalizations of epidemic models as social contagion processes). The key assumption in our model is that individuals' state transitions depend on their current state and on the state of the individuals they interact with. We show that the qualitative results that we have described for the two-group SIS model, namely the existence of situations where the equilibrium diffusion levels are non-monotonic functions of the mixing level *m*, as well as the existence of Pareto-inefficient outcomes, hold in this more general case.

Consider an extended model which includes as parameters for each population $i\in \{1,\hspace{0.17em}2\}$ the following contagion and recovery rates, conditional on the current state of the interacting individual (state *S* or state *I*):

— ${\upsilon}_{i|S}$: rate at which individuals in state

*S*who interact with individuals in state*S*adopt state*I*. In an infection model, this is the rate of infection when meeting a healthy partner (due to other factors of infection). In a school motivation model, this would be the rate at which students in group*i*in motivation state*S*and with a partner in motivation state*S*adopt motivation state*I*(due to other motivating factors).— ${\upsilon}_{i|I}$: rate at which individuals in state

*S*who interact with individuals in state*I*adopt state*I*. This is the rate of infection when meeting an infected partner.— ${\delta}_{i|S}$: rate at which individuals in state

*I*who interact with individuals in state*S*adopt state*S*. This is the rate of recovery when having a healthy partner.— ${\delta}_{i|I}$: rate at which individuals in state

*I*who interact with individuals in state*I*adopt state*S*. This is the rate of recovery when having an infected partner.

Leaving apart the limit cases in which some parameters are either 1 or null, we assume that $0<{\upsilon}_{i|S}<{\upsilon}_{i|I}<1$ and $0<{\delta}_{i|I}<{\delta}_{i|S}<1$.

The probability that an individual in group *i* interacts with an individual in state *I* is ${I}_{i}=(1-m){\rho}_{i}+m{\rho}_{j}$, with index *j* indicating the other group: $j\in \{1,\hspace{0.17em}2\},j\ne i$.

The system of differential equations describing the evolution of adoption in each group over time is:

*i*that can change to state

*I*(because they are in state

*S*), ${\upsilon}_{i|I}{I}_{i}$ is the rate at which such individuals meet a partner in state

*I*and then change to state

*I*, and ${\upsilon}_{i|S}(1-{I}_{i})$ is the rate at which such individuals meet a partner in state

*S*and then change to state

*I*. The rest of the terms can be interpreted similarly.

For each value of *m* and ${\rho}_{j}\in [0,\hspace{0.17em}1]$, ${\dot{\rho}}_{i}$ is a second-degree polynomial in *ρ _{i}* such that ${\dot{\rho}}_{i}({\rho}_{i}=0)={\upsilon}_{i|S}+m{\rho}_{j}({\upsilon}_{i|I}-{\upsilon}_{i|S})>0$, and ${\dot{\rho}}_{i}({\rho}_{i}=1)=-[{\delta}_{i|I}+m(1-{\rho}_{j})({\delta}_{i|S}-{\delta}_{i|I})]<0$.

Consequently, for each value of *m* and ${\rho}_{j}\in [0,\hspace{0.17em}1]$ there is a unique and positive value of ${\rho}_{i}\in [0,\hspace{0.17em}1]$ satisfying ${\dot{\rho}}_{i}=0$, and this equation defines a ‘reaction function’ ${\rho}_{i}^{\mathrm{R}}:[0,\hspace{0.17em}1]\times [0,\hspace{0.17em}1]\to (0,\hspace{0.17em}1)$, $({\rho}_{j},m)\to {\rho}_{i}^{\mathrm{R}}({\rho}_{j},m)$, which provides the corresponding equilibrium diffusion level in group *i*.

It is not difficult to see that, for a fixed value of *m*, ${\rho}_{i}^{\mathrm{R}}$ is strictly increasing in *ρ _{j}* (this follows from the fact that $\mathrm{\partial}{\dot{\rho}}_{i}\text{/}\mathrm{\partial}{\rho}_{j}>0$) and that, if $({\upsilon}_{i|I}-{\upsilon}_{i|S})>({\delta}_{i|S}-{\delta}_{i|I})$, it is also strictly concave (strictly convex if the inequality is reversed). For the strictly concave–concave case, as well as for the strictly convex–convex case (which can be easily transformed to the concave–concave case via a change of variables), the same arguments that we used in §A2 of the electronic supplementary material for the SIS model can be applied to show that there is a unique interior globally asymptotically stable stationary state.

Figure 3 illustrates the equilibrium diffusion values (${\rho}_{1}^{\mathrm{E}},{\rho}_{2}^{\mathrm{E}}$) as a function of the mixing level *m* for a parametrization of this model. It shows that the same qualitative features that we discussed for the multi-group SIS model also apply to this extended case: the diffusion level in a group can be a non-monotonic function of the mixing level, and there can be Pareto-inefficient mixing levels.^{9} Again, for policy considerations, it also shows that the qualitative global effect of modifying the level of segregation or mixing between groups varies with the parameter values of the groups: given most reasonable sets of objectives, a modification of the mixing level in one direction (increase or decrease) could be beneficial or prejudicial depending on the status quo and on the parameter values of both groups. Particularly, for the issue of ability sorting in schools (for which empirical findings are often controversial and sometimes even contradictory [27–29]), our extended model would suggest a way of reconciling apparently opposing recommendations within one single coherent explanation: increasing the level of mixing between students with high and low academic performance can have a positive or negative overall effect depending on students' responsiveness to their partners’ state.

### 5. Discussion

Humans belong to different groups according to race, gender, age, abilities, preferences, etc. Most kinds of human interactions are biased in the sense that they take place preferentially between individuals of the same group (homophily) or, conversely, between individuals of different groups (disassortative mixing). Nonetheless, social policies can be implemented to modify the level of mixing between different groups. We have studied the effect on diffusion processes—such as the adoption of a particular behaviour or the spread of a disease—of mixing two groups with different propensities for adoption.

Our results using a SIS model show that, for some parameter regions, the diffusion level in the resistant group is a non-monotonic function of the mixing level *m* (proposition 3.3). This is a consequence of two opposing effects taking place simultaneously when increasing the mixing level from an initial equilibrium situation. On the one hand, by mixing more with the sensitive group, which has more infected individuals or adopters, the number of adopters in the resistant group should increase. On the other hand, a greater mixing with the resistant group decreases the diffusion level in the sensitive group (proposition 3.2). This, in turn, creates a feedback loop effect on the resistant group such that, when the reduction of adopters in the sensitive group is strong enough (i.e. when *m* is sufficiently high), the number of adopters in the resistant group also decreases as mixing increases.

If the diffusion level in the resistant group is non-monotonic, there are Pareto inefficient mixing levels, i.e. mixing levels such that both groups would be better off at some other mixing level. In this case, avoiding Pareto-dominated outcomes, which can be considered a generally desirable objective [2], would rule out a range of (non-efficient) mixing levels, though, in general, it would not provide just one single optimal mixing level. Optimizing the *average diffusion* is another possible objective for a social planner to focus on. In such a case, and depending on the groups' adoption rates, the optimal mixing level can range from the totally segregated case (*m* = 0) to the bipartite case (*m* = 1). An alternative objective worth exploring can be to reduce the diffusion difference between groups. To achieve this, the bipartite case where all interactions are between groups (*m* = 1) is always the best structure (proposition 3.5). However, it should be noted that this situation may be Pareto inefficient (see, e.g. the graph representative of region C in figure 2, assuming a desirable trait).

The generalization of the SIS model that we have considered also shows parameter regions such that the equilibrium diffusion levels are non-monotonic functions of the mixing level *m*, with Pareto-inefficient mixing levels.

To conclude, our results indicate that the best mixing level among heterogeneous groups will generally depend not only on the desired objective (such as, for instance, maximizing the average diffusion level), but typically on the effective adoption rates (or propensities) of each group, these being parameters that are well defined and which can be measured or estimated. A ‘one-fits-all’ recommendation does not exist, meaning that the optimal policy could be very different for different contexts. Furthermore, the existence of inefficient mixing levels highlights the importance of estimating appropriately the relevant contagion parameters before embracing any particular policy.

### Data accessibility

A computer program available at https://luis-r-izquierdo.github.io/micopro/ implements the two-type SIS model used in the robustness analysis. An interactive Mathematica demonstration that computes and displays the equilibrium infection levels as a function of the mixing level is available at http://demonstrations.wolfram.com/MixingAndInfectionInATwoGroupSISModel/.

### Authors' contributions

S.S.I., L.R.I. and D.L.-P contributed to the conception, design, analysis, interpretation and writing of the paper. All authors gave final approval for publication.

### Competing interests

We have no competing interests.

### Funding

The authors gratefully acknowledge financial support: D.L.-P. from the Spanish Ministry of Science and Innovation (ECO2011-22919) and from project ECO2017-83147-C2-1-P (MINECO/AEI/FEDER, UE). L.R.I. and S.S.I. from project ECO2017-83147-C2-2-P (MINECO/AEI/FEDER, UE).

## Acknowledgements

We thank Fernando Vega-Redondo for helpful comments.

## Footnotes

2 Also related, there have been some reports of a non-monotonic effect of mixing on diffusion levels in simulation experiments [17]. More distantly related to our study, considering costly strategic decisions that can mitigate the infection process, two-type SIS models for different mixing levels have been studied with relation to the issue of strategic immunization or adoption of prevention measures [18,19].

3 To make statements about individuals’ well-being, first we have to assume that the infected state is either desirable or undesirable. If the infected state is undesirable, then each group's well-being decreases with its own equilibrium infection level, i.e. the fewer infected individuals, the better. In contrast, if the infected state is desirable, the group's well-being increases with its own infection level, i.e. the more infected individuals, the better. Notice that, in this framework, the equilibrium determines an average fraction of infected individuals in each group, but the identity of such individuals will typically change from one period to another: agents are permanently switching from infected to susceptible and vice versa.

4 Naturally, we do not claim that our simple model can be *directly* applied to any such situations and used to automatically derive policy recommendations in settings where other factors not included in the model may play an important role. Our model has been purposefully designed to illustrate a phenomenon that can occur in a variety of contexts and, precisely for this reason, it is highly stylized.

5 There is a close relationship between the mixing level in our model and the concept of modularity in general networks. The modularity of a partition of a network into groups is the fraction of intra-group links minus the expected value of such a fraction if links were distributed at random [30,31]. For networks with two groups where the number of links departing from nodes in each group (i.e. the sum of the degrees of all nodes belonging to each group) is the same, as in our model on expectation, the fraction of between-group links *m* and the modularity *Q* of the partition given by the groups are linearly related in a particularly simple way: *Q *= (1 – *m*) – ½ =½ – *m*. Similarly, the relationship between the mixing level *m* and the assortativity coefficient *r* [32] in our model is also straightforward: *r *= 1 – 2*m*.

6 Unless infection is desirable in one group and undesirable in the other, a case we do not consider here.

7 In these situations, for a resistant individual, and given some positive mixing level, coordinating with the other resistant individuals to increase the mixing level can be advantageous to reduce the average time infected, even though more mixing with susceptible individuals is individually costly if the other resistant individuals do not follow suit. In this sense, in a strategic setting, increasing the mixing level could constitute a social dilemma. However, it follows from proposition 3.3 that no situation for the resistant group can be strictly better than the situation with no mixing.

8 The behaviour in region B is somewhat less surprising once it is understood that enough mixing can eliminate the infection, and considering that a positive level of infection in one group implies a positive level of infection in the other. Continuity would then make the blue line in graph B go from a no-infection level at *m *= 0 back to a no-infection level again for sufficiently high mixing, going through positive values in the way.

9 There are also parameter combinations for which there are no inefficient mixing levels. For instance, for the ‘mirror’ case in which ${\upsilon}_{i|1}={\delta}_{j|0}$ and ${\upsilon}_{i|0}={\delta}_{j|1}$ , with $i,j\in \{1,2\},\hspace{0.17em}i\hspace{0.17em}\ne j$, it can be easily shown that ${\rho}_{1}^{\mathrm{E}}+{\rho}_{2}^{\mathrm{E}}=\hspace{0.17em}1$, so any increase in one of the equilibrium infection levels must correspond to a decrease in the other.

### References

- 1
Pastor-Satorras R, Castellano C, Van Mieghem P, Vespignani A . 2015 Epidemic processes in complex networks.**Rev. Mod. Phys.**, 925–979. (doi:10.1103/RevModPhys.87.925) Crossref, Web of Science, Google Scholar**87** - 2
Ingham S . 2017 Pareto-optimality.*Encycl. Br*. See https://www.britannica.com/topic/Pareto-optimality (accessed on 12 January 2018). Google Scholar - 3
Rass L, Radcliffe J . 2000 Global asymptotic convergence results for multitype models.**Int. J. Appl. Math. Comput. Sci. Vol.**, 63–79. Google Scholar**10** - 4
Lajmanovich A, Yorke JA . 1976 A deterministic model for gonorrhea in a nonhomogeneous population.**Math. Biosci.**, 221–236. (doi:10.1016/0025-5564(76)90125-5) Crossref, Google Scholar**28** - 5
Newman MEJ . 2002 Spread of epidemic disease on networks.**Phys. Rev. E**, 16128. (doi:10.1103/PhysRevE.66.016128) Crossref, Web of Science, Google Scholar**66** - 6
Pastor-Satorras R, Vespignani A . 2001 Epidemic spreading in scale-free networks.**Phys. Rev. Lett.**, 3200–3203. (doi:10.1103/PhysRevLett.86.3200) Crossref, PubMed, Web of Science, Google Scholar**86** - 7
Vega-Redondo F . 2007**Complex social networks**. Cambridge, UK: Cambridge University Press. Crossref, Google Scholar - 8
Keeling MJ . 1999 The effects of local spatial structure on epidemiological invasions.**Proc. R. Soc. B**, 859–867. (doi:10.1098/rspb.1999.0716) Link, Web of Science, Google Scholar**266** - 9
Pastor-Satorras R, Vespignani A . 2001 Epidemic dynamics and endemic states in complex networks.**Phys. Rev. E**, 66117. (doi:10.1103/PhysRevE.63.066117) Crossref, Web of Science, Google Scholar**63** - 10
López-Pintado D . 2012 Influence networks.**Games Econ. Behav.**, 776–787. (doi:10.1016/j.geb.2012.01.008) Crossref, Web of Science, Google Scholar**75** - 11
Kuniya T, Muroya Y . 2015 Global stability of a multi-group SIS epidemic model with varying total population size.**Appl. Math. Comput.**, 785–798. (doi:10.1016/J.AMC.2015.05.124) Web of Science, Google Scholar**265** - 12
López-Pintado D . 2008 Diffusion in complex social networks.**Games Econ. Behav.**, 573–590. (doi:10.1016/j.geb.2007.08.001) Crossref, Web of Science, Google Scholar**62** - 13
Jackson MO, López-Pintado D . 2013 Diffusion and contagion in networks with heterogeneous agents and homophily.**Netw. Sci.**, 49–67. (doi:10.1017/nws.2012.7) Crossref, Google Scholar**1** - 14
Gómez-Gardeñes J, Latora V, Moreno Y, Profumo E . 2008 Spreading of sexually transmitted diseases in heterosexual populations.**Proc. Natl Acad. Sci. USA**, 1399–1404. (doi:10.1073/pnas.0707332105) Crossref, PubMed, Web of Science, Google Scholar**105** - 15
Wen L, Zhong J . 2012 Global asymptotic stability and a property of the SIS model on bipartite networks.**Nonlinear Anal. Real World Appl.**, 967–976. (doi:10.1016/j.nonrwa.2011.09.003) Crossref, Web of Science, Google Scholar**13** - 16
Sugimine N, Aihara K . 2007 Stability of an equilibrium state in a multiinfectious-type SIS model on a truncated network.**Artif. Life Robot.**, 157–161. (doi:10.1007/s10015-007-0421-4) Crossref, Google Scholar**11** - 17
Yavaş M, Yücel G . 2014 Impact of homophily on diffusion dynamics over social networks.**Soc. Sci. Comput. Rev.**, 354–372. (doi:10.1177/0894439313512464) Crossref, Web of Science, Google Scholar**32** - 18
Reluga TC . 2009 An SIS epidemiology game with two subpopulations.**J. Biol. Dyn.**, 515–531. (doi:10.1080/17513750802638399) Crossref, PubMed, Google Scholar**3** - 19
Galeotti A, Rogers BW . 2013 Strategic immunization and group structure.**Am. Econ. J. Microecon.**, 1–32. (doi:10.1257/mic.5.2.1) Crossref, Web of Science, Google Scholar**5** - 20
Bettencourt LMA, Cintrón-Arias A, Kaiser DI, Castillo-Chávez C . 2006 The power of a good idea: quantitative modeling of the spread of ideas from epidemiological models.**Phys. A Stat. Mech. Appl.**, 513–536. (doi:10.1016/j.physa.2005.08.083) Crossref, Web of Science, Google Scholar**364** - 21
Dodds PS, Watts DJ . 2004 Universal behavior in a generalized model of contagion.**Phys. Rev. Lett.**, 218701. (doi:10.1103/PhysRevLett.92.218701) Crossref, PubMed, Web of Science, Google Scholar**92** - 22
Dodds PS, Watts DJ . 2005 A generalized model of social and biological contagion.**J. Theor. Biol.**, 587–604. (doi:10.1016/J.JTBI.2004.09.006) Crossref, PubMed, Web of Science, Google Scholar**232** - 23
Golub B, Jackson MO . 2012 How homophily affects the speed of learning and best-response dynamics.**Q. J. Econ.**, 1287–1338. (doi:10.1093/qje/qjs021) Crossref, Web of Science, Google Scholar**127** - 24
McPherson M, Smith-Lovin L, Cook JM . 2001 Birds of a feather: homophily in social networks.**Annu. Rev. Sociol.**, 415–444. (doi:10.1146/annurev.soc.27.1.415) Crossref, Web of Science, Google Scholar**27** - 25
Bramoullé Y, Currarini S, Jackson MO, Pin P, Rogers BW . 2012 Homophily and long-run integration in social networks.**J. Econ. Theory**, 1754–1786. (doi:10.1016/j.jet.2012.05.007) Crossref, Web of Science, Google Scholar**147** - 26
Centola D . 2011 An experimental study of homophily in the adoption of health behavior.**Science**, 1269–1272. (doi:10.1126/science.1207055) Crossref, PubMed, Web of Science, Google Scholar**334** - 27
Gamoran A . 1992 The variable effects of high school tracking.**Am. Sociol. Rev.**, 812–828. (doi:10.2307/2096125) Crossref, Web of Science, Google Scholar**57** - 28
Androushchak G, Poldin O, Yudkevich M . 2013 Role of peers in student academic achievement in exogenously formed university groups.**Educ. Stud.**, 568–581. (doi:10.1080/03055698.2013.814561) Crossref, Web of Science, Google Scholar**39** - 29
Duflo E, Dupas P, Kremer M . 2011 Peer effects, teacher incentives, and the impact of tracking: evidence from a randomized evaluation in Kenya.**Am. Econ. Rev.**, 1739–1774. (doi:10.1257/aer.101.5.1739) Crossref, Web of Science, Google Scholar**101** - 30
Newman MEJ . 2006 Modularity and community structure in networks.**Proc. Natl Acad. Sci. USA**, 8577–8582. (doi:10.1073/pnas.0601602103) Crossref, PubMed, Web of Science, Google Scholar**103** - 31
Newman MEJ, Girvan M . 2004 Finding and evaluating community structure in networks.**Phys. Rev. E**, 26113. (doi:10.1103/PhysRevE.69.026113) Crossref, Web of Science, Google Scholar**69** - 32
Newman MEJ . 2003 Mixing patterns in networks.**Phys. Rev. E**, 26126. (doi:10.1103/PhysRevE.67.026126) Crossref, PubMed, Web of Science, Google Scholar**67** - 33
Izquierdo SS, Izquierdo LR . 2013 Stochastic approximation to understand simple simulation models.**J. Stat. Phys.**, 254–276. (doi:10.1007/s10955-012-0654-z) Crossref, Web of Science, Google Scholar**151** - 34
Sandholm WH . 2010**Population games and evolutionary dynamics**. Cambridge, MA: The MIT Press. Google Scholar - 35
Gonçalves B, Perra N, Vespignani A. 2013 Social networks, contagion processes and the spreading of infectious diseases. In*Handbook of systems biology*(edsVidal M, Dekker SB ), pp. 515–527. San Diego, CA: Academic Press. Google Scholar - 36
Hill AL, Rand DG, Nowak MA, Christakis NA . 2010 Infectious disease modeling of social contagion in networks.**PLoS Comput. Biol.**, e1000968. (doi:10.1371/journal.pcbi.1000968) Crossref, PubMed, Web of Science, Google Scholar**6**