Introduction

Foraging is a fundamental aspect of animal behaviour since it encompasses the strategies species employ to obtain resources and survive. Natural selection will favour organisms with more efficient foraging behaviour, such as those that select better feeding sites, find food faster or maximise capture of their prey (Pyke 1984; Stephens and Krebs 1986). Evolution of the most economically advantageous foraging strategies implies (i) that there is variation in the expression of a foraging strategy, (ii) fitness varies with the expressed strategy and (iii) the strategy has hereditary components (Endler 1986). A lot of what we know about the evolution of foraging behaviour has been described theoretically (Hassell and Southwood 1978; Traniello 1989; Uetz 1992; Perry and Pianka 1997; Hayden 2018). However, despite the importance and simplicity of this hypothesis, when tested empirically, these premises tend to use measures such as the rate of energy intake or the probability of meeting total energy requirements (Cowie 1977; Zimmerman 1982; Mittelbach 1983), instead of directly measuring fitness, i.e., fecundity and probability of survival. Similarly, foraging time and energy budgets have been used to indirectly predict fitness (Morrison et al. 1990; Perry and Pianka 1997). Considering the lack of empirical studies that directly measure the cost of foraging and its effect on fitness, it is fundamental to increase experimental evidence to support theoretical assumptions.

The effects of foraging behaviour on fitness have been tested before (Godin and Smith 1988; Lemon 1991; Frey-roos et al. 1995; Morris and Davidson 2000; Patrick and Weimerskirch 2014). For instance, most dominant female water striders (Gerris remigis), with the best ability to find and maintain better foraging sites, have higher fecundity than their less dominant counterparts (Blanckenhorn 1991). Similarly, in female zebra finches (Taeniopygia guttata), fertility and probability of survival was positively correlated with net energy gain during foraging (Lemon 1991). And the ability to select an optimal diet had a strong impact on Columbian ground squirrels’ (Urocitellus columbianus) fitness; females with higher energy intake had larger litter size, growth rate and survival, compared with deviating foragers (Ritchie 1990). Most of these studies testing selection on foraging efficiency focus on the effects of a behaviour in the next generation only, overlooking the effects in multiple generations. Additionally, the quantitative variation of different fitness components in the descendants is not always included, which is important if we are to understand the evolutionary features of natural selection such as the strength and the rate of the selection.

Artificial selection experiments are commonly used to study evolution because they are useful to understand the fitness outcome of inherited effects. Here we used artificial selection to study the multi-generation evolution of foraging efficiency and its relation to fitness in Drosophila melanogaster. Although foraging behaviour in Drosophila is usually studied in larvae (Sewell et al. 1974; Burnet et al. 1977; Sokolowski 1985; Steven De Belle and Sokoiowski 1987; Wallin 1988; Mueller et al. 2005; Vijendravarma et al. 2012; Edelsparre et al. 2014), adult Drosophila are also good models to test foraging efficiency because they are continuously searching for new ephemeral food sources to feed, mate and reproduce (Soto-Yéber et al. 2018). Furthermore, a genetic component of Drosophila foraging behaviour has been identified before (Sokolowski 1980; Steven De Belle and Sokoiowski 1987; de Belle et al. 1989; Pereira and Sokolowski 1993; Sokolowski et al. 1997; Reddiex et al. 2013; Lee et al. 2017; Anreiter et al. 2017; Allen et al. 2018). First, we artificially selected flies with higher foraging ability to find food faster in an experimental maze (selected treatment with four replicates) and compared them with control flies (control treatment with two replicates), which were chosen regardless of their foraging ability. Second, in a separate experiment, and for each generation, we analysed the flies’ individual foraging behaviour in both selection and control treatments. For each fly we measured its movement time, foraging success, time to find a food source, and the time it spent on the food. This helped us to elucidate whether selected individuals were indeed more efficient foragers instead of only being the most active flies. Finally, we measured the fecundity and probability of survival of each treatment and generation.

We predicted that: (1) After five generations (F5), selected flies would find food faster than control flies; (2) Selected flies in F5 would find food faster in comparison to their founding population (F1); (3) When measuring individual behaviour, selected and control treatments would not differ in their activity level, but they would differ in their foraging behaviour; (4) If finding food faster is beneficial for flies, then selected individuals would show higher fitness than control individuals in the next generations. By measuring the ability to find food and the biological fitness of selected and control flies, we were able to investigate whether foraging behaviour can be selected and if this selection has a positive effect on the fitness of the following generations.

Material and methods

Experimental flies and culture conditions

We used wild-type flies, Drosophila melanogaster Meigen, 1830 (Diptera, Drosophilidae), raised under laboratory conditions. Our stock population was maintained at the Laboratory of Evolutionary Ecology of Benemérita Universidad Autónoma de Puebla (BUAP), and it was derived from the Drosophila Stock Centre of Universidad Nacional Autónoma de México (UNAM) in 2014 (Drosophila Stock Center México 2023). These flies were maintained in 1L glass container with a density of 300 flies, with a sex ratio of 1:1 male:female. Experimental flies were cultured in 300 ml glass containers, previously sterilized, with 30 ml of standard medium, containing, per litre, 66 g dead yeast, 70 g sugar, 15 g agar, 4 ml nipagin solution 10%, and 4 ml propionic acid. The development took place in a room at a temperature of 25 ± 1 ° C, 40-60% room humidity and a 12:12 dark light cycle. All the flies used in behavioural trials, in group or individually, were sexually mature. Selected flies were used to create a new independent population per generation. After the experimental trials, flies were returned to the main stock population in our laboratory and were not further used in this experiment. All experimental procedures were carried out according to the guidelines of BUAP.

Selection procedure

We created two evolutionary treatments, selection and control. We independently replicated the selection treatment four times (populations S1, S2, S3, S4) and the control treatment twice (populations C1 and C2); there was no gene flow between different populations. To create each population, we selected (see below) 60 founding females and 50 founding males (N = 110 breeding flies per population) from a pool of 800 individuals (1:1 sex ratio) sourced from the base stock population (in total, 6 x 800 = 4,800 flies were used to obtain the founding flies of all populations). This population size (N = 110) is commonly used in artificial selection experiments (e.g., Manning 1961; Rathie and Nicholas 1980; Nunney 1996; Mackay et al. 2005). All adult flies used in the selection procedure were virgin and 1 to 3 days old. In all following generations (F2-F5), for each population, we selected the 110 individuals from 400 individuals (1:1 sex ratio) to breed the next generation in each replica. We used a higher number of individuals to select from in the founding generation (F1) of the experiment to maximise the initial available additive genetic variance (VA) for foraging efficiency. As VA is a critical component of evolutionary change (Bonnet et al. 2022), we expect adaptation to be strongest following the first generation of selection, but to continue across the following four generations of the experiment.

We selected the flies that find food faster using an experimental maze (30×10×10 cm long, wide, and high) that was made with white hard cardboard and transparent plastic sheets (Fig. 1). The maze was divided into three sections: the first section (5 cm long) for an acclimation period, the second (20 cm) for movement, and the third one (5 cm) for foraging. We placed a movable door between the first and the second sections, and the second and third sections were connected through a circular opening (4 cm diameter) in the centre of a wall, which also had a movable door. The third section was a chamber containing the food. Food presented was 5 ml of live yeast mixed with 5 g of sugar served in a plastic container (2.5 cm high and 2 cm diameter); this mixture had a viscous consistency and was prepared by continuously mixing the ingredients for 20 minutes at 35 ° C on an electric grill.

Fig. 1
figure 1

Experimental maze. Experimental maze used for the selection procedure to examine the foraging ability of the flies; a first section, b movable door, c second section or movement section, d circular opening, e third section or foraging section, and f food container

To promote foraging behaviour in our selection trials, recently emerged (1-3 days), same-sex virgin adult flies were placed in 300 ml glass jars with access to water (wet cotton swab), but without food for 12 h; the density was 100 females and 100 males per jar. We chose to include this starvation period because in our pilot study using the stock population, most of the recently emerged adult flies that had never eaten and those that recently ate were unable to find the food in our experimental maze during a 2 hr-observation. No flies died during the starvation period and all starved flies were active. After this starvation period, selection trials were conducted between 07:00 -12:00 h, corresponding to the flies’ first peak of activity (Helfrich-Förster 2000; Grima et al. 2004).

Males and females were tested on the same day and time in separate experimental mazes. Trials started when we placed 100 virgin, same-sex flies in the first section of the experimental maze for an acclimation period of 30 seconds; there was a movable door on top of the first section that allowed us to place the flies into the maze. Afterwards, the door of the first section was opened and the flies could freely move through the rest of the experimental maze. Once the fastest flies entered the chamber containing the food, the opening between the movement and foraging section was closed (Fig. 1).

The initial population, referred to as F0, consists of the stock flies. The subsequent generations were established by selecting F1 founding flies from the F0 population using the experimental maze, to initiate reproduction and continue the lineages. Due to the limited foraging capabilities of the F0 flies and to increase additive genetic variance, in the first selection round we conducted additional selection trials with a reduced number of flies compared to subsequent generations. To obtain the founding populations (F1), we selected the first 13 males and 15 females that found the food, and for the next generations (F2-F5) we selected the first 25 males and 30 females. For F1, we conducted eight selection trials (selection batches; four trails per sex) to obtain the total population size used to reproduce in each population (i.e., N = 110, see above), and for F2-F5 we conducted two selection trials per sex to start each generation. An observer recorded the time it passed until the flies touched the food for the first time (i.e., latency to touch the food). To conduct a thorough comparison between the initial and final generations, in generations F1 and F5, we registered the first 40 the time it took each of the flies per sex; and for all other generations, we recorded the time it took for all the flies (50 males and 60 females) to find the food inside the maze. Then, the selected flies were collected with an aspirator and used to breed the next generation and the rest of the flies (in the other sections of the maze) were not used in this experiment anymore. Control populations were selected following the same procedure, but flies were placed inside the maze for 10 minutes and then all of them were collected with an aspirator and then they were randomly selected, therefore choosing flies irrespectively to their location inside the maze or their foraging ability.

To breed the next generation, selected flies in both treatments were allowed to mate for 36 h; afterwards, adults were removed from the population containers, and their eggs’ development was monitored. Offspring completed their lifecycle from egg to adult in 10 days in all generations. To test the behaviour of same age flies, we only collected recently emerged adults during the first three days after the first adult emerged. Virgin adults were collected and sexed every four hours, between 07:00-20:00 h, to be placed in same-sex glass jars with 15 ml of standard medium, in groups of maximum 100 individuals. These recently emerged flies were then starved and later tested in the selection trials. The whole procedure was repeated for five generations.

Individual foraging behaviour

In our selection procedure we could have been selecting for the most active flies instead of the flies that found the food faster. That is why we also compared the individual activity and foraging behaviour of the selected flies in both treatments and in every generation, and we expected that the flies’ activity level was similar between treatments and generations. After selected flies reproduced (i.e., 3 days, N = 110), we randomly chose 15 females and 15 males to be deprived of food for 12 hours. Afterwards, each fly was individually placed on the edge inside a Petri dish (90x15mm) that contained a drop of fresh yeast in the centre (Supp. Fig. S1). These individual tests were carried out between 7 and 11 hrs at a temperature of 25 ° C. For 10 min, we manually recorded: a) Movement time: total time in which the fly was in motion; b) Foraging success: whether the fly had contact or not with the food; c) Food searching time: time since the fly was placed inside the Petri dish until it touched the food for the first time; and d) Time on food: total time the fly stayed on top of the food.

Fitness measurement

We recorded fecundity and offspring survivorship as proxy for fitness of the selected flies in both treatments and in every generation. After selected flies reproduced (i.e., 3 days, N = 110), flies were anesthetized with ether, and we randomly chose 15 females and 15 males. Males were added to promote female oviposition (Isaac et al. 2010; Lin et al. 2015). These flies were placed for 12 h in a glass container (1 L) that had a Petri dish with 15 ml of standard culture medium and were let to breed. Then, we removed adults, and the total number of eggs was counted. To determine hatching success, after 24 hours unhatched eggs were counted. After 3 days, a thin layer of medium was removed from the Petri dish altogether with 50 larvae, to be placed in a 300 ml glass container with 30 ml standard culture; this to control the effect of density over fly development (Horváth and Kalinka 2016). Fifteen days later, the number of larvae that reached the adult stage was counted, when no more adults emerged.

Data analysis

Selection procedure

Once the selection trials started, for both treatments, we recorded the latency to touch the food, i.e., the time in seconds that the first flies took to find the food source inside the maze (Fig. 1). Because all the flies in the selection treatment found food in less than 10 min, selection trials for both treatments were standardised to 10 min. We employed survival analyses to fit failure time data, specifically the time until an event (i.e., the probability of finding food by each fly), as our dependent variable. Classical statistical approaches were not applicable due to the data not meeting the underlying assumptions (Fox 2001). We utilized a mixed-effects Cox proportional hazards model, taking into account the different replicates for each treatment. Our statistical model included the generation (F1 vs F5), treatment (control vs selection) and sex (male vs female) as fixed factors, whereas treatment replicates (populations) were included as a random factor. All analyses were performed using the R statistical software version 3.5.1 (R Core Team 2018)⁠, with the survival, rms and survminer packages (Therneau 2015, 2022; Kassambara et al. 2019)⁠. All analyses were made with a 5% of significance level.

Individual foraging behaviour

For each individual foraging behaviour component (movement time, foraging success, food searching time and time on food), we fitted generalized linear mixed models using the lme4 package (Bates et al. 2015) with Weibull distribution. A behaviour component was the response variable, whereas generation (F1 vs F5), treatment (control vs selection) and sex (male vs female), and all their statistical interactions, were the explanatory variables; treatment replicates (populations) were included as a random factor. Not all flies found the food during the individual trails, so only those that did (see foraging success) were used for the analyses of food searching time and time on food.

Fitness measurement

We tested if the observed frequency of laid eggs and larvae survival were different between treatments (control vs selection) and generations (F1 vs F5) using a χ2 test of homogeneity.

Results

Selection procedure

We found that the time it took for the flies in the selection group to locate the food inside the maze decreased with generation (Fig. 2). The Cox mixed-effect model showed that males and females had similar performance, but generations and treatments had significant effects on the time to find food (Fig. 3). Moreover, we observed a significant statistical interaction between generation and treatment (Table 1; Supp. Table S1). This is because selection treatment flies of generation five (F5) where faster than the control flies of generation five (F5) and faster than the first generation of both treatments (F1 selected and F1 control). The random intercept of the Cox mixed-effects model showed a variance of 3.08 × 10-6 ± 1.75 × 10-3 suggesting that the variability in the survival times within each replicate group was small (Supp. Fig S2). In generation one, populations of both selection and control treatments had a similar performance in terms of the time it took them to find the food source inside the experimental maze (Fig. 3), indicating that all populations started with the same abilities and therefore no detectable bias for some lines to do better than others.

Fig. 2
figure 2

Selection procedure. Time (seconds) it took for the last fast fly from each replicate to find the food inside the maze (i.e. male number 50 and female number 60). The X-axis represents the generation (F0 to F5), and the Y-axis represents the time (seconds) for the last fly to locate the food. Sexes shown in different panels (left: females, right: males). Solid lines and circles represent the four replicates from the selection treatment and dotted lines and triangles the two replicates from control treatment

Fig. 3
figure 3

Proportion of flies that have not yet found food. Y-axis goes from 1 (none of the flies have found the food) to 0 (all the flies have found the food). Time is represented in seconds. Each one of the lines represents curve comparisons between generation and treatment. The letters denote statistical differences among curves: a) denote the probability of selected flies F5 to find food, b) denote the probability of control flies (F1 and F5) and selected flies (F1) to find food (see Table 1). The data for each line were obtained from the fastest 80 flies to find the food in the experimental maze

Table 1 Results of the Cox mixed-effect model for foraging behaviour ability, with generation (G), treatment (T), sex (S) and all their possible interactions as fixed factors; treatment replicates were included as random factor

Individual behaviour

  1. a)

    Movement time: The total time that the fly was in motion, since it was placed inside the Petri dish until the end of the test, showed no differences between generations, treatments, or sexes (Table 2), but a significant interaction was found between generation and treatment. This interaction was driven by an increase in movement time of the control treatment between generations (Table 3).

  2. b)

    Foraging success: Flies in different generations, treatments and sexes were similar in terms of being able to find the food at the individual trials, but there was a significant interaction between generation and sex (Table 2; 3). Females from the fifth generation of the control treatment found the food source less frequently during the test, compared with other generations, treatments, and sex.

  3. c)

    Food searching time: Searching time was similar between treatments, generations, and sex (Table 2), but a significant interaction between treatment and generation, as well as treatment and sex was found. Both sexes in the control treatment increased their food searching time with generations (Table 3).

  4. d)

    Time on food: The time the flies spent on the food, once it was discovered, was different between sexes and there was an interaction between treatment and sex (Table 2; 3). Females from the selection treatment spent more time on the food than control females.

Table 2 Results from generalized linear mixed models (GLMer) for each of the different individual foraging behaviours, with generation (G), treatment (T), sex (S) and all their possible interactions as fixed factor; treatment replicates were included as random factor
Table 3 Mean (± sd.) of the different components of individual behaviour tests

Fitness measurement

Female flies from the selection treatment had higher fecundity than control flies, both in generation one (X2 = 142.5, P < 0.0001) and generation five (X2 = 10.89, P < 0.012; Fig. 4). There were no differences in the percentage of hatched eggs (91-98%), neither in the larva-to-adult survival (F1-X2 = 0.63, P < 0.88, F5-X2 = 0.75, P < 0.86; Supp. Table S3). Despite no significant differences were found between the F1 and F5 generations on the number of final adult flies, larva to adult survival decreased in F5 in the selection treatment.

Fig. 4
figure 4

Female fecundity. Total number of eggs laid by 15 females for 12 hours in each replicate treatment and in each generation. Solid lines and circles represent replicates from the selection treatment and dotted lines and triangles replicates from control treatment

Discussion

Here, we show that foraging behaviour is selective in Drosophila melanogaster adults. The ability to find food in a new environment responded to artificial selection, with possible consequences on reproductive success, given that selected flies showed higher fecundity in the first generation, in comparison to control flies, although this was mainly observed in one of the selected populations (see below). In our experiment, foraging ability (i.e., time to find food) showed a rapid response to artificial selection: there were significant differences between the founding generation (F1) and the fifth generation of selected flies, with the latest finding food 2.4 times faster than the F1, and the F5 control flies (Fig. 3). Note that we initially attempted to also select for the slower flies to find food, but in each round of selection there were flies that never left the first section of the maze. That is why the selection of slow flies was not possible and we opted to only select the fastest flies.

The design of our experimental maze prevented flies from having visual access to the food source, so it is probable that they found the food using chemical cues. Food releases different volatile compounds, which can be perceived, by females and males, through ionotropic receptors of the cells’ membranes that make up the antennae (Grosjean et al. 2011). Once received, chemical signals that are analysed in the pheromone processing centre of the flies trigger changes in their behaviour (Grosjean et al. 2011). For example, the presence of phenylacetic acid and phenylacetaldehyde in food causes an increase in courtship behaviour in males and mating in both sexes (Grosjean et al. 2011). Furthermore, females use compounds such as ethanol, a product of yeast fermentation, as an indicative of high-quality oviposition sites (Richmond and Gerking 1979; Jaenike 1982). We assume that in our study, flies that found food most efficiently are those with a more sensitive olfactory system. Individual behaviour trials showed that fifth-generation selected females had more affinity for food since they spent more time on the food than control flies. However, the reduction in time on the food could also be caused by the low number of female flies of the control treatment in generation F5 that found the food during the individual behavioural test (Table 3).

Due to the characteristics of our experimental maze, we could have selected the most active flies instead of the fastest finding food, namely, the flies whose general level of activity and locomotion was greater than the rest of individuals (Réale et al. 2007). However, the experiment testing individual behaviour showed that activity (i.e., mobility within the Petri dish) was similar between treatments and generations, so there was no evidence for differences in activity level between selected and control flies. Surprisingly, flies in both treatments were similar in their individual foraging success (being able to find the food source) or for their searching time; we believe that our set up was too simple and we might have underestimated the flies’ ability to find food inside a Petri dish: (1) the Petri dish is much smaller than the experimental maze in which the selection was carried out, (2) in the Petri dish, the flies had direct and immediate access to the food, while in the selection box the flies had to find food moving though the experimental maze. Finding food in this experimental set-up was undemanding for the flies and consequently it was not possible to measure foraging differences between flies in different treatments.

In nature, multiple factors influence individual foraging success (Baker et al. 1981; Warfe and Barmuta 2004; Weimerskirch et al. 2005). Foraging ability can be affected by social factors, as well as the learning capacity (Reader and Laland 2000; Gibbons et al. 2005). In addition, predation, competition and the organism’s physiological state directly affect foraging behaviour and indirectly impact fitness (Godin and Smith 1988; Morris and Davidson 2000). For Drosophila, foraging behaviour has been mainly studied at the larva stage (Sokolowski 1980; Sokolowski et al. 1983; de Belle et al. 1989); in adults, foraging behaviour can be altered by the type of food (difference in food source), environmental conditions (temperature and sun exposure), and adult density (social behaviour; Soto-Yéber et al. 2018). The main objective of our individual foraging trials was not to measure the variables affecting foraging success, but to only test differences in activity and time to find food, to better explain the dissimilarity between our treatments.

Drosophila flies mainly live on decaying fruit and the variety of microhabitats around it, which, in addition to food, provide oviposition, mating and courtship sites (Soto-Yéber et al. 2018). Because in nature this type of food is ephemeral, finding food faster could give fitness advantages to flies. After pupal-adult metamorphosis, the newly emerged organisms have a small lipid reserve that allows them to survive while they find food (Aguila et al. 2007). Locating a foraging site promptly could be a strong selective force, because once the energetic reserve finishes the new adults could face significant trade-offs or even death (Chippindale et al. 1996; Boggs and Freeman 2005; Aguila et al. 2007). Furthermore, females prefer to oviposit in sites without larval residues (Chess and Ringo 1985); if a female finds a food source faster than others, her offspring will have less competition and will grow in sites with less density, which has complex effects on development time, viability, body size and ultimately fitness (Moth and Barker 1977; González-Candelas et al. 1990; Horváth and Kalinka 2016).

The results of our study also show a relationship between foraging behaviour and fitness, since more efficient foragers from the selected treatment had higher fecundity than the flies from the control group in F1. We believe that the increase in fertility observed in the first generation of our experiment is correlated to the selection process and not a direct result of selection. Correlated effects due to artificial selection of a physical or ethological trait in Drosophila have been shown in other experiments before (Pyle 1978; Allemand and Boulétreau-Merle 1989; Partridge and Fowler 1992; Partridge et al. 1999; Promislow and Bugbee 2000; Krebs and Thompson 2006; Jordan et al. 2007; Sambucetti et al. 2010; Schwasinger-Schmidt et al. 2012; Takahashi et al. 2013; Brown et al. 2017; Scott et al. 2021). However, our result should be considered with caution because, although selected flies in F1 showed higher fitness than F1 control flies, throughout the experiment the increase in fertility occurred mainly in one of the four selected populations, and this increase in fertility was diluted as the generations passed. In the literature, it is common to find studies that test the effects of artificial selection in the first generation only, disregarding the effect of selection afterwards. Our results highlight the importance of testing selection in multiple generations.

Fecundity was higher for selected flies in the first generation only. Maintaining high fecundity could be costly, so it might be the case that extreme fecundity cannot be maintained for many generations, as it has been observed in other experiments using artificial selection (Rose 1984). This was probably a consequence of artificial selection, since, by continuously reproducing faster individuals, homozygous organisms are being selected, resulting in inbreeding, possible genetic disjunctives or genetic depression, causing a decrease in fecundity (Latter and Robertson 1962; Rose 1984; Barrett and Charlesworth 1991; Reed and Frankham 2003). Viability decreased in the fifth generation, although not significantly, the offspring of the selection treatment in this generation experienced an increase in mortality (Supp. Table S3), similarly to another experiment testing artificial selection in guppies (Poecilia reticulata) foraging preferences (Cole and Endler 2015). We cannot rule out the possibility that the increase in fertility may be caused as the result of the unintentional selection of a second variable that affects both the fertility and the foraging speed in our flies.

In conclusion, we artificially selected Drosophila foraging ability to find food in a new environment. Our results indicate that a response to selection can be produced in a few generations, which may serve flies to find food in changing environments. We also demonstrate that fecundity increased in flies with a better foraging ability, most likely as a character related to selection, since we cannot prove that the increase in fertility is a direct effect to a better foraging ability. Fecundity decreased with generations, probably due to negative genetic effects of artificial selection. The selection of different components of the foraging behaviour may be continuously affected by diverse components such as experience, predation, and competition. Our results provide empirical evidence suggesting that adaptive evolution of foraging abilities may occur in nature.