The eco-evolutionary assembly of complex communities with multiple interaction types - PMC Skip to main content An official website of the United States government Here's how you know Here's how you know Official websites use .gov A .gov website belongs to an official government organization in the United States. Secure .gov websites use HTTPS A lock ( Lock Locked padlock icon ) or https:// means you've safely connected to the .gov website. Share sensitive information only on official, secure websites. Search Log in Dashboard Publications Account settings Log out Search… Search NCBI Primary site navigation Search Logged in as: Dashboard Publications Account settings Log in Search PMC Full-Text Archive Search in PMC Journal List User Guide PERMALINK Copy As a library, NLM provides access to scientific literature. Inclusion in an NLM database does not imply endorsement of, or agreement with, the contents by NLM or the National Institutes of Health. Learn more: PMC Disclaimer | PMC Copyright Notice Nat Commun . 2026 Mar 5;17:3511. doi: 10.1038/s41467-026-70117-8 Search in PMC Search in PubMed View in NLM Catalog Add to search The eco-evolutionary assembly of complex communities with multiple interaction types Gui Araujo Gui Araujo 1 Department of Biosciences, Swansea University, Singleton Park, Swansea, SA2 8PP UK Find articles by Gui Araujo 1 , Miguel Lurgi Miguel Lurgi 1 Department of Biosciences, Swansea University, Singleton Park, Swansea, SA2 8PP UK Find articles by Miguel Lurgi 1, ✉ Author information Article notes Copyright and License information 1 Department of Biosciences, Swansea University, Singleton Park, Swansea, SA2 8PP UK ✉ Corresponding author. Received 2025 Jul 15; Accepted 2026 Feb 19; Collection date 2026. © The Author(s) 2026 Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/ . PMC Copyright notice PMCID: PMC13083869 PMID: 41786703 Abstract Identifying the mechanisms that generate structure in complex ecological communities is fundamental for understanding their assembly. Yet a comprehensive picture of how ecology and evolution combine to generate these patterns remains limited. We use an eco-evolutionary model of community assembly that incorporates interaction-driven population dynamics and evolutionary processes, including speciation and inheritance of interactions, to unveil the mechanisms generating and maintaining biodiversity in complex species interaction networks. Importantly, our model unpicks the effects of selection of interaction types from those of inheritance by comparing evolutionary assembly with invasion-based assembly under different combinations of interaction types. We find that a cost-benefit balance in accumulating interactions separates communities into two distinct types. Weakly beneficial interactions produce sparse, competition-dominated networks, whereas strongly beneficial interactions generate highly mutualistic, more connected communities. Mutualism, driven by both selection and inheritance, facilitates the emergence of large communities with increased complexity. Comparing model results with empirical patterns from microbial communities, we identify potential drivers of ecosystem assembly and characteristic interaction structures. Our results provide a classification system of complex ecosystems based on their composition of ecological interactions, thus generating testable hypotheses on the conditions under which different community types (mutualistic vs. competitive) might emerge. Subject terms: Ecological networks, Evolutionary theory, Food webs, Theoretical ecology Ecological community complexity emerges from interactions shaped by ecological and evolutionary processes. This study shows that cost-benefit trade-offs in interactions generate distinct community types dominated by competition or mutualism. Introduction Unveiling and understanding the processes that generate and maintain biodiversity is a central focus of ecological research. Both evolutionary (e.g. speciation) and ecological (e.g. invasions) assembly mechanisms, and how they are shaped by biotic and abiotic factors such as species interactions and environmental conditions, have been shown to promote the complexity observed in natural communities 1 – 6 . Clarifying the relative importance of different mechanisms that foster biodiversity, while maintaining the stability of complex communities thus assembled, is fundamental to understand ecosystems 7 , 8 and to inform future conservation strategies 9 , 10 . Five decades ago, Robert May 11 demonstrated that ecological systems with a large number of species and high connectivity are less likely to be stable than simpler ones. This seminal finding sparked a decades-long search for the organisational features that enable natural communities to increase in complexity without compromising stability or persistence. May’s result referred to randomly connected communities (i.e., not subjected to a deterministic structure or assembly processes) represented by randomly sampled community matrices. Subsequent work has shown that particular network structures can alter the complexity-stability relationship 12 , and that in empirical systems a large number of species often translates into low connectivity between them 3 . Furthermore, beyond structural patterns, the relative composition of interaction types, such as mutualism, competition, and consumer-resource interactions, has emerged as a key factor influencing the outcomes of community assembly and the stability of the resulting communities 13 – 17 . Only recently has theoretical research begun to explore how the interplay between different interaction types shapes the temporal assembly of complex communities, with recent studies revealing the key role of mutualistic interactions in fostering diversity (e.g., 18 ). The next challenge is to uncover the mechanisms driving the emergence of different compositions of interaction types, the structural patterns of the resulting species interaction networks, and the influence of these patterns and processes on the diversity-connectivity relationships that underpin the complexity of ecological communities. Evolutionarily, speciation is a major driver of community assembly. Speciation, acting on an existing pool of species and traits, together with subsequent selection, has been shown to recover patterns of biodiversity and network structure observed in complex model ecosystems 4 , 19 . These findings suggest that speciation-driven assembly offers a key pathway for the emergence of complexity in ecological communities. Comparing speciation-driven evolutionary assembly with ecological assembly via repeated invasions helps clarify the distinct contributions of evolutionary processes to community structure 20 . Considering both speciation and invasion processes together, and their interplay, enables the investigation of two key mechanisms shaping community structure: selection of interaction types and inheritance of interactions. To date, theoretical studies of evolutionary community assembly have primarily focused on single-type species interaction networks such as food webs or mutualistic networks 4 , 5 , 19 – 25 . The combined effects of multiple interaction types have so far only been explored in a preliminary manner in evolutionary models of community assembly, with an emphasis on the study of stability 26 , leaving their broader role in shaping ecological complexity largely unresolved. Network structure not only determines biodiversity, complexity, and stability but can also characterise distinct types of ecological communities. These structural properties often emerge from different ecological and evolutionary assembly mechanisms, as observed across diverse ecosystems 27 . For instance, in microbial communities associated to phytoplankton cells in the phycosphere, community composition is shaped by host identity and metabolic profile 28 , 29 . More generally, across host-associated microbiomes, microbial succession is thought to be driven by cross-feeding interactions between microbes and with the host 30 . The discovery of universal macroecological patterns of abundance and variability in microbial communities has motivated efforts to identify general network structures that can give rise to such patterns 31 , 32 . Non-interactive population dynamic models have successfully reproduced many of these patterns and have been proposed as null models for microbial community structure 31 , 33 , 34 . However, such models fail to capture non-random correlations in species abundances observed in these communities, a caveat that has been addressed by adding sparse and weak interactions between community members 35 , 36 . Together, these findings highlight the critical role of the structure of ecological interactions in shaping microbial communities and the need to identify the assembly mechanisms that give rise to such structural organisation. Similar challenges are observed across ecosystems types and scales. For example, in mutualistic networks comprising interactions between plants and their animal pollinators, characteristic patterns of network modularity and nestedness have been suggested to arise through adaptation and niche optimisation 25 or speciation 4 . A holistic eco-evolutionary understanding of how these processes and their interplay determine community assembly can shed further light on ecological structure across scales. Here, we develop a deeper mechanistic understanding of community assembly by investigating the evolutionary emergence of complex ecological networks involving multiple interaction types. We use a dynamical model that we previously developed 26 in which mutualistic, consumer-resource, and competitive interactions shape the outcomes of speciation and invasion events driving community assembly and complexity. Interactions between species determine how they influence one another, potentially triggering extinction cascades. Over time, successive assembly events and ecological filtering give rise to stable interaction network structures. We find that the strength of ecological interaction benefits defines a threshold that separates two distinct community types: one dominated by competition, and the other by mutualism. Moreover, mutualism and speciation jointly promote increasing network complexity and species diversification. Nonetheless, species richness can increase independently of mutualism and speciation if enough invasion events occur and network connecitivity is low. By analysing longitudinal data from microbial communities 31 , 35 , we link macroecological patterns to underlying assembly mechanisms. We hypothesise that strong benefits from ecological interactions can favour the emergence of highly interactive microbial communities that display patterns of abundance correlations characteristic of these systems. By linking eco-evolutionary assembly mechanisms to emergent community structure and observed macroecological features, our results advance understanding of the processes that shape complexity in natural communities. Results We analyse a step-wise community assembly model in which new species are introduced sequentially to the existing community via two distinct mechanisms: (1) evolutionary speciation and (2) invasion. We start the assembly process with small communities comprising five non-interacting species. Assembly by evolutionary speciation: In this scenario, new species arise as a variation of a randomly selected parent species and inherit their ecological interactions with limited fidelity. Inheritance with changes in species interactions represents mutations in foraging, morphological, or physiological traits that biologically determine interactions with other species (e.g., feeding modes, body morphology, metabolic pathways, signaling mechanisms, etc.). A parameter Δ defines the maximum number of interactions by which the offspring may differ from the parent species. Smaller values of Δ correspond to more constrained inheritance (i.e., greater similarity to the parent), a regime we term strong inheritance. For each speciation event, all interactions of parent species are copied into the offspring, although not faithfully: an integer d , representing the total number of interaction changes, is then drawn uniformly from the interval [1, Δ]. Interactions are randomly removed and/or added from the offspring until the total number of modifications, relative to the parent, equals d . For a given d , the number of interactions created is uniformly chosen from [1, d ] and the number of interactions destroyed is d minus that number. If there are not enough interactions inherited (or no interactions, as in the initial state), then new interactions are created whenever an inexistent one would be destroyed (and vice-versa). Speciation is thus a flexible process, with the average degree of inheritance controlled by Δ: larger values lead to weaker average inheritance. If a parent species has no interactions (i.e., an isolated species), at least one interaction must be added ( d ≥1) to ensure variability. Assembly by invasion: We then define a purely ecological scenario in which new species are introduced without any inherited interactions. Instead, each invader is assigned a connectivity value drawn uniformly from the interval [ ρ 1 , ρ 2 ]. This value defines the probability of forming an interaction with each existing species in the community. As invaders differ in their connectivity, community-level connectivity can shift over time due to ecological filtering / selection. We set ρ 1 = 0.01 and ρ 2 = 0.5 to span a range comparable to connectivity values observed in speciation scenarios. New species are introduced once community dynamics reach equilibrium, i.e., when the dynamics governed by Eq. ( 1 ) have stabilised. Species addition can destabilise the system, driving existing species below an extinction threshold and leading to their removal from the community. The addition of a new thriving species (i.e., that does not go extinct) constitutes an assembly event (Fig. 1 a). After a new species is introduced in an assembly event, we assume no rewiring of its interactions, only the possible addition of interactions with new species included in subsequent events. Species abundances follow ecological dynamics governed by the system of differential equations in Eq. ( 1 ), where x i is the abundance of species i in a community of S species, governed by several mechanistic drivers (Fig. 1 b). The non-negative coefficients p i j , m i j , and c i j represent the strengths of consumer-resource (+/-), mutualistic (+/+), and competitive (-/-) interactions, respectively, and are nonzero only when there is an interaction of the corresponding type between i and j . These interactions are interspecific, thus p i i = m i i = c i i = 0. These coefficients determine the strength of the effect of species j on the density of species i . For consumer-resource interactions, we have p i j + if i is a consumer and p i j − if i is a resource. 1 x i d x i d t = r i − n i + δ ⏟ b a s e l i n e r e p r o d u c t i o n − s i x i ⏟ i n t r a s p e c i f i c c o m p e t i t i o n − ∑ j = 1 S c i j x j ⏟ c o m p e t i t i o n i n t e r a c t i o n s + + ∑ j = 1 S − p i j − x j ( 1 + h p ∑ k p j k + x k ) ⏟ C − R i n t e r a c t i o n s a s r e s o u r c e + p i j + x j ( 1 + h p ∑ k p i k + x k ) ⏟ C − R i n t e r a c t i o n s a s c o n s u m e r + m i j x j ( 1 + h m ∑ k m i k x k ) ⏟ m u t u a l i s t i c i n t e r a c t i o n s 1 Fig. 1. Conceptual overview of the community assembly model and its ecological drivers. Open in a new tab a Communities assemble through the sequential introduction of new species, which may increase in abundance and may competitively exclude existing species, leading to extinctions and the establishment of a new ecological equilibrium. Despite such extinctions, species richness increases over time, resulting in the progressive build-up of a complex community. Alternative assembly scenarios differ in how ecological interactions are assigned between newly introduced and resident species. In the schematic, coloured circles represent species and edges denote the presence of ecological interactions. The plots illustrate the sequence of steps as species abundances ( x ), identified in the network by their colours, change in time ( t ). As an assembly event, the introduction of the blue species into a three-species community (step 1) triggers the extinction of the red species (step 2). Following the attainment of a new equilibrium, the purple species is introduced (step 3), and the assembly process is repeated until a large community is formed (step 4). b Species abundances are governed by standard ecological processes captured by a Lotka-Volterra framework, including logistic growth with baseline reproduction and intraspecific self-regulation due to competition for limited resources, as well as the three principal classes of interspecific interactions: mutualism, consumer-resource interactions, and competition. Costs to baseline reproduction and saturating functional responses are applied to positive interactions (mutualism and consumption), capturing both the maintenance costs and diminishing returns associated with accrued benefits. The variable n i + measures the number of interactions in which species i is a mutualist or a consumer, used to consider the cost of every positive interaction. The sums over j and k run for all S species. We used Type II functional responses to represent intake saturation in both mutualistic and consumer interactions. Note the subtle difference in the denominators of resource and consumer interaction terms, summing respectively over p j k + and p i k + , because the sum gathers all the resources of a consumer (i.e., all sources). Each species i has a positive intrinsic growth rate r i drawn from a half-normal distribution ∣ N ( μ r , σ r 2 ) ∣ . Intraspecific competition strength s i is chosen such that the resulting carrying capacities r i / s i follow a lognormal distribution. New interactions introduced via speciation or invasion are assigned a strength drawn from a half-normal distribution ∣ N ( 0 , σ 2 ) ∣ , where σ sets the level of interaction strength (the choice of interaction type depends on the scenario). In the case of consumer-resource interactions, we impose a directional constraint on interaction strengths to reflect energetic inefficiency. Specifically, we assume that the number of resource individuals removed through consumption always exceeds the number of new consumer individuals produced as a consequence of that consumption. Accordingly, when interaction strengths are randomly sampled, if p i j + > p j i − , we reset p i j + so that p i j + = p j i − . This constraint prevents unrealistically efficient trophic conversion. To capture saturation of resource intake, we assign two parameters: h p for consumers and h m for mutualists, representing their average handling times. Every positive interaction (whether a consumer-resource link in which species i is the consumer, or a mutualistic link in which i benefits) incurs a harvesting cost δ , representing the energetic and physiological investment required to acquire and maintain benefits from a given interaction. Such costs arise from the allocation of finite resources to interaction-related traits. For simplicity and interpretability, we assume a constant per-interaction cost, understood as a mean-field approximation capturing the average energetic burden of maintaining a positive interaction. This cost is subtracted from r i for each beneficial interaction, reflecting a trade-off: as a species accumulates positive links, it becomes increasingly reliant on its partners and may ultimately depend on them for survival (i.e., obligate mutualism or increasing trophic dependence on external resources for consumers, with reduced viability in their absence). This choice reflects the allocation of energy in either interaction traits or survival and reproduction. The balance between the interaction strength parameter σ and the per-link cost δ therefore determines the net benefit of positive interactions. A separation between competitive and mutualistic communities The interplay between the strength and the cost of interactions creates a threshold that separates competitive from mutualistic communities . After 500 evolutionary assembly steps, we observed a threshold in the benefit of ecological interactions that separates two distinct community types (Fig. 2 ). When σ is low and δ is high, resulting in weak interaction benefits, communities are dominated by competitive interactions (Fig. 2 c). We refer to this regime as Type 1 (T1). Conversely, when σ is high and δ is low, producing strong benefits from ecological interactions, mutualisms predominate (Fig. 2 a). We refer to this regime as Type 2 (T2). Consumer-resource interactions reach their highest proportion at the interface between T1 and T2, corresponding to intermediate levels of interaction benefit (Fig. 2 b). Fig. 2. The benefit of ecological interactions creates a threshold that separates two community types. Open in a new tab Final community structure after 500 assembly events under evolutionary assembly with strong inheritance (Δ = 5), shaped by the interplay between interaction strength ( σ ) and the cost of positive interactions or harvesting cost ( δ ). a – c The proportions of interaction types reveal a threshold separating two distinct community regimes. Type 1 communities, where interaction benefits are weak (low σ or high δ ), are dominated by competition. Type 2 communities, where benefits are strong (high σ and low δ ), are dominated by mutualism. Consumer-resource interactions have a higher proportion at the interface between the two regimes, particularly at low interaction costs. d – f Community complexity, defined as species richness multiplied by connectance, is higher in Type 2 communities and follows the same pattern as connectance, as species richness only declines under high cost and high interaction strength. Values in heatmaps represent means across n=15 replicate simulations for each parameter combination. Interaction strengths were drawn from a half-normal ∣ N ( 0 , σ 2 ) ∣ . Communities started with 5 non-interacting species, and new species were introduced by speciation with Δ = 5 and initial abundances equal to the extinction threshold (10 −6 ). h p = h m = 0.1, p i j − ≥ p j i + , r i ~ ∣ N ( μ r , σ r 2 ) ∣ . Species richness (i.e., the number of species in the network) decreases with increasing harvesting cost δ (Fig. 2 d), while network connectance ( C = L / S 2 on the binary directed network, a measure of connectivity) reflects the threshold between community types, being higher in T2 communities (Fig. 2 e). As a result, community complexity, defined as the product of species richness and connectance, substantially increases in mutualism-dominated T2 communities (Fig. 2 f). Additionally, we found that the intensity of intraspecific competition shifts the position of the threshold (Supplementary Fig. S2 ), with higher values shifting the regime from T2 to T1, indicating that the benefits of interactions must be evaluated relative to the strength of self-regulation. The existence of this threshold highlights interaction benefits as key drivers of community assembly, shaping the composition of interaction types and mediating the emergence of complexity. A simple mean-field argument can clarify the origin of the threshold. Consider a community structured by mutualistic and competitive interactions. The potential advantage of a species acquiring a new mutualistic link can be expressed by the inequality μ x 1 + h m k 1 μ x − δ > 0 , 2 where x is the average abundance of a species, μ is the mean interaction strength, k 1 is the mean number of mutualistic links per species, and δ is the cost per mutualistic interaction. This inequality formalises the intuitive idea that a new mutualistic interaction is selectively favourable only if the associated benefit exceeds its cost. We can further approximate the equilibrium abundance of a species using a mean-field description: 1 x d x d t = 0 = r − δ k 1 + k 1 μ x 1 + k 1 h m μ x − k 2 μ x − γ x , 3 where k 2 represents the strength of interspecific competition and γ the mean intraspecific competition. Here, the focal species experiences the community as an average background, reducing the dynamics to a single uncoupled equation for x . By combining these two expressions, we can identify the parameter region in which the inequality is satisfied, given that x > 0 and x satisfies the equilibrium equation. This analysis reveals the existence of a threshold in k 1 , which shifts toward lower values depending on the parameter set. In particular, higher costs δ for a fixed small value of k 2 cause the inequality to fail at smaller k 1 , highlighting a clear benefit-to-cost trade-off associated with acquiring additional mutualistic links (Supplementary Fig. S1 ). Intraspecific competition, being central in determining the equilibrium density x , also impacts the threshold. Selection and inheritance drive interaction type composition Having established two distinct community types driven by interaction benefits, we next examine the role of inheritance in shaping community structure. To do so, it is necessary to distinguish inheritance effects from ecological filtering driven by the selection of interaction types that characterises the compositions of T1 and T2 communities. Both interaction-type selection and inheritance contribute to assembly under evolution, but only selection is present in assembly by invasion. By comparing evolutionary with invasion-driven assembly both considering the selection of interaction types, we can isolate the effects of inheritance. To this end, we designed four assembly scenarios. These scenarios combine two community types (T1 and T2), two inheritance regimes (weak and strong, for evolution), and two levels of variability of interaction types (low and high, for invasion), yielding a total of eight scenarios (Fig. 3 a). The key distinction among these scenarios lies in how new species acquire their ecological interactions during assembly events. Fig. 3. Selection and inheritance of interactions drives the composition of interaction types in assembled communities. Open in a new tab a To disentangle the effects of inheritance from those of interaction-type selection, we analyse eight assembly scenarios, four for each community type (Type 1 and Type 2), spanning evolutionary and invasion processes. For evolution, we define strong (Δ = 5) and weak (Δ = 30) inheritance of interactions from parent to offspring. For invasion, we vary the level of interaction-type variability associated with the invader: low (random interaction types; Inv. Rand.) and high (random interaction-type proportions; Inv. Prop.). High interaction-type variability, present in both evolutionary scenarios and Inv. Prop., enables stronger interaction-type selection. Type 1 communities are defined by weak interaction benefits ( σ = 0.05, δ = 0.025), and Type 2 communities by strong benefits ( σ = 0.2, δ = 0.01). b Ternary plot showing the proportions of mutualistic (M), competitive (C), and consumer-resource (C-R) interactions across assembled communities. Each point represents a community at equilibrium after 500 assembly events, coloured by assembly scenario. Communities assembled under strong inheritance (Δ = 5) show more extreme separation between community types, while those assembled via Inv. Rand. converge toward intermediate compositions due to limited interaction-type selection. Evolutionary scenarios produce more diverse interaction-type compositions across communities. Other parameter values are the same as in Fig. 2 . Evo. (Δ = 5): evolution with strong inheritance. A new species arises via speciation from a randomly selected parent species. After copying the parent’s interactions, up to five additions or deletions are allowed (Δ = 5), resulting in high inheritance fidelity and close similarity between parent and offspring. The types of newly added interactions are determined by choosing the signs of each directed interaction (positive or negative) with equal probability. Evo. (Δ = 30): as above, but with Δ = 30, offspring may differ by up to thirty interactions, producing low inheritance fidelity and greater divergence from the parent species. Intermediate evolutionary scenarios (Δ = 14 and Δ = 22) yielded a similar behaviour to this one (Supplementary Figs. S3 and S4 , Supplementary Note 1 ). Inv. Rand.: invasion with fixed probabilities for each interaction type. Each new species is introduced with independently assigned interactions, where each link is randomly assigned to one of the four available interaction types (mutualist, competitor, consumer, or resource). Due to the random nature of this process, this will yield a probability of 0.25 for each of the interaction types. Because these probabilities are fixed, the proportion of interaction types shows low variability across invaders, limiting the scope for ecological filtering (i.e., selection cannot select species with larger proportions of specific interaction types because they do not exist). This scenario serves as a baseline and mirrors previous models of invasion-based assembly with mixed interactions 18 . Inv. Prop.: invasion with variable proportions of interaction types. For each new invader, the overall proportions of the four interaction types are randomly drawn from a uniform distribution. Interactions are then assigned accordingly. This introduces high variability in the species-level composition of interaction types, allowing ecological dynamics to selectively shape (via selection) the structure of community-level interactions composition. Community types (T1 and T2): for every scenario, we chose particular points ( δ , σ ) to represent T1 and T2 community regions, ( δ = 2.5 × 1 0 −2 , σ = 0.05) for T1 (fifth column from the left and second row from the bottom in Fig. 2 ) and ( δ = 1.0 × 10 −2 , σ = 0.2) for T2 (second column from the left and fifth row from the bottom in Fig. 2 ). We tested different points within the same regions and all yielded similar analyses (Supplementary Figs. S5 – S8 , Supplementary Note 1 ). After 500 assembly events and at ecological equilibrium, the eight scenarios produced a broad range of interaction-type compositions (Fig. 3 b). Across all scenarios, the threshold between T1 and T2 communities was preserved: competitive interactions dominated in T1, while mutualistic interactions predominated in T2. However, inheritance and interaction-type selection each independently amplified the divergence between community types. Strong inheritance (Δ = 5) led to the clearest predominance of the corresponding selected interaction type (consumer-resource or mutualistic), as well as the largest variability in the composition of interaction types. These results underscore the importance of species-level inheritance in shaping community-level structure and in reinforcing the effects of selection across community types. Evolution fosters diversity and complexity in assembled networks To identify the drivers of community complexity, we recorded the trajectories of each assembly scenario across 500 assembly events, evaluated at ecological equilibrium (Fig. 4 a, c). The increase in complexity ( S × C ) was strongly dependent on community type, with T2 communities reaching substantially higher values across all scenarios. Across both community types however, both selection and inheritance independently contributed to increases in complexity. In T1 communities, Evo. (Δ = 30) and Inv. Rand. exhibited similar trajectories, due to the low connectance inhibiting selection from effectively influencing the outcome of assembly when Δ is high. By contrast, Evo. (Δ = 5) and Inv. Prop. communities reached higher average values of connectance and richness (Fig. 4 b), leading to a more sustained increase in complexity following a rapid initial increase (Fig. 4 a). Although species richness increased substantially in all communities, connectance remained consistently low. This suggests that when interaction benefits are low, resulting in competitive T1 communities, assembly tends to produce sparsely connected networks with limited complexity. Fig. 4. Complexity emerges from selection and inheritance of interactions. Open in a new tab a, c Assembly histories showing the emergence of community complexity, defined as the product of species richness and network connectance, over 500 assembly events. Points represent the mean of n=20 replicate simulations sampled every 50 events, with vertical lines indicating the standard error ( S D / n ). Type 2 communities consistently reach higher levels of complexity across all scenarios. In Type 1 communities, interaction-type selection increases complexity, while inheritance has minimal effect. In contrast, both selection and inheritance independently contribute to complexity in Type 2 communities. Weak and strong inheritance result in similar final complexity. b, d Final values of network connectance versus species richness for the communities shown in panels a and c , measured at assembly event 500. Each point represents a single simulation. Type 1 communities attain high species richness but low connectance, whereas Type 2 communities maintain higher connectance while increasing richness. Evolutionary scenarios produce greater variability in structural outcomes. Strong and weak inheritance yield high complexity through distinct routes, either via greater connectance or greater richness. Community types were specified as in Fig. 3 , other parameter values are the same as in Fig. 2 . In T2 communities, the Inv. Rand. scenario produced communities with the lowest complexity, primarily due to reduced species richness (Fig. 4 c, d). In contrast, Inv. Prop. resulted in higher complexity due to increased species richness, despite exhibiting lower average connectance (Fig. 4 c, d). Evolutionary scenarios had a stronger impact on assembly outcomes than invasion. Both weak and strong inheritance produced similarly high levels of complexity, the highest among all scenarios (Fig. 4 b), but through distinct structural pathways. Evo. (Δ = 5) produced communities with higher richness and lower connectance, while Evo. (Δ = 30) yielded the opposite pattern (Fig. 4 d). Thus, the strength of inheritance acts as a mechanism shaping alternative routes to complexity. Moreover, evolutionary scenarios resulted in greater heterogeneity of communities across the richness vs. connectance space, compared to invasion (Fig. 4 d). Overall, high interaction benefits that promote mutualism are also consistently associated with increased community complexity 26 . Both the selection of interaction types and inheritance contributed to the predominance of mutualism and the resulting emergence of complexity. Our results suggest that the effectiveness of inheritance in driving the emergence of complexity depends on community type, and that the degree of inheritance determines the specific pathway through which complexity arises. T2 communities exhibit clearer distinctions between assembly scenarios, highlighting the stronger influence of both selection and inheritance in these mutualism-dominated systems. We extended our analysis to explore faster evolutionary assembly events, out of equilibrium (Supplementary Figs. S9 – S12 , Supplementary Note 1 ), mixed assembly events with different proportions of evolution and invasion (Supplementary Figs. S13 and S14 ), and varying levels of intrinsic growth rate (Supplementary Figs. S15 – S18 , Supplementary Note 1 ) and intraspecific competition (Supplementary Figs. S19 – S22 , Supplementary Note 1 ). All additional results contribute to corroborating the robustness of our conclusions. Moreover, these results show that evolution with high inheritance is more resilient than other scenarios in assembling a community that thrives under stricter conditions (Supplementary Figs. S15 , S17 , and S21 ). To further examine how interaction architecture (i.e., the structure of who interacts with whom) emerges during community assembly, independently of interaction sign, direction, or magnitude, we analysed the topological degree entropy (a measure of the evenness in the number of links across species) and network modularity of assembled communities. For this analysis, community networks were represented in an undirected and unweighted form, retaining only the presence or absence of interactions. This choice isolates structural properties of interaction architecture that are robust to dynamical fluctuations in interaction strengths, while necessarily discarding information on interaction type, directionality, and energetic asymmetries. We quantified the relative increase in structure using a score metric of relative increase over random networks, comparing each observed value Z to the average of 50 randomised communities Z r with matching complexity. The score was defined as Z s = ( Z − Z r )/ Z r (see Methods for details). In T1 communities, strong inheritance (Δ = 5) produced a higher relative increase in both degree entropy and modularity. In T2 communities, both inheritance and selection contributed to increased entropy, but only inheritance led to a substantial increase in modularity (Supplementary Fig. S23 ). Weighted metrics yield equivalent results for T2 communities, but T1 communities no longer exhibit an increase in degree entropy (Supplementary Fig. S24 ). These findings suggest that inheritance promotes the emergence of more modular networks with heterogeneous distributions of the number of interactions across species, both organisational hallmarks of ecological networks 37 . Assembled communities recapitulate microbiome organisation We compared our model results to empirical data from microbial communities in an attempt to identify the mechanisms, assembly processes, or community types that best approximate observed macroecological patterns in these ecosystems. We focused on patterns of relative abundance distributions found in both cross-sectional and time-series microbial community data using data from the human microbiome across different body sites (palm, gut, and mouth) and comprising 3,121 microbial types found in n = 1341 samples 31 . As shown elsewhere 31 , 35 , these data exhibit consistent statistical patterns in the standardised log-mean abundance distribution (MAD) and in pairwise abundance correlations (Fig. 5 ). Importantly, deviations from random expectations in pairwise abundance correlations have been linked, in part, to ecological interactions 35 . To generate data from our model outputs comparable to those from microbial communities, we ran stochastic simulations of communities assembled from equilibrium after 500 assembly events (see Methods for details). To quantify the comparison between correlation distributions, we used the Wasserstein distance, which measures the total displacement of probability mass required to completely match two distributions. Fig. 5. Macroecological patterns observed in microbial communities are driven by ecological and evolutionary mechanisms. Open in a new tab We compared universal patterns from time-series data of human gut, palm, and mouth microbiomes (black points; see Methods) to simulated communities assembled via our eco-evolutionary model. The top row ( a, c, e ) shows the standardised log-mean relative abundance distributions (MAD), where each point represents the probability density of observing a species with a given abundance. Although real microbial abundances follow an approximately lognormal distribution, the lower tail is truncated due to sampling limitations. The bottom row ( b, d, f ) shows distributions of pairwise abundance correlations, where each point indicates the probability density of observing a given correlation coefficient between two species as their abundances fluctuate. Coloured points represent simulation outcomes. Percentages in panels b, d , and f quantify the relative difference between the average Wasserstein distance of simulated-empirical sample pairs and that of empirical-empirical sample pairs, defined as ( W s e − W e e )/ W e e . W s e denotes the mean simulated-empirical distance, and W e e denotes the mean empirical-empirical distance. A value of 100% indicates that the typical distance between simulated and empirical samples is twice the typical distance among empirical samples. a , b Type 1 Inv. Rand. baseline scenario. All Type 1 scenarios yield distributions nearly identical to this baseline (Supplementary Fig. S25 ), and none approximate empirical MAD or correlation patterns. c , d Type 2 Inv. Rand. baseline: This scenario more closely matches the observed empirical distributions for both MAD and correlations, but fails to capture the high-abundance range in the MAD. e , f Type 2 weak inheritance (Evo. Δ = 30): This produces a good fit to empirical data, capturing more of the observable MAD and reproducing the distribution of negative correlations, although positive correlations remain underestimated. Data sample sizes, n = 131 (feces F4), n = 134 (l-palm F4), n = 334 (feces M3), n = 143 (l-palm M3), n = 268 (r-palm M3), n = and 331 (tongue M3). See Methods for full details. Simulations used the same parameters as in previous analyses, with n = 20 replicate communities sampled after 500 assembly events. Time-series fluctuations were generated by applying normally distributed environmental noise (s.d. = 0.1) proportional to species abundances, independently to each species. We used the Inv. Rand. scenario, in which interactions are assigned randomly, as a baseline for comparison. Due to sparsity of interactions, all T1 scenarios produced similar relative abundance and pairwise correlation patterns (Supplementary Fig. S25 , Supplementary Note 2 ), as illustrated in Fig. 5 a, b for the Inv. Rand. baseline. This suggests that, in T1 communities, variation in assembly mechanisms does not translate into differences in abundance patterns, which may instead be dominated by environmental stochasticity. Moreover, none of the T1 scenarios represented well the empirical MAD or pairwise correlation patterns. In contrast to T1, T2 communities yielded a closer resemblance to the empirical patterns observed in microbial communities. The Inv. Rand. baseline scenario approximates the observable range of the microbial mean abundance distribution (MAD), though it fails to capture the upper tail of highly abundant taxa (Fig. 5 c). It also reproduces the overall shape of pairwise abundance correlations (Fig. 5 d). Weak evolutionary inheritance (Evo. Δ = 30; Fig. 5 e, f) and the Inv. Prop. scenario (Supplementary Fig. S26 ) yield an even closer match to empirical patterns. These scenarios better capture the higher density region of the MAD (Fig. 5 e) and approximate the empirical distribution of negative pairwise correlations, although they underestimate the frequency of positive correlations (Fig. 5 f). Based on the Wasserstein distances (Supplementary Fig. S27 ) for the correlation pattern, T2 communities provide a better match to the empirical data than T1 communities. In T2 scenarios, the simulated distributions are closer to the empirical ones, and also closer to those obtained from the corresponding simulations without interactions (i.e. logistic simulations of the same communities). In contrast, T1 communities produce simulated distributions that deviate more strongly from the empirical data than their non-interacting counterparts, indicating that interactions in T1 communities systematically worsen the agreement with observations. Thus, whereas interactions in T2 communities improve empirical concordance, interactions in T1 communities drive simulations further away from empirical patterns. Extending this analysis to additional scenarios explored in the Supplementary Material yielded consistent results: good agreement was recovered for T2 simulations with mixed evolution-invasion assembly (Supplementary Fig. S28 ) and under reduced intraspecific competition (Supplementary Fig. S29 ), while no T1 scenario produced a comparably good match. Therefore, our analysis identifies T2 communities as better representations of microbial communities, highlighting strong interaction benefits as a potential mechanism underlying their macroecological abundance patterns. Discussion The assembly of complex ecological communities is the result of evolutionary and ecological processes acting together to generate and maintain diversity. However, our understanding of how eco-evolutionary mechanisms interact to produce such diversity remains incomplete. Here, we investigated how interaction-type selection and inheritance shape the structure of species interaction networks in a dynamic community assembly framework. We identified two distinct community regimes defined by the level of benefit species derive from ecological interactions. When interactions are weak and costly, competitive links dominate. In contrast, stronger benefits promote mutualistic communities, with consumer-resource interactions increasing in proportion at the transition between these regimes. Evolution of interactions by speciation, implementing inheritance of interactions and interaction-type selection, was found to promote community complexity. The strength of inheritance modulates how complexity emerges: strong inheritance favours increased connectance, while weak inheritance promotes species richness. These results offer insights into the mechanisms underlying natural community assembly and reveal an association between interaction benefits and macroecological patterns observed in microbial communities. Barbier and Loreau (2019) 38 demonstrated that food webs shift from stable, self-regulated ‘pyramidal’ structures to feedback-driven ‘cascade’ dynamics depending on the balance between interaction strength and intraspecific self-regulation. Similarly, our model identifies a threshold where the balance between species self-limitation (intraspecific competition) and how much they gain from others (benefits of interactions) determines whether mainly competitive (T1) or mutualistic (T2) networks emerge. Below the threshold, strong self-regulation or high interaction costs maintain communities in a competition-dominated regime. Above it, interaction benefits become sufficiently strong to favour the emergence of mutualistic networks. Consistent with our mean-field analysis, processes that broadly suppress species abundances, including stronger intraspecific competition, diminish the net gains from positive interactions and consequently favour the emergence of T1 communities. These findings support a general hypothesis: community structure is governed by the interplay between interaction strength, interaction costs, and self-regulation, which together drive the emergence of distinct and dynamically stable configurations. The ability to manage energy and resources to sustain interactions has been proposed as a key driver of ecological diversity 39 . This supports the hypothesis that variation in the cost-benefit balance of interactions gives rise to distinct community types. Mooij et al. (2024) 40 showed that Lotka-Volterra competitive communities with sparse, weak interactions can stably support unlimited species richness. These findings align with our results for Type 1 communities, which we propose emerge through assembly processes that favour competition over other interaction types. Previous studies have shown that both the mix of interaction types and their cost-benefit characteristics influence community stability and structure 14 , 16 . Our results demonstrate how these characteristics can be set to facilitate the emergence of ecological complexity, with high interaction benefits and the selection of mutualism appearing as important mechanisms, also in line with our previous explorations 26 . When speciation is included, these mechanisms lead to even higher complexity in Type 2 communities. These findings highlight the joint contribution of evolution and the structure of ecological interactions as drivers of community complexity. Surprisingly, high complexity emerged alongside stronger interactions, challenging May’s classical view of random communities 11 , 12 and demonstrating that highly connected, strongly interactive systems can remain stable. Although May’s inequality is true, we argue that a randomly defined community matrix (i.e., the Jacobian) does not reflect complex communities with saturating positive interactions. Moreover, our results suggest that inheritance is a key driver of modularity, which is a property associated with stability in mutualistic and microbial communities 25 , 41 , 42 . Moreover, we also highlight the role of the ecological selection of interaction types as a generator of complexity, since it enhanced the emergence of complexity in Type 1 communities in the scenarios with effective selection (evolution with high inheritance and invasion with variable proportion of interaction types). This happened regardless of these scenarios featuring the highest proportions of competition, which means that complexity emerges through selection not only with a joint domination of mutualism. Both species richness and connectance were on average higher for these scenarios (Fig. 4 b), although in Type 2 communities the effect of ecological selection of interaction types on complexity resulted from an increase in species richness only (Fig. 4 d, difference between the two invasion scenarios). In addition to promoting complexity and modularity, inheritance was essential for generating diverse community outcomes in interaction composition, connectance, and species richness. This variability highlights evolutionary processes (acting on species interactions) as key drivers of local and regional diversity, generating novelty in the co-occurrence patterns among communities. This conclusion aligns with the geographic mosaic theory of coevolution, which posits that local evolutionary dynamics generate population-level heterogeneity 1 . Our results show that local speciation, through species interactions alone, can drive divergent community outcomes, even in the absence of abiotic or trait-based heterogeneity. This further supports the role of priority effects and historical contingency in the evolutionary assembly of microbial communities 43 , 44 . Specifically, we find that the degree of inheritance shapes distinct pathways to complexity, favouring either species richness or network connectance. This richness-connectance trade-off has been observed in microbial systems 45 , and we propose that inheritance strength acts as an evolutionary mechanism driving this pattern. Differences between the Inv. Rand. and Inv. Prop. scenarios underscore the key role of interaction-type selection in shaping community assembly. However, successful invasions require an external supply of interaction-type diversity or a precise composition matching community demands, which may be rare or unreliable conditions. We argue that interaction-type selection is more characteristic of evolutionary assembly. Unlike invasion, evolution more reliably generates variability internally, through diversification and inheritance. Thus, even ecological filtering of interaction types may be primarily driven by evolutionary processes. Consequently, the influence of inheritance through speciation may be greater than suggested by the differences between the Inv. Prop. and speciation scenarios. Camacho-Mateu et al. (2024) 35 found that sparse and weak interactions closely reproduce macroecological patterns observed in microbial communities. However, those configurations emerged from parameter optimisation rather than from a generative process based on internal community dynamics. Instead, we investigated the macroecological patterns exhibited by communities assembled via eco-evolutionary processes. While our results do not fully replicate empirical patterns, they reveal additional pathways through which these patterns may be approximated. Surprisingly, our results suggest that, when considering community assembly, strong and abundant interactions characterise microbial communities exhibiting such patterns. Moreover, previous studies linked phylogenetic distance with positive microbial abundance correlations 46 . We found that weak inheritance in T2 communities approximates empirical patterns well, except for positive correlations. This, combined with previous findings, suggests that modifying the implementation of weak inheritance, e.g., by altering how interactions evolve or incorporating taxon-specific traits, could improve alignment with empirical data. We also found that introducing species with randomly defined interactions can generate strong positive correlations, offering an alternative explanation for observed pairwise patterns in microbial communities. Future work may build on these results to explore additional mechanisms that help explain the remaining variability in microbial macroecological patterns. We highlight the contrast between inheritance through speciation and ecological filtering through selection of interaction types as distinct drivers of eco-evolutionary community assembly. Previous models incorporating mixed interaction types have examined invasion-driven assembly, similar to our Inv. Rand. scenario, and identified mutualism as a key factor in community persistence 18 . We extend these findings by isolating the contribution of interaction inheritance to community assembly. This distinction is an important step toward disentangling the relative contributions of ecological and evolutionary processes in community assembly. Disentangling these contributions is especially relevant for microbiomes, which are complex communities assembled in close phylogenetic and life-long association with host individuals 27 , 47 . These systems often reflect long-term coevolution among microbes and between microbes and their hosts 48 , making evolutionary processes central to understanding microbiome structure and function. Future work could build on our framework to explore the mechanistic assembly of both free-living microbial communities and host-associated microbiomes to further characterise the action of evolutionary mechanisms. In this context, considering host communities alongside their associated microbes within a metacommunity framework, as recently proposed 27 , 49 , 50 , may offer deeper insight into the mechanisms underlying the eco-evolutionary assembly of complex coevolved symbioses, highlighting the importance of dispersal and transmission modes. Our results provide insights into the processes driving the emergence of complexity during eco-evolutionary community assembly. Key mechanisms include the strength of ecological benefits, the degree of inheritance of interactions, and the selection of interaction types, which determine whether competition or mutualism predominates. Understanding both the network structures and underlying mechanisms supporting stable, complex, and diverse communities is essential to explain their persistence in nature. This knowledge is also critical for predicting their responses to environmental change. In this way, our work advances ecological theory and supports efforts to maintain and restore complex ecological systems. Methods Simulations All simulations begin with five species with no initial interactions. Species abundances at initialization are uniformly drawn from the interval [0, 0.02]. A species is considered extinct and removed from the system if its abundance falls below a threshold of x e x t = 10 −6 (we verified that results are qualitatively equivalent for x e x t = 10 −5 and x e x t = 10 −7 and thus not sensitive to a particular choice). Each simulation proceeds for 500 assembly events. Assembly occurs only after the system reaches ecological equilibrium, defined as a relative change in all species abundances of less than 0.01% over ten time steps of size 0.01. Intrinsic growth rates r i are sampled from a normal distribution N ( μ r , σ r 2 ) with μ r = σ r = 0.1. Intraspecific competition coefficients s i are determined such that carrying capacities K i = r i / s i follow a lognormal distribution with underlying normal parameters μ = − 2.2, σ = 0.5; specifically, s i ∝ r i / log N ( − 2.2 , 0 . 5 2 ) . In evolutionary scenarios, r i and s i are not inherited (i.e. are sampled from their distributions, regardless of the parent), reflecting their dependence on species-specific environmental conditions and focusing inheritance on interaction structure only. Simulations use Type II functional response on positive interactions with constant handling times set as h m = h p = 0.1. When new interactions are introduced, their strengths are drawn from a half-normal distribution: ∣ N ( 0 , σ 2 ) ∣ , where σ controls the typical strength of interactions. In evolution scenarios, inherited interaction strengths are subject to small stochastic variation, given by w ′ = w ∣ ( 1 + N ( 0 , [ 0.05 w ] 2 ) ) ∣ , where w is the parent’s strength and w ′ is the offspring’s (interactions do not change type with inheritance). After the first 20 assembly events, all isolated species (i.e. those with no interactions) are removed after each subsequent event. Numerical integration of ecological dynamics (Eq ( 1 )) was performed using the odeint function from the SciPy library in Python 51 . Analysis For each combination of δ = ({0.005, 0.01, 0.015, 0.02, 0.025, 0.03} and σ = {0.01, 0.05, 0.1, 0.15, 0.2, 0.25}) in the heatmaps, we ran 15 independent simulations using the strong inheritance evolution model (Δ = 5), each consisting of 500 assembly events. Final community properties were averaged across these replicates and used to generate the heatmap data. To analyse the temporal dynamics of community composition (Fig. 4 ), we ran n=20 replicate simulations per scenario. Variables were recorded every 50 assembly events, and both the mean and standard error (defined as the standard deviation divided by the square root of the number of replicates) were computed and shown in the plots. Except for the heatmaps, all other results were based on these n=20 replicates per scenario. Type 1 and Type 2 communities were defined by parameter combinations ( δ = 0.025, σ = 0.05) and ( δ = 0.01, σ = 0.2), respectively (which are contained in the heatmaps). Network metrics We evaluated two structural properties of the assembled ecological networks: degree entropy and modularity. Degree entropy quantifies the heterogeneity of the network’s degree distribution P ( k ), where k denotes the number of interactions (degree) of a node (species). We computed the entropy using the unweighted network (i.e., considering only presence-absence of links), as H = − ∑ k P ( k ) l n ( P ( k )). Modularity is a standard network metric that quantifies the extent to which nodes form communities, i.e., groups of species that are more densely connected internally than to other parts of the network 52 . We calculated modularity from the unweighted interaction network using M o d = ∑ c L c m − ϵ k c 2 m 2 where c indexes each community (or module), L c is the number of intra-community links, k c is the sum of degrees of nodes in community c , and m is the total number of edges in the network. The resolution parameter ϵ was set to 1. All network analyses were performed using the Python package NetworkX 53 , and community detection was carried out using the Louvain algorithm 54 . Effective increase: To facilitate comparison across scenarios, topological network metrics (degree entropy and modularity) were expressed as their effective increase relative to corresponding random networks. Specifically, for a given metric Z , we computed its effective increase Z s as Z s = Z − Z r Z r , where Z is the observed value in the assembled network, and Z r is the mean value obtained from 50 Erdős-Rényi random networks with the same number of species S and connectance C . This measure represents the percentage increase of the observed network property relative to what would be expected by chance. For the weighted comparison (Supplementary Fig. S24 ), we maintained information about interaction strength and summed the absolute strength ( m , p + , p − , c ) of the pair of directed interactions between two species to compose the weighted link. Data analysis We utilised publicly available data from EBI Metagenomics: longitudinal human microbiome data (feces, left/right palm, tongue; subjects F4 and M3; Study MGYS00002184, ERP021896) from the EBI MGnify platform (project ERP021896) 55 , 56 . This is the same longitudinal dataset used by Grilli (2020) 31 to investigate macroecological patterns. We retained only samples containing at least 10,000 sequencing reads and computed species’ relative abundances accordingly. The 6 filtered data groups utilised in the analysis contained n=131 (feces F4), n=134 (l-palm F4), n=334 (feces M3), n=143 (l-palm M3), n=268 (r-palm M3), and n=331 (tongue M3) samples. Two groups (tongue F4 and r-palm F4) were excluded due to their small resulting sample size. To generate comparable simulation data, we reused the same replicate simulations from Figs. 3 and 4 , starting from the final equilibrium state reached after 500 assembly events. We modelled species abundance fluctuations using stochastic differential equations with environmental noise. Specifically, we added independent Gaussian noise to each species, scaled proportionally to its abundance, with a standard deviation of 0.1. Integration was performed using the Euler-Maruyama method, and abundances were recorded at evenly spaced, non-overlapping time intervals. We computed Wasserstein distances using the function wasserstein_distance from scipy.stats in Python. The simulations without interactions (logistic) used for comparison were done by integrating stochastic perturbations with only the intrinsic growth rates and intraspecific competition in the equation for the assembled communities. We waited until a new equilibrium was reached before sampling the timeseries. Reporting summary Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article. Supplementary information Supplementary Information (4.6MB, pdf) Reporting Summary (85.8KB, pdf) Transparent Peer Review file (629.3KB, pdf) Acknowledgements This project was supported by the Leverhulme Trust through Research Project Grant # RPG-2022-114 to M.L. We acknowledge the support of the Supercomputing Wales project, which is part-funded by the European Regional Development Fund (ERDF) via Welsh Government. Author contributions M.L. and G.A. conceived and designed the study. G.A. implemented the model and performed numerical simulations and analysis. M.L. and G.A. wrote the manuscript. Peer review Peer review information Nature Communications thanks the anonymous reviewers for their contribution to the peer review of this work. A peer review file is available. Data availability No new experimental or field data were collected. Publicly available datasets from the EBI MGnify platform were used for model comparison, specifically longitudinal human microbiome data from subjects F4 and M3 in MGYS00002184 . Raw OTU data were filtered and transformed as described in the Methods, and the original tables and process are available in the Zenodo repository [10.5281/zenodo.15621027]. Code availability Files generated and analysed in this study and computer code developed to implement the model and execute the numerical simulations are available in the accompanying Zenodo repository [10.5281/zenodo.15621027] and on GitHub: [ https://github.com/computational-ecology-lab/eco-evo-network-assembly ]. All simulations and data analyses were performed in Python (v3.11.11). The computational workflow relied on NumPy (v2.2.6) and SciPy (v1.15.2) for numerical computations, pandas (v2.2.3) for data handling, and Matplotlib (v3.9.1) and seaborn (v0.13.2) for visualisation. Additional specialised visualisations were generated using python-ternary (v1.0.8). Competing interests The authors declare no competing interests. Footnotes Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. Supplementary information The online version contains supplementary material available at 10.1038/s41467-026-70117-8. References 1. Thompson, J. N. The geographic mosaic of coevolution. University of Chicago Press: Chicago, 2019. [ Google Scholar ] 2. Leibold, M. A., Govaert, L., Loeuille, N., De Meester, L. & Urban, M. C. Evolution and community assembly across spatial scales. Annu. Rev. Ecol., Evolution, Syst. 53 , 299–326 (2022). [ Google Scholar ] 3. Pimm, S. L. The complexity and stability of ecosystems. Nature 307 , 321–326 (1984). [ Google Scholar ] 4. Valverde, S. et al. The architecture of mutualistic networks as an evolutionary spandrel. Nat. Ecol. Evolution 2 , 94–99 (2018). [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] 5. Brännström, Å, Loeuille, N., Loreau, M. & Dieckmann, U. Emergence and maintenance of biodiversity in an evolutionary food-web model. Theor. Ecol. 4 , 467–478 (2011). [ Google Scholar ] 6. Hagen, O., Viana, D., Wiegand, T., Chase, J. & Onstein, R. The macro-eco-evolutionary interplay between dispersal, competition and landscape structure in generating biodiversity. Philos. Trans. B 379 , 20230140 (2024). [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] 7. Cowles, H. C. The ecological relations of the vegetation on the sand dunes of Lake Michigan. Part I.-Geographical relations of the dune floras. Botanical Gaz. 27 , 95–117 (1899). [ Google Scholar ] 8. Clements, F. E. Plant Succession: An analysis of the development of vegetation . No. 242 in Carnegie Institution of Washington Publication (Carnegie Institution of Washington, Washington, D.C., 1916). 9. Landi, P., Minoarivelo, H. O., Brännström, Å, Hui, C. & Dieckmann, U. Complexity and stability of ecological networks: a review of the theory. Popul. Ecol. 60 , 319–345 (2018). [ Google Scholar ] 10. McCann, K. S. The diversity–stability debate. Nature 405 , 228–233 (2000). [ DOI ] [ PubMed ] [ Google Scholar ] 11. May, R. M. Will a large complex system be stable?. Nature 238 , 413–414 (1972). [ DOI ] [ PubMed ] [ Google Scholar ] 12. Allesina, S. & Tang, S. The stability–complexity relationship at age 40: a random matrix perspective. Popul. Ecol. 57 , 63–75 (2015). [ Google Scholar ] 13. Mougi, A. & Kondoh, M. Diversity of interaction types and ecological community stability. Science 337 , 349–351 (2012). [ DOI ] [ PubMed ] [ Google Scholar ] 14. Sauve, A. M., Thébault, E., Pocock, M. J. & Fontaine, C. How plants connect pollination and herbivory networks and their contribution to community stability. Ecology 97 , 908–917 (2016). [ PubMed ] [ Google Scholar ] 15. Mougi, A. & Kondoh, M. Stability of competition–antagonism–mutualism hybrid community and the role of community network structure. J. Theor. Biol. 360 , 54–58 (2014). [ DOI ] [ PubMed ] [ Google Scholar ] 16. Sauve, A. M., Fontaine, C. & Thébault, E. Structure–stability relationships in networks combining mutualistic and antagonistic interactions. Oikos 123 , 378–384 (2014). [ Google Scholar ] 17. Namba, T. Multi-faceted approaches toward unravelling complex ecological networks. Popul. Ecol. 57 , 3–19 (2015). [ Google Scholar ] 18. Qian, J. J. & Akçay, E. The balance of interaction types determines the assembly and stability of ecological communities. Nat. Ecol. Evolution 4 , 356–365 (2020). [ DOI ] [ PubMed ] [ Google Scholar ] 19. Segar, S. T. et al. The role of evolution in shaping ecological networks. Trends Ecol. Evolution 35 , 454–466 (2020). [ DOI ] [ PubMed ] [ Google Scholar ] 20. Brännström, Å et al. Modelling the ecology and evolution of communities: a review of past achievements, current efforts, and future promises. Evolut. Ecol. Res. 14 , 601–625 (2012). [ Google Scholar ] 21. Yacine, Y. & Loeuille, N. Stable coexistence in plant-pollinator-herbivore communities requires balanced mutualistic vs antagonistic interactions. Ecol. Model. 465 , 109857 (2022). [ Google Scholar ] 22. Allhoff, K. T., Ritterskamp, D., Rall, B. C., Drossel, B. & Guill, C. Evolutionary food web model based on body masses gives realistic networks with permanent species turnover. Sci. Rep. 5 , 10955 (2015). [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] 23. Metz, T., Blüthgen, N. & Drossel, B. Shifts from non-obligate generalists to obligate specialists in simulations of mutualistic network assembly. Oikos 2023 , e09697 (2023). [ Google Scholar ] 24. McKane, A. J. Evolving complex food webs. Eur. Phys. J. B 38 , 287–295 (2004). [ Google Scholar ] 25. Cai, W., Snyder, J., Hastings, A. & D’Souza, R. M. Mutualistic networks emerging from adaptive niche-based interactions. Nat. Commun. 11 , 5470 (2020). [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] 26. Araujo, G. & Lurgi, M. Mutualism provides a basis for biodiversity in eco-evolutionary community assembly. PLOS Computational Biol. 21 , e1013402 (2025). [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] 27. Araujo, G., Montoya, J. M., Thomas, T., Webster, N. S. & Lurgi, M. A mechanistic framework for complex microbe-host symbioses. Trends Microbiol. 33 , 96–111 (2025). [ DOI ] [ PubMed ] [ Google Scholar ] 28. Fu, H., Uchimiya, M., Gore, J. & Moran, M. A. Ecological drivers of bacterial community assembly in synthetic phycospheres. Proc. Natl. Acad. Sci. 117 , 3656–3662 (2020). [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] 29. White, P. S., Broe, T. Y., Kuijpers, M. C., Dickey, J. R. & Jackrel, S. L. Host identity drives the assembly of phytoplankton microbiomes across a continental-scale environmental gradient. ISME J. 19 , wraf083 (2025). [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] 30. Coyte, K. Z., Rao, C., Rakoff-Nahoum, S. & Foster, K. R. Ecological rules for the assembly of microbiome communities. PLoS Biol. 19 , e3001116 (2021). [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] 31. Grilli, J. Macroecological laws describe variation and diversity in microbial communities. Nat. Commun. 11 , 4743 (2020). [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] 32. Camacho-Mateu, J., Lampo, A., Ares, S. & Cuesta, J. A. Nonequilibrium microbial dynamics unveil a new macroecological pattern beyond taylor’s law. Phys. Rev. E 110 , 044402 (2024). [ DOI ] [ PubMed ] [ Google Scholar ] 33. Descheemaeker, L. & De Buyl, S. Stochastic logistic models reproduce experimental time series of microbial communities. Elife 9 , e55650 (2020). [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] 34. Shoemaker, W. R. & Grilli, J. Investigating macroecological patterns in coarse-grained microbial communities using the stochastic logistic model of growth. Elife 12 , RP89650 (2024). [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] 35. Camacho-Mateu, J., Lampo, A., Sireci, M., Muñoz, M. A. & Cuesta, J. A. Sparse species interactions reproduce abundance correlation patterns in microbial communities. Proc. Natl. Acad. Sci. 121 , e2309575121 (2024). [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] 36. Descheemaeker, L., Grilli, J. & de Buyl, S. Heavy-tailed abundance distributions from stochastic lotka-volterra models. Phys. Rev. E 104 , 034404 (2021). [ DOI ] [ PubMed ] [ Google Scholar ] 37. Montoya, J. M., Pimm, S. L. & Solé, R. V. Ecological networks and their fragility. Nature 442 , 259–264 (2006). [ DOI ] [ PubMed ] [ Google Scholar ] 38. Barbier, M. & Loreau, M. Pyramids and cascades: a synthesis of food chain functioning and stability. Ecol. Lett. 22 , 405–419 (2019). [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] 39. Ushio, M. Interaction capacity as a potential driver of community diversity. Proc. R. Soc. B 289 , 20212690 (2022). [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] 40. Mooij, M. N., Baudena, M., Heydt, A. & Kryven, I. Stable coexistence in indefinitely large systems of competing species. Proc. R. Soc. A 480 , 20240290 (2024). [ Google Scholar ] 41. Grilli, J., Rogers, T. & Allesina, S. Modularity and stability in ecological communities. Nat. Commun. 7 , 12031 (2016). [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] 42. Lurgi, M., Thomas, T., Wemheuer, B., Webster, N. S. & Montoya, J. M. Modularity and predicted functions of the global sponge-microbiome network. Nat. Commun. 10 , 992 (2019). [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] 43. Debray, R. et al. Priority effects in microbiome assembly. Nat. Rev. Microbiol. 20 , 109–121 (2022). [ DOI ] [ PubMed ] [ Google Scholar ] 44. Pantel, J. H., Duvivier, C. & Meester, L. D. Rapid local adaptation mediates zooplankton community assembly in experimental mesocosms. Ecol. Lett. 18 , 992–1000 (2015). [ DOI ] [ PubMed ] [ Google Scholar ] 45. Yonatan, Y., Amit, G., Friedman, J. & Bashan, A. Complexity–stability trade-off in empirical microbial ecosystems. Nat. Ecol. Evolution 6 , 693–700 (2022). [ DOI ] [ PubMed ] [ Google Scholar ] 46. Sireci, M., Muñoz, M. A. & Grilli, J. Environmental fluctuations explain the universal decay of species-abundance correlations with phylogenetic distance. Proc. Natl. Acad. Sci. 120 , e2217144120 (2023). [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] 47. Fisher, R. M., Henry, L. M., Cornwallis, C. K., Kiers, E. T. & West, S. A. The evolution of host-symbiont dependence. Nat. Commun. 8 , 15973 (2017). [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] 48. Pankey, S. M. et al. Cophylogeny and convergence shape holobiont evolution in sponge–microbe symbioses. Nat. Ecol. Evolution 6 , 750–762 (2022). [ DOI ] [ PubMed ] [ Google Scholar ] 49. Mihaljevic, J. R. Linking metacommunity theory and symbiont evolutionary ecology. Trends Ecol. Evolution 27 , 323–329 (2012). [ DOI ] [ PubMed ] [ Google Scholar ] 50. Miller, E. T., Svanbäck, R. & Bohannan, B. J. Microbiomes as metacommunities: understanding host-associated microbes through metacommunity ecology. Trends Ecol. Evolution 33 , 926–935 (2018). [ DOI ] [ PubMed ] [ Google Scholar ] 51. Virtanen, P. et al. Scipy 1.0: fundamental algorithms for scientific computing in python. Nat. Methods 17 , 261–272 (2020). [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] 52. Newman, M. Networks. Oxford university press: Oxford, 2018. [ Google Scholar ] 53. Hagberg, A., Swart, P. J. & Schult, D. A. Exploring network structure, dynamics, and function using networkx. Tech. Rep. LA-UR-08-5495, Los Alamos National Laboratory, Los Alamos, NM (2008). 54. Blondel, V. D., Guillaume, J.-L., Lambiotte, R. & Lefebvre, E. Fast unfolding of communities in large networks. J. Stat. Mech.: Theory Exp. 2008 , P10008 (2008). [ Google Scholar ] 55. Mitchell, A. L. et al. Ebi metagenomics in 2017: enriching the analysis of microbial communities, from sequence reads to assemblies. Nucleic Acids Res. 46 , D726–D735 (2018). [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] 56. Caporaso, J. G. et al. Moving pictures of the human microbiome. Genome Biol. 12 , R50 (2011). [ DOI ] [ PMC free article ] [ PubMed ] [ Google Scholar ] Associated Data This section collects any data citations, data availability statements, or supplementary materials included in this article. Supplementary Materials Supplementary Information (4.6MB, pdf) Reporting Summary (85.8KB, pdf) Transparent Peer Review file (629.3KB, pdf) Data Availability Statement No new experimental or field data were collected. Publicly available datasets from the EBI MGnify platform were used for model comparison, specifically longitudinal human microbiome data from subjects F4 and M3 in MGYS00002184 . Raw OTU data were filtered and transformed as described in the Methods, and the original tables and process are available in the Zenodo repository [10.5281/zenodo.15621027]. Files generated and analysed in this study and computer code developed to implement the model and execute the numerical simulations are available in the accompanying Zenodo repository [10.5281/zenodo.15621027] and on GitHub: [ https://github.com/computational-ecology-lab/eco-evo-network-assembly ]. All simulations and data analyses were performed in Python (v3.11.11). The computational workflow relied on NumPy (v2.2.6) and SciPy (v1.15.2) for numerical computations, pandas (v2.2.3) for data handling, and Matplotlib (v3.9.1) and seaborn (v0.13.2) for visualisation. Additional specialised visualisations were generated using python-ternary (v1.0.8). Articles from Nature Communications are provided here courtesy of Nature Publishing Group ACTIONS View on publisher site PDF (6.7 MB) Cite Collections Permalink PERMALINK Copy RESOURCES Similar articles Cited by other articles Links to NCBI Databases Cite Copy Download .nbib .nbib Format: AMA APA MLA NLM Add to Collections Create a new collection Add to an existing collection Name your collection * Choose a collection Unable to load your collection due to an error Please try again Add Cancel Follow NCBI NCBI on X (formerly known as Twitter) NCBI on Facebook NCBI on LinkedIn NCBI on GitHub NCBI RSS feed Connect with NLM NLM on X (formerly known as Twitter) NLM on Facebook NLM on YouTube National Library of Medicine 8600 Rockville Pike Bethesda, MD 20894 Web Policies FOIA HHS Vulnerability Disclosure Help Accessibility Careers NLM NIH HHS USA.gov Back to Top