The compound topology of host–parasite networks is explained by the integrative hypothesis of specialization

What is the prevalent topology among interaction networks? How do consumers balance between generalism and performance when exploiting different resources? These two long-standing, still open questions have been unified under a common framework by the integrative hypothesis of specialization (IHS). According to the IHS, ecological specialization is structured by different processes at small and large network hierarchical levels, from an entire network to its modules and nodes. From those hierarchical processes, two patterns are expected. First, a modular network with internally nested modules, i.e. a compound topology. Second, different relationships between consumer performance and generalism on different network hierarchical levels. We confirmed those predictions using an extensive data set of host–parasite interactions, compiled from several studies, and spanning decades of fieldwork in the Palearctic Region. We used a set of topological analyses combined in a novel protocol based on the IHS to disentangle the complexity of this data set at different geographic scales, from local to regional. As predicted, the studied network indeed has a compound topology at both local and regional geographic scales. In addition, the relationship between parasite generalism and performance changes from negative in an entire network to positive within its modules. But, as expected, this shift in the signal of the generalism versus performance relationship happens only in local networks with a compound structure. Our results shed light on two central debates about topology and performance and provide insight into their solution.


Introduction
Darwin's 'tangled bank' of species interactions is one of the most complex phenomena in nature (Lewinsohn and Cagnolo 2012).To unveil the processes behind the patterns observed in this 'bank' is a major quest in ecology (Bascompte andJordano 2007, Guimarães 2020).This quest has been largely facilitated by tools from network science in the past decades (Dáttilo and Rico-Gray 2018).
In the terminology of network science, patterns in interaction matrices translate to topologies in interaction networks.Inspired by insights from biogeography and metacommunity (Atmar and Patterson 1993, Leibold and Mikkelson 2002, Presley et al. 2010), four archetypical topologies were conceived for interaction networks (Lewinsohn et al. 2006).Recently, Ulrich et al. (2017b) reformulated these archetypes as a triangular space, with the vertices representing segregation, nestedness and modularity (i.e.compartmented).However, contrary to occurrence matrices (Ulrich and Gotelli 2013), segregation is rarely reported for interaction networks, in which nestedness (Bascompte et al. 2003) and modularity (Olesen et al. 2007) predominate.Therefore, in the present study we focus on nestedness and modularity.
In a nested network, the interactions of the least connected species represent subsets of the interactions of the most connected species.First described in plant-animal networks (Bascompte et al. 2003), nestedness was later found in several other mutualistic (e.g.anemofish: Ollerton et al. 2007) and antagonistic systems (e.g.ectoparasites: Graham et al. 2009).In turn, a modular network is composed of cohesive subgroups of species (modules) that interact more frequently with one another than with other species of the same network (Gauzens et al. 2015).Modularity has also been widely reported (Olesen et al. 2007, Dupont and Olesen 2009, Mello et al. 2011, Krasnov et al. 2012).Interestingly, some ecological networks score high in both nestedness and modularity (Olesen et al. 2007, Fortuna et al. 2010, Bellay et al. 2011, Flores et al. 2013), showing that these two topologies can coexist within the same network.
A possible explanation for this coexistence is that a dual nested-modular topology would arise if each topology predominated at different network hierarchical levels.Those levels would be represented by the entire network, its modules and its nodes.For instance, some plant-animal networks are modular at the entire network level but nested within their modules.This kind of hierarchical architecture was named a compound topology (Lewinsohn et al. 2006).Later, some empirical studies found evidence of compound topologies in pollination (Bezerra et al. 2009), host-pathogen (Flores et al. 2013), seed dispersal (Sarmento et al. 2014), multilayer plant-animal interactions (Genrich et al. 2017, Mello et al. 2019) and non-ecological networks (Solé-Ribalta et al. 2018).In addition, theoretical studies have confirmed this topology in simulated host-parasite (Beckett 2016, Leung andWeitz 2016) and consumer-resource networks (Pinheiro et al. 2019).
But how does a compound topology emerge?Some studies claim that network topologies, especially nestedness, result from a selection for stability, with stable patterns being more often observed (Thebault andFontaine 2010, Borrelli 2015).An alternative view is that network topologies emerge from niche and neutral mechanism acting on each species individually, and, thus, selection on network stability would not be necessary to explain topology (Maynard et al. 2018, Valverde et al. 2018).For instance, the frequently observed nested topology could emerge simply as a byproduct of unequal species abundances (Krishna et al. 2008).In a similar line of thought, nestedness could emerge from an optimization principle that maximizes species abundances (Suweis et al. 2013).Or nestedness could be simply an evolutionary spandrel that emerges from heterogenous degree distributions (Valverde et al. 2018).Modularity, on the other hand, is usually explained as a product of niche processes, especially related to tradeoffs in the interactions (Allen 2006).
Recently, those niche and neutral views have been reconciled by an 'integrative hypothesis of specialization' (IHS), which proposes a mechanism by which compound topologies might emerge in interaction networks (Pinheiro et al. 2016(Pinheiro et al. , 2019)).In a few words (see Box 1 for a more detailed explanation), the IHS assumes that adaptations that enhance the performance of a consumer in exploiting a given resource will also tend to help it exploit similar resources, but they will represent maladaptations to exploit dissimilar resources.If this assumption holds, the threshold of dissimilarity between resources above which consumer adaptations turn to maladaptations must coincide with the hierarchical level in which modules emerge in the resulting network.Consequently, one should expect to find a positive relationship between the average performance and generalism of a consumer when exploiting resources only within its module, from which results the nested interaction pattern within a module (Box 1), but a negative relationship between the performance and generalism between modules, from which results the modular interaction pattern.
The IHS has been recently corroborated in silico (Pinheiro et al. 2019), and some of its predictions were tested and confirmed using a continent-wide data set of mutualistic interactions (Mello et al. 2019), a local data set of pollination interactions (Queiroz et al. 2021), and also in a frugivory network at the individual level (Crestani et al. 2019).However, the cited studies found evidence in support of the IHS, mostly concerning network topology, but did not address the prediction that the relationship between performance and generalism would be positive for within-module generalism, but negative for between-modules generalism in a compound network.
Here, we make and empirical test of this central prediction of the IHS using an extensive host-parasite data set composed of flea-mammal interactions on 15 sites all over the Palearctic Region.We considered fleas as consumers and mammals as resources.First, we developed a protocol to test for a compound topology and applied it to the flea-mammal networks.This protocol has been successfully used in other studies (Mello et al. 2019, Pinheiro et al. 2019) since we first introduced it in a preprint (Felix et al. 2017).Here, we used this protocol, which we explain below, to test for compound topologies especially in the local networks (formed by interactions reported for each site), but also in the regional network (formed by pooling together interactions reported on all sites).Once the topologies of the networks were analyzed,

Box 1. The integrative hypothesis of specialization
Let us imagine a group of resources that differ from one another in several eco-evolutionary dimensions affecting their exploitability by different consumers.For instance, morphological traits, phylogenetic distance and phenology.Let us now summarize all these dissimilarities in a hierarchical dendrogram, where relatedness among resources reflects how similar they are from the perspective of the consumers (Fig. 1a).Note that the cluster in Fig. 1 is a dendrogram of similarity, and not a cladogram of phylogenetic relatedness.Finally, let us assume that any adaptation that enhances the performance of a consumer in exploiting a specific resource (the arrow in Fig. 1a) will also tend to be an adaptation to exploit similar resources (the '+' in Fig. 1a), but a maladaptation to exploit dissimilar resources (the '−' in Fig. 1a).
Then, we should not expect constraints in consumer generalism between similar resources.Instead, resources with highest availabilities (e.g. the most abundant) should be more strongly exploited by the highest performing consumers.Thus, the performance of consumers (i.e. the fitness obtained by each consumer on each resource) in similar resources and the resource range used by those consumers are expected to be positively correlated.Consequently, those interactions are expected to be nested.Alternatively, if sufficiently dissimilar resources are considered, then constraints in consumer generalism are expected.In other words, the performances of consumers exploiting very dissimilar resources is expected to be negatively correlated with the resource range used.Therefore, the nested pattern mentioned before should be restricted to within each resource cluster (Fig. 1b).In this context, resource clusters are the real units of specialization and the true generalist consumers are those that can exploit resources across clusters (blue species in Fig. 1b).The exact dendrogram level (the pruning lines in Fig. 1a-b) that represents a threshold between adaptations and maladaptations should coincide with the point at which modules emerge in the network structure.The expected pattern of consumer performance on resources.On the one hand, only consumers exploiting resources in different clusters (blue) are expected to suffer from tradeoffs in generalism.On the other hand, the performances of consumers specialized in one cluster (purple, orange and green) should be correlated in different resources of that cluster.Then, by sampling consumers exploiting resources of a single cluster, we should find a nested interaction matrix (c) and a positive relationship among performance and generalism (d).Otherwise, by sampling consumers exploiting resources at different clusters, we should find a compound interaction network (e) and a dependence on the signal of the relationship between generalism and performance to the type of generalism analyzed: positive for within-module generalism and negative for between-modules generalism (f ).
we tested whether the relationship between host range (generalism) and performance changes from positive within each module (within-module generalism) to negative out modules (between-module generalism).Our results corroborate the IHS and shed light on the processes behind the emergence of compound topologies in ecological networks.

Data set
We used an extensive data set on host-parasite interactions that has been analyzed in several studies on ecological interactions (Krasnov et al. 2004b, 2008, Vázquez et al. 2007, Fortuna et al. 2010).It is composed of dozens of flea-mammal interaction matrices sampled all around the world, from which we selected 15 Palearctic sites to maximize two parameters: matrix size (at least 10 parasite species and 10 host species per site), and host sample size (more than 1000 individual mammals sampled per site).The selected sites range from Poland to Mongolia, with one site located much further east, in Magadan, a region in the Russia's far east (Supporting information).
The local networks have an average size of 45.0 ± 12.6 species (mean ± standard deviation), with 26.2 ± 9.4 flea species and 18.8 ± 4.7 mammal species and contain on average 129.6 ± 57.2 interaction records (Supporting information).The mean pairwise overlap of species among sites is of 32.29% for mammals and 32.03% for fleas.
In addition to the local networks, we have also analyzed a regional network with all 15 sites pooled, which contains 263 species (nodes: 161 fleas and 102 mammals) and 1200 interaction records (links).This regional matrix allows testing for a compound topology in a system with much higher taxonomic diversity, which is assumed to lead to stronger interaction tradeoffs.
Furthermore, the regional matrix and some local matrices produced networks with more than one component, i.e. a subgroup of species totally disconnected from the other nodes of the network.In most of these networks, there is a giant component comprising most of the nodes and one or few small components, each including a small number of nodes.The subsequent analyses, at regional and local scales, were carried out by using only the respective binary version of the giant component of each matrix, i.e. the larger group of species that are all connected to each other, directly or indirectly.In the regional network, the giant component comprises 98% of the species.In the local networks, the giant components comprise at least 85% of the species.
The presence-absence data of flea and mammal species reported for each site can be found in the Supporting information.

Modularity
The first step to test for a compound topology is to unfold the modular structure of the regional and local networks.We did this by computing the Barber modularity (Q) (Barber 2007) optimized by the DIRTLPAwb+ algorithm (Beckett 2016), through the computeModules function of the package bipartite (Dormann et al. 2008) for R (<www.r-project.org>).Modularity (Q) varies from 0 to 1, and the algorithm also reveals the number and composition of the modules found in the network.

Nestedness decomposition
In a nested matrix, the interactions of the least connected species represent subsets of the interactions of the most connected species (Ulrich et al. 2009).NODF is a metric that aims to synthesize this pattern in a single number (Almeida-Neto et al. 2008).In its default algorithm, a NODF score is computed for each pair of species (independently for consumers and resources, i.e. the rows and columns of the matrix), and then averaged to calculate the mean NODF score of the entire matrix.
Nevertheless, the mean score of a pairwise metric is only a good descriptor of the matrix structure if its pairwise distribution is unimodal.When the pairwise distribution has more than one mode, then its mean is a poor descriptor of the matrix structure, as the mean will misrepresent all modes (Gotelli and Ulrich 2012).For instance, averaging the

Box 1. Continued
Therefore, on the one hand, by sampling interactions in a group of similar resources and their respective consumers, one should find both a nested network topology (Fig. 1c) and a positive relationship between generalism and performance (Fig. 1d).On the other hand, we should not expect to find a highly nested topology if the dissimilarity among at least some of the resources is higher than the dissimilarity in which interaction constraints emerge.Instead, we should find a modular network with internally nested modules: a compound topology (sensu Lewinsohn et al. 2006) (Fig. 1e).In addition, we expected the relationship between consumer performance and generalism to be positive within each cluster of similar resources, but negative when considering resources of different clusters (modules in the network) (Fig. 1f ).
pairwise NODF among all pairs of species in a compound matrix returns an intermediate NODF value, lying halfway between the mean NODF between pairs of species belonging to the same module and the mean NODF between pairs of species belonging to different modules.By focusing on this intermediate NODF value, one would conclude that a moderate nestedness describes the overall matrix structure.This conclusion, although, is masking the more complex pattern: high nestedness between pairs of species belonging to the same module, and small nestedness between pairs of species belonging to different modules.
In order to solve this problem, we adapted the method proposed by Flores et al. (2013), and averaged nestedness separately between pairs of species of the same module (NODF SM ), and between pairs of species of different modules (NODF DM ) (see the Supporting information for a mathematical formulation of NODF SM and NODF DM ).

Null models
When testing for patterns in ecological matrices, it is a common procedure to ask whether the observed score differs significantly from that expected at a given null scenario, in which only a predefined set of processes operates.This practice allows to ask if the observed pattern could be sufficiently explained by the processes kept in the null scenario, or if it is necessary to postulate additional processes to explain the pattern.The null scenarios are commonly simulated through statistical null models, which are randomization procedures that shuffle interactions in the observed matrix under specific constraints that are expected to mimic the processes of interest (Gotelli 1996).Usually, ecologist uses null models to ask if the pattern would emerge 'at random', that is, from purely stochastic forces, excluded species interactions and abiotic forces (Ulrich and Gotelli 2013).However, in principle, null models can be constructed to include any processes of interest, stochastic or not.Notice, still, that if a null model fully recovers a pattern, this does not means that the pattern does not exist, but only that the processes kept in the null models are sufficient to produce the pattern (Guimarães 2020).
What should be the null expectations for NODF SM and NODF DM ?Usually, in nestedness analysis, it is recommended to use null models that shuffle interactions while keeping constant both the matrix connectance (the number of occupied matrix cells divided by the number of total matrix cells) and the species degree distribution (the distribution of the number of interactions per species) (Ulrich et al. 2009) -this null model is usually named as proportional null model in the literature (Vázquez et al. 2007).The logic behind these constraints is that both connectance and species degree distribution reflect stochastic factors (sampling and abundance distribution, respectively) that affect nestedness and, thus, should have their effects discounted.Therefore, a first alternative would be to compare the observed NODF SM and NODF DM scores against the NODF SM and NODF DM expected when shuffling interactions in the entire matrix according to the proportional null model.By performing such a comparation, we would be asking if interactions between pairs of species belonging to the same modules, and to different modules, are so nested as expected 'at random'.
Note, however, that NODF, in its essence, is an overlap index -the Simpson similarity index (Simpson 1943) adjusted to penalize for ties (Almeida-Neto et al. 2008).Happens that, by definition, species of the same module overlap more interactions than expected at random.Consequently, any modular matrix will have NODF SM higher than expected by species degrees (i.e. by the proportional null model), whether the modules are internally nested or not.On the other hand, species of different modules overlap less interactions than expected at random and, thus, any modular matrix will have NODF DM smaller than expected by species degrees.
In summary, the only information we would obtain by comparing NODF SM and NODF DM against their respective expectations under de proportional null model is whether the interaction matrix is modular, which is trivial and would already know to be the case.The new question we propose, to differentiate a pure modular from a compound topology, is whether NODF SM and NODF DM are higher than expected given the matrix modular structure.In other words, if the pairs of species overlap more interactions than expected given that they are in the same or in different modules.To answer this question, we developed a restricted null model, which, in addition to matrix connectance and degree distribution, also conserves the matrix modular structure in the null matrices.The detailed instructions for performing it are presented in the Supporting information.Hereafter, we refer to the proportional null model as free null model, in opposition to the restricted null model.Code to perform the analysis, as well as a tutorial for reproducing them, are available at GitHub repository <https://doi.org/10.5281/zenodo.4616748> .

Z-score
For the giant component of each of the 16 networks (15 local networks and 1 regional network), we generated 1000 randomized matrices using the free null model and 1000 randomized matrices using the restricted null model.Next, for each randomized matrix, we computed its overall NODF and decomposed it into NODF SM and NODF DM using the observed partitions of their corresponding real network.
Finally, for each matrix (16 in total), considering the combinations of null models (2: free and restricted) and NODF metrics (3: NODF, NODF SM and NODF DM ), a Z-score was calculated as the difference between the observed value and the average value in the randomized matrices, divided by the standard deviation of values in the randomized matrices.Observed and expected modularity values were also compared using Z-scores, but only for the free null model, as it does not make sense to compare observed and expected modularity scores with a null model that fixes the modules.
Nestedness and modularity standardized by null models are hereafter called relative nestedness and relative modularity, respectively.For simplicity, they will be represented here as Z F or Z R , depending on the null model, followed by the metric name (e.g.Z F Q and Z F NODF SM represent, respectively, relative modularity and relative nestedness between pairs of species of the same module, when standardized by the free null model).
Our goal was to test how modularity and nestedness interact with each other in a continuous way.Therefore, in all analyses we used the original Z-scores, without classifying them as significant or non-significant.We used AIC (Johnson and Omland 2004) to rank linear models assuming different hypotheses about the relationship between the local values of nestedness and modularity.We include matrix size as a covariate in the models since both the raw and relative values of nestedness and modularity are known to depend on the size of the matrix (Ulrich et al. 2017a(Ulrich et al. , 2018)).

Matrix plotting
The interaction matrices were reorganized by a procedure adapted from Flores et al. (2013Flores et al. ( , 2016)).Briefly, we first reordered the matrix rows and columns within modules by degree and then permuted the entire modules to find the arrangement of modules that maximizes the concentration of interactions closer to the matrix diagonal.This procedure, implemented in the plotmatrix function of the bipartite package (Dormann et al. 2008), facilitates the visualization of a compound topology.

Performance versus within and betweenmodule generalism Performance index
In a consumer-resource system, performance is defined as the fitness obtained by each consumer when exploiting each resource (Pinheiro et al. 2019).In the particular case of hostparasite interactions, the performance of a parasite on a host is usually quantified indirectly through some metric assumed to reflect it, such as prevalence, intensity or abundance (Poulin 2007).We chose abundance: the average number of individual fleas per individual mammal (calculated including infected and uninfected hosts).Abundance is considered a good measure of performance for studying interactions between ectoparasites and hosts (Krasnov et al. 2006).For a parasite that does not multiply on the host, where each individual found represents a successful infection event, abundance captures one key performance aspect, directly related to parasite fitness: the ability to successfully infest a host.All else being equal, several parasites on one host species means that the parasites perform well on that host, i.e. that they have a high rate of success at infesting it.Other measures, e.g.rate of blood extraction from the host, are simply not available for all flea-mammal combinations.
Moreover, the abundance of a consumer (i.e.parasite) in a habitat (i.e.host) can be considered as a measure of its efficiency of resource exploitation (Morris 1987).For fleas this was proved by combining field observations (Krasnov et al. 1997) with laboratory experiments (Krasnov et al. 2004a, Khokhlova et al. 2012).Finally, abundance integrates intensity of infestation and prevalence in a single metric (abundance = intensity of infestation times prevalence), measuring different aspects of parasite performance.

Generalism within-modules and between-modules
For each flea species, generalism within and between-modules was measured, respectively through its within-module degree and participation coefficient (Guimerà and Amaral 2005).Within-module degree and participation coefficient define the functional role of a species in a network and are related to the number of interactions a species makes with other species of its own module and with species of other modules, respectively.Within-module degree and participation coefficient values were calculated independently for each local network.See the Supporting information for a detailed explanation of within-module degree and participation coefficient.

Mixed models
Once all relevant theoretical variables (performance, withinmodule and between-module generalism) where operationalized in measurable variables (abundance, within-module degree and participation coefficient, respectively), we built a mixed model that mirrors the IHS prediction that performance correlates positively with within-module generalism but negatively with between-module generalism (Fig. 1).
To test this first prediction, we fitted the log-transformed abundance of each flea species per mammal species per region against the within-module degree and participation coefficient values of each flea species in each region.We decided to use flea abundances per mammal species, rather than average it between all mammals exploited by a flea, to control for mammal characteristics known to affect abundance (e.g.carrying capacity, susceptibility and richness of parasite fauna) (Krasnov et al. 2005).Averaging would also decrease the power of the analysis (Hopkins 1982, Schank andKoehnle 2009).
However, as presented in Fig. 1 (Pinheiro et al. 2019), the negative relationship between performance and betweenmodule generalism is only expected in highly diverse, heavily compartmentalized networks, in which modules boundaries reflect strong interaction constraints.We should not expect to find a negative relationship between performance and between-module generalism in poorly diverse, weakly compartmentalized networks, in which modules boundaries are more 'permeable' or even spurious.To account for this, we included an interaction between both Z F Q and Z F NODF DM and within-module degree and participation coefficient.We expect Z F Q and Z F NODF DM to have an influence on the effect of participation coefficient on abundance, but not to have an influence on the effect of within-module degree.Specifically, we expected that the effect of participation coefficient on abundance should be negative only in local networks in which the modular structure constrains nestedness between pairs of species of different modules, that is, in local networks with negative values of Z F NODF DM and/or with positive values of Z F Q. Since Z F NODF DM and Z F Q are partially correlated, we expected that only one of them, that which better modulates the relationship between participation coefficient and abundance, to be kept in the minimal model.
Lastly, to control for taxonomic and spatial pseudoreplication (Hurlbert 1984), we included mammal species, flea species and region as crossed random factors of the model.We used backward stepwise regression to select fixed and random effects, following the protocol suggested by Bolker et al. (2009).First, we used the likelihood ratio (LR) test to compare models with different random structures (to which the models are refitted with maximum likelihood) and, once the minimal random structure was defined, we perform Wald χ 2 tests on the fixed effects to access their significance.To tell apart the variance explained by fixed and random factors in the minimal selected model, we computed both marginal and conditional R 2 (Nakagawa and Schielzeth 2013).The marginal R 2 informs the amount of variance explained by the random structure of the model, while conditional R 2 informs the variance explained by the complete model (random and fixed effects).The confidence intervals of the parameters were obtained by bootstrapping.For these analyzes we use the following R packages: MuMIn, interplot, car and lme4.

Topology of the local networks
Nestedness and modularity varied widely between local networks, which, in general, were more nested (NODF = 0.51 ± 0.15) than modular (Q = 0.28 ± 0.14) (Fig. 2a).In addition, some relationships between these two topologies were evident.First, nestedness and modularity were negatively related to one another in the local networks, both for their raw and Z-scores.However, the relationship with modularity was much weaker for the Z-scores of nestedness computed by the restricted null model (Fig. 2a, c, e, Supporting information).
Second, observed and relative values of local NODF SM were higher than those of local NODF DM (Fig. 2b, d, f ), and the difference between them increased with modularity.In addition, the Z-scores of NODF DM decreased with modularity when computed in comparation with the free null model expectation (Z F NODF DM ), but not when computed by the restricted null model (Z R NODF DM ).The Z-scores of NODF SM , on the other hand, was not influenced by modularity independently of the null models used.
Finally, NODF SM values were higher than expected by the free null model, but equal or higher to that expected by the restricted null model, showing that when overlap due to modularity is controlled, interactions among species on the same module are more or equally nested as expected by their degrees (Fig. 2d, f ).The same was true for pairs of species at different modules, as NODF DM values were either equal or lower than expected by the free null model, but equal or higher to that expected by the restricted null model (Fig. 2d, f ).
Those results show that some of the local networks present a compound topology: significant modularity, and NODF SM higher than expected given the modular structure.
Topology of the regional network The regional network presented higher modularity (Z F Q = 51.13) and equal nestedness (Z F NODF = 0.39) than expected by the free null model.However, the observed scores of nestedness were almost five times higher between pairs of species of the same module than between pairs of species of different modules (NODF SM = 0.45, NODF DM = 0.09).
In addition, as expected if the modules constrain nestedness between species of different modules, NODF DM was smaller than expected by the free null model (Z F NODF DM = −13.02)(Fig. 3), but equal to expected by the restricted null model (Z R NODF DM = 0.20) (Fig. 3).Finally, nestedness between pairs of species of the same module was higher than expected by both null models (Z F NODF SM = 48.68,Z R NODF SM = 7.49) (Fig. 3).
Therefore, the regional flea-mammal network also presents a compound topology, which can be easily seen when we plot the interaction matrix maximizing nestedness without disrupting the modular structure (Fig. 4).

Generalism versus performance
On the one hand, flea abundances were always positively correlated with their within-module generalism (within-module degree) in the local networks (Supporting information).On the other hand, as expected, the relationship between flea abundance and between-module generalism (participation coefficient), depended on the degree of restrictions that the modules impose to the interactions.Specifically, the effect of flea participation coefficient on abundance changes from positive to negative as NODF DM becomes smaller than expected by the free null model, crossing zero at Z F NODF DM ≈ −2 (Fig. 5a).In addition, the predicted positive effect of the participation coefficient on flea performance was higher than that of the within-module degree, when NODF DM becomes equal to or higher than expected by the free null model.Interestingly, Z F Q was not kept in the minimal model.
Figure 5b shows the predicted effects of participation coefficient and within-module degree on fleas' abundances for three selected localities, confirming the predictions of Fig. 1, that as the network becomes more modular the effect of between-module generalism on performance changes from positive to negative.
Random factors explained a significant portion of the variance in flea abundance (Supporting information).In addition, as expected, only within-module degree, participation coefficient, and the interaction between participation coefficient and relative nestedness for species of different modules compared to the free null model (Z F NODF DM ) significantly explained flea abundances.Neither Z F NODF DM nor its interaction with within-module degree were retained in the minimum selected model (Supporting information).Although the complete models explained a large amount of data variance, the fixed factors were responsible for only a small fraction of the explanation (R 2 (m) = 0.086, R 2 (c) = 0.53).

Discussion
Here, we provide empirical support for the integrative hypothesis of specialization (IHS, Pinheiro et al. 2016, 2019, Mello et al. 2019), which proposes a mechanistic model for the emergence of compound topologies in interaction networks (Box 1, Fig. 1).
We developed a method to test for compound topologies and used it to confirm the emergence of compound topologies in interaction networks formed by fleas and mammals in the Palearctic Region (Fig. 2-4).Next, we showed that flea performances were positively related to within-module generalism, but negatively related to between-module generalism in local networks (Fig. 5), as predicted by the IHS.Together, our results provide insight into the solution of two long-standing debates in the ecological literature, which we discuss bellow.
The first debate concerns the topology of interaction networks.How to make sense of the fact that nestedness and modularity, two conceptually different patterns (Lewinsohn et al. 2006, Ulrich et al. 2017b), coexist in several interaction Figure 3. Observed values (dots) of NODF, NODF SM and NODF DM in the regional network contrasted with the values expected by species degrees (distributions) in the absence (free null model) or presence (restricted null model) of a modular structure.NODF: overall nestedness.NODF SM : nestedness between pairs of species of the same module.NODF DM : nestedness between pairs of species of different modules.As expected if the regional network has a compound topology, NODF SM is higher than expected given the modular structure, that is, by the restricted null model.Figure 4. Interaction matrix reorganized to maximize between-and within-module nestedness without disrupting the modular structure of the network.Interactions within modules (delimited by boxes) are showed in black, while those outside modules are showed in gray.Flea species are represented in columns and mammals in rows.The compound topology of the regional network is evident.networks in nature (Olesen et al. 2007, Fortuna et al. 2010, Thebault and Fontaine 2010)?An interaction matrix that is both nested and modular lies within the triangular space proposed by Ulrich et al. (2017b) at some point midway between nestedness and modularity.But what does such an interaction matrix looks like?Is nestedness superimposed over the modular structure, as suggested by the 'two sides of the same coin' perspective (see Fig. 1C in Fortuna et al. 2010), or is nestedness confined to the modules, in a compound topology (Lewinsohn et al. 2006)?
At a first glance, considering only that some local and the regional flea-mammal networks presented scores of nestedness and modularity higher than or equal to those expected by species degrees (by the free null model) (Fig. 2cd, 3), one could conclude that those two topologies combine freely as two sides of the same coin (Fortuna et al. 2010).However, as found in previous studies (Thebault and Fontaine 2010, Trøjelsgaard and Olesen 2013, Pinheiro et al. 2019), the observed and relative values of modularity and nestedness were negatively correlated in the local flea-mammal networks (Fig. 2a, c).In addition, while nestedness between pairs of species of the same module was higher than expected by species degrees (i.e. by the free null model), the opposite was true for nestedness between pairs of species of different modules (Fig. 2d).In addition, the difference between these two partitions of nestedness (NODF SM and NODF DM ) increased with modularity (Fig. 2a, c).Those results point out that modularity restricts nestedness at higher hierarchical network levels, making it stronger within the modules in a compound structure.
However, to say that modularity restricts nestedness between species of different modules is a logical consequence of the definitions of modularity and nestedness, a truism that is recognized since the propositions of these archetypes (Leibold and Mikkelson 2002, Presley et al. 2010, Ulrich and Gotelli 2013).A much more interesting question, which our method allows answering, is whether interactions between species of different modules are more nested than expected given that they belong to different modules.Here, we show that both the local (Fig. 2f ) and the regional (Fig. 3) networks have interactions between species of different modules equally nested as expected by their degrees, once the decreasing in overlap expected between-modules is discounted.That is, NODF DM was equal to expected by the restricted null model.
This result implies that when a flea of the module A exploits a host from the module B, it tends to exploit the most exploited host of module B. This does not necessarily need to be true since competitive exclusion might predominate over host exploitability outside the modules.For example, if parasites have poor performance on hosts that do not belong to their modules, diffuse competition could hinder parasites of module B from successfully establishing themselves in the most exploited hosts of module A. If that happens, parasites might become supertramps (sensu Diamond 1975) when exploiting hosts of other modules, infecting only the less exploited hosts outside its own module, and producing an anti-nested (Poulin and Guégan 2000) pattern of between-module interactions.Although this is not true neither in the flea-mammal network analyzed here, nor in the bat-plant network analyzed by Mello et al. (2019), it is an interesting hypothesis to be tested with other systems.Recent evidence suggests that interactions are more flexible than previously supposed (Calatayud et al. 2016), and understanding the processes governing the spillover of interactions between modules has important practical implications.It may help, for example, to predict which species are likely to invade new habitats or which parasite or pathogen species are more likely to exploit new hosts, as observed in the current COVID-19 pandemic.
The second issue our results provide insight into concerns what is the expected relationship between the resource range (generalism) of a species and its average performance at exploiting these resources (Futuyma and Moreno 1988).As in the case of network topology, conflicting results have been reported, and two scenarios are possible.First, the relationship between generalism and average performance varies among systems, taxa, place, and interaction types.Second, this relationship should change at different network hierarchical levels, from positive within modules to negative betweenmodules, as predicted by the IHS (Pinheiro et al. 2016).
Our results support the second scenario (Fig. 5).In local networks where modules represent a significant constraint to interactions, the relationship between flea abundance and generalism changed from positive within to negative betweenmodules, as predicted.In addition, the effect of participation coefficient on abundance becomes stronger as the modular structure imposes stronger constraints on the between-module interactions.Therefore, if the network is composed of more than one module, the relationship between generalism and performance should depend on the network hierarchical level analyzed.
Otherwise, if the network is composed of very similar resources (i.e.just one module), we expect a simple positive relationship between generalism and performance.A further step would be to test if the contradictory results reported by previous studies which addressed the relationship between performance and generalism would also be explained by differences in the diversity of each community studied.While some of them focused on different populations of the same resource species (Szollõsi et al. 2011) others sampled entire resource communities (Poulin 1998, Hellgren et al. 2009).
In conclusion, although the results of our study fully corroborate major predictions of the IHS, as a novel hypothesis the IHS needs to be further tested.We encourage researchers to put the IHS to the test using other kinds of interaction made between other taxa.The method we develop here can help to answer if compound topologies are also present at local scales in other systems, something that might have been overlooked in the literature, considering that most studies focus on single-taxon, single-interaction systems.Indeed, most mutualistic and antagonistic networks studied so far are strongly taxon-biased, so they most probably represent modules of larger networks (as proposed by Bezerra et al. 2009, Mello et al. 2011, Sarmento et al. 2014), in which the strongest trade-offs are absent.
Acknowledgments -This study was developed as the master's project of GMF.We thank our institutions and colleagues, who helped us in different ways during this project.Adriano Paglia, Cang Hui, Carsten Dormann, Elisabeth Kalko, Erika Braga, Judith Bronstein, Leonardo Rê-Jorge, Paulo Guimarães Jr., Pedro Jordano, Nico Blüthgen, Thomas Lewinsohn and Tiago Quental helped us with exciting discussions about species interactions, complex networks and assembly rules.Mario Almeida-Neto made a thorough review of our manuscript, making valuable comments and suggestions that substantially improved the final version.Thomas Lewinsohn discussed archetypical network topologies with us, thus contributing considerably to solve conceptual and methodological issues.The editors made insightful and constructive comments, which helped us see many points from a different perspective.This is publication no.1107 of the Mitrani Department of Desert Ecology.Finding -The Graduate School in Ecology of the Federal University of Minais Gerais (ECMVS) provided us with scholarships granted to GMF and RBPP, and with infrastructure.MARM was funded by the Alexander von Humboldt Foundation (AvH: 3.4-8151/15037 and 3.2-BRA/1134644), Minas Gerais Research Foundation (FAPEMIG: PPM-00324-15), Research Dean of the Federal University of

Figure 1 .
Figure 1.The integrative hypothesis of specialization.(a) If the dissimilarity among resources is represented as a dendrogram, then a mutation that enhances the performance of a consumer in a focal resource (the black arrow), should also represent an adaptation to exploit closely related resources (+), but a maladaptation for distant resources (−).The red dashed line marks the dendrogram level above which dissimilarities among clusters of resources become sufficiently large to turn adaptations for one cluster into maladaptations for other clusters.(b)The expected pattern of consumer performance on resources.On the one hand, only consumers exploiting resources in different clusters (blue) are expected to suffer from tradeoffs in generalism.On the other hand, the performances of consumers specialized in one cluster (purple, orange and green) should be correlated in different resources of that cluster.Then, by sampling consumers exploiting resources of a single cluster, we should find a nested interaction matrix (c) and a positive relationship among performance and generalism (d).Otherwise, by sampling consumers exploiting resources at different clusters, we should find a compound interaction network (e) and a dependence on the signal of the relationship between generalism and performance to the type of generalism analyzed: positive for within-module generalism and negative for between-modules generalism (f ).

Figure 2 .
Figure 2. Relationship between observed and relative (Z F and Z R ) scores of nestedness components (NODF, NODF SM and NODF DM ) and modularity in local networks.Z F and Z R represent the relative score of a metric (nestedness or modularity) standardized by the score expected in the absence (the free null model) or in the presence (restricted null model) of the modular structure, respectively.NODF (green): overall nestedness.NODF SM (purple): nestedness between pairs of species of the same module.NODF DM (yellow): nestedness between pairs of species of different modules.Left panels (a, c and e): relationship between observed and relative nestedness and modularity scores.Right panels (b, d and f ): box plots of observed and relative nestedness scores.Notice that relative modularity is always standardized by modularity expected by the free null model, both in (c) and (e).Only curves representing significant relationships (p < 0.05) are shown.

Figure 5 .
Figure 5.The predicted effect of participation coefficient on flea performances (abundance) for different values of Z F NODF DM (relative nestedness between pairs of species at different modules in each local network when compared to that expected by the free null model).(a) Lines show the predicted effect of participation coefficient on abundance (and its 95% confidence intervals), while dots indicate the fifteen local networks.As expected by the IHS, the effect of participation coefficient changes from negative to positive as nestedness between species in different modules increases.(b) Predicted effect of participation coefficient and within-module degree on abundance for three selected local networks (roman numerals in (a)) with decreasing modular restrictions.Node colors indicate module membership recovered by the modularity algorithm.