Skip to main content
  • Loading metrics

Food Web Assembly Rules for Generalized Lotka-Volterra Equations

  • Jan O. Haerter ,

    Affiliation Center for Models of Life, Niels Bohr Institute, University of Copenhagen, Copenhagen, Denmark

  • Namiko Mitarai,

    Affiliation Center for Models of Life, Niels Bohr Institute, University of Copenhagen, Copenhagen, Denmark

  • Kim Sneppen

    Affiliation Center for Models of Life, Niels Bohr Institute, University of Copenhagen, Copenhagen, Denmark


In food webs, many interacting species coexist despite the restrictions imposed by the competitive exclusion principle and apparent competition. For the generalized Lotka-Volterra equations, sustainable coexistence necessitates nonzero determinant of the interaction matrix. Here we show that this requirement is equivalent to demanding that each species be part of a non-overlapping pairing, which substantially constrains the food web structure. We demonstrate that a stable food web can always be obtained if a non-overlapping pairing exists. If it does not, the matrix rank can be used to quantify the lack of niches, corresponding to unpaired species. For the species richness at each trophic level, we derive the food web assembly rules, which specify sustainable combinations. In neighboring levels, these rules allow the higher level to avert competitive exclusion at the lower, thereby incorporating apparent competition. In agreement with data, the assembly rules predict high species numbers at intermediate levels and thinning at the top and bottom. Using comprehensive food web data, we demonstrate how omnivores or parasites with hosts at multiple trophic levels can loosen the constraints and help obtain coexistence in food webs. Hence, omnivory may be the glue that keeps communities intact even under extinction or ecological release of species.

Author Summary

Human impact currently induces rapid reductions in global biodiversity. Assessing the consequences of such modifications requires that ecological science better understand the conditions under which the species in a community can coexist and when not. Fundamentally, two species can not coexist indefinitely when they exclusively compete for the same prey—one must inevitably become extinct. This paradigm is known as the competitive exclusion principle. We consider communities of any number of species and multiple trophic levels, i.e. the average number of steps between a predator and basic nutrient, e.g. sunlight or sugars. We show that the extension of the competitive exclusion principle to such large systems means that each species must be part of a “non-overlapping pairing”. Such pairings are exclusive connections between two species, e.g. a predator and a prey. We demonstrate that a stable food web can always be obtained if a non-overlapping pairing exists. The food web assembly rules are explicit conditions that specify sustainable combinations of species at the different trophic levels. As also seen in field data, our rules imply high species numbers at intermediate levels and few at the top and bottom. We further show that omnivorous species—those with hosts at multiple trophic levels—may take a special role in stabilizing food webs, as they combine several trophic levels.


Fueled by ongoing rapid decline of biodiversity [1], ecology is in the midst of a lively debate on the effect of species loss or introduction on food web stability [2, 3]. In food webs, complexity arises from combining a large number of species (the nodes) and a large number of relations between these species (the links). Addressing the latter, recent attention was devoted to the structure of links using e.g. the random, cascade and niche models [4, 5], stirring a prolific debate on the role of the link distribution regarding food web stability [2, 3, 6, 7]. We take a complementary approach: Using standard consumer-resource equations, we demonstrate fundamental constraints on node diversity in a food web, termed food web assembly rules.

For consumer-resource relationships, the competitive exclusion principle states that when two consumers compete for the exact same resource within an environment, one consumer will eventually outcompete and displace the other [8, 9]. It is known that the number of coexisting species cannot exceed the number of resources these species compete for [10]. Expressed more generally, the number of coexisting species cannot be greater than the number of distinct regulating factors in the community [11]. For trophic communities of several levels, it was subsequently stated that the number of species on any trophic level could not exceed the sum of the numbers on adjacent levels [12]. Experimental studies do demonstrate strong correlations between consumer and resource diversity [1316]. These observations highlight that also the consumer plays a critical role in shaping the network of species, even when direct interaction between resource species is absent, an observation captured in Holt’s paradigm of apparent competition [17].

Despite the existing theoretical constraints and empirical findings, a selective theory for stable coexistence of many species in food webs is currently lacking. This lack may partially be due to the complexity of the many-species interactions, yielding an uncontrollable number of parameters and hampering direct calculations or simulations of sufficient generality. Notwithstanding these complications, progress can be made when necessary conditions are demanded. For an ecology, consisting only of a resource and a consumer level, we have recently shown that coexistence requires that the species richness of both levels is balanced and that a cascade of parameter values must be maintained [18]. Examples of such systems may be the phage-bacteria ecology in the Atlantic Ocean [19, 20] or laboratory ecologies.

However, in food webs, a subset of trophic levels can generally not be considered in isolation. A species’ niche is determined by its entire set of interactions, which generally may be composed of both beneficial and harmful interactions, i.e. the species may act both as a consumer or resource. Further, many food webs contain omnivorous interactions, i.e. those where one species preys on several other species that are located at more than one trophic level. To derive necessary conditions for coexistence in food webs, a more general starting point is required.

Based on the generalized Lotka-Volterra equation [21], we here show that in sustainable food webs each species must be part of a non-overlapping pairing. We define a non-overlapping pairing as a topological pattern for a directed network, where each species must contribute to a closed loop and none of the loops may overlap (Details: Methods). Mathematically, this is a consequence of demanding that the determinant of the interaction matrix be nonzero. This allows us to formulate the principle of competitive exclusion for food webs with multiple trophic levels. We term the resulting constraints the food web assembly rules. For trophically coherent food webs [22] the assembly rules predict that species richness must be largest at intermediate trophic levels, but relatively small at the top and bottom. We then show that any food web that obeys the assembly rules can be dynamically stable and feasible, given that parameters are chosen appropriately. Using the assembly rules, we make predictions for circumstances under which secondary extinctions must occur. By investigating seven highly-resolved empirical food web data sets we finally assess the potentially stabilizing effect of parasitism and omnivory.


Steady state equations

For consumer-resource interactions in food webs, the generalized Lotka-Volterra equations [21] are (1) for primary producers and (2) for species at trophic levels l > 1. We distinguish a species by the set of links that connect it to predators and prey or nutrients and the strength of these links (Details: Sec. S4 in S1 Text). In Eqs 1 and 2, Si(l) with i = 1, …, nl are the densities of species residing at trophic level l, nl is the species richness at level l, denote the maximal growth rates of , pji describe differential consumption of the basic resources by the , denote the decay rate of species , are the interaction coefficients between a species with species , and are the efficiencies of reproduction of species when consuming species .

In the steady state, the time derivatives and on the LHS of Eq 1, respectively Eq 2, vanish and we have the equations (3) (4)

Collecting all constant coefficients (RHS of Eqs 3 and 4) in the vector k and all interaction coefficients on the LHS in the interaction matrix , we have the linear matrix equation , where S is the vector of all species densities. For completely shared nutrients, the competition factors pji = 1. (Details: Secs S1 and S2 in S1 Text).

Parasite interactions

Parasites have complex life-cycles that can demand several hosts [23, 24]. Notwithstanding these complications, we here formally treat them as consumers, respectively resources of independently acting other species. Also, we simplify concomitant links in terms of simple linear responses (details: Sec. S9.3.3 in S1 Text).

Non-overlapping pairing

can be fulfilled if every species is paired with another species or nutrient (this constitutes a perfect matching [25]). For food webs with exclusively sharp trophic levels (as in Figs 1, 2 and 3, but not Fig 4), the network is bipartite and therefore it is required that such a perfect matching exists. When species with variation in food chain length are present, one may generally obtain nonzero by covering the entire network with closed loops of directed pairings (i.e. cycles). This is a sequence of nonzero matrix elements , , (Sec. S6 in S1 Text), i.e. a chain of directed pairings where the direction is maintained and the last element connects to the first. A directed pairing represents one nonzero matrix element, whereas a pairing also includes the symmetric element.

Fig 1. Food web interaction matrix and application of perfect matching.

a, White (gray) boxes indicate nonzero (zero) matrix elements, orange boxes are unity matrix elements for the primary producers; dark and light blue squares indicate a possible path chosen, allowing to be nonzero. Here, No = n1 + n3 + n5 = 13 and Ne = n2 + n4 + n6 = 12, and Eq 6 is fulfilled with Δ = 1. Inset: Schematic of a possible pairing for the chosen path. Note that the invariance property of was used, yielding only n1 non-vanishing matrix elements in the lower right block (Details: SI). b, Perfect matching [25] applied to simple food webs where competitive exclusion rules out coexistence due to lack of niches (i) and where enough niches are available for coexistence (ii). (iii) and (iv) are two additional examples, where coexistence is ruled out by the assembly rules. In (iii), n1 = 2, n2 = n3 = 1. In (iv), n1 = n3 = n4 = 1, n2 = 2. In both, Δ ≡ NoNe ∉ {0, 1}, see Eq 5.

Fig 2. Species richness for different trophic levels.

a, Food web with two trophic levels only; a staircase of coexistence with balanced species richness at levels 1 and 2 [18]. b, Three trophic levels. The number of intermediate species must equal the total number of basal and predator species. Intermediate species dominate ecosystem biodiversity. c, Four trophic levels. n2 (n3) must at least match basal (predator) species richness n1 (n4), indicated by thin black lines in green and orange bar. Solid green (orange) bars show the minimal upper bound to species richness in trophic level one (two). Species richness n2 and n3 can increase even further by co-evolution of intermediate species (shaded region). Note the applicable assembly rules shown for the different cases.

Fig 3. Food web assembly.

a, Consumer limited food web and its interaction matrix. The symbols “×” mark nonzero entries and circles a path through the matrix. Basic nutrient is shown as a gray hexagon, whereas species on subsequent trophic levels are shown with coloured circles. Small circles highlight limitations by consumers. Shaded ovals indicate possible pairing of species. b, Possible assembly of the food web in (a) with labels for No+Ne and NoNe. We set all growth and coupling constants equal to unity, but consider fine-tuned decay coefficients α ≪ 1 (details: [38], in prep.). Note the transitions between biomass limiting states. Sizes of circles indicate approximate densities of species in the different states. Link shown in gray was set to zero in the numerical simulations in (c). c, Species added one-by-one as shown in (b) and granted small initial population density (10−4). After each addition the system is integrated until steady state is reached. In the plot, colors of curves denote species of similar colors in the panels of (b). Note the double-logarithmic axis-scaling in (c). Time in each panel is relative to the time of introduction of the new species.

Fig 4. Inclusion of omnivory.

Food web and corresponding interaction matrix for several species with sharp trophic levels and a single generalist omnivore. We only show its paired link in the network plot, but indicate all its interactions in the matrix.

Empirical food web data

We use high-resolution data on seven food webs including free-living and parasite species: The North American Pacific Coast webs Carpinteria Salt Marsh (CA), Estero de Punta Banda (PB), Bahia Falsa (BF, Fig 5) [26, 27]; the coastal webs Flensburg Fjord (FF) [28], Sylt Tidal Basin (ST) [29], and Otago Harbor (OH), New Zealand [30], as well as the Ythan Estuary (YT), Scotland [23]. These food webs describe consumer-resource interactions between basal, predatory and parasite species. A compilation of all seven food webs has recently been provided [31, 32]. Specifically, the data distinguish three types of links: (i) links between free-living species only (“Free”), (ii) additional links between parasites and other species (“Par”) and (iii) links from free-living consumers to the parasites of their resources (“ParCon”), i.e. so-called concomitant links. Details on data analysis: Section S9 in S1 Text. For the empirical data, the lack of niches, i.e. nullity , was computed by using random values for all nonzero entries of the respective matrix . Basal species were each given an individual nutrient source. In “ParCon sym” a subset (20 percent) of concomitant links were randomly selected to be symmetric (Details: Sec. S9.3.3 in S1 Text). In the data analysis and simulations (Figs 5 and 6), the trophic level of a species is defined by its prey-averaged food chain length (Sec. S9.2.1 in S1 Text).

Fig 5. Comparison to existing models and data analysis.

a, Bahia Falsa free-living food web, with blue and red matrix elements for predator respectively prey dependency. Trophic levels indicated by gray and black bars, whereas color coding along the left and upper edge labels chain length of free-living species (increase from red to blue shades). b, Niche model simulation of the Bahia Falsa free-living food web. c, Cascade model simulation of the Bahia Falsa free-living food web. d, As (a) but with parasites (“Par”) and with colors for free-living species carried over from (a). Remaining species are parasites. e, As (d) but additionally including symmetric concomitant links (“ParCon sym”). f, Lack of niches (d) for seven empirical food webs [31]. Labels mark the sub-webs of free-living species (“Free“), including also parasite links (”Par“), asymmetric (”ParCon asym“) and several symmetric concomitant links (”ParCon sym“). Dashed line connects averages in these categories. Rank deficiencies for free living (df), free-living and parasite species (df+p) as well as additional concomitant links (dc,sym) marked in (a), (d), and (e), respectively. (Analysis details and abbreviations: see Methods).

Fig 6. Simulations of different food web matrices.

a, Barplots indicate distributions of node richness for each approximate trophic level in the seven empirical foodwebs and a generic foodweb derived by averaging the empirical node richnesses in each trophic level. b, Interaction matrix corresponding to the generic food web, containing 110 free-living and 47 parasite species (Details: Methods and Sec. S10 in S1 Text). c, Addition of parasites that form random links to any existing free-living species. d, Addition of parasites that are confined to consumer at a specific trophic level. e, Similar to (c) but with the restriction of parasites consuming only free-living species at levels 3 and 4. f, Similar to (e) but with additional parasite-parasite interactions (hyperparasitism), approximately 5 percent of parasite links are from parasite to parasite. Note the color coding along the edges of the matrices in (c)—(f), chosen as in Fig 5a, 5d and 5e. g, The lack of niches, i.e. rank deficiency, as a function of the number of links per parasite for each of the four cases described in (c)—(f).


We perform two types of simulations: (i) In-silico assembly of a tree-like food web (Fig 3c), where parameters are chosen according to constraints discussed in Sec. S2 in S1 Text. The numerical values of the parameters are: For the interaction and growth coefficients η = β = k = 1 for all links present (solid black arrows in Fig 3b), as well as the decay coefficients {α1, …, α8} = {.1, .1, .16, .1, .12, .15, .1, .1}, where the labels are as indicated in Fig 3b. Each new species is introduced at low density and time-integration is continued until steady state is reached (using Mathematica NDSolve method).

(ii) An idealized food web was constructed by using the average species counts at levels ni obtained from all empirical data sets and initially assuming sharp trophic levels for all species. Sharp trophic levels were obtained by rounding each species’ chain length to the nearest integer value (Fig 6a). With the constraint of these trophic levels, a number of links was assigned to match the empirical average for free-living food webs (Fig 6b). When adding further species, the empirical average of parasite species count was used (47 species). To obtain Fig 6, initially, each parasite received one link. In the cases (c) and (d), this link connected the parasite to any existing free-living species. In the cases (e) and (f), this link connected the parasite to any existing species at trophic levels 3 or 4. For any subsequent link, a parasite was chosen at random. A link was then formed in three ways: Case c: randomly to connect with another existing species; Case d: randomly, but only to species at the same trophic level as for the initial link of that parasite; Case e: randomly to other existing species at levels 3, level 4; Case f: randomly to other existing species at levels 3, level 4 or another parasite (More detail: Sec. S10 in S1 Text).



We describe the interaction of species on L trophic levels by the generalized Lotka-Volterra equations [21, 33]. Basal species are constrained by the system carrying capacity while the consumers are assumed not self-limiting, and trophic interactions occur through the linear type-I functional response (Methods). Such equations have been widely used in community assembly models, where food web networks are assembled by numerically analyzing the equations to find parameter sets with stable and/or permanent coexistence solutions [3436]. Here we take an alternative path by first finding a necessary condition for coexistence in terms of species richness, which results in the food web assembly rules that constrains the network topology. We subsequently show that when these assembly rules are fulfilled, there always exist parameters for which feasible and stable network structures can be obtained.

In the steady state, we have the matrix equation , where S is the vector of all species densities, is the interaction matrix between the species, and k is the vector of growth and decay coefficients. Note that has a block structure with nonzero entries only for interactions between neighboring trophic levels but not within the same level, and that the positions of these matrix elements are symmetric due to mutual interaction between predator and prey (Fig 1a). Stable/permanent coexistence requires that a feasible solution exists [7, 35]. Structural stability, i.e. robustness against parameter perturbations, of a feasible coexistence solution requires that be nonzero (Sec. S2 in S1 Text), a condition required for the existence of the matrix inverse in a linear equation [37]. In the following, we analyze what this basic condition means for the species richnesses at the different trophic levels of a food web. We then discuss also the stability of a given solution.

We first specialize to the case of a single shared basic nutrient, e.g. sunlight, used by all primary producers , with n1 the species richness on the first trophic level and i ranging from 1 to n1. This corresponds to setting the competition terms pji = 1 for all 1 ≤ i, jn1 in Eq 1, thereby yielding a block of n1 × n1 unit entries in the lower right block. (Example: Sec. S4 in S1 Text). Nonzero determinant is achieved if it is possible to identify a path of matrix elements that only contains elements from the non-zero sub-matrices bordering the diagonal (Fig 1a). This is equivalent to demanding that every species be part of a consumer-resource pair connecting neighboring trophic levels and none of these pairs overlap (known as perfect matching of a bipartite graph in graph theory [25]). The pairing guarantees that no species share exactly the same niche, i.e. a particular set of interactions with resources and consumers (Sec. S4 in S1 Text), and manifests the competitive exclusion principle (Fig 1bi and 1bii). For primary producers, pairings may involve the nutrient source (Fig 1a, inset). In that case, at least n1 − 1 species at level two are required for pairing of the remaining basal species. We term this structure resource-limited. In this case, n2n1 − 1 is required. In the example (Fig 1a) this condition can indeed be fulfilled, because a sufficient number of species exists at level two. If pairing with nutrients is not used, n2n1 is required—a consumer-limited configuration due to the biomass restriction imposed by consumer predation (Fig B in S1 Text). In turn, those species left unpaired at level two must be paired by species at level three.

Defining No and Ne as the sums of node richness at odd and even levels, respectively, it is then easy to check that the general constraints become (5) which encompasses the competitive exclusion principle [8, 9, 18]. Defining L as the top trophic level, for each of the two options in Eq 5 a set of L − 1 nested inequalities arises relating the species counts ni: (6) This sequence continues until nL is reached. The case Δ = 0 is consumer-limited, whereas Δ = 1 signals resource limitation. Note that these rules allow simple assessment on which food webs can have coexistence-solutions. To illustrate this, we give two simple examples of food webs that cannot coexist by Eqs 5 and 6 (Fig 1biii and 1biv). Our rules thereby are more selective than those in previous work [12]. There, a requirement was stated for trophic communities of several levels, where the number of species on any level could not exceed the sum of the numbers on adjacent levels—a condition that would e.g. not rule out the two simple webs (Fig 1biii and 1biv), hence not detect the lack of niches.

The conditions (Eqs 5 and 6) rule out stable coexistence when violated, yet they leave unanswered if all populations can be positive or stable when they are met. For any choice of species counts fulfilling Eqs 5 and 6, a feasible solution can be obtained by starting from the complete non-overlapping pairing of species, i.e. a subset of links. A tree-like backbone of links will be obtained, which preserves the complete non-overlapping pairing. Additional links give each species access to nutrients. Note that a tree is a maximally trophically coherent network of species [22]. For this structure, we find that the parameters can always be assigned to yield positive steady-state populations for all species. This can be demonstrated by selecting all interaction strength equal to unity. Subsequently the decay rates αi can be selected to be small and to fulfill constraints at each branching point of the tree, thereby obeying trade-offs between the species in the respective branches. As the number of these constraints is less than the number of available decay coefficients, these inequalities can always be fulfilled (details: [38], in prep.). An example for possible assembly is shown in the subsequent section. Recognizing the existence of solutions may then serve as a starting point for investigations into the volume of parameter space of feasible solution for Lotka-Volterra systems [39].

The existence of a Lyapunov function is a sufficient criterion for global stability [40]. Using this, in extension of the analysis of simple chains of species [41], we demonstrate that tree like food webs that are feasible are always stable, i.e. the Lyapunov function decreases monotonically with time after the initial perturbation (Sec. S2.2 in S1 Text). We thereby establish that for each combination of species richnesses consistent with the conditions (Eqs 5 and 6), a feasible and stable food web exists.

In practice, there may be several basic nutrients, such as different chemical compounds or spatial or temporal subdivision [42]. If nS > 1 separate nutrients are available, the assembly rules yield nS+1 sets of conditions analogous to those in Eq 6 where any Δ ∈ {0, nS} is allowed (Sec. S7 in S1 Text). The presented theory assumes simple predator-prey couplings. Non-linear interactions (i.e. type-II response) and cannibalism can be included by adding diagonal matrix elements in Fig 1a, corresponding to species that pair with themselves (Secs S7, S8 in S1 Text). Another future extension of the theory could be that of incorporating frequency-dependent predation [43].

Food web assembly

We return to a single nutrient (nS = 1) and now discuss species richness at the different trophic levels. In the consumer-limited case, Eq 6(i) restricts n1 to an upper bound given by n2. Eq 6(ii) conversely restricts n2 to numbers equal to the sum of the total species richness in both neighboring trophic levels, hence the limitation to the abundance of n2 is much weaker compared to that of n1. Accordingly, the basal level cannot constitute the global maximum of node richness within a level. Moving further, n3 could again exceed n2 but possible limitations stemming from the count of top predator species become noticeable. When starting at the top predator level L, by symmetry, similar constraints as in Eq 6 hold: nLnL−1 ≤ 0. Together with Eq 6(i) we have for the consumer-limited state, n1 + nLn2 + nL−1, i.e. species at intermediate trophic levels generally dominate food web biodiversity (Fig 2). The condition is similar for the resource-limited state, where the limit is shifted by one species. For increasing L, these equations predict further increase in the contribution of intermediate species to total biodiversity.

Given these general constraints, we can now discuss food web assembly. Consider a simple food web and its interaction matrix (Fig 3a). Graphically, an allowed structure is again manifested by permitting non-overlapping pairing of species. Food web growth is characterized by alternating transitions between resource- and consumer-limited states. Initial community growth requires the presence of a single primary producer (Fig 3b), hence n1 = 1. The only possible addition is then a consumer, preying on the existing producer. This entails immediate addition of a trophic level (n1 = n2 = 1) and transition to a consumer-limited state. The assembly rules subsequently permit additions at different trophic levels, but alternation between consumer and resource limitation must be preserved.

For each food web consistent with the conditions in Eqs 5 and 6, parameters can be assigned in a way that food web evolution is possible, i.e. that feasibility and stability are even achieved after each addition of species. To exemplify this, we assign parameters for all eight species of the example, tree-like, food web (Fig 3b). Using in-silico simulations, we mimic the evolution of this web, starting from only a single species (Fig 3c). Any addition of new species leads to a transient disruption of population densities, but a new feasible steady state is eventually established (Fig 3c). To quantify stability, we further compute a Lyapunov function, and verify that it monotonically decreases after each addition within each stage of the food web (Sec. S2 in S1 Text). We have checked that addition of further weak links is compatible with stability and feasibility, hence in principle allowing arbitrary link structure.

Our assembly rules are easily generalized to food webs containing omnivores or parasites with hosts at several trophic levels (Sec. S6 in S1 Text), with the limitation that parasites are here mathematically treated as omnivores, and thus not as species that require multiple hosts to complete their life cycle. Generalizations from our theory would result, when considering nonlinear responses, such as the ones discussed elsewhere [44]. Consider again Fig 3a, but imagine that another species is added on trophic level 4, causing a violation of the assembly rules. This violation can be rectified by a single generalist omnivore (Fig 4), corresponding to an additional row and column of nonzero coefficients in the interaction matrix. The omnivore can be interpreted as a consumer preying on all trophic levels. Hence, one can choose a level i and let its species count ni be increased by one unit to again satisfy the assembly rules. In general, omnivory or parasitism can make the graph non-bipartite. If so, the non-overlapping pairing to achieve is extended to covering the entire network with closed loops of directed pairings (Sec. S6 in S1 Text). The potential for stabilization due to omnivory has also been addressed by Pillai et al. within a metacommunity model [45]. There, coexistence of species on multiple patches in space can be obtained when an omnivore preys on a given basal species on one patch, while it preys on one of the consumers of that basal species on another patch. Our findings provide criteria for sustainable food webs within each patch, i.e. without the notion of spatial separation. In our model, increased diversity could then be obtained by considering partially isolated spatial locations as representing additional basal resources.

Data analysis and simulations

What do the assembly rules teach us about real food webs? For seven detailed empirical food webs (Details: Materials and Methods) containing both free-living and parasite species, we determine the difference between the respective total number of species S and the maximum number of linearly independent rows, (Details: Methods). Linear dependence can be seen as the sharing of a specific niche by several species, therefore d measures the lack of niches in the given food web. When d = 0, the assembly rules are satisfied (). As done previously [31], we distinguish webs formed by: links between free-living species only; links between all free-living and parasite species; with additional concomitant links (Methods and Sec. S9.3.3 in S1 Text).

The free-living webs have substantial structure, an example is given in Fig 5a and others in Sec. S9 in S1 Text. Many species are located at sharp trophic levels (Fig G in S1 Text), a feature that manifests itself by the blocks of white spaces, i.e. absent interactions (Fig 5a). The organization into sharp trophic levels entails stricter demands on the combinations of species richnesses (Eqs 5 and 6), and many sub-webs consisting only of free-living species do not seem to fulfill these demands. This is quantified by an associated lack of niches in most free-living webs, i.e. d > 0. Additional analysis reveals that all free-living webs are in a consumer-limited state, i.e. species richness in even trophic levels dominates (Sec. S9 in S1 Text).

We contrast these findings with simple models, namely the cascade [4] and niche models [5]. Using number of species and links from the empirical datasets, we generate network samples (Fig 5b and 5c). The resulting interaction matrices are characterized by very little structure in terms of trophic levels (the white blocks are all but missing). When repeating the simulations for all seven webs (Sec. S9 in S1 Text) and obtaining the corresponding rank deficiencies, we find that the networks simulated using the cascade and niche models consistently give d ≈ 0 and are less structured than empirical data (Sec. S9 in S1 Text).

We further quantify the organization of species by the chain length distributions for the empirical and modeled networks, where much broader distributions are found for the models. Quantifying omnivory by the standard deviation of chain lengths [46], modeled networks consistently yield substantially higher fractions of omnivory.

We now consider the webs involving parasites (Fig 5d and 5e). At the edge of the panels we indicate by a color-coding, where, in terms of trophic level, parasites enter and how the free-living species are re-organized. Notably, parasites predominantly enter at high trophic levels, the lower section (approximately levels one and two, red to green colors) remains nearly unaltered by the inclusion of parasites. Specifically, interactions of a given parasite generally involve several free-living species at multiple trophic levels (Sec. S9 in S1 Text), which in our linear formalism tend to loosen the structure at the higher levels (n3 and n4, compare Fig 5a and 5d) and reaching agreement with the assembly rules (Sec. S6 in S1 Text). In other words, some of the parasites can be seen as effectively acting as odd-level species, thereby relaxing the initially consumer-dominated free-living webs to a more balanced state.

Concomitant links (Fig 5e) cause further entanglement of trophic levels, open additional options for possible pairings and systematically increase sustainability of food webs. Concomitant links require additional consideration, as they generally are directed links where a parasite is consumed by its host’s predator, i.e. they denote a detrimental effect on the parasite population. A positive impact on the predator’s population may however not always result. We call such links asymmetric concomitant links. If the predator’s population does benefit from the consumption, such as observed in some studies [46, 47], we use the term symmetric concomitant link. Nonetheless, such directed links can lead to additional non-overlapping pairings, when a closed loop of directed links is formed, e.g. a triangle (loop of length three). In the empirical webs it is noticeable that inclusion of asymmetric concomitant links only rarely yields rank improvement. Investigating this further, we find that many food webs with parasite interactions already contain sufficient numbers of loops to allow pairings between parasites and free-living species. The limitation arises because a surplus of parasites exists. Each loop will involve at least two free-living species but only one parasite, making it impossible to find non-overlapping pairings for all parasites. For those webs, only the inclusion of symmetric concomitant links leads to an additional improvement of rank, since then each parasite can be paired with a single free-living species. In two webs, where loops are rare, even asymmetric concomitant links help improve the rank. Details and simulations are available in SI sections S9.3.3 and S10.4 in S1 Text.

For all empirical food webs, we summarize the effect of the different link additions on rank deficiency d (Fig 5f). We find a general decrease of d as more parasite links are added. Notably, full rank is sometimes not achieved, even when all available concomitant links are included. Indeed, empirical food web datasets may often be incomplete, as some links can be difficult to detect. Our findings may serve as a means of identifying possibly missing data, most notably in the Ythan Estuary food web, where overall link density is low and parasite-parasite links are completely absent (further details on individual food webs: Sec. S9.3.2 and S10.3 in S1 Text).

As mentioned above, existing food web models generally produce network structures lacking rank deficiency (d ≈ 0), even for the free-living webs. When instead starting from model networks with similar link density as the empirical webs but sharp trophic levels, we obtain d substantially larger than zero (Fig 6). Parasites, with their complex life-cycles [23], often consume species at varying trophic levels during different stages of their lives. Adding species that each interact with species at multiple trophic levels (Fig 6c), i.e. mimicking the addition of parasites, our modeled webs give systematic decrease of d as links are added (black line in Fig 6g). When adding species that each interact with a single (Fig 6d), or exclusively higher trophic levels (Fig 6e), saturation at d > 0 occurs (blue and red lines in Fig 6b). When simulating also parasite-parasite interaction, d is also found to decrease (Fig 6f, Simulation details: Methods and Sec. S10 in S1 Text). Overall, it takes species with interaction to multiple trophic levels to understand the observed rank improvement by parasites.

We have further explored addition of omnivorous links to the free-living web. The rank deficiency d is reduced rapidly if the addition happens randomly for all trophic levels, but the reduction is limited if omnivorous links occur mostly at the trophic level 3 as in the real data (Sec. S10.2 in S1 Text). We have also performed extensive simulations on the effect of concomitant predation, which further emphasizes the importance of parasite-parasite interaction in achieving coexistence for some webs (Sec. S10.4 in S1 Text).


The food web assembly rules generalize the competitive exclusion principle to food webs of any number of species and trophic levels. They quantify which combinations of species richness at the different trophic levels can yield coexistence solutions. We show that for any of these combinations, there are stable and feasible network structures. Demanding full rank of the food web interaction matrix expresses the simple notion that each species must occupy a unique niche and leads to biologically plausible combinations of species richnesses at the different trophic levels. The requirement, i.e. non-overlapping pairing or equivalently nonzero determinant, is simple and directly allows us to evaluate the self-consistency of empirical data. The rules help explain that actual food web networks are far from random and more structured than those obtained from the traditional niche and cascade models. While some food web datasets do fulfill our conditions, networks known to lack interactions, e.g. the Ythan Estuary web [23], stand out as particularly far from reaching agreement with the rules.

One immediate consequence for food webs with species predominantly organized according to trophic levels, e.g. many free-living webs, is that species richness at the basal and top-predator levels should be limited by the species richness of the respective neighboring levels (compare Eq 6). This can explain the observations, both for terrestrial [48] and marine food webs [49], which report greatest species richness at intermediate trophic levels while top predators and basal species contribute little. Similar conclusions were further drawn from semi-analytical work [50], where a maximum in biodiversity at an intermediate trophic level was predicted. Another consequence for such webs is that additions of species are generally not possible at any trophic level, if sustainable ecologies are to be achieved. Even when the addition satisfies the assembly rules, its presence might cause substantial redistribution of biomass, i.e. shifts between consumer and resource limitation. In practice, it may be precisely these dramatic transitions that explain the profound and abrupt impacts on species abundance and energy flow patterns which are sometimes observed in the field. E.g. the introduction of opossum shrimp into a lake caused a cascade of trophic disruptions by reduction of salmon numbers and subsequent depletion of eagle and grizzly bear [51]. On the other hand, our rules also describe the circumstances, under which removal of a species must trigger additional extinctions.

The assembly rules thus allow predictions of secondary extinction, resulting either from addition or removal of species. If the modified food web obeys the assembly rules, the food web might be stable. Indeed, in some observed cases, ecological release of new species into a habitat has had relatively gentle effects [52]. However, a violation of the assembly rules (Eqs 5 and 6) by addition of a new species can have one of two effects: Either the new species will not be competitive and collapse, or a number of species will collapse (possibly including the species itself) to restore the food web to a permitted state. For removal of a species that leads to violation of the assembly rules, secondary extinctions [53] must be triggered to re-gain a sustainable state. We find a consistent pattern, when considering species removal in empirical food webs: E.g. in consumer-limited webs, such as the free-living empirical webs, secondary extinctions are more likely triggered by removal of resource than consumer species (Sec. S9 and Fig L in S1 Text).

Community omnivory [2, 5456] and parasitism [24, 31, 57] have been suggested as contributing to food web stability. Our approach provides theoretical support for this claim. We indeed find that full rank of the food web interaction matrix is difficult to achieve for species that are organized at strict trophic positions. Species that consume resources at different trophic positions, e.g. omnivores or some parasites, are shown to loosen the constraints and make it easier to comply with the assembly rules, i.e. finding a non-overlapping pairing of species.

Supporting Information

S1 Text. Supporting Information.

Additional technical details on mathematics and data analysis.



We thank I. Dodd and S. Semsey for fruitful discussions.

Author Contributions

Conceived and designed the experiments: JOH NM KS. Analyzed the data: JOH NM KS. Wrote the paper: JOH NM KS.


  1. 1. Ricciardi A, Rasmussen JB. Extinction rates of North American freshwater fauna. Conservation Biology. 1999;13(5):1220–1222.
  2. 2. McCann KS. The diversity–stability debate. Nature. 2000;405(6783):228–233. pmid:10821283
  3. 3. Montoya JM, Pimm SL, Solé RV. Ecological networks and their fragility. Nature. 2006;442(7100):259–264. pmid:16855581
  4. 4. Cohen J, Newman C. A stochastic theory of community food webs: I. Models and aggregated data. Proceedings of the Royal society of London Series B Biological sciences. 1985;224(1237):421–448.
  5. 5. Williams RJ, Martinez ND. Simple rules yield complex food webs. Nature. 2000;404(6774):180–183. pmid:10724169
  6. 6. Ives AR, Carpenter SR. Stability and diversity of ecosystems. science. 2007;317(5834):58–62. pmid:17615333
  7. 7. Allesina S, Tang S. Stability criteria for complex ecosystems. Nature. 2012;483(7388):205–208. pmid:22343894
  8. 8. Gause G. The struggle for existence. Soil Science. 1936;41(2):159.
  9. 9. Hardin G. The competitive exclusion principle. Science. 1960;131(3409):1292–1297. pmid:14399717
  10. 10. MacArthur R, Levins R. Competition, habitat selection, and character displacement in a patchy environment. Proceedings of the National Academy of Sciences of the United States of America. 1964;51(6):1207. pmid:14215645
  11. 11. Levin SA. Community equilibria and stability, and an extension of the competitive exclusion principle. American Naturalist. 1970;104:413–423.
  12. 12. Levins R. Coexistence in a variable environment. American Naturalist. 1979;114:765–783.
  13. 13. Sandom C, Dalby L, Flojgaard C, Kissling WD, Lenoir J, Sandel B, et al. Mammal predator and prey species richness are strongly linked at macroscales. Ecology. 2013;94(5):1112–1122. pmid:23858651
  14. 14. Armbrecht I, Perfecto I, Vandermeer J. Enigmatic biodiversity correlations: ant diversity responds to diverse resources. Science. 2004;304(5668):284–286. pmid:15073375
  15. 15. Andow DA. Vegetational diversity and arthropod population response. Annual review of entomology. 1991;36(1):561–586.
  16. 16. Murdoch WW, Evans FC, Peterson CH. Diversity and pattern in plants and insects. Ecology. 1972;53(3):819–829.
  17. 17. Holt RD. Predation, apparent competition, and the structure of prey communities. Theoretical population biology. 1977;12(2):197–229. pmid:929457
  18. 18. Haerter JO, Mitarai N, Sneppen K. Phage and bacteria support mutual diversity in a narrowing staircase of coexistence. The ISME journal. 2014;8:2317–2326. pmid:24858781
  19. 19. Moebus K, Nattkemper H. Taxonomic investigations of bacteriophage sensitive bacteria isolated from marine waters. Helgoländer Meeresunters. 1983;36:357–373.
  20. 20. Flores CO, Valverde S, Weitz JS. Multi-scale structure and geographic drivers of cross-infection within marine bacteria and phages. The ISME journal. 2013;7(3):520–532. pmid:23178671
  21. 21. Campbell AM. Conditions for the existence of bacteriophage. Evolution. 1961;15:153–165.
  22. 22. Johnson S, Domínguez-García V, Donetti L, Muñoz MA. Trophic coherence determines food-web stability. Proceedings of the National Academy of Sciences. 2014;111(50):17923–17928.
  23. 23. Huxham M, Beaney S, Raffaelli D. Do parasites reduce the chances of triangulation in a real food web? Oikos. 1996;76:284–300.
  24. 24. Lafferty KD, Allesina S, Arim M, Briggs CJ, De Leo G, Dobson AP, et al. Parasites in food webs: the ultimate missing links. Ecology letters. 2008;11(6):533–546. pmid:18462196
  25. 25. Lovász L, Plummer MD. Matching theory. New York. 1986;.
  26. 26. Hechinger RF, Lafferty KD, McLaughlin JP, Fredensborg BL, Huspeni TC, Lorda J, et al. Food webs including parasites, biomass, body sizes, and life stages for three California/Baja California estuaries: Ecological Archives E092-066. Ecology. 2011;92(3):791–791.
  27. 27. Lafferty KD, Dobson AP, Kuris AM. Parasites dominate food web links. Proceedings of the National Academy of Sciences. 2006;103(30):11211–11216.
  28. 28. Zander CD, Josten N, Detloff KC, Poulin R, McLaughlin JP, Thieltges DW. Food web including metazoan parasites for a brackish shallow water ecosystem in Germany and Denmark: Ecological Archives E092-174. Ecology. 2011;92(10):2007–2007.
  29. 29. Thieltges DW, Reise K, Mouritsen KN, McLaughlin JP, Poulin R. Food web including metazoan parasites for a tidal basin in Germany and Denmark: Ecological Archives E092-172. Ecology. 2011;92(10):2005–2005.
  30. 30. Mouritsen KN, Poulin R, McLaughlin JP, Thieltges DW. Food web including metazoan parasites for an intertidal ecosystem in New Zealand: Ecological Archives E092-173. Ecology. 2011;92(10):2006–2006.
  31. 31. Dunne JA, Lafferty KD, Dobson AP, Hechinger RF, Kuris AM, Martinez ND, et al. Parasites affect food web structure primarily through increased diversity and complexity. PLoS biology. 2013;11(6):e1001579. pmid:23776404
  32. 32. Dunne JA, et al. Data from: Parasites affect food web structure primarily through increased diversity and complexity. Dryad Digital Repository.
  33. 33. Case TJ. An Illustrative Guide to Theoretical Ecology. Oxford University Press, chapter 15; 2000.
  34. 34. Post W, Pimm S. Community assembly and food web stability. Mathematical Biosciences. 1983;64(2):169–192.
  35. 35. Law R, Morton RD. Permanence and the Assembly of Ecological Communities. Ecology. 1996;77:762–775.
  36. 36. Drossel B, McKane AJ. Modelling food webs. arXiv preprint nlin/0202034. 2002;.
  37. 37. Petersen P. Linear Algebra. Springer, ch 5; 1962.
  38. 38. Haerter JO, Mitarai N, Sneppen K. in preparation;.
  39. 39. Grilli J, Adorisio M, Suweis S, Barabás G, Banavar JR, Allesina S, et al. The geometry of coexistence in large ecosystems. arXiv preprint arXiv:150705337. 2015;.
  40. 40. Goh BS. Global stability in many-species systems. American Naturalist. 1977;p. 135–143.
  41. 41. Hofbauer J, Sigmund K. The Theory of Evolution and Dynamical Systems. Cambridge University Press, pg 59ff; 1988.
  42. 42. Tilman D. Competition and biodiversity in spatially structured habitats. Ecology. 1994;75(1):2–16.
  43. 43. Allen J, Greenwood J. Frequency-Dependent Selection by Predators [and Discussion]. Philosophical Transactions of the Royal Society of London B, Biological Sciences. 1988;319(1196):485–503. pmid:2905488
  44. 44. Brose U, Williams RJ, Martinez ND. Allometric scaling enhances stability in complex food webs. Ecology Letters. 2006;9(11):1228–1236. pmid:17040325
  45. 45. Pillai P, Gonzalez A, Loreau M. Metacommunity theory explains the emergence of food web complexity. Proceedings of the National Academy of Sciences. 2011;108(48):19293–19298.
  46. 46. Lafferty KD, Morris AK. Altered behavior of parasitized killifish increases susceptibility to predation by bird final hosts. Ecology. 1996;77(5):1390–1397.
  47. 47. Johnson PT, Dobson A, Lafferty KD, Marcogliese DJ, Memmott J, Orlofske SA, et al. When parasites become prey: ecological and epidemiological significance of eating parasites. Trends in Ecology & Evolution. 2010;25(6):362–371.
  48. 48. Martinez ND. Artifacts or attributes? Effects of resolution on the Little Rock Lake food web. Ecol Monographs. 1991;61(4):367–392.
  49. 49. Dunne JA, Williams RJ, Martinez ND. Network structure and robustness of marine food webs. Marine Ecology Progress Series. 2004;273:291–302.
  50. 50. Bastolla U, Lässig M, Manrubia SC, Valleriani A. Biodiversity in model ecosystems, II: species assembly and food web structure. Journal of theoretical biology. 2005;235(4):531–539. pmid:15935171
  51. 51. Spencer CN, McClelland BR, Stanford JA. Shrimp stocking, salmon collapse, and eagle displacement. BioScience. 1991;41:14–21.
  52. 52. Williamson M, Fitter A. The varying success of invaders. Ecology. 1996;77(6):1661–1666.
  53. 53. Eklöf A, Ebenman B. Species loss and secondary extinctions in simple and complex model communities. Journal of animal ecology. 2006;75(1):239–246. pmid:16903061
  54. 54. Fagan WF. Omnivory as a stabilizing feature of natural communities. The American Naturalist. 1997;150(5):554–567. pmid:18811300
  55. 55. Bascompte J, Melián CJ, Sala E. Interaction strength combinations and the overfishing of a marine food web. Proceedings of the National Academy of Sciences of the United States of America. 2005;102(15):5443–5447. pmid:15802468
  56. 56. Thompson RM, Hemberg M, Starzomski BM, Shurin JB. Trophic levels and trophic tangles: the prevalence of omnivory in real food webs. Ecology. 2007;88(3):612–617. pmid:17503589
  57. 57. Hudson PJ, Dobson AP, Lafferty KD. Is a healthy ecosystem one that is rich in parasites? Trends in Ecology & Evolution. 2006;21(7):381–385.