The nested assembly of individual-resource networks


  • M. M. Pires,

    Corresponding author
    1. Programa de Pós-Graduação em Ecologia, Instituto de Biologia, Universidade Estadual de Campinas, Caixa Postal 6109, 13083-970 Campinas, São Paulo, Brazil
    Search for more papers by this author
  • P. R. Guimarães Jr,

    1. Department of Ecology and Evolutionary Biology, University of California, Santa Cruz, CA 95064, USA
    2. Departamento de Ecologia, Instituto de Biociências, CP 11294, Universidade de São Paulo, São Paulo 05422-970, Brazil
    Search for more papers by this author
  • M. S. Araújo,

    1. Department of Biological Sciences, Florida International University, 3000 NE 151st Street, North Miami, FL 33181, USA
    Search for more papers by this author
  • A. A. Giaretta,

    1. Laboratório de Ecologia e Sistemática de Anuros Neotropicais, Instituto de Biologia, Universidade Federal de Uberlândia, 38400-902, Uberlândia, Minas Gerais, Brazil
    Search for more papers by this author
  • J. C. L. Costa,

    1. Programa de Pós-Graduação em Ecologia, Instituto de Biologia, Universidade Estadual de Campinas, Caixa Postal 6109, 13083-970 Campinas, São Paulo, Brazil
    Search for more papers by this author
  • S. F. dos Reis

    1. Departamento de Biologia Animal, Instituto de Biologia, Universidade Estadual de Campinas, Caixa Postal 6109, 13083-970, Campinas, São Paulo, Brazil
    Search for more papers by this author

Correspondence author. E-mail:


1. Much of the current understanding of ecological systems is based on theory that does not explicitly take into account individual variation within natural populations. However, individuals may show substantial variation in resource use. This variation in turn may be translated into topological properties of networks that depict interactions among individuals and the food resources they consume (individual-resource networks).

2. Different models derived from optimal diet theory (ODT) predict highly distinct patterns of trophic interactions at the individual level that should translate into distinct network topologies. As a consequence, individual-resource networks can be useful tools in revealing the incidence of different patterns of resource use by individuals and suggesting their mechanistic basis.

3. In the present study, using data from several dietary studies, we assembled individual-resource networks of 10 vertebrate species, previously reported to show interindividual diet variation, and used a network-based approach to investigate their structure.

4. We found significant nestedness, but no modularity, in all empirical networks, indicating that (i) these populations are composed of both opportunistic and selective individuals and (ii) the diets of the latter are ordered as predictable subsets of the diets of the more opportunistic individuals.

5. Nested patterns are a common feature of species networks, and our results extend its generality to trophic interactions at the individual level. This pattern is consistent with a recently proposed ODT model, in which individuals show similar rank preferences but differ in their acceptance rate for alternative resources. Our findings therefore suggest a common mechanism underlying interindividual variation in resource use in disparate taxa.


A central problem in ecology is to understand how animal populations use resources in the environment. Even though it has been known for a long time that many natural populations are not homogeneous regarding resource use (e.g. Van Valen 1965), most of ecological theory, in particular niche (Chase & Leibold 2003) and food web theories (Dunne 2006), did not effectively address diet variability among individuals within populations. Such theories have provided unequivocal insights into understanding ecological systems (e.g. Pascual & Dunne 2006). However, a few ecological models that do incorporate individual variation indicate that it greatly impacts the stability and persistence of populations and communities (e.g., Okuyama 2008; Lankau 2009). Empirically, niche variation within populations has been shown to be a widespread phenomenon (Bolnick et al. 2003), but we still know little about its underlying ecological mechanisms.

Variation in resource use among individuals might be a result of environmental differences in resource availability across space and time. Alternatively, phenotypic differences among individuals might lead to distinct individual niches, generating intrapopulational variation in resource use (Glasser 1982; Schindler, Hodgson & Kitchell 1997; Robinson & Wilson 1998; Robinson 2000; Bolnick et al. 2003, 2007). Optimal diet theory (ODT) provides a mechanistic approach to understand variation in resource use. ODT assumes that individuals make decisions on which food resources should be consumed to maximize the rate of energy income (Pulliam 1974). It also assumes that individual decisions are a function of the energetic value of resources and the search and handling times related to their capture, consumption and digestion. Therefore, consumers are predicted to rank resources according to energy yielded per unit time. In this context, phenotypic variation among individuals that affect search efficiency, handling times and digestive abilities may lead to interindividual variation in rank preferences for resources, causing interindividual diet variation (Bolnick et al. 2003, 2007; Svanbäck & Bolnick 2005) and different resource use patterns within populations.

In food webs, structural patterns of trophic interactions among species have been studied using network approaches, in which nodes represent species within a community and links among them depict their interactions (Dunne 2006). Similarly, patterns of resource use by individuals within a population can be unravelled by studying individual-resource networks (Araújo et al. 2008, 2010; Fig. 1). These networks have two distinct sets of nodes: one representing individuals and the other resources, and a link represents the consumption of a given resource by an individual (Fig. 1). The different patterns of resource use by individuals, in turn, result in different topologies, so that the predictions of distinct ODT models (Svanbäck & Bolnick 2005) can be directly associated with distinct network architectures. Thus, depicting resource use patterns of individuals as networks and describing their topology enable the test of hypotheses on resource partitioning within populations. For instance, if individuals share the preferred resource but differ in their preferences for alternative resources (competitive refuge model; Svanbäck & Bolnick 2005) or if individuals have different top-ranked resources (distinct preferences model), we would expect that, depending on resource availability, the individual-resource network would exhibit modularity, i.e., semi-independent subgroups of nodes densely linked (Fig. 1a,b, respectively). Modularity would occur owing to different groups of individuals consuming different subsets of the available resources (Araújo et al. 2008). Alternatively, the network would have a nested structure (Araújo et al. 2010; Fig. 1c) if individuals from different phenotypes had similar rank preferences but differed in their acceptance rate for alternative resources in response to the abundance of resources in the environment (shared preferences model). In this scenario, when the preferred resources are scarce, the diets of the most selective individuals become a proper subset of the diet of the next more opportunistic individuals, leading to nestedness (Fig. 1c).

Figure 1.

 Hypothetical individual-resource networks depicting resource use patterns based on Svanbäck & Bolnick’s (2005) models of optimal diet (a–c). Circles represent individuals and diamonds resources; different colours represent different phenotypes with different rank preferences. A link represents the consumption of a given resource by an individual. Networks on the left of each panel portray a scenario where the preferred resource of each phenotype is abundant, and on the right, the scenario when this resource become scarce. (a) The ‘competitive refuge’ model assumes phenotypes share the top-ranked resource, but choose different alternative resources. As the preferred resource becomes scarce, individuals shift to alternative resources, reducing dietary overlap and increasing modularity. (b) The ‘distinct preferences’ model assumes different phenotypes rank resources in a different order. In the opposite direction of the competitive refuge model, the ‘distinct preference model’ predicts that if the preferred resources become scarce, individuals include novel resources in their diets, thereby increasing dietary overlap. (c) The ‘shared preferences’ model assumes phenotypes have similar rank preferences but vary in the rate at which they accept less-preferred resources, leading to nested diets. In all models, when all resources are scarce, all individuals should adopt an opportunistic strategy. For further details on each model and its predictions, we refer readers to Svanbäck & Bolnick (2005).

Up to now, there are few studies (Araújo et al. 2008, 2010; Dupont, Trøjelsgaard & Olesen 2010) that integrate network theory and variation in resource use among individuals. The present study advances in this direction: we used a network-based approach as an attempt to unravel the topological complexity of trophic networks at the individual level and the generality of resource use patterns. First, we depicted as networks the resource use by populations of 10 different vertebrate species previously reported to show interindividual diet variation (Table 1) and then investigated the topology of these networks. The following questions were addressed: do nonrandom patterns emerge in the interactions between the individuals of a heterogeneous population and the food resources they consume? Are similar patterns observed across the distinct species analysed? Are these patterns predicted by recently proposed ODT models for heterogeneous populations?

Table 1.   Information about each population
ReferencesCommon nameTaxonStudy area
Pires 2010Tate’s Woolly mouse opossumMicoureus paraguayanusCerrado, southeastern Brazil (São Paulo)
Costa 2008Tropidurus lizardTropidurus hispidusRestinga formation, northeastern Brazil (Maranhão)
Araújo et al. 2007Brazilian savannah frogsIschnocnema penaxavantinho
L. fuscus
Proceratophrys sp.
Cerrado, southeastern Brazil (Minas Gerais)
Araújo et al. 2009Brazilian savannah frogsPhysalaemus cuvieri
Eupemphix nattereri
Chiasmocleis albopunctata
Elachistocleis bicolor
Cerrado, southeastern Brazil (Minas Gerais)

Materials and methods

Study Systems

The dietary data used here come from previous work on intrapopulation diet variation of 10 different Neotropical taxa: the didelphid marsupial Micoureus paraguayanus (Pires 2010), eight frog species from five different families (Araújo et al. 2007, 2009), and the lizard Tropidurus hispidus (Costa 2008). These previous studies have shown diet variation that was not related to age, sex or reproductive condition, so that we can employ the term interindividual diet variation. Determining the persistence of diet variation over time is important to distinguish between short-term stochastic effects and long-term preferences (Bolnick et al. 2003). For M. paraguayanus, diet was assessed by longitudinal sampling, and the diets of individuals were shown to persist for at least 6 months (Pires 2010). For the Neotropical frogs, the cross-sectional dietary data were tested for temporal consistency using stable isotope ratios, suggesting temporal consistency in individual preferences at the scale of months (Araújo et al. 2007, 2009). The remaining population (Tropidurus hispidus) was not evaluated for individuals’ dietary temporal consistency. Information on each population is summarized in Table 1.

Dietary Analysis

The diet of M. paraguayanus was determined by the analysis of faeces of live-trapped individuals. Individuals were live-trapped throughout 1 year so that we had several faecal samples for each individual. The diet of frogs and lizards was determined by stomach content analysis. Frogs and lizards were immediately killed upon collection, preserved and dissected in the laboratory to obtain stomach contents. Faecal and stomach contents were examined in the laboratory with a stereoscope. Food resources were mainly arthropods such as beetles, ants, termites and spiders, consumed by individuals from all populations, and fruits, consumed only by M. paraguayanus. Resource categories were identified by comparison of arthropods remains or fruit seeds with a reference collection or using taxonomic keys, allowing the identification to the lowest taxonomic level possible (usually order for arthropods and genus for plants). A food resource category was recorded whenever it was detected in a sample. Matrices of resource use by individuals containing the complete list of resources used by these species are available in Appendix S1, Supporting information.

Network Structure

The consumption of resources by individuals within each sampled population was depicted as an individual-resource network consisting of two sets of nodes (individuals and resource categories) and links among them. It is important to stress that even though consumer nodes refer to individuals, resource nodes represent a food resource category as a whole. Thus, when we refer to individual level, herein we are specifically talking about consumers because we do not address individual variation within resource categories. This individual-resource network is defined as an incidence matrix R describing trophic interactions between individuals (represented in rows) and resources (in columns), where an element rij of the matrix is 1 if the consumption of resource j by individual i was recorded and zero otherwise (Harary 1969; Bascompte et al. 2003). We recognize that an alternative approach is the use of weighted networks to describe variation in the relative strength of trophic interactions (Berlow et al. 2004; Bascompte, Jordano & Olesen 2006). However, the predictions of the ODT models we consider here are qualitative in nature and thus more suited to binary, nonweighted networks. Therefore, to test the predictions of the models, unweighted networks were used to describe the use of food resources by individuals and investigate structural patterns such as nestedness and modularity.


Nestedness is a property of networks in which the interactions of a node is a subset of the interactions of the next more connected node (Bascompte et al. 2003). The index NODF (Almeida-Neto et al. 2008) was used to compute the degree of nestedness of individual-resource networks. This metric has conceptual advantages when compared with other metrics and seems to be less prone to type-I statistical error, consistently rejecting nestedness for random networks (Almeida-Neto et al. 2008). Moreover, it allows the calculation of nestedness independently among individuals and resources (see Almeida-Neto et al. 2008 for further details). For each network, total nestedness was calculated. Nestedness was partitioned into two components (Almeida-Neto et al. 2008), which we call individuals and resource nestedness, and we investigated them separately. Because the shared preferences model predicts nested patterns because of interindividual variation in dietary selectivity, our focus is on the nestedness of individuals as opposed to resources. Furthermore, nestedness of individuals allows us to control for nested patterns generated by factors associated with resources, such as differences in abundances of different food items. NODF will tend to 100 for highly nested matrices and tend to zero when individuals show other nonrandom patterns of resource use (Almeida-Neto et al. 2008). However, here we use NODF/100 to facilitate comparisons among measures. Because recent studies have reported differences in the behaviour of different nestedness metrics (Ulrich, Almeida-Neto & Gotelli 2009; Joppa et al. 2010), we also report in the Supporting information, results using matrix temperature, T, a more traditional measure of nestedness (Atmar & Patterson 1993). The program ANINHADO (Guimarães & Guimarães 2006) was used to calculate NODF and T.


A modular or compartmented network consists of distinct subsets of nodes, termed modules or compartments, in which nodes are more densely connected to each other than to nodes in other modules (Danon et al. 2005; Guimerà & Amaral 2005a,b). Although there are many available methods for identifying modular structure in networks, we followed Danon et al. (2005) and Olesen et al. (2007) who identified the simulated annealing algorithm (SA; Guimerà & Amaral 2005a,b) as the most effective among methods for estimating the degree of modularity in a network. We also refer readers to Olesen et al. (2007) for a brief summary on the advantages and disadvantages of different methods to assess modularity in complex networks. The SA is a stochastic optimization technique that, combined with a module identification algorithm, allows partitioning of the network into modules that yield the largest degree of modularity (Guimerà & Amaral 2005a,b). For each partition of a given network, an index of modularity M is computed:

image(eqn 1)

where NM is the number of modules in the network, ls is the number of interactions between all nodes (individuals and resources) within module s, L is the number of interactions in the network and ds is the sum of degrees of all nodes in s. The SA algorithm is then used to obtain the best determination of the modules of a network by direct maximization of M (Guimerà & Amaral 2005a,b). M equals 0 if nodes are placed at random into modules or if all nodes are in the same cluster and approaches 1 if modules have well-delimited boundaries, i.e. few among-modules links. Note M did not take into account the fact, the network is bipartite, i.e. networks in which interactions only occur between nodes in different sets (individuals and resources). Nevertheless, our null models keep the bipartivity of real networks, controlling for any potential effect of bipartite structure on modularity.

Null Model

A certain degree of nestedness or modularity may be generated by stochastic processes (Guimerà, Sales-Pardo & Amaral 2004; Vázquez & Aizen 2004; Ulrich, Almeida-Neto & Gotelli 2009) such as sampling biases. In studies with continuous sampling, structure may be affected by reduced sampling effort, because the diets of individuals with limited information might appear as subsets of the diets of the individuals that were captured many times, increasing nestedness. In studies with cross-sectional sampling, such as gut content analysis, if individuals are captured at different points in their activity period, they may differ in the time spent foraging and thus both the degree of nestedness and modularity might be affected. In addition, as resources are not evenly distributed, structure may arise from individuals randomly sampling a shared distribution of resources. Thus, to verify the significance of those patterns, the empirical values of N and M were tested against null distributions of these values.

We generated theoretical individual-resource networks in which the probability that an individual i feeds on a resource j is

image(eqn 2)

in which inline image is the number of resource types consumed by individual i and kj is the number of individuals that consume resource type j, A is the number of resources and B is the number of individuals sampled. This model is identical to the one used by Bascompte et al. (2003) for mutualistic bipartite species networks. This model was chosen because it has a low rate of type-I error when compared to unconstrained null models (Ulrich, Almeida-Neto & Gotelli 2009), and by preserving differences in the number of interactions among individuals and among resources found in the empirical network, the model accounts for random processes that might generate structure as highlighted earlier. There are more constrained models, which fix both columns and/or rows totals from the original incidence matrix and randomizes interactions. However, these models greatly increase the tendency of type-II error (Ulrich & Gotelli 2007; Ulrich, Almeida-Neto & Gotelli 2009; Joppa et al. 2010). Moreover, observed individual diets are intrinsically probabilistic, because they represent an estimate of actual individual diet. Thus, there is no biological realism in assuming diets as fixed.

Calculating N and M for each resampled population (we used 1000 iterations for each network), the null hypotheses can be rejected if the observed values are >95% of the theoretical values. To allow cross-network comparisons, we used the relative nestedness (Bascompte et al. 2003), and analogously the relative modularity, which correct for variation in the size of the networks, i.e. the number of sampled individuals, types of resources and trophic interactions. Relative nestedness is defined as inline image, where N is the nestedness of the actual matrix and inline image is the average nestedness of random replicates generated from the null model analysis. Similarly, relative modularity can be defined as inline image. The MATLAB script for generating null model networks is available under request.


Individual-resource networks vary from small-sized networks containing as few as 20 individuals and six resource categories to large networks containing 115 individuals and almost 30 resource categories (sampled individuals = 67·8 ± 33·4, resource categories = 18·5 ± 8·9, mean ± SD, n = 10). Along the same lines, network connectance, the proportion of potential links that actually occur, also varied across networks (inline image, range: 0·10–0·32). Yet, all empirical networks (Fig. 2) were significantly more nested (inline image, mean ± SD) than their randomized counterparts (inline image; < 0·05 in all networks). Using the matrix temperature metric gave similar results (Table S1, Supporting information). The degree of nestedness was often >60% larger in empirical networks than in their randomized versions (inline image). Nestedness in empirical individual-resource networks may be generated both by the resource use pattern of individuals and by the variation in resource availability across the environment. Resources were indeed more nested than expected by chance for most of the empirical networks (six of 10 networks, < 0·05; inline image; inline image). Nevertheless, the nestedness of individuals was higher in all the networks than in their randomized counterparts (< 0·05; inline image; inline image), in agreement with the predicted pattern for the shared preferences model. The average relative nestedness for individuals (0·68 ± 0·27) was three times higher than that for resources (0·26 ± 0·20). Therefore, most of the nestedness observed in the empirical networks was a result of the nested use of resources by individuals.

Figure 2.

 Individual-resource networks. Links represent the consumption of a resource (diamonds) by each individual (circles). (a) Micoureus paraguayanus; (b) Tropidurus hispidus; (c) Leptodactylus sp.; (d) Chiasmocleis albopunctata; (e) Physalaemus cuvieri; (f) Ischnocnema penaxavantinho; (g) L. fuscus; (h) Eupemphix nattereri; (i) Elachistocleis bicolor; (j) Proceratophrys sp. Networks were drawn in Pajek (

All empirical networks showed low degree of modularity (inline image). The observed values of modularity for individual-resource networks were not significantly higher than expected by similar random networks (> 0·10 for all networks). In fact, the degree of modularity was, on average, higher for randomly generated networks than for real networks (inline image; inline image). Therefore, the individual-resource networks showed no evidence of patterns associated with the competitive refuge and distinct preferences models. Networks with higher connectance were also more nested (F8,1 = 20·82, r2 = 0·68, < 0·01) but were less modular (F8,1 = 7·04, r2 = 0·40, < 0·05). However, the number of nodes had no effect in the degree of nestedness or modularity (nestedness: F8,1 = 2·02, r2 = 0·10, = 0·20; modularity: F8,1 = 0·06, r2 = 0·01, = 0·8). Table S1, Supporting information contains information about the number of nodes, connectance, the degrees of nestedness and relative nestedness and the degrees of modularity and relative modularity for each network.


Despite the dissimilarity of the networks describing the analysed populations, in which the number of sampled individuals and trophic interactions among individuals and resources differed, our results show a remarkably invariant pattern across the different species. All networks were more nested than expected by chance alone, and the relative degree of nestedness was considerably large for most of them (Table S1). This high degree of nestedness in individual-resource networks means that the populations studied are composed of both opportunistic and selective individuals and that the diets of selective individuals are ordered, predictable subsets of the diets of the opportunists (Araújo et al. 2010). Consistent with these results, we found low degrees of modularity, indicating that, even though all populations show interindividual diet variation, these networks are not organized into clearly delimited modules corresponding to groups of individuals consuming different subsets of the available resources (e.g., Araújo et al. 2008). Highly connected networks were more nested and less modular. This relationship is expected because the nested structure itself implies a certain degree of overlap that blurs boundaries of potential modules (Olesen et al. 2007). In individual-resource networks, high connectance ultimately reflects larger dietary overlap and thus a larger tendency towards nestedness than modularity, even though both patterns are not incompatible (e.g., Lewinsohn et al. 2006; Olesen et al. 2007; Ulrich & Gotelli 2007; Fortuna et al. 2009, 2010). Nevertheless, the degree of nestedness observed in individual-resource networks analysed was higher than expected for networks generated using a null model that controls for connectivity patterns. This raises the question as to what is the mechanistic basis of the structure observed in individual-resource networks.

A nested pattern is predicted by ODT (Fig. 1c) if individuals have similar rank preferences but differ in their willingness to include lower-ranked resources in their diets (the shared preferences model –Svanbäck & Bolnick 2005). Even though we have known for decades that ODT predicts that individuals take the rate of energy income into consideration when ranking food items (Stephens & Krebs 1986), the shared preferences model introduces an additional factor: the variation among individuals in the threshold for adding alternative resources in their diets. According to this model, for a given set of available resources, the population would be composed of some individuals who behave as opportunists, while others would still behave more selectively consuming only top-ranked resources. Because most individuals shared similar rank preferences, novel resources should be added in a predictable order, causing nestedness (Araújo et al. 2010).

The observed pattern can also be interpreted in the light of ideal free distribution theory (IFD, Fretwell & Lucas 1970). IFD predicts some individuals will disperse to a lower-quality patch as the density in the higher-quality patch increases, so that at equilibrium the different patches all have the same pay-off. Similarly, the specialization of all individuals on the top-ranked resource would lead to resource depletion, favouring the inclusion of lower quality resources (Estes et al. 2003). If we assume that individuals differ in competitive ability, so that superior competitors are disproportionately more common in the higher-quality patch (Houston & McNamara 1988), such an IFD model applied to resource use would lead to a nested pattern. According to this adapted model, superior competitors would monopolize the best resource, whereas out-competed individuals would feed on top resources but also add lower quality resources to their diets. This formulation shares many commonalities with the shared preference models such as density-dependent effects and the assumption of interindividual variation in the acceptance of resources.

The fact that the observed patterns can be explained by two different, albeit interrelated, theoretical frameworks illustrates the difficulty in directly linking observational empirical data to their underlying mechanisms. However, the fact that nestedness was observed in 10 different species belonging to taxonomic groups as disparate as marsupials, and frogs suggest a general, shared underlying mechanism. Future observational and experimental studies would be of great help in determining the mechanistic basis of nestedness in these and other species. An equally promising field for future research is to address related questions addressed here using quantitative approaches. As stated before, we used qualitative networks because we focused in the qualitative predictions of the ODT models. Future studies should develop the approach introduced here, creating quantitative predictions of ODT models in terms of topological aspects of weighted networks (e.g., Barthélemy et al. 2005), and allowing us to test whether the generality in the patterns of interaction observed here holds true when addressing the quantitative variation in resource use within populations.

Our results reinforce that network-based approaches, as commonly used at the species level in ecology (Pimm, Lawton & Cohen 1991; Bascompte et al. 2003; Dunne 2006), are useful when applied at the individual level, where they can uncover patterns of resource use within populations (Araújo et al. 2008, 2010). Nestedness is a widespread pattern reported for several systems in the context of species interactions (Valtonen et al. 2001; Bascompte et al. 2003; Lewinsohn et al. 2006; Guimarães et al. 2006, 2007; Burns 2007; Ollerton et al. 2007). Here, we expand the generality of the nested pattern to trophic interactions at the individual level. The nested pattern uncovered here has important implications for ecological studies at different scales. A potential implication of nestedness in resource use is that if resources are in limited supply, competitive interactions among individuals will be highly asymmetric. This asymmetry in turn might affect the ecological and evolutionary dynamics of populations in ways that still need to be determined (Araújo et al. 2010). Future studies should explore how general is nestedness across other animal species and if and how nestedness is moulding competitive interactions within populations. Finally, our work describes nonrandom patterns of interaction in networks at the individual level, which might have substantial implications to the assembly, stability and dynamics of ecological interactions at the community level. An open question is whether the implications of food web structure to ecological dynamics (Dunne, Williams & Martinez 2002; Williams et al. 2002) will be affected if we consider the nested structure of individual level networks.


We thank M. Tim Tinker and one anonymous reviewer for their comments on the manuscript and R. Guimerà for the Modularity algorithm. M.M. Pires was supported by a FAPESP scholarship; P.R. Guimarães Jr. was supported by FAPESP and CNPq. M.S. Araújo was supported by the CAPES and NSF. A.A. Giaretta was supported by FAPEMIG and CNPq. S.F. dos Reis was partially supported by a research fellowship from CNPq.