Agent-based neutral competition in two-community networks

Competition between alternative states is an essential process in social and biological networks. Neutral competition can be represented by an unbiased random drift process in which the states of vertices (e.g., opinions, genotypes, or species) in a network are updated by repeatedly selecting two connected vertices. One of these vertices copies the state of the selected neighbor. Such updates are repeated until all vertices are in the same"consensus"state. There is no unique rule for selecting the vertex pair to be updated. Real-world processes comprise three limiting factors that can influence the selected edge and the direction of spread: (1) the rate at which a vertex sends a state to its neighbors, (2) the rate at which a state is received by a neighbor, and (3) the rate at which a state can be exchanged through a connecting edge. We investigate how these three limitations influence neutral competition in networks with two communities generated by a stochastic block model. By using Monte Carlo simulations, we show how the community structure and update rule determine the states' success probabilities and the time until a consensus is reached. We present a heterogeneous mean-field theory that agrees well with the Monte Carlo simulations. The effectiveness of the heterogeneous mean-field theory implies that quantitative predictions about the consensus are possible even if empirical data (e.g., from ecological fieldwork or observations of social interactions) do not allow a complete reconstruction of all edges in the network.


INTRODUCTION
Numerous social and biological phenomena in complex networks can be modeled as dynamic processes in which vertices update their states by copying their neighbors. In social networks, individuals (represented by vertices) tend to adopt the opinions, beliefs, or cultural traits of their peers with whom they are connected [1,2]. In biological settings, the vertices can represent individuals or places inhabited by individuals. For example, in an ecological habitat network, patches (vertices) are colonized by species from connected patches [3][4][5][6][7]. Unbiased random drift processes are benchmark models in which the probability of a copying event is independent of the state of the vertex [8,9]. In a genetic model, this feature can be interpreted as ascribing equal fitness to all states. In an ecological context, a random drift process assumes that none of the species is a stronger competitor within a habitat patch (a vertex) than any other. A state can only gain more influence by occupying more influential positions in the network. Although a random drift process is a highly simplified representation of real-world dynamics, it can serve as a null model for investigating positional influence.
The voter model is a paradigmatic example of a random drift process [10,11]. It aims to model the spread of opinions in a social network. The voter model also has applications in other contexts (e.g., spread of lan-guages [12], competition between species [13], and genetic drifts [14]). In the simplest versions of the voter model, each vertex is in one of two possible states: "red" or "blue." Vertices repeatedly update their states by copying the state of a random neighbor. Three conditions must be met for a successful copying event. (1) A vertex must send information about its state. (2) A connected vertex must be ready to update its state. (3) A connection between the sender and recipient must be active. In an ecological setting, the equivalent conditions are as follows: (1) The species must produce colonizers (e.g., seeds) in the sender patch. (2) These colonizers must be able to establish their lives in the recipient patch. (3) The colonizers must find a way from the sender into the recipient patch (e.g., through a suitable ecological corridor). We investigated random drift processes in which one of the three conditions is the limiting factor in the spread of the states.
• In a sender-limited process (SLP), all edges are permanently open, and the recipient immediately updates its state. However, vertices attempt to spread their states across randomly selected edges at a finite rate only.
• In a recipient-limited process (RLP), all vertices constantly attempt to spread their states, and all edges are permanently open. However, vertices only copy the states of their neighbors at a finite rate.
• In a connection-limited process (CLP), vertices attempt to colonize their neighbors at an infinite rate, and they update their state immediately after receiving a copy of a neighbor. However, the edges are only open for transmission at a finite rate.
We assume that the system is homogeneous in the sense that all vertices are equally active senders, they are all equally active recipients, and all edges are open for transmission with equal rates. Under these assumptions, the conventional voter model corresponds to the RLP. Previous studies have termed the SLP as a "reverse voter model" [15] or an "invasion process" [16]. Others have referred to the SLP as a "birth-death process," the RLP as a "death-birth process," and the CLP as "link dynamics" [17].
Early research on random drift models assumed that the network was either a complete graph [18] or a regular lattice [10]. In these networks, as well as in any other regular network (i.e., a network in which each vertex has the same number of neighbors), no difference exists between the SLP, RLP, and CLP; every vertex is equally likely to be a sender and equally likely to be a recipient. In irregular networks, this symmetry is broken. The resulting differences between the update rules have been discussed in the context of the voter model [15,16], evolutionary dynamics [14], and game-theoretic settings [19][20][21].
The purpose of this study is to demonstrate the differences between the SLP, RLP, and CLP in networks with a community structure. A community is conventionally defined as a subnetwork that contains a significantly higher number of edges than predicted by a null model (e.g., an Erdős-Rényi graph with the same mean degree as the investigated network). In this study, we define communities more broadly as subnetworks with different (i.e., higher or lower) densities than the corresponding Erdős-Rényi graph; thus, we also cover core-periphery structures and disassortative topologies under the umbrella of community-structured networks. We generated a community structure using a stochastic block model, which is a standard method for generating communities in networks [22,23]. By considering networks with two communities, we demonstrate that, depending on the network structure and the factor that limits the transmission of a state, an initial minority state can become the more probable winner in the competition. We also compare the amount of time required to reach a consensus (i.e., a condition in which all vertices are in the same state) in the three processes (SLP, RLP, and CLP).
In Sec. II, we briefly review the relevant literature on random drift processes in modular networks. In Sec. III, we define our notation for the stochastic block model and specify how we implemented the random drift processes as agent-based models. We present the heterogeneous mean-field theory of two-community random drift processes in Sec. IV. In Sec. V, we derive the probability with which one of the states becomes a consensus. In Sec. VI, we compare the mean consensus times in the SLP, RLP, and CLP. We conclude by discussing the implications of our findings in Sec. VII.

II. BACKGROUND
Random drift models have a long history in mathematical biology, usually under the name "neutral models." This name indicates that competing partners are assumed to be equally strong. Since the introduction of the neutral theory of evolution [24], such neutral models have been intensively applied in the field of population genetics. In this context, the "colors" (red vs. blue or more colors) represent genotypes within a population (i.e., within a single species). Another typical field of application is ecology [8], in which the "colors" mark different species living together in a community.
In both fields, neutral models are important references for the study of competition between genotypes/species (in genetics/ecology). The agents can represent individuals or places occupied by individuals belonging to different species [25]. The earliest models typically used meanfield approximations [18], assuming perfect mixing in the whole population; nevertheless, early literature also highlighted the idea of considering the structure of interactions between agents. For example, the classic model of Wright [26] represents genetic drift in a population that is spatially divided into subpopulations (demes), which inhabit discrete habitat patches ("islands"). Members of the demes mostly breed within themselves, except for a few migrants drawn from the rest of the population. Numerous models later explicitly considered the interaction structure, representing it by a network. These studies investigated the effect of the network topology on the dynamics of competition between genotypes/species (e.g., [14,19,27]). Many of these models relaxed the assumption of neutrality (i.e., allowing unequal competitive strengths), further extended the voter model by including more than two "colors" (beyond red and blue), and permitted new colors to enter the system (by mutation in the genetic models and by speciation or immigration from an external species pool in the ecological settings).
A large field of research, which aims at integrating local (patch-level) and regional species dynamics, is metacommunity ecology [3]. Metacommunity models usually relax some of the aforementioned restrictive assumptions and assume interaction rules between species that are more complex than those in the voter model. Nevertheless, we believe that the voter model, because of its simplicity, is an important baseline model for the dynamics of competition in metacommunities.
In the context of opinion formation, vertices typically represent individuals, and the network structure reflects social relations (e.g., acquaintances). Some previous studies have investigated the dynamics of the voter model on a special type of modular network structure: two-clique networks (i.e., networks in which both communities are complete subgraphs). Sood et al. [16] found that, if the number of edges between the cliques is small, the opinion dynamics in the two cliques can be approximated by two independent diffusion processes. Conversely, when the inter-clique connectivity is high, the average opinions in the two cliques quickly become equal and remain coupled until a consensus is reached. Later studies showed how this finding can be explained by the theory of coalescing random walks [28] and a heterogeneous mean-field theory [29]. Recent work has also investigated how the dynamics of the two-clique voter model change if the cliques are influenced by opposing external news sources [30,31].
Only a few previous studies have analyzed the voter model on general two-community networks in which the communities are not cliques. These studies focused on the question of suitable representations of the underlying Markov chain [32]. Numerical results for the consensus time [33] and the success probability of a single mutant [34] have also been presented. Our study goes beyond previous research by examining the process from various initial conditions and under three kinds of limitations: when the interaction rates between adjacent vertices are limited by the ability of vertices to send (SLP model) or receive information (RLP) or by the capacity to transmit information across an edge (CLP).

III. MODEL
We generated networks using the stochastic block model, which is a canonical model for modular networks that can generate various community structures [22]. In the special case of a two-community network, the stochastic block model takes the following data as input. First, we partition N vertices into two disjoint communities, C 1 and C 2 . The number of vertices in C i is denoted as N i . Between any two vertices in the same community C i , a link exists with probability P i . The number of edges between C 1 and C 2 , randomly selected from all N 1 N 2 pairs of vertices, is denoted by X. In our parameterization of the stochastic block model, X is a fixed deterministic value; thus, X ≥ 1 guarantees that there are connections between the communities. We discarded any networks in which communities were internally disconnected to ensure that a consensus could be reached.
Given a network with two communities generated by the stochastic block model, we assign an initial state (red or blue) to each vertex. We assume that C 1 is initially entirely red, and C 2 is entirely blue. We refer to this state as a "polarized" initial condition. This situation can occur, for instance, if the communities were previously unconnected, and each of them developed an internal consensus before new inter-community edges enabled interactions between communities. (In Appendix A, we show numerical results for a non-polarized initial condition.) We then update the states according to either the SLP, RLP, or CLP. In the SLP, we randomly choose a "sender" from all vertices in the network. The sender then exports its state to a randomly chosen neighbor. In the RLP, the direction of the exchange is inverted: we pick a random "recipient" that adopts the state of a randomly chosen neighbor. In the CLP, we first chose a random In the SLP and RLP, we pick a random vertex (e.g., the blue vertex a) and a neighbor of that vertex. If the chosen neighbor is the blue vertex b, a maintains its current state. If, instead, the chosen neighbor is the red vertex c, then either c becomes blue (SLP), or a becomes red (RLP). In the CLP, we pick a random edge instead of a random vertex. If the selected edge is (a, c), either a becomes red (with probability 1/2) or c becomes blue (also with probability 1/2). edge. A randomly chosen vertex on the edge adopts the state of the other vertex on the same edge. In Fig. 1, we illustrate the differences between the three processes. In all three investigated processes, we modeled random drift dynamics as a continuous-time Markov chain. In other words, the time intervals between consecutive updates are independent and identically distributed exponential random numbers. We set the time unit so that the mean update rate per vertex is 1 in all investigated processes (SLP, RLP, and CLP). Updates were repeated until the vertices reached a consensus. Because we restricted our study to finite, connected networks, the occurrence of a consensus in finite time was guaranteed [35].

IV. HETEROGENEOUS MEAN-FIELD THEORY
A continuous-time Markov chain is fully specified by the transition rates Q(x, y) at which the process moves from any state x to a new state y = x. If we wanted to represent the state of every vertex in a network with N vertices faithfully, we would have to distinguish between 2 N different states of the network. All Monte Carlo simulations presented in this study are based on this exact agent-based paradigm. We complemented the simulations with a heterogeneous mean-field theory, in which we denote the state of the system as (ρ 1 , ρ 2 ) if a fraction ρ 1 of vertices in C 1 and a fraction ρ 2 of vertices in C 2 are red.
We can split the degree k i of a vertex in C i into two contributions: k i = k i,int + k i,ext , where k i,int is the number of neighbors in the same community, and k i,ext is the number of neighbors in the opposite community. In the stochastic block model, k i,int is a random variable with a binomial distribution B(N i − 1, P i ) for vertices in C i . We made a heterogeneous mean-field approxima-tion by replacing k i,int with the mean of the distribution, With these approximations, we can derive all the transition rates. For example, let us consider the transition from (ρ 1 , ρ 2 ) to (ρ 1 + 1/N 1 , ρ 2 ). The transition occurs when a vertex in C 1 changes from blue to red. In the SLP, the transition probability can be written as a sum of two probabilities Π 1 + Π 2 , where Π i is the probability that the sender is a red agent in C i who sends its state to a blue agent in C 1 . The first probability takes the following form: where the first factor on the right-hand side, N 1 ρ 1 /N , is the probability of choosing a red sender in C 1 . The second factor is the expected proportion of blue neighbors in C 1 , conditioned on the selection of a red agent in C 1 as the sender. The second probability follows analogously: The transition rate is thus where the factor N accounts for the fact that there are, on average, N updates per unit time. After inserting Eqs. (1) and (2) into Eq. (3), we obtain the result in the top left corner of Table I, where we use the mean number of internal edges in C i , as an auxiliary variable to shorten the expressions. Based on similar arguments, we can calculate the other transition rates listed in Table I. We adopted the convention that the diagonal elements of the transition rate matrix satisfy In this section, we calculate the probability R(ρ 1 , ρ 2 ) of reaching a red consensus from the initial state (ρ 1 , ρ 2 ). The choice of color is arbitrary; the labels "red" and "blue" are interchangeable. R is the martingale that satisfies R(0, 0) = 0, R(1, 1) = 1, and for all (ρ 1 , ρ 2 ) / ∈ {(0, 0), (1, 1)}. The solution for the investigated processes has the form R(ρ 1 , ρ 2 ) = r 12 ρ 1 + r 21 ρ 2 r 12 + r 21 (7) with It is possible to verify Eq. (7) and Eq. (8) by inserting them into Eq. (6) together with the expressions for Table I. We note that r ij for the SLP is not equal to r ji in the RLP; thus, there is no symmetry between the two processes. Equation (8) shows that the probability of a red consensus in the SLP and RLP depends on the number of edges within and between communities. In the CLP, however, R is always the initial fraction of red vertices in the entire network, regardless of the details of the community structure. Consequently, the initial majority state is always the likely consensus state in the CLP. In the SLP and RLP, the initial majority is not necessarily the likely winner, as we can see from the following example.
We assume a polarized initial state in which ρ 1 = 1 and ρ 2 = 0. In general, if R(ρ 1 , ρ 2 ) > 1/2, then the consensus opinion is more likely to be red than blue. In the SLP, starting from a polarized state, this situation occurs if The quantity in the numerator, 2E i + X, is the number of end points of the edges (also called "edge stubs") in C i . Equation (9) implies that even if N 1 < N 2 (i.e., red is initially in the minority), red is the likely final winner as long as the number of stubs in the red community is sufficiently small. In Fig. 2, we confirmed the predictions of Eqs. (7) and (8) using Monte Carlo simulations for an illustrative set of parameters. In the SLP, the probability of a minority takeover from a polarized state decreases with X if the minority community contains fewer edges than the majority (Fig. 2a). However, even for maximally interconnected communities (i.e., X = N 1 N 2 ), the minority can be the likely winner; for example, if N 1 = 100, E 1 = 0, N 2 = 150, and E 2 = 11 175 (in which case C 2 is a clique), then Eq. (8) implies that red wins with a probability of R = 0.525 despite initially having only 40% of the votes. This mean-field approximation agrees well with the Monte Carlo simulations (R = 0.526, 95% confidence interval [0.519, 0.533]).
In the SLP, it is beneficial for the initial minority to have as few edge stubs as possible because, under these conditions, the minority is relatively rarely "infected" with the majority state and can spread its own state with high probability. The opposite is true for the RLP. If the RLP starts from (ρ 1 , ρ 2 ) = (1, 0), then R is the fraction TABLE I. Transition rates from the state (ρ1, ρ2) in the investigated random drift processes. In these expressions, Ei is the mean number of edges in Ci (Eq. 4). We only list transitions with positive rates.

New state (y, z)
Transition rate matrix element Q[(ρ1, ρ2), (y, z)] sender-limited recipient-limited connection-limited Probability R of a red consensus as a function of the number of inter-community edges X for two illustrative parameter sets. In all cases, the initial state is polarized: (ρ1, ρ2) = (1, 0). Point symbols represent the means obtained from Monte Carlo simulations (error bars: 95% confidence intervals). The curves are the theoretical predictions from Eqs. (7) and (8). The background color (red vs. blue) indicates the likely winner. The dotted line in panel (a) shows the inter-community connectivity for which the three processes have identical heterogeneous mean-field theories. For the parameters in panel (a), the smaller community C1 has fewer internal edges than the larger community C2. In panel (b), C1 has more internal edges than C2.
of edge stubs that are located in the red community C 1 . It follows that red is likely to win if E 1 > E 2 (Fig 2b).
It should be noted that this criterion does not depend on X. If there are more edges between the communities, the difference between the success probabilities of the two states decreases. However, the likely winner in the RLP is always the state that initially occupies the community with more internal edges. Consequently, the likely winner can be the initial minority (e.g., red if N 1 < N 2 and E 1 > E 2 , see the RLP curve in Fig. 2b).
In general, the SLP, RLP, and CLP have different values of R. An exception is the case in which the ratio of the number of vertices in the two communities is equal to the ratio of the edge stubs, In this case, it follows from Eqs. (7) and (8) that R equals the initial fraction of red vertices in all three processes. An intuitive way to understand this feature is to note that the left-hand side of Eq. (10) describes the SLP's (RLP's) odds of choosing a sender (recipient) in C 1 vs. C 2 during one update. The right-hand side represents the odds of choosing the SLP's recipient (RLP's sender) from the vertices in C 1 vs. C 2 in the heterogeneous mean-field approximation. In the CLP, the right-hand side is equal to the odds of being a sender and the odds of being a recipient. If Eq. (10) is satisfied, then all odds mentioned above are equal; thus, the processes are identical under the heterogeneous mean-field assumption. In Fig. 2(a), we confirm this prediction with Monte Carlo simulations for an illustrative set of parameters: R is the same for the SLP, RLP, and CLP if X has the special value If Eq. (11) formally predicts X intersect < 0 (e.g., for the parameters chosen in Fig. 2b), no intersection exists.

VI. MEAN CONSENSUS TIME
The transition rates listed in Table I determine the mean time T (ρ 1 , ρ 2 ) until a consensus is reached from the initial state (ρ 1 , ρ 2 ). The equations that determine T are T (0, 0) = T (1, 1) = 0 and y,z Q[(ρ 1 , ρ 2 ), (y, z)] T (y, z) = −1 (12) for all (ρ 1 , ρ 2 ) / ∈ {(0, 0), (1, 1)}. When we insert the transition rates from Table I and Eq. (5) into Eq. (12), we can obtain recurrence relations for the values of T . Using a diffusion approximation [36], we can convert the recurrence relations into the more familiar form of a partial differential equation. That is, we assume N 1 , N 2 1 and take the continuum limit of Eq. (12). For the SLP, this procedure leads to the following partial differential equation: We now assume that the communities are so sparsely connected to each other that X min (N 1 , N 2 ). We can then drop all terms from Eq. (13) For the RLP and CLP, we obtain similar second-order partial differential equations (see Appendix B). We are not aware of a closed-form solution of Eq. (14) or the corresponding equations for the RLP and CLP. However, we can obtain a good approximation of T using a two-dimensional power series. We call this approximation T sparse to indicate that this approximation is valid only if the communities are sparsely connected to each other, We expand the right-hand side only up to quadratic terms because this approximation is sufficiently accurate if X is small. The value of T remains unchanged if we swap the labels of the states (i.e., red and blue); thus, T must satisfy T (ρ 1 , ρ 2 ) = T (1 − ρ 1 , 1 − ρ 2 ). Consequently, the coefficients c ij in Eq. (15) must be zero if either i is odd and j is even, or vice versa. The remaining coefficients can be determined using Eq. (14) and the boundary conditions. In Appendix B, we show how to The dashed lines in Fig. 3 indicate these limits. We can deduce from Eq. (16) that the mean consensus time in the SLP for a small X is always shorter than in the CLP. The mean consensus time for the RLP can range from being shorter than for the SLP (if the community with more vertices has a higher average withincommunity degree) to being longer than for the CLP (if P 1 /P 2 is between N 2 /N 1 and N 3 2 /N 3 1 ). The two illustrative parameter sets shown in Fig. 3

exhibit both cases.
The points in Fig. 3 indicate the results from the Monte Carlo simulations. The curves in Fig. 3 are numerical solutions of the diffusion approximations for the SLP, RLP, and CLP, calculated using the method described in Appendix C. As X increases, the leading-order approximation in Eq. (16) becomes inaccurate, and the rankings of the processes in terms of T change. However, the agreement with the heterogeneous mean-field theory (curves in Fig. 3) is excellent. For the special inter-community connectivity X intersect , derived in Eq. (11), the mean consensus times for all processes are equal. Besides this special case, there are no simple rules that govern which process is fastest or slowest for a given X.
While T is a monotonically decreasing function of X for the CLP, there can be local minima and maxima for the SLP and RLP. Thus, it is possible to increase the mean consensus time by increasing the inter-community connectivity. At first glance, this effect is counterintuitive because one might expect that more inter-community edges, which necessarily speed up communication between the cliques, would always lead, on average, to a faster consensus. The resolution to this apparent paradox lies in the fact that a larger X can give the initial minority state more options to displace the majority, which can slow down consensus formation. For the special case of the RLP on two cliques, this counterintuitive effect has already been observed by Gastner and Ishida [29].
So far, we have focused on polarized initial states. In Appendix A, we present results for a non-polarized initial state with ρ 1 = ρ 2 = 1/2. As for the polarized case, we found that T is a monotonically decreasing function of X for the CLP but not for the SLP and RLP (Fig. 4). If X is small, we also observed the same rankings of the processes in terms of T . For larger values of X, however, the rankings generally depend on the initial state.

VII. DISCUSSION
We compared the effect of three limitations on spreading in networks that had a specific community structure: each network consisted of two subgraphs (communities) with arbitrary sizes and connected by X edges. The parameter X varied from 1, representing a single "bottleneck" transmission channel (or ecological corridor) between the communities, up to X = N 1 N 2 , in which case every possible inter-community connection was present.

A. Two communities divided by a barrier
The case of a small X is particularly interesting from a biological viewpoint. In an ecological interpretation, the model can be viewed as a two-species metacommunity model, in which the vertices represent discrete habitat sites. A barrier (e.g., mountain range or river) divides the area into two regions. X represents the penetrability of the barrier. For example, the barrier can be transgressed via ecological corridors.
Notably, when the barrier is hardly permeable (i.e., X is very small), the time of winning is inversely related to X (Eq. 16). For example, when the two sides of a barrier are connected by twice as many corridors, the time of coexistence is halved. This rule is important when we prefer coexistence, to maintain species diversity, or when we wish to eliminate one of the species. In real life, an additional corridor can arise naturally (e.g., by a rock slide on a mountain), or can be man-made, either voluntarily or involuntarily. A typical example of the latter is when building a road, railway line, or canal promotes the spread of species (e.g., weeds) from one geographic region into another. Our results suggest that having two corridors instead of one does not considerably influence which species wins (Fig. 2) but dramatically influences the time required for winning (Fig. 3).
Although our model contains serious simplifications, it reflects two important, realistic features of real-life metacommunities. First, local dynamics are integrated into regional dynamics [4,7]. Second, the opportunity for spreading of a species depends on the initial position within the network (see, for example, a review on river networks in [5]). The capacity of the voter model for studying metacommunities has only rarely been used (e.g., [37]); to our knowledge, our model is the first to introduce a habitat structure that has the topology of a modular network (local patches with a regional barrier).
The effect of a modular habitat structure is similarly important in evolutionary models, in which the colors (red and blue) represent genotypes within a species. Geographic barriers have often been mentioned as major drivers of evolution, including speciation [38]. Therefore, studying the penetrability of barriers, compared to spreading within each side, is of primary importance. We propose that network theory can provide considerable help in this regard.
Our model is also applicable to social networks with exogenous community structures. Barriers in social networks can be along religious divisions (e.g., Catholics vs. Protestants in Northern Ireland), language barriers (e.g., between Dutch and French speakers in Belgium), or ethnic conflicts (e.g., between Greek and Turkish Cypriots). The likelihood of inter-community links can be increased, for example, by working in the same place, visiting common places of entertainment, or living in the same neighborhood. The present results suggest that, when the number of links is originally low, adding a few new links can significantly decrease the time required for consensus formation.

B. Validity of the heterogeneous mean-field theory
The heterogeneous mean-field approximation in Sec. IV assumes perfect mixing (in ecological terms, no dispersal limitation) within each side of the barrier, whereas our simulated networks represent the exact configuration of the links (ecological corridors) between the sites. Interestingly, the heterogeneous mean-field approximation agrees well with the results of the explicit (i.e., agent-based) model. Because the heterogeneous meanfield approximation does not contain detailed information regarding the network structure, its effectiveness in predicting the outcome could be utilized in ecological fieldwork and observational studies of social dynamics: it is easier to estimate the connection probability within and between groups of vertices than to map the links exactly.
At small X, the agreement between the agent-based model and the heterogeneous mean-field theory can be explained by the fact that winning within a single side (within a community) is a relatively fast process because of the higher intra-community connectivity. The main bottleneck for an invader is to find a way from one community to another. Therefore, all sites within the same side of the barrier can be considered almost identical in terms of sending and receiving the species.
The validity of the heterogeneous mean-field theory is not limited to a small X. If X is large, the proportion of red vertices ρ 1 and ρ 2 quickly equalizes between communities 1 and 2. In this case, the heterogeneous mean-field theory approximates the random drifts in ρ 1 and ρ 2 as being coupled by the constraint ρ 1 = ρ 2 [29,39]; thus, the vertices in the same community can again be treated as almost identical. Figure 2 shows that the theory correctly predicts that, in the SLP, the initial minority can be the likely consensus at small X but is unlikely to win at large X, even if all other parameters (P 1 , P 2 , and the initial distribution of red and blue vertices) are held constant. The heterogeneous mean-field approximation also correctly captures the sensitive dependence of the consensus time T on the process (SLP, RLP, and CLP) and the network parameters (P 1 , P 2 , N 1 , and N 2 ) for the full range of inter-community connectivity (i.e., from X = 1 to X = N 1 N 2 ; see Fig. 3).
As X increases, the network topology changes from a modular structure sensu stricto (i.e., two clusters divided by a barrier) over a core-periphery structure to an anti-community structure, where both communities are sparsely connected internally and highly connected to each other. Ecological habitat networks often form a core-periphery structure toward the edge of the geographic range [40], as the suitable area tends to become fragmented [41]. However, these cases require more complex models; the network's parameters are unlikely to be homogeneous from the core to the periphery because of a change in the environment across space. More typical examples of core-periphery networks are available in social sciences. For example, networks of professional relationships between scientists have been reported to possess a core-periphery structure [42,43]. Networks of romantic relationships typically exhibit anti-community structures because most edges are between agents of different genders [44]. Our results underline the importance of knowing the limiting process (SLP, RLP, or CLP) regardless of whether the network has a modular, core-periphery, or anti-community structure.

C. Effect of sender, recipient, and channel limitations
The importance of the update rule has been emphasized in several studies on general networks (e.g., [16,[45][46][47]), and various update rules have appeared under unrelated names. The nomenclature suggested here (SLP, CLP, and RLP) expresses that there are different limiting factors in the process of copying the state of a vertex to one of its neighbors. The spread can be limited by the sender (as in our SLP), the connection (CLP), or the recipient (RLP). In our study, only one type of limitation was present in each case. To our knowledge, earlier studies have also assumed only one type of limitation in each process. For example, Sood et al. [16] studied the voter model (equivalent to our RLP) and two processes that they termed the "invasion process" (equivalent to our SLP) and "link dynamics" (our CLP). Castellano [15] called the SLP a "reverse voter model", whereas Macijewski [45] discussed the SLP and RLP under the names birth-death and death-birth Moran processes, respectively.
In an ecological and evolutionary context, the SLP, CLP, and RLP represent different types of limitation on the species/genotypes. In the SLP, the production of dispersers (e.g., seeds in plants) is limited. The CLP corresponds to another type of dispersal limitation; here, the movement of the species between habitat patches is limited. This situation occurs, for instance, when the distance between the patches is high or the penetrability of the terrain is low, relative to the organisms' ability to move. For example, if the landing distance of seeds from the parent plant is relatively short compared to the distance between suitable habitat patches, the CLP is applicable. Finally, the RLP represents establishment limitation. In the case of a plant species, establishment limitation typically occurs when germination in the new site is limited, or the survival probability of the seedlings is low.
Several studies on metacommunity ecology and landscape ecology have shown that these factors are important for the maintenance of biodiversity in landscapes with multiple habitat patches [48]. For example, the pace of succession in plant communities can be significantly reduced by any of the aforementioned limiting factors [49].
In this study, we compared the relative importance of the three types of limiting factors. Let us consider the case in which the initial condition is polarized: region 1 is inhabited solely by the "red" species (ρ 1 = 1), whereas region 2 is occupied by the "blue" species (ρ 2 = 0). Without loss of generality, we assume that N 1 < N 2 , that is, the red species is less frequent than the blue one (it is a "minority"). For example, the red color may represent a species that has newly arrived as a potential invader and is attempting to cross a barrier for the first time. Alternatively, red and blue can represent two vicariant species that have lived stably on different sides of the barrier [50]. The process starts when the originally impermeable barrier becomes permeable (X > 0), for example, due to a climate change. Building roads or bridges can also make a barrier permeable, depending on the species. Creating artificial ecological corridors is a means of increasing permeability for species that are worthy of protection. Even a single link (X = 1) initiates a diffusion of species across the barrier. The endpoint is reached when one of the species outcompetes the other on both sides of the barrier. If "red" is an alien invader, then low R (probability of red fixation, see Sec. V) is preferred from the perspective of nature conservation. Conversely, if "red" is a rare species that is worthy of protection, a high R may be desirable. Our results suggest that there are two scenarios in which invasion across the barrier by the initial minority is likely (see the red region in Fig. 2): in the SLP, when the internal connectivity on the "red" side of the barrier is low compared to the "blue" side, or in the RLP, when this connectivity is high. This finding agrees with earlier results in the opinion dynamics literature: it depends on the update rule whether low-degree or high-degree vertices are more likely to spread their opinions [16,45,47,[51][52][53]. Notably, invasion by the minority can be successful not only at low X but also in a broad range of X, depending on P 1 and P 2 (Fig. 2). In general, starting from good network positions, the minority can win against the majority, even though it does not enjoy any local advantage (i.e., the competition is neutral).
If spreading is limited because crossing the corridors is difficult (i.e., in the CLP), then the final outcome of competition does not depend on the number of corridors (X) and only the time of winning does. Therefore, creating more ecological corridors across a barrier or closing some existing corridors can influence the pace of invasion, but not the probability of winning, at least against an alternative species in neutral competition. In the case of the CLP, the network positions do not matter either: it is merely the initial abundance of the two species that determines R. In other words, we observe a mass effect.

D. Suggestions for future work
The aforementioned results hold true only for neutral competition between two species/genotypes. To gain a more general view, the model should be extended to non-neutral competition and to more than two species/genotypes. Non-neutrality (i.e., selection) has been introduced into several network models of evolu-tionary processes [14,19,45].
In the present model, a considerable simplification is that each vertex can be inhabited only by a single species (red or blue) at a time. This assumption is plausible in two cases. In the first case, the spatial resolution is so fine that each site can contain only a single individual (that belongs to the red or blue species). In the second case, a time scale separation can be made, assuming that the time needed for competitive exclusion within a site is much shorter than the waiting time for the arrival of a new colonizer (i.e., the system is strongly dispersallimited). Future extensions of the model with non-binary discrete or continuous states are worthy of investigation. The literature on social influence has highlighted substantial differences between opinion dynamics on binary, continuous, and nominal scales [54].
Another interesting task for future research is to investigate two or three types of limitations on spreading acting simultaneously. Their relative importance can be thought of as points in a multi-dimensional parameter space, in which we have so far only investigated special cases when two out of three processes (sending, receiving, and transmitting) occur at infinite rates.
We acknowledge that the network model presented in this study is not spatially explicit. However, it would be straightforward to replace the non-spatial stochastic block model with a model for modular spatial networks (e.g., the model proposed by Gross et al. [55]). Equationbased results are difficult to obtain for spatially explicit models; however, Monte Carlo simulations are certainly possible.
In summary, we studied three different agent-based models of neutral competition using equation-based and numerical techniques. The update rules of the models assumed that either the senders, recipients, or channels of transmission were the bottlenecks in the spread of the states from one vertex to another. While we acknowledge that our update rules and network models are highly simplified compared to real-world applications, we believe that our results provide a basis for future studies of agent-based competition in modular networks. pare those results with the outcomes of Monte Carlo simulations for an illustrative non-polarized initial state: ρ 1 = ρ 2 = 1/2. We randomly assign an initial color (red or blue) to each vertex with probability 1/2. In this case, Eq. (7) predicts R = 1/2 for all X and for all three processes (SLP, RLP, and CLP). Thus, if both communities initially have an equal number of vertices of both colors, then both colors are equally likely to win regardless of the number of inter-community links and the process. We confirmed this prediction with Monte Carlo simulations. Unlike R, the mean consensus time T depends on X and the type of process (Fig. 4). In Appendix B, we present an analytic technique that can approximate T as a function of X. This approximation is applicable for all initial conditions. In Fig. 4, we represent the approximation by the solid curves. The approximation is in good agreement with Monte Carlo simulations (represented by point symbols in Fig. 4). In the limit of small X, it follows from Eqs. (B8) and (B9) that the mean consensus time in the non-polarized case is half of that in the polarized case; thus, the rankings of the processes in this limit are the same for both types of initial conditions (polarized and non-polarized with ρ 1 = ρ 2 = 1/2). For larger values of X, however, there are no simple rules that would relate the mean consensus time to the initial conditions. Appendix B: Mean consensus time for sparse inter-community connectivity The diffusion approximation for the three processes under investigation (SLP, RLP, and CLP) has the following general form: with functions f i (ρ 1 , ρ 2 ) and g i (ρ 1 , ρ 2 ) which differ between the processes. These functions are listed in Table II. If X = O[min(N 1 , N 2 )], the leading-order terms of Eq. (B1) are where the parameters H i and I i are dependent on the process. Their values are listed in Table II. For X min(N 1 , N 2 ), we obtain the approximate consensus time T sparse for all three update rules (SLP, RLP, and CLP) by assuming that T sparse can be approximated by the truncated power series in Eq. (15). For the SLP, we insert Eq. (15) into Eq. (14) and compare the constant terms on the left-hand and right-hand sides of the equation. The result is Because the blue consensus is an absorbing state, we must have T (0, 0) = 0. By inserting this condition into Eq. (15), we obtain the condition 2N 2 1 (2E 2 +X) 2N 2 1 P 1 ρ 1 (1−ρ 1 )+X(ρ 1 +ρ 2 −2ρ 1 ρ 2 ) 2N 1 (2E 1 +X) N P 1 ρ 1 (1−ρ 1 ) 2(E 1 +E 2 +X) + N X(ρ 1 +ρ 2 −2ρ 1 ρ 2 ) 4N 2 1 (E 1 +E 2 +X) f2(ρ1, ρ2) N 2 P 2 ρ 2 (1−ρ 2 ) 2E 2 +X + N 1 X(ρ 1 +ρ 2 −2ρ 1 ρ 2 ) 2N 2 2 (2E 1 +X) 2N 2 2 P 2 ρ 2 (1−ρ 2 )+X(ρ 1 +ρ 2 −2ρ 1 ρ 2 ) 2N 2 (2E 2 +X) N P 2 ρ 2 (1−ρ 2 ) 2(E 1 +E 2 +X) + N X(ρ 1 +ρ 2 −2ρ 1 ρ 2 ) 4N 2 2 (E 1 +E 2 +X) g1(ρ1, ρ2) The corresponding matrix equations for the other two processes, M RLP c RLP = v RLP and M CLP c CLP = v CLP , can be found in a similar manner. In these cases, the matrices and vectors are 1 P 1 X 2(N 2 1 P 1 + N 2 2 P 2 )X −4N 2 2 P 2 X −(N 2 1 P 1 + N 2 2 P 2 )X 0 −4N 2 1 P 1 X 2N 2 2 P 2 X 4N 1 N 2 2 P 1 P 2 N 1 N 2 2 P 1 P 2 0 4N 2 1 N 2 P 1 P 2 2N 2 1 P 1 X −4N 2 2 P 2 X N 2 It is possible to express the solutions of M SLP c SLP = v SLP , as well as the corresponding equations for the other two processes, in a closed form. We use these exact solutions for the interpolation shown as solid curves in Fig. 3. The expressions are long and not immediately insightful; thus, we omit them here. However, one can easily infer the leading-order terms in the limit X min(N1,N2) → 0 of c ij from the general form of the matrices M SLP , M RLP , and M CLP , and the vectors v SLP , v RLP , and v CLP . We find c 11,SLP → − 2N 1 N 2 P 1 P 2 (P 1 + P 2 )X , (B5) c 11,RLP → − 2N 2 1 N 2 2 P 1 P 2 (N 2 1 P 1 + N 2 2 P 2 )X , In the special case of a polarized initial condition (i.e., ρ 1 = 1 and ρ 2 = 0), we can simplify Eq. (15)