Persistence of complex food webs in metacommunities

Metacommunity theory is considered a promising approach for explaining species diversity and food web complexity. Recently Pillai et al. proposed a simple modeling framework for the dynamics of food webs at the metacommunity level. Here, we employ this framework to compute general conditions for the persistence of complex food webs in metacommunities. The persistence conditions found depend on the connectivity of the resource patches and the structure of the assembled food web, thus linking the underlying spatial patch-network and the species interaction network. We find that the persistence of omnivores is more likely when it is feeding on (a) prey on low trophic levels, and (b) prey on similar trophic levels.


Introduction
A central aim of ecology is to understand the emergence and maintenance of the enormous diversity of ecological species. Both in aquatic and terrestrial environments the number of niches created by primary abiotic factors is relatively limited. Most ecological communities thus exhibit a self-sustaining diversity where species present in the system open up niches for others.
Perhaps the simplest example for biotically created niches is found in predator-prey interactions. By persisting in a given system a species can open up a niche for a predator feeding on that species. This mechanism can in principle enable the coexistence of a large numbers of species in complex food webs.
Recent investigations have identified several factors that contribute to the stability of large food webs and thus promote diversity (McCann, Hastings & Huxel 1998, Brose, Williams & Martinez 2006, Vandermeer 2006, Gross, Rudolf, Levin & Dieckmann 2009). However, growing evidence suggests that, at least in some systems, the food web emerges only on a regional scale, whereas simple food chains are observed if specific locations (patches) are considered in isolation (see Fig. 1) (Pillai, Gonzalez & Loreau 2011). This points to a need for a meta-community perspective, in which one explicitly accounts for the dispersal of species across a network of patches. In particular, one can ask if and how different communities can be sustained in a network of similar patches.
The dynamics of dispersal in a system of multiple patches was first discussed in the context of metapopulation theory, introduced by Levins (Levins 1969, Hanski 1998. The simplest metapopulation model considers only a single species that spreads over a system of identical patches, such that each patch is either occupied by the species or vacant. Extending this framework to allow for multiple populations per patch leads to metacommunities. In the present paper we focus on a class of metacommunity models that has recently been proposed by Pillai et al. (Pillai, Loreau & Gonzalez 2010, Pillai et al. 2011, Pillai, Gonzalez & Loreau 2012. These models are relatively simple and therefore conducive to a detailed analysis. At their center stands the assumption that within each patch competitive exclusion precludes the formation of complex food webs. Thus any single patch can only harbor a simple food chain. However, as different food chains can be realized in different patches a complex food web emerges at the landscape level (see Spatially coupled local patches sustaining food chains give rise to complex food webs on the landscape scale. Figure reprinted from (Pillai et al. 2011) . this work and show that the computation of persistence conditions follows a general pattern. Exploiting this pattern, we present a general approach allowing the direct computation of conditions for the persistence of an arbitrary given food web in the metacommunity.
We start in Sec. 2 with a detailed description of the modeling framework. In Sec. 3, we compute conditions for food chain persistence, introducing a concept which is then used to compute persistence conditions for more complex food webs in the subsequent sections. Based on Sec. 4, where we consider a simple example involving omnivory, we formulate a general formalism for the calculation of persistence ranges in Sec. 5. In Secs. 6 and 7 we use this formalism to investigate the dependence of the persistence range on the predator-prey interactions and on the geographical network. We conclude with a summary and discussions in Sec. 8.

Modeling framework
Following Pillai et al. (Pillai et al. 2010, Pillai et al. 2011 we consider a metacommunity consisting of s species that populate a network of discrete, interconnected patches. We do not account for the abundance in specific patches, but capture the presence (or absence) of a certain species in a particular patch by a binary variable. Thus every individual patch is either empty or occupied by a specific set of species.
The system evolves due to local extinctions and colonization of adjacent patches. Local extinctions occur either spontaneously (e.g. due to external events or demographic stochasticity) or due to interactions with other species in the model. For every species i we denote the rate of spontaneous local extinctions as e i . When the extinction of a species occurs, all species directly or indirectly feeding upon this species also go locally extinct. For example, in a patch with three species where species 3 feeds on species 2 and species 2 feeds on species 1, species 1 goes extinct with rate e 1 , species 2 goes extinct with rate e 1 + e 2 and species 3 goes extinct with rate e 1 + e 2 + e 3 .
Colonization allows a species i that is established in a patch to establish itself in suitable patches with a constant rate c i . A target patch is considered suitable if a) it can be reached from the source patch, b) no stronger competitor is already established in the target patch, and c) prey for the focal species is established in the target patch.
Regarding a) we assume that the patches form a complex network, to which we refer as the geographical network. In this network every node represents a patch, and a link between two nodes indicates that colonization is possible between the corresponding patches. We assume that the geographical network is identical for all species, which is not necessarily true in all systems. Furthermore, we note that assuming constant colonization rates per link implies that dispersal is not strongly limited by the number of colonizers.
Regarding competition, b) we assume that specialists are better adapted and therefore superior competitors than generalists. If there is an exploitative competition between a specialist and a generalist predator in the same patch and the generalist cannot feed on the specialist then the generalist is excluded. This is assumed to occur instantly in the model. Thus, a generalist predator cannot colonize a patch where a competing specialist is already established. Furthermore, an established generalist population goes locally extinct if a competing specialist colonizes its patch.
Regarding the availability of suitable prey, c), we assume that only certain primary species can colonize empty patches. All other species require suitable prey species in their respective patches. In any particular model system we thus choose a fixed set of suitable prey species for each species in the model. Together all of these potential predator-prey relationships also define a network. In this trophic network the nodes represent the species, whereas directed links represent potential predator-prey interactions. We note that every food chain observed in a particular patch is a subgraph of this trophic network (i.e. a subset of its nodes and links). Therefore, also the food web that is formed on the landscape scale, by superposition of the food chains found in patches, is a subgraph of the trophic network. The trophic network is thus the maximal food web that can be observed on the landscape scale. However, the observed food webs may be missing some nodes, if some species go extinct on all patches, or links, if some predator-prey interactions are not realized in any patch.
In the following sections we investigate the conditions for the coexistence of species on the landscape scale, depending on the structure of the trophic and geographical networks.

Linear food chain
We start by considering the case where the maximal trophic network is a linear tri-trophic food chain (see Fig. 2 a)). The main purpose of this simple example is to illustrate the calculation of coexistence ranges, which is extended into a general rule for more complex cases in the subsequent sections. We note that a very similar system, although on a different network, was already analyzed in (Pillai et al. 2011).
To gain a mathematical understanding of the metacommunity dynamics we formulate a mean-field model describing the density of patches in which a specific set of species is found. We use a notation where symbols of the form The expected time evolution of the mean-field patch densities is then given by where we introduced k to denote the mean number of neighboring patches per patch.
In Eq. (1) the first terms on the right-hand-sides describe the effect of colonization, whereas the second terms describe the effect of extinctions. To understand the specific functional form appearing in the equations let us consider the first term of the first equation, −c 1 k [0]p 1 , which describes the loss of empty patches due to colonization. We lose empty patches due to colonization from adjacent patches in which species 1 is established. A typical patch has k adjacent patches and species 1 is established in any of these with probability p 1 . Multiplying the expected number of adjacent patches where species 1 is established, p 1 k , with the colonization rate c 1 yields the total expected colonization rate for a given empty patch. Multiplying further with the proportion of empty patches, [0], yields the total loss rate c 1 k [0]p 1 .
We note that in the equations for empty patches ([0]) and tri-trophic patches ([3]) the effect of colonization is purely negative and purely positive, respectively. By contrast, for single-species ([1]) and two-species ([2]) patches colonization appears both, as a gain and as a loss term, as patches of these types can be both, created and destroyed by colonization. Similarly, the effect of extinctions is purely positive for [0]-patches and purely negative for [3]-patches, whereas for [1]-and [2]-patches extinction has both, positive and negative effects.
In the equations we replaced the number of patches adjacent to a given patch, with the expectation value of adjacent patches k , the so-called mean degree. Working with this mean degree instead of the full probability distribution of the numbers of adjacent patches (the degree distribution) is known as homogeneous approximation in network science. This approximation is known to yield good results for all reasonably narrow degree distributions, which should cover most ecologically relevant cases. However, we emphasize that a somewhat more complicated computation is necessary for instance for geographical networks with a central hub.
By setting the right-hand sides of Eq.
(1) to zero and solving the resulting system of equations, we find the expected equilibrium patch densities where we used asterisks to indicate the stationary values that the system approaches after sufficiently long time.
Generalizing these results to a class of systems where the maximal net-work is a linear food chain of length l, one finds In the following we use similar reasoning to study more complex cases. To simplify the presentation we assume that the extinction rates for all species are equal, e i = e ∀i, and further that the colonization rates for all species are equal, c i = c ∀i. Additionally, we introduce the dimensionless parameters z = e/c andz = z/ k , which constitute differently normalized extinction rates. In this notation the equilibrium patch densities are Let us now investigate under which conditions a food chain of length l can persist in the metacommunity. To obtain an answer directly, we use an approach motivated by the epidemic literature (Kamgang & Sallet 2008, Van den Driessche, Watmough et al. 2002, Diekmann, Heesterbeek & Roberts 2010, Böhme & Gross 2011) and compute the linear stability of the "l-free equilibrium", i.e. the equilibrium where the species l is absent, which is analogous to considering the "disease-free equilibrium" for epidemics. In other words, we analyze the stability of a food chain of length l − 1 against arrival of species l. This reveals the threshold parameter values at which the l − 1-trophic food chain becomes unstable and species l can establish itself. As will become apparent below, this is also the threshold for persistence of species l because the present model cannot exhibit Allee-effects on the metapopulation level.
From the evolution equation for the patch density it follows that persistence of species l is possible if We note that [l − 1] * denotes the equilibrium patch density of species l − 1 in the "l-free equilibrium", before arrival of species l. The condition Eq. (3) shows that the prey, species l − 1, must reach a threshold density [l − 1] * = lz to allow for persistence of species l, which confirms basic ecological intuition. Using Eq.
(2) the persistence condition for l can be rewritten as which can be read as a bound for the dimensionless extinction rate z. Thus, high extinction rates hinder the formation of long food chains while a dense geographical connectivity (high k ) promotes it.

Omnivory in a tri-trophic example
In this section, we calculate the parameter range for z where food webs containing specialists and omnivores can persist at the metacommunity scale. These analyses generalize the results of (Pillai et al. 2011) by providing a general formalism for the computation of persistence ranges. As a first example, we consider the food web configuration shown in Fig. 2. Here, the maximal food web consists of a linear food chain and an additional omnivore top predator that can feed on both the producer and the primary consumer in the food chain. We investigate under which conditions the omnivore, x, can coexist with the specialist top-predator of the food chain, although the specialist will exclude the omnivore in any given patch.
Even without mathematical reasoning it is intuitive that the omnivore faces two dangers. First, if the geographical network is very sparse then the prey species may be too sparse to allow for persistence of the omnivore. Second, if the geographical network is too dense then the specialist top-predator will establish, which threatens the omnivore with competitive exclusion.
In the following we mathematically determine the threshold connectivities of the geographical network by employing the same line of reasoning as for the linear chain. We start by writing the governing equations for patches in which the omnivore x is established as where we used symbols of the form [ix] to denote patches in which a specialist food chain of length i and the omnivore x is established. Note that omnivore x does not suffer competitive exclusion in [1x]-patches, because species 2 is not only a competitor for x, but also one of its prey species. Thus, colonization of species 2 turns a [1x]-patch into a [2x]-patch. This contribution is captured in the term c k [1x]p 2 . Specialists are numbered according to the trophic level they belong to. Arrows indicate feeding links. Shown are different food web that arise on the landscape-scale in the parameter rangesindicated. c) The omnivore x is able to persist in a system of two specialists for z < k /3, coexists with the specialist species 3 for z < k /6 and becomes extinct due to competitive exclusion for z < k /(6 + 3 √ 2). These parameter ranges are not drawn to scale. See text for derivation.
To allow for a more concise treatment we can rewrite Eqs. (5) in the matrix form describing the time evolution of the vector p ). Now, we analyze the response of the x-free equilibrium to small perturbations, i.e. arrival of x in a small number of patches. Persistence of the omnivore x is possible when the x-free equilibrium is unstable. From nonlinear dynamics we know that this is the case when the largest eigenvalue λ of the matrix S, in the x-free equilibrium, is positive, which we write as Starting from this condition we now extract an explicit condition in terms of the connectivity of the geographical network k and the extinction rate z.
In the evaluation of the eigenvalue inequality, we have to take into account that S * depends on the equilibrium patch density of species 3. Because it thus makes a difference whether species 3 is present or absent, we have to analyze the stability of the x-free equilibrium separately for these two cases (see Fig. 2 b) and c)). To distinguish between the two cases, we useŠ * to denote S * when species 3 is present (0 ≤ z < k /6) andŜ * to denote S * when species 3 is absent ( k /6 ≤ z ≤ k /3). The persistence range for the omnivore x is then obtained from a combination of the two conditions λ(Š * ) > 0 and λ(Ŝ * ) > 0 .
Let us first consider the case when species 3 is present. Inserting the corresponding equilibrium expressions from Eqs. (2) into Eq. (6), we can The matrixŠ * is thus split into two matrices,š 1 andš 2 , which capture the net balance of x-patches due to colonization and local extinction, respectively. From (8) it is clear that the x-free equilibrium is stable at z = 0, because all eigenvalues ofŠ * z=0 =š 1 are negative. When z is increased a threshold z is eventually reached where one eigenvalue becomes positive and the omnivore can no longer persist. Mathematically we can detect the transition by monitoring the determinant det(Š * ), which becomes negative at z . In order to calculate the threshold, we write det(Š * ) = det(š 1 k +š 2 z) = det(−š 1 ) det(Mz − k ), whereM = −š 2š −1 1 , andš −1 1 is the inverse matrix ofš 1 . From Eq. (9) it follows that det(Š * ) < 0 if either a) det(−š 1 ) < 0 and all (real) eigenvalues of M smaller than k /z, or b) det(−š 1 ) > 0 and λ(M) > k /z, where λ(M) is the largest (real) eigenvalue ofM. As for the matrix given in Eq. (8) we have det(−š 1 ) > 0, the omnivore persists in the system for z > z = k /λ(M). Now we have an explicit expression for the threshold z . For the matrix S * in Eq. (8) and therefore, the persistence condition for p 3 = 0 becomes This is a lower bound for the parameter z, which limits the persistence of x due to competition with the specialist 3. Now, we consider the case p * 3 = 0, shown in Fig. 2 c). Inserting the corresponding expressions from Eqs. (2) in Eq. (6) yieldŝ In this case, we observe that the stability of the x-free equilibrium is lost when approaching some threshold value z from above. This can be understood intuitively, because the x-free equilibrium is certainly stable when there is no prey species 2, i.e. for z ≥ k /3. It becomes unstable if one eigenvalue of S * becomes positive at a value z , and accordingly det(Ŝ * ) becomes negative. An analogous argumentation as before in Eq. (9) leads to the conclusion that λ(Ŝ * ) > 0 is fulfilled when z < z = k /λ(M), whereM = −ŝ 2ŝ −1 1 and we used that det(−š 1 ) < 0 for the matrix given in Eq. (11).
For the matrixŜ * in (11) the corresponding condition yields This constitutes an upper bound for z, below which omnivore x persists in a system of two specialists. Note that we obtain the same upper bound for the persistence range of a specialist species 2, according to Eq. (4). Thus, as soon as a chain of two specialists exists in the metacommunity, an omnivore feeding upon both of them can establish. Below we show that this holds for any omnivore feeding upon two prey species on subsequent trophic levels. Taking conditions Eq. (10) and Eq. (12) together, we conclude that for omnivore x is able to coexist with a chain of specialists at the metacommunity level. A summary of the results for this example system are shown in Fig. 2. We found that for z < k /3 omnivore x can establish itself in the metacommunity. In contrast to the persistence range of species 2, the persistence range of omnivore x is bounded from below, due to competition with specialist 3, which can persist in the system for z < k /6. Omnivore x can coexist with the superior competitor 3 for z > k /(6 + 3 √ 2) (b), while for z < k /(6 + 3 √ 2) the omnivore becomes extinct and the observed food web is a linear chain of three specialists (a).
The results obtained in this section reproduce those already obtained by (Pillai et al. 2011). Whereas (Pillai et al. 2011) obtained these results from 1. Construct matrix S from evolution equations for p x .
5. The persistence condition is k /λ(M) < z < k /λ(M). the solution of the full underlying equation system, we compute them directly from a stability analysis. The advantage of this approach is that it can be easily applied to more complicated situations and lends itself to automation in computer algebra systems, which allows to compute coexistence ranges for a large variety of different food webs.

General method for persistence thresholds
We now exploit the power of the method proposed in the previous section to obtain general results on the persistence of omnivores. Consider an omnivore feeding on different prey species, where the trophic level of the highest prey species is i − 1. In this case the corresponding S * -matrix is given by .
The different ranges appear in this equation because of the extinction of species i and extinction of species i − 1, respectively. From the general expression for S * we can proceed analogously to the previously discussed specific example. Importantly, certain properties of the specific example system that we exploited above remain valid in the general case. For example, S * has only negative eigenvalues at z = 0, becauseš 1 is always lower triangular and has negative diagonal entries. Therefore det(−š 1 ) > 0, and due to Eq. (9) there is a lower bound for the persistence range, which is determined by λ(M). Conversely, as det(−ŝ 1 ) < 0, there is an upper bound of the persistence range, if λ(M) = k /z in the relevant range. Otherwise, the persistence range is naturally bounded at 2 k /(i(i − 1)), where the highest prey species of the omnivore (species i − 1) goes extinct. Summarizing the considerations above, we find This relationship enables the direct computation of the persistence range for a given omnivore, and thus allows for the analysis of a broad class of food webs in metacommunities. An overview of this procedure is given in Fig. 3. An additional example for the application of this procedure to a specific food web is given in the Appendix.

General results on omnivory
Let us now use the method proposed above to gain ecological insights into the persistence of omnivores in food chains. For simplicity, we restrict our analysis to omnivores feeding upon two prey species, but note that the proposed method can be likewise applied to omnivores feeding on more prey species. Unless stated otherwise we denote the trophic levels of the omnivores' prey by i − 1 and j − 1, where i > j. Correspondingly, the specialists competing with the respective omnivore occupy trophic levels i and j. We distinguish between the following two cases (see Fig. 4): I) The omnivore feeds upon prey at subsequent trophic levels (i = j + 1). II) The omnivore feeds upon prey at non-subsequent trophic levels (i > j + 1). The S * -matrices governing the evolution equations for [(i − 1)x]-and [(j − 1)x]patches in the x-free equilibrium are then given by and where we introduced the subscripts I and II in order to distinguish the S *matrices in the different cases. In order to calculate the coexistence range for a general omnivore, we have to separately consider the situation where species i is absent (p Figure 4: General food web configuration consisting of a chain of specialists and an omnivore x. In I) the omnivore x feeds on two subsequent trophic levels, i.e. i = j+1, whereas in II) the omnivore x feeds on two non-subsequent trophic levels, i.e. i > j + 1. Accordingly, different coexistence ranges are obtained for both cases, as described in the text. 0, [i − 1] * = p * i−1 = 1 − (i(i − 1)z)/2), and the situation where species i is present in the system (p * i = 1 − (i(i + 1)z)/2, [i − 1] * = iz). Then, combining both conditions, we expect to find a parameter range for z which is bounded from below and from above.
Following the procedure in Fig. 3 and using Eq. (14), we finď , and the corresponding coexistence ranges Equations (17) and (18)  i=8 Figure 5: Dependence of the coexistence range for an omnivore on the trophic levels of its prey. The grey regions show the coexistence ranges for different values of i and varying j, corresponding to an omnivore feeding on species i − 1 and j − 1 (see Eqs. (17), (18)). The coexistence range becomes smaller with increasing i and for fixed i with decreasing j. This shows that omnivores are more likely to coexist if they feed on adjacent tropic levels, low in the food chain. Dashed lines indicate the respective persistence thresholds of species i. The dashed region marks the parameter range where the maximal number of omnivores coexists with the specialist chain.
in the metacommunity. We can further deduce statements concerning the dependence of the coexistence range on the trophic levels of the prey species: 1. The coexistence range for omnivore x becomes smaller with increasing trophic level of the prey species.
2. The coexistence range for omnivore x becomes smaller with increasing distance between the trophic levels of its prey species.
These characteristics of the coexistence range are shown in Fig. 5. Note that if we are only interested in the range where the omnivore coexists with the competitor i, the upper thresholds in Eq. (17) and Eq. (18) become the persistence threshold for species i, i.e. z < 2 k /(i(i + 1)) (dashed line in Fig. 5). The range where possibly more than one omnivore coexists with a chain of specialists is given by the intersection of the respective individual coexistence ranges. The dashed areas in Fig. 5 mark the parameter ranges where all coexistence ranges for the same value of i overlap. Thus the maximal number of coexisting omnivores in these parameter ranges yields n max x = i − 1. Let us emphasize that the coexistence range of an omnivore only depends on the trophic levels of its prey species and not on the total length of the specialist chain. This is a consequence of the following relationship: In the x-free equilibrium, i.e. for [(j − 1)x] = [(i − 1)x] = 0, the equilibrium densities given in Eq.
(2) are recovered. Relation (19) can be interpreted as "biomass-conservation", implying that the species densities p i−1 in the chain are conserved, no matter how many predators feed upon species i − 1 (and upon prey at trophic levels below i − 1). The conservation law in Eq. (19) has another practical implication: it allows for the direct computation of equilibrium patch densities p x for omnivores. In the Appendix we derive that the total density of patches where omnivore x is established is given by where S * is the corresponding transition matrix in the x-free equilibrium (matrices given in Eq. (15), Eq. (16)). Note that S * is altered at the point where species i enters the system. Thus, there is no unique matrix S * describing p * x in the whole coexistence range. This is apparent in Fig. 6 at the parameter valuez = 2/(i(i + 1)). So, from the point where invasion of q q q q q q q q q q q q q q q q q q q q q q q q q patch−density 1 10 + 4 2 2 13 + 97 1 6 + 3 2 1 10 1 5 + 13 1 6 0 0.5 z q q q q q q q q q q q q q q q q q q q q q q q q q q x 1 (i=4,j=2) x 2 (i=4,j=3) x 3 (i=3,j=2) Figure 6: Equilibrium densities of three different omnivores from numerical simulations (symbols) and theoretical predictions (lines). Dashed lines indicate parameter values where the respective specialist competitor goes extinct in the metacommunity. The equilibrium patch densities observed in simulations display a close to linear behavior and are well described by the analytical formula in Eq. (20). The parameters for the simulation are the same as in Fig. 10. Figure 7: General food web configuration consisting of a chain of specialists and a generalist g. The generalist feeds on two prey species in two independent chains arising from two types of habitat. In A), the trophic level of both prey species is the same (i = j), in B) the trophic levels differ at least by one (i > j). The corresponding coexistence ranges for both configurations are derived in the text.
an omnivore becomes possible, at the upper bound of the coexistence range, its patch density increases up to the point where the specialist competitor becomes able to persist in the system. At this point (dashed lines in Fig. 6), the patch density of the omnivore starts to decrease due to competition with the specialist i. Both, increase and decrease proceed almost linearly, as it can be seen in Fig. 6. For i > j + 1 and p * i = 0 the linearity is exact becausě S * II = −1 +M IIz . The analytical expression for the equilibrium patch density of omnivores is useful for the computation of persistence conditions of predators that are capable of feeding on other omnivores. Then, the S-matrix contains patch densities of omnivores, in addition to patch densities of specialists.

Competition between generalists and specialists
So far, we considered all empty patches to be equal. In this section we consider a system which comprises two different types of habitat h 1 and h 2 , which we assume to occur with equal probablity. Primary producers are assumed to specialize on a specific type of habitat. Thus, each habitat type sustains a distinct chain of specialists (see Fig. 7). Now, we can ask for the conditions under which a generalist, feeding on prey from both chains, is able to persist in the metacommunity. For simplicity, we focus again on generalists feeding on exactly two prey species. In analogy to the previous analysis we denote the trophic levels of the prey species of the generalist g with i − 1 and j − 1, where j ≤ i. The corresponding matrix S * , describing the evolution of [(j − 1)g]-and [(i − 1)g]patches in the g-free equilibrium is then given by In contrast to above, [(j − 1)g]-patches cannot become [(i − 1)g]-patches or vice versa, as both prey species are from different, independent chains. For the calculation of the coexistence range, we distinguish the two cases (see Fig. 7): A) The two prey species are at the same trophic level. B) The two prey species are at different trophic levels. This is necessary because generalists feeding upon two prey species at the same level, say i − 1, experience no competition with specialists if species i is not present. In contrast, a generalist feeding upon one prey at level i − 1 and a second one at some lower level j − 1, even in the absence of specialist i, experiences competition from the specialist j.
Proceeding according to Fig. 3, we find the coexistence ranges In case A, we wrote the largest eigenvalues of the corresponding M-matrices explicitly, as they assume a very simple form. In case B, the threshold values are given through the following matrices, Here we used that the equilibrium patch densities for a two-habitat system are given by p * i = 1/2−i(i+1)z/2 and [j] = (j +1)z, for j < i. The change in p i compared to a single-habitat system (see Eq. (2)) is due to normalization.
Analyzing the dependence of the coexistence ranges for generalists with respect to the trophic levels of their prey, we find qualitatively the same characteristics as for omnivores: The coexistence range increases with decreasing trophic levels and with decreasing distance between the levels. One exception is the case where both prey levels are equal (i = j). Here, the coexistence range is smaller than in the asymmetric case i = j + 1, though still larger than for i > j + 1 (see Fig. 8). Thus, as above, the maximal coexistence range for generalists is found when feeding on adjacent trophic levels.
In order to relate the coexistence range to the omnivores discussed above, we have to determine the coexistence range for omnivores in the presence of a second independent chain. One finds that the coexistence range for omnivores, given in its general form in Eqs. (17), Eq. (18), aquires an additional factor of 1/2 in every threshold (see Appendix). Then, a comparison shows that the coexistence range for omnivores is always (slightly) larger than the corresponding one for generalists considered in this section (see Fig. 8).
Using the conservation equation (19), one can obtain an analogous result for the patch density of generalists, as the one provided in Eq. (20) for omnivores.

Summary and outlook
In this paper we studied extensions of the metacommunity model proposed in (Pillai et al. 2011). We developed a mathematical method for the computation of persistence and coexistence conditions for different species, based on a successive linear stability analysis of the system in equilibrium. This method allowed convenient computation of the range of connectivities of the underlying spatial network, for which competing species can coexists in different scenarios.
Among other results we used the proposed method to show that that the coexistence range is increased when a) predators feed on low trophic levels and b) when the distance between the trophic levels of their prey is small. This was found to be true both for predators feeding on species from the same chain of specialists and predators feeding on prey from different chains of specialists.
For simplicity, we considered only species which are capable of feeding at most on two prey species. We emphasize, the mathematical method proposed here can be directly extended to predators feeding on a larger number of prey species.
While the underlying model makes strong simplifying assumptions, the results obtained here and in the previous works (Pillai et al. 2010, Pillai et al. 2011, Pillai et al. 2012) seem plausible and thus probably merit further investigation in the future. A clear advantage of the simple model is that it is analytically tractable and thus offers an alternative to numerical Comparison between the coexistence ranges for omnivores and generalists. For a system of two types of habitat and 10 trophic levels (20 specialists in two branches), we plot the coexistence range for an omnivore x, feeding upon prey species from exclusively one branch and the coexistence range for a generalist g, feeding upon two prey species from both branches (inset). Throughout the whole j-range, the coexistence range for the omnivore is larger than the coexistence range for the generalist.
investigations. This advantage is reinforced by the method proposed here, which allows direct computation of persistence conditions even in complex scenarios.
A possible extension not discussed here is to consider directed geographical networks. For instance for dispersal in river networks the directed flow between patches should not be neglected, which leads to a directed connectivity (Muneepeerakul, Weitz, Levin, Rinaldo & Rodriguez-Iturbe 2007). In this case a number of adjustments have to be made, for instance replacing the mean degree by the mean in-degree in the equations. Another promising direction for future research is to extend the present work to strongly heterogeneous networks, such as scale-free networks, where the degree distribution cannot be approximated by the mean degree Finally, we note that the method proposed here may also be applicable in other systems. For example, the model discussed here is closely related to ongoing investigations on simultaneous spreading of several (competing) diseases in social networks (Karrer & Newman 2011, Newman 2005, Masuda & Konno 2006, Ahn, Jeong, Masuda & Noh 2006. where S x denotes the transition matrix for x-patches away from the x-free equilibrium and p x = ([(j −1)x], [(i−1)x]). For example, in case II (i > j +1), the corresponding transition matrix is given by In contrast to the matrix in Eq. (16), describing the x-free equilibrium, the amount of suitable resource patches form omnivore x is reduced, as patches where the omnivore is already established are not available. However, with Eq. (19) we can relate the transition matrix S x to the corresponding matrix S * of the x-free case: Rewriting Eq. (22) reveals, So, at equilibrium (with x), the density of x-patches is given by p * x = [(j − 1)x] * + [(i − 1)x] * = λ(S * ).
Appendix C: Example for omnivory in a 4trophic chain Here, we consider an additional example to the one provided in the main text, in order to demostrate the procedure stated in Fig. 3. In this example, an omnivore feeds on two prey species which are not at subsequent trophic levels (see Fig. 9). Consequently, for step 1) we have to use the S * -matrix given in (16) for i = 4 and j = 2, q q q q q q q q q q q q q q q q q q species 3 species 4 omnivore x Figure 10: Comparison of the predicted ranges with simulation results. Plotted are the equilibrium patch-densities p * 3 (•), p * 4 (•) and p * x (×), obtained from network simulations. Eeach point corresponds to an average over 10 independent simulation runs. We used N = 10000, k = 20, c = 0.05 and variedz = e within the indicated range. Dashed lines correspond to the persistence thresholds predicted by our analytical calculations. Coexistence range for omnivore x: 2/(13+ √ 97) <z < 1/(5+ √ 13), persistence threshold for specialist 3:z = 1/6 and persistence threshold for specialist 4:z = 1/10. According to step 5), the parameter range where an omnivore feeding on trophic levels 1 and 3 can coexist with a specialist chain is given by k 13 + √ 97 < z < k 5 + √ 13 .
Comparing this range to the one given in Eq. (13), one can observe that the whole range is shifted to smaller z-values, and that the total size of the coexistence range is smaller compared to the previous example. These two features resemble the general behavior shown in Fig. 5. A summary of the obtained results for this example system can be found in Fig. 9. In Fig. 10 we show simulation results for this system. It can be seen that the analytically estimated ranges correspond to disappearance or appearance of the respective species types, indicating that the predicted food web configurations actually are realized in the metacommunity.