Abstract
The Marginal Value Theorem (MVT) is an important part of Optimal Foraging Theory, predicting the optimal time to leave a food patch. It has been mostly studied in birds, insects and mammals, even though simpler organisms also need to forage efficiently in patchy environments. Here we test whether the nematode Caenorhabditis elegans implements the MVT. We recorded individual nematodes exploring patchy environments, across four inter-patch distances and three different food qualities, and found that C. elegans behavior matches MVT predictions: When food patches are further away, each food patch is exploited for a longer time. In previous studies animals achieved this by modulating the duration of visits to food patches. Similarly, we found that C. elegans also increases visit duration with inter-patch distance, but this only accounts for half of the increase in total exploitation time. The other half of the increase comes from C. elegans revisiting food patches multiple times, and the number of these revisits increasing with inter-patch distance. This increase in the number of revisits is not due to behavioral changes in response to distance, but rather to a passive interaction between trajectories and environment geometry. These results show that C. elegans can learn the statistics of an environment and use this information in a way consistent with the MVT, but also that part of the fitness-relevant outcomes can emerge passively.
Keywords: Optimal Foraging, Marginal Value Theorem, C. elegans, Behavioral Ecology, Animal Behavior
INTRODUCTION
Optimal Foraging Theory provides tools to predict and assess how animals find and consume food (Ritvo, 2022; D. W. Stephens and Krebs, 1986). While organisms should not be expected to be perfectly optimal and often deviate from the optimum in systematic ways (Chen et al., 2006; De Petrillo and Rosati, 2019; Lea and Ryan, 2015; Nonacs, 2001; Parker and Smith, 1990; Pérez-Escudero et al., 2009; Shettleworth, 2010), Optimal Foraging Theory provides a useful reference and has been successful in explaining many features of animal behavior (Ritvo, 2022; D. W. Stephens and Krebs, 1986). A key question is the optimal way of exploiting heterogeneous environments, where resources are patchily distributed. Historically, this question has been addressed using the Marginal Value Theorem (MVT), which prescribes the optimal time to leave a patch of food (Charnov, 1976). One of the main predictions of the MVT is that the optimal time to leave a food patch depends on the quality and distance of other food patches, requiring the individual to form an overall estimate of the environment, rather than to just focus on the current food source. This prediction has been tested in many insects and vertebrates (Cassini et al., 1990, 1993; Giraldeau and Kramer, 1982; Kacelnik and Todd, 1992; Marshall et al., 2013; Nonacs, 2001; O’Bryan et al., 2020; Pleasants, 1989; Pyke, 1978; Tenhumberg et al., 2001; Wajnberg et al., 2000; Watanabe et al., 2014; Zimmerman, 1981), including humans (Bella-Fernández et al., 2022; Louâpre et al., 2010; Pacheco-Cobos et al., 2019; Schlender et al., 2024). However, all these studies focus on animals with comparatively complex sensory and nervous systems, such as insects, birds or mammals.
Simpler organisms, and in particular those without vision, face the same foraging challenges and must address them with stronger cognitive and sensory constraints. Certain aspects of for-aging have been extensively studied in microorganisms and small invertebrates, including search (Hills et al., 2004; Salvador et al., 2014; Zjacic and Scholz, 2022), chemotaxis (Berg, 2004; Iino and Yoshida, 2009; Suwazono et al., 2025), food choice (Dussutour et al., 2019; Fukasawa and Ishii, 2023; Katzen et al., 2023; Madirolas et al., 2023; Shtonda and Avery, 2006), patch-leaving, (Haley et al., 2025; Latty and Beekman, 2009; Milward et al., 2011; Scheer and Bargmann, 2023), dispersal (Donahue et al., 2003) sensory adaptation (Colbert and Bargmann, 1995; Dekkers et al., 2021) and learning (Boussard et al., 2019; Cho et al., 2016; Dussutour, 2021; Saeki et al., 2001). However, the main prediction of the MVT, which links patch residence time to the distance and quality of other food patches, has rarely been tested in these systems (Hohberg and Traunspurger, 2009). Besides their ecological importance, small, short-lived organisms offer an opportunity to test Optimal Foraging models rigorously, because they can be understood with great mechanistic detail and studied with large numbers of individuals, long distances relative to body size and long experimental times relative to lifespan (Al-Asmar and Pérez-Escudero, 2026; Anderson and Perona, 2014).
To take advantage of these opportunities and improve our understanding of Optimal Foraging in simple organisms, we turned to the nematode Caenorhabditis elegans, a 1 mm-long worm with 959 cells, including 302 neurons, which feeds on the bacteria that grow on decaying organic matter (Al-Asmar and Pérez-Escudero, 2026). Owing to its small size, fast life cycle, and ease of cultivation, C. elegans is a widely used model organism (Dietrich et al., 2014; Nigon and Félix, 2018). Its foraging-related behaviors have been extensively studied, including locomotion (Ahamed et al., 2021; Costa et al., 2024; Gomez-Marin et al., 2016; Schwarz et al., 2015; G. J. Stephens et al., 2008, 2011; Yemini et al., 2013), search (Hills et al., 2004; Salvador et al., 2014), chemotaxis (Iino and Yoshida, 2009; Pierce-Shimomura et al., 1999; Suwazono et al., 2025; Ward, 1973), food choice (Madirolas et al., 2023; Shtonda and Avery, 2006), feeding (Arous et al., 2009; Ding et al., 2020; Lee et al., 2017), patch handling (Ding et al., 2020; Haley et al., 2025; Iwanir et al., 2016; Milward et al., 2011), collective patterns (Ding et al., 2019; Perez et al., 2025), associative learning (Gourgou et al., 2021; Saeki et al., 2001; Tasnim et al., 2025), and behavioral states (Arous et al., 2009; Scheer and Bargmann, 2023), although most studies have been performed in highly stereotyped laboratory conditions aimed to dissect mechanistic details of C. elegans behavior, rather than to understand its function in an ecological context (Al-Asmar and Pérez-Escudero, 2026; Frézal and Félix, 2015; Petersen et al., 2015). Several studies have looked into C. elegans foraging in patchy environments, finding that worms facing a novel environment tend to explore several food patches before settling to exploit one of them (Haley et al., 2025; Pradhan et al., 2019), prefer high-quality food patches regardless of their species composition (Madirolas et al., 2023), and leave food patches once they are depleted (Milward et al., 2011). While these results have shown that the worms can modulate their response to food based on both local stimuli and past experience, it has never been tested whether this modulation is enough for worms to adapt to large-scale environmental features such as inter-patch distance, especially on a long time scale.
Here, we test whether the MVT applies to C. elegans by studying its foraging behavior in a patchy environment. We recorded more than a thousand worms foraging individually in arenas with different inter-patch distances and food qualities. This approach allows us to quantify how patch residence times depend on both food distribution and quality, and to assess whether the nematode’s behavior follows the predictions of Optimal Foraging Theory.
RESULTS
An experimental model for foraging in patches in C. elegans
We developed a high-throughput pipeline to record worms while they are foraging on patches of bacteria. In each experimental replicate, a single worm was placed in a 55 mm diameter arena, where food patches had been placed the previous day following a triangular grid pattern (Figure 1A). Food patches consisted of small (0.75 μL) drops of E. coli OP50, so that each food patch could be depleted in a relatively short time. We used a pipetting robot to increase the accuracy and repeatability of the food patches, which had a radius of 1.4 mm ± 0.2 and a standard deviation of 2% in inter-patch distance (Figure S1H–I). We used oblique illumination to determine the exact position and geometry of each food patch, locating patch edges with an accuracy of 1 pixel (0.03 mm) (Figure S2). Each non-control plate had one of three food qualities (OD = 0.2, OD = 0.5 and OD = 1.25, measured as Optical Density at 600 nm), with control plates containing drops of buffer instead of bacteria (hereafter OD = 0). Our experimental plates were optimized to prevent bacterial growth, ensuring that worms were exposed to the target bacterial qualities (Madirolas et al., 2023). We recorded each worm for 8 hours, and analyzed the video to obtain the worm’s silhouette and its center of mass in every frame.
Figure 1: Overview of the worms’ response to our experimental setup.

A: Probability of presence of the worm in all pixels of the arena, for Optical Density OD = 0.2. Coordinates have been transformed for patch locations and sizes to exactly match between plates (see Methods). In these transformed coordinates, the region of interest (ROI) for the tracking is slightly different for each plate. White line shows an approximate average ROI. B: Average time spent per unit area as a function of distance to the edge of the food patch (negative distances inside the food patch). Each line corresponds to a food quality (OD of the bacteria). C, D: Same as A, B but for the average speed. Inset: Speed of the worm as a function of time around patch entry (left) or patch exit (right) (only keeping entry/exits when the worm remained inside the food patch for at least 8.3 seconds before the entry/exit and for at least 8.3 seconds after it). E: Examples of worm trajectories. The color of each trajectory indicates food quality (OD, see other panels for legend). White: bacterial food patches. F: Average duration of the visits to a patch as a function of the time spent in that food patch before the visit (i.e. the first visit to a food patch is at time 0, the second visit is counted at the time duration of the first visit, etc.). Each curve corresponds to a food quality. Inset: Definition of visits: the worm is considered to be inside a food patch whenever any of its pixels overlaps with the patch. All boxes: Errorbars are 95% bootstrap confidence intervals (1000 resamples, see Methods).
Worms responded to the food patches in a way consistent with previous studies (Iwanir et al., 2016; Scheer and Bargmann, 2023): They spent much more time inside the food patches than outside them, showing a preference for food patch edges (Figure 1A, B), and they moved more slowly when inside (Figure 1C, D). Both of these effects were stronger for higher food quality (Figure 1B, D).
We defined a visit event as starting when any part of the worm touches a food patch, and ending once the worm body has completely left (Figure 1F, inset). Worms visited multiple, but rarely all patches within the experimental time (Figure 1E and Figure S3). They often visited the same food patch multiple times, and we used this fact to study the effect of food depletion: Most theoretical models assume that food patches provide diminishing returns, giving out less and less food per unit of time as they get depleted (Charnov, 1976; D. W. Stephens and Krebs, 1986). Given that worms respond to lower food quality by reducing the time spent on the patch (Figure 1B), if our food patches indeed provide diminishing returns, revisits to a food patch should be shorter, on average, the longer the worm has spent previously on that patch. This is what we found, with visit duration decreasing from around 20 min (fresh food patch) to just a couple of minutes (Figure 1F). This shortest visit duration is reached earlier the lower the initial quality. These results are consistent with a previous study that found that leaving rate increases progressively on large food patches populated by a group of worms (Milward et al., 2011).
C. elegans spends more time in each patch as inter-patch distance increases
We next tested the main prediction of the Marginal Value Theorem (MVT), which states that an individual should leave a patch once their feeding rate in that patch has reached the average expected feeding rate in their environment (Charnov, 1976). A way to test this theorem is to change the distance between food patches, because higher inter-patch distances lead to higher transit times, and thus to a lower average feeding rate. Therefore, according to the MVT, when the distance between the food patches increases, the average residency time in each patch should increase (Figure 2A). This prediction is interesting because implementing it requires individuals to integrate local and global information (current food, but also inter-patch distance). It is especially interesting in organisms lacking vision such as C. elegans, as they cannot trivially estimate global information such as distance to a non-visited patch.
Figure 2: The time spent in each patch increases with inter-patch distance, as predicted by the MVT.

A: Main result of the MVT: Environment 1 (left) has closer food patches than Environmen 2 (right), so it has a higher average feeding rate (dashed lines). The plots show the feeding rate experienced by an animal on a food patch, which decreases over time due to diminishing returns, and is identical in both environments. The MVT dictates that the animal should leave the food patch when the feeding rate matches the environmental average, predicting a longer optimal time in patches in Environment 2 than in Environment 1. B-E: Same as Figure 1A, B, D, F, for all inter-patch distances and for quality OD = 0.5. See Figures S4, S5, S6, S7, S8 for full datasets and alternative normalizations. F: Top: Sketch of trajectory, indicating transits and visits to food patches. Bottom: Equation for the total time spent per patch. G: Total time per patch as a function of inter-patch distance. Each line corresponds to one food quality. All boxes: Error bars are the 95% bootstrap confidence intervals (1000 resamples, see Methods).
To test this prediction in C. elegans, we replicated the setup shown in Figure 1, but with four different inter-patch distances, ranging from 4.5 to 28 mm (Figure 2B). First, we checked that the results presented in Figure 1 hold qualitatively for all distances: In all cases worms spend more time inside the food patches and particularly near their edge (Figure 2C), slow down inside the food patches (Figure 2D) and decrease the visit duration in subsequent revisits, in a fashion compatible with diminishing returns (Figure 2E) (see full results in Figures S5, S4, S6, S8).
The quantity of interest in the MVT is the total time spent in each food patch, as it determines the extent to which a food patch has been depleted. We measured the total amount of time that the worms spent in each visited food patch during our experiment (Figure 2F), and found that it increased as distance increased, as predicted by the MVT (Figure 2G). However, it was not immediately clear what behavioral changes drove this increase in total time per patch: The speed inside the food patches did not decrease with inter-patch distance (Figure 2D) and visit duration dynamics were similar across distances (Figure 2E).
The increase in total time per patch is only partially driven by behavioral changes inside food patches
In our experiments, C. elegans visits each food patch multiple times. This means that the total time spent in each patch depends on: (1) the number of visits, and (2) the duration of each individual visit (Figure 3A). In all conditions, the number of visits per patch increased with distance (Figure 3B, S9). By contrast, the average visit duration increased with inter-patch distance only in one of the tested food qualities (OD = 0.2). In the two other conditions (OD = 0.5 and OD = 1.25), no increase was observed (Figure 3C, S9).
Figure 3: Behavioral adaptation to inter-patch distance.

A: Left: Sketch of trajectory, indicating transits and visits to food patches. Right: Equations for the number of visits per patch and the average visit duration. B: Number of visits per patch, as a function of inter-patch distance. Each line corresponds to one food quality. C: Same as B, but for average visit duration. D: Cumulative time spent in a food patch up to (and including) the -th visit, as a function of These times are computed by averaging the times of all first, second, third, etc. visits, and then computing the cumulative sum of these averages. Each box corresponds to one food quality, and each line corresponds to one inter-patch distance. E: Same as B, but for duration of the first visit to each food patch. F: Visit duration as a function of the duration of the preceding transit (points with less than N = 10 visits are not shown). All boxes: Errorbars and shaded areas represent 95% bootstrap confidence intervals (1000 resample, see Methods).
However, average visit duration is obscured by the effect of diminishing returns: Visits become shorter as a food patch gets revisited multiple times (Figure 1F), and patches that receive more visits accumulate more of the shorter late visits, which drives their average visit duration downwards. In order to control for this effect, we looked at how the total time spent in a patch increases as successive visits accumulate. We found that this cumulative time grows following sub-linear power laws, and shows clear differences across inter-patch distances (Figure 3D). The clearest difference can be seen in the vertical shift of the curves, which represents the first visit to each food patch. This first visit is by definition not affected by patch depletion, and its duration increases both with food quality and inter-patch distance (Figure 3E). These results show that the worms do alter their behavioral response to food as a function of the distance between patches, in a way consistent with the MVT (longer visit durations in poorer environments). Since worms cannot trivially estimate inter-patch distances, we hypothesized that they might be responding to the duration of the previous transit to modulate visit duration. We found that the longer a transit is, the longer worms remain a food patch when they encounter one (Figure 3F). Transit duration could thus be used as a proxy of inter-patch distance and, more generally, of environmental quality.
The increase in number of visits is not driven by behavioral adaptation to inter-patch distance
In higher inter-patch distances, each patch gets visited more times on average (Figure 3B). This increase in number of visits may be simply due to the fact that higher inter-patch distances mean fewer patches in the arena, so the worm has more time to revisit each of them, but it could also be a consequence of behavioral changes in response to different inter-patch distances. In particular, worms could be altering their speed and trajectories after exiting a food patch, which could change their probability of coming back to it. In order to test for this effect, we looked at the probability of worms reaching a certain distance from the patch edge after leaving (Figure 4A), and at the average time it took worms to reach that distance (Figure 4B). We found no clear difference between distances in almost all conditions, suggesting that changing inter-patch distance does not change behavior outside the food patches in a way that affects revisit probabilities.
Figure 4: The increase in number of visits is not driven by behavioral adaptation to inter-patch distance.

A: Probability that the worm reaches a given distance to the patch edge after exiting a patch. Each color corresponds to an inter-patch distance, and data are shown only for distances below the distance to the nearest patch (vertical lines). Each column corresponds to a food quality. B: Same as A, but for the time taken by the worm to reach a given distance to the patch edge after exiting a patch. C: Simulation of random walk trajectories with 18 mm inter-patch distance, for finite and infinite environments. D: Average number of visits to each food patch, as a function of inter-patch distance, for our experiments (yellow dots) and for simulations (1000 agents, and 8 hours) in finite (purple) and infinite (green) environments. All boxes: Error bars are the 95% bootstrap confidence intervals (1000 resamples, see Methods).
To study how the increase in number of visits happens without behavioral adaptation to inter-patch distance, we simulated agents that do not change their behavior as a function of inter-patch distance, in environments with the same patch arrangements as our experiments. We used a random walk model, in which agents reorient themselves randomly at some temporal frequency, and progress at two different speeds depending on whether they are inside, or outside food patches (Figure 4C). We fitted the three model parameters to best reproduce number, average duration, and sum of visits made to each visited food patch in our experiments (Supplementary Table S3). The fitting was made once for each food quality, without changing the parameters across inter-patch distances.
This simple model reproduces the increase in number of visits as a function of inter-patch distance (Figure 4D, purple curves), showing that behavioral adaptation to inter-patch distance is not necessary to reproduce the phenomenon. This means that it could instead be the result of an interaction between the worm’s behavioral programme (which does not change with distance), and the geometry of the environment.
This increase in number of visits emerges from the finite nature of our experiments, both in space and in time. Finite space means that higher inter-patch distance leads to fewer food patches, each of them accumulating more visits. But even in an infinite space we can observe an increase of number of visits with inter-patch visits, provided that time is finite: Smaller inter-patch distances mean that more food patches are found between successive revisits to a given food patch. Since each visit to another food patch takes extra time, it increases the probability that the experiment finishes before the original food patch is revisited. To illustrate this effect we simulated the same agents in infinite environments, showing that the increase in number of visits with inter-patch distance is diminished but conserved (Figure 4D, green curves).
Behavioral adaptation and passive effects contribute similarly to increasing total time per patch with inter-patch distance
Total time per patch increases as inter-patch distance increases, and this is driven by both the duration of visits, and their number (Figure 3). While the visit duration increase can be attributed to a behavioral response, the number of visits seems to increase regardless of whether worms change their out-of-patch behavior (Figure 4). Because of this lack of behavioral change, we refer to this second factor as passive. We have built a model to disentangle the relative contribution of in-patch effects and out-of-patch passive effects.
To capture out-of-patch effects, we first characterized the transition matrix across food patches, computing the probability that a worm moves from one food patch to another (Figure 5A). This transition matrix includes experimental complexities, such as how worms are more likely to return to the patch they have just exited, and how peripheral patches differ from central ones. Then, we characterized the duration of these transitions, again building a matrix that distinguishes transitions for every pair of food patches (Figure 5B). Each element of this matrix actually represents a whole distribution of transit durations (see Methods for details). Similarly, to describe the beginning of the experiment, we built a first-transit array, containing the probability to reach each patch first and the distribution of durations it took to reach them.
Figure 5: Relative contribution of in-patch and out-of-patch effects.

A: Transition matrix showing the probability of a transit between any two patches, for the three-patch condition with quality OD = 0.2. Arrow colors show transition probability, using the same scale as the heatmap. See all matrices in Supplementary Figure S12 B: Same as A, but for the average transit time between every two patches. Lists in each element of the matrix represent the whole list of used to draw transit times in the model. C: Histogram of visit durations for the three-patch condition with quality OD = 0.2. Colors represent visit rank (1st visit, 2nd visit, etc.). D: Schematic of our model and the plots in panel E. Condition 1 is the baseline condition (orange). In the full model, condition 2 is simulated using its visit durations and transits (green), and its result is represented by the gray dot. To simulate out-of-patch effects only, the model uses visit durations from condition 1 and transitions from condition 2 (cartoon with blue background), and the result is shown by the blue bar. To simulate in-patch effects only, the model uses visit durations from the condition 2 and transits from the condition 1 (cartoon with yellow background), and the result is shown by the yellow bar, which is stacked on top of the blue bar. The difference between the full model and the addition of the two separate effects (red bar) represents the interaction between out-of-patch and in-patch effects. E: Total time per patch as a function of inter-patch distance, and for each food quality. Orange crosses: Experimental values. Gray dots: Full model. Bars: Contribution of each component of the model, as described in panel E. Insets: Relative contribution of each type of effect, computed as follows: Let be the total time per patch computed using the Full model, Out-of-patch effects only, and In-patch effects only, respectively. The blue dots show , the yellow dots show , and the red dots show . Error bars are the 95% bootstrap confidence intervals (1000 resamples, see Methods).
To capture in-patch effects, we extracted visit durations, assuming that they depend on the number of visits already made to the food patch, and that their distribution is equal for all food patches in a given condition (Figure 5C).
We then modeled the behavior of a worm as follows: The worm enters a patch chosen with a probability given by the first-transit matrix and at a time extracted from the first-transit duration distribution. Then, it spends a time in the patch extracted from the corresponding distribution of visit durations (in this case, corresponding to a first visit). It then transits to another patch (which can be the same as the original one), with probabilities taken from the transition matrix, and spending a transit time taken from the corresponding distribution in the transit-time matrix. The simulation continues in this way until it reaches the experimental time of 8 hours (see Methods for a more detailed description).
We ran this model for all conditions, obtaining good agreement with the experimental data (Figure 5D, E, gray dots). Then, we used the model to disentangle the contribution of in-patch and out-of-patch effects: Using the condition with smallest inter-patch distance as a reference, we simulated the effect of applying the out-of-patch effects (i.e. transition matrices) from the other conditions, while keeping the in-patch effects (i.e. visit durations) from the reference condition (Figure 5D, blue). In this way, this simulation mimics a worm that does not change visit duration with inter-patch distance, retaining only out-of-patch passive effects. This produced an increase in total time per patch roughly half of the one observed experimentally (Figure 5E, blue bars). Conversely, we performed a simulation where only the in-patch effects are present, by keeping the out-of-patch effects of the reference condition and changing only visit duration with inter-patch distance (Figure 5D, E, yellow bars). The combination of out-of-patch and in-patch effects almost amounts to the results of the full simulation, with the difference corresponding to the interaction between the two effects, which is absent when running simulations with one effect only (Figure 5E, red bars).
We then computed the proportion of the increase in total time per patch due to each separate effect (Figure 5E, insets), finding that this interaction is not statistically significant in most cases (i.e. the two effects are additive), and that the relative contribution of out-of-patch effects increased with food quality.
DISCUSSION
We have tested the Marginal Value Theorem (MVT) on C. elegans, finding that worms can adapt their behavior to large-scale environmental features, such as inter-patch distance. The relevant outcome of this adaptation—the increase in total time spent in each patch when inter-patch distance increases—is a combination of two effects that have similar weight: A behavioral adaptation to increase visit duration, which requires the worms to perceive and respond to the characteristics of the environment, and passive effects arising from the interaction between movement trajectories and environmental geometry.
The behavioral adaptation leading to longer visits is compatible with previous work that showed that worms that had fed on high food qualities in the past move faster (Sawin et al., 2000), or are more likely to not react (Haley et al., 2025) when encountering lower quality food. By extension, in our setup where satiety is modulated by inter-patch distance rather than food quality, one could hypothesize that when food patches are closer and worms experience food more frequently, they react less strongly to food patches, moving overall faster. However, on average, we only observed this effect for the lowest food quality, while for the two highest food qualities the speed inside the food patches was constant, or even lower for the closest inter-patch distance at OD = 0.5 (Supplementary Figure S7), which suggest a non-trivial interaction between food quality and distance. While previous results were obtained by conditioning worms for long periods of time before the experiment (Haley et al., 2025; Sawin et al., 2000), our study shows that worms can tune their response to food patches in response to a large-scale environmental feature, which only affects indirectly the amount of food they encounter at each point in time. This suggests that C. elegans learning is fast enough to adapt to new environments of this size, while being slow enough to average out the fluctuations experienced when exploring different food patches.
Similarly to results found in birds (Houston, 2009; Nonacs, 2001), we also found that visit durations could be in part predicted by the duration of the preceding transit time (3), suggesting worms integrate past feeding experience to modulate their visit durations. One important difference between worms and birds however, is that worms can probably not control directly their leaving of a patch, rather leaving stochastically, at a rate which also depends on the rate at which they encounter the patch edge. While the consequences of stochastic leaving of food patches has been studied from the point of view of optimality (Adler and Kotar, 1999), there has been little work on how worms actually modulate this leaving rate (Scheer and Bargmann, 2023), a behavior which is hard to disentangle from movement speed, as the faster a worm moves, the more chance it has to encounter the patch edge.
The second effect contributing to increasing the total time per patch when increasing inter-patch distance is an increase in the number of visits to each patch. While this effect contributes around half of the total outcome, it had been largely neglected in previous works on the MVT: Most experimental works either make revisits impossible or irrelevant by design (Cassini et al., 1990, 1993; Giraldeau and Kramer, 1982; Kacelnik and Todd, 1992; O’Bryan et al., 2020; Wajnberg et al., 2000), study situations where food patches are not clearly defined (Pacheco-Cobos et al., 2019; Watanabe et al., 2014), report negligible revisit rates (Pleasants, 1989; Schlender et al., 2024), or do not mention revisits (Marshall et al., 2013; Pyke, 1978). Some studies found significant revisit rates, but did not study the change in revisit rate with inter-patch distance (Hong and Wolfe, 2023; Tenhumberg et al., 2001; Zimmerman, 1981). In contrast, our results show that revisits play a key role for C. elegans. They probably also play an important role in many other organisms, especially those with limited spatial awareness whose search patterns inevitably lead to revisiting the same locations.
The consequences of revisiting previously explored space have been extensively studied in random search theory. This literature has found efficient search strategies that balance intensive sampling of recently profitable regions with extensive exploration of unvisited space. This balance can be achieved through several mechanisms, including scale-free step-length distributions such as in Lévy walks (Bartumeus et al., 2002; Bartumeus et al., 2005, 2014; Viswanathan et al., 1999; Viswanathan et al., 2011), correlated or composite random walks (Benhamou, 2007, 2014; Codling et al., 2008), intermittent search strategies that alternate between local detection and relocation phases (Bénichou et al., 2011; Nolting et al., 2015), and area-restricted search, in which recent resource encounters or expectations increase local search effort (Bartumeus and Levin, 2008; Benhamou, 1992; Dorfman et al., 2022). These strategies differ in the degree to which they reduce oversampling, promote returns to resource-rich regions, or accelerate displacement to new areas.
While this body of work has provided substantial insight into how movement strategies influence encounter rates (Bartumeus et al., 2002; Bartumeus and Levin, 2008; Bartumeus et al., 2005, 2014; Benhamou, 1992, 2007, 2014; Bénichou et al., 2011; Codling et al., 2008; Dorfman et al., 2022; Nolting et al., 2015; Viswanathan et al., 1999; Viswanathan et al., 2011), our results highlight two largely overlooked aspects. First, most previous studies simplify patch encounters, neglecting the interaction between revisit dynamics and patch depletion dynamics; our results indicate that search outcomes depend critically on this interaction. Second, we show that inter-patch distance strongly affects the number of revisits, particularly in finite spatial domains and over biologically relevant timescales. As a consequence, increased distances between patches can substantially increase cumulative residence times within individual patches, reducing the need for behavioral adjustment to patch spacing. This result also modifies a central prediction of the Marginal Value Theorem: when future revisits are possible, the optimal residence time during a given visit should be shorter than predicted by models that assume a single exploitation event (Adler and Kotar, 1999). Therefore, optimal patch-leaving decisions cannot be understood independently of future revisit opportunities.
Our results suggest that the increase in number of revisits with inter-patch distance does not arise from systematic changes in out-of-patch behavior. Indeed, when looking at worm movement outcomes after exiting food patches, we found little or no differences in out-of-patch movement patterns across inter-patch distances (Figure 4A, B). We also showed that the observed number of revisits are compatible with a random walk model that uses identical parameters across treatments (Figure 4D). We used a deliberately simple random walk to demonstrate that the observed effects do not require complex movement strategies. However, C. elegans locomotion is considerably more complex, exhibiting long-range directional persistence (Peliti et al., 2013), curvature modulation during runs (Iino and Yoshida, 2009; Suwazono et al., 2025), and adaptive reorientation dynamics (Salvador et al., 2014). In particular, reorientation rates are initially elevated following food removal and progressively decline during subsequent relocation phases (Gray et al., 2005; Hills et al., 2004; Salvador et al., 2014), a behavioral transition that has been interpreted as part of a broader shift from local exploration to relocation under uncertainty (Bartumeus et al., 2016) and could therefore influence revisit probability. We did not find evidence for worms modulating their exploration intensity in response to inter-patch distance (Figure 4A), but it did increase with food quality (Figure S11).
A key factor in the increase of number of revisits with inter-patch distance is the effect of limited space. Our experimental arenas were large compared to C. elegans, but worms often reached the edge of the experimental plates, and this limitation seems to have played an important role in increasing revisits (Figure 4D). While this may be seen as an experimental artifact, natural environments with rich food sources are also limited in size and time, and this is especially relevant for C. elegans, which feeds on the bacteria growing on pieces of decaying organic matter and has a boom and bust life cycle (Félix and Duveau, 2012). For this reason, our experimental data may also be used to investigate the limits of the MVT when confronting real situations.
C. elegans foraging is a multi-scale phenomenon, where worms perceive a variable level of food quality and respond to it by adapting local behaviors (turning, speed, food pumping, etc.), which in turn affects patch-level outcomes (time spent in patch, probability of revisiting it, time to reach the next patch). In the present paper, we have chosen to discuss mostly those patch-level outcomes, which have the advantage of having a direct parallel with classical optimality theory and with fitness outcomes such as the total amount of food extracted from each patch. However, remaining at the patch level has two drawbacks. The first one is a loss of nuance: For example, while we claim that food patches provide diminishing feeding rate over time, this is only true on average. Worms deplete food locally within a food patch, so their feeding rate will also increase locally when they move to yet unexplored sections of the patch. An alternative description would focus on the instantaneous experience of the worm, and could apply a recent version of the MVT adapted to this perspective, and specifically developed for simple organisms (Orjollet–Lacomme et al., 2025). The second drawback is that, without looking at food intake and local behaviors, we cannot draw the link between local sensory inputs (food intake) and patch-level outcomes (patch-leaving), nor make quantitative estimations of foraging success, only discussing MVT predictions qualitatively. In order to draw this full picture, one last technical limitation remains. In our experiments, the initial geometry and quality of patches is known, but monitoring of the food distribution past this initial state was not possible. Future works should address this limitation, as it would allow foraging behavior with an unprecedented multi-scale integration.
In conclusion, our results show that even a simple organism such as C. elegans can exhibit foraging behavior consistent with the predictions of the Marginal Value Theorem, despite lacking explicit spatial awareness and operating under strong sensory and cognitive constraints. By combining long-term, high-throughput observations with controlled manipulations of environmental structure, we show that near-optimal behavior emerges from a combination of active behavioral adaptation—modulation of visit duration based on recent experience—and passive effects arising from the interaction between movement trajectories and environmental geometry. Importantly, our findings highlight that revisits, often neglected in classical formulations of the MVT, play a central role in shaping patch exploitation strategies in simple organisms. Together, these results suggest that optimal foraging can arise from relatively simple mechanisms, and that incorporating both behavioral and geometrical factors is essential to understand decision-making in realistic environments. More broadly, this work bridges the gap between optimality models and biological implementation, providing a framework to study how ecological constraints and organismal limitations jointly shape adaptive behavior.
MATERIALS AND METHODS
Worm preparation
Caenorhabditis elegans were all from the N2 strain, ordered from the Caenorhabditis Genetics Center (CGC). Strains were ordered in 2018, and stored at −80°C using standard practices (Stiernagle, 2006). Worms were reared at 22°C in 100 mm diameter petri dishes containing 18 mL of Nematode Growth Medium (NGM: 3 g/L NaCl, 2.5 g/L peptone, 20 g/L agar, 25 mL/L potassium phosphate buffer pH 6, 1 mM MgSO4, 5 mg/L cholesterol, 1 mM CaCl2) seeded with 800 μL of saturated Escherichia coli OP50 culture (see Bacterial cultures). The worms were transferred every 2–4 days, before the food was depleted. To prevent accumulation of mutations with respect to the CGC strains, we never used worms that were more than 30 generations away from our freezer stock. We achieved this by re-starting our worm population periodically, either from the frozen stock or from dauer larvae that were few generations away from the frozen stock. To minimize transgenerational effects from freezing and starvation, we always used worms that were at least 5 generations away from the frozen or dauer stock. Prior to experiments, worms were age-synchronized by bleaching and egg collection (Al-Asmar et al., 2022). Eggs were allowed to hatch in 10 mL of M9 buffer (Stiernagle, 2006) under continuous agitation (orbital shaker, Heidolph Rotamax 120, 250 rpm) at 22 °C. After 19–33 h, synchronized L1 larvae were recovered by washing and transferred to rearing plates. Behavioral assays were conducted following 48 h of growth on the rearing plate (range: 46–49.5 h).
Bacterial cultures
Escherichia coli (OP50 strain) were streaked on NGM medium from a −80°C stock in 50% glycerol, incubated for a few days, and then stored at 4°C and restreaked to a new plate every 2 weeks to ensure survival. To prepare liquid cultures, we first inoculated 2–3 colonies from the fridge stocks in 5 mL of LB medium in a closed 50 mL Falcon tube, and let it incubate for 24 h at 22°C with shaking (orbital shaker, Heidolph Rotamax 120, 300 rpm). Then, we extracted 1 μL of this culture using a sterile loop, and used it to inoculate 5 or 10 mL of fresh LB, that we let incubate for 24 h in the same conditions, before using it to prepare experimental plates or breeding plates.
Experimental plates
All of the experiments were run in 55-mm petri dishes containing 8 mL of Foraging Medium (3 g/L NaCl, 20 g/L agar, 25 mL/L potassium phosphate buffer pH 6, 1 mM MgSO4, 5 mg/L cholesterol, 1 mM CaCl2, 10 mg/L chloramphenicol and 100 mg/L novobiocin) (Escudero et al., 2023). The plates were poured while each plate laid flat on a leveled table, and stored at 22°C for 2 to 9 days before the experiments. Note that these plates do not contain nutrients for the bacteria, and contain antibiotics at bacteriostatic concentrations (determined by measuring the minimum inhibitory concentration, and checking viability after 24 h of exposure (Madirolas et al., 2023)), so that bacterial quality remains constant from the moment the bacteria are placed on the plates to the moment the experiment begins.
The day before the experiments, saturated liquid cultures of E. coli OP50 were washed three times with 5 mL of Foraging Buffer (3 g/L NaCl, 25 mL/L potassium phosphate buffer pH 6, 1 mM MgSO4, 1 mM CaCl2, 10 mg/L chloramphenicol and 100 mg/L novobiocin) by centrifugation for 5 min in a benchtop centrifuge (MyFuge 5, Benchmark Scientific, 5500 rpm). After the last wash, the bacteria were resuspended in Foraging Buffer, and batches with the OD600 required for the experiments were prepared using a spectrophotometer (Jenway 7200, Cole-Parmer, Staffordshire, UK). OD was measured directly for values above 0.1, and serial dilutions were performed to obtain lower optical densities. Bacterial concentration was double-checked using a colony-forming unit counting protocol on the same day, obtaining values that were consistent for every experimental day (Figure S13), as well as with our previous studies (Madirolas et al., 2023). A pipetting robot (OT-2, Opentrons, Long Island City, NY, USA, with custom modifications to handle agar plates) was used to place 0.75 μL drops of bacterial culture on the experimental plates. These drops were then left to dry at 22°C until the experiments were performed the following day.
Foraging experiment
The experiments were run in foraging plates containing 3, 7, 24 or 52 0.75 μL drops of bacteria, arranged following a regular triangular grid (Figure 2B). The theoretical center-to-center distance between food patches was 4.5, 9, 18 and 27.7 mm for each condition respectively, and actual distances approximated these theoretical values with good accuracy (Figure S1I). Controls (“OD = 0”) were prepared using drops of buffer, placed in the same position as the 24-patch condition. There were 40 to 101 plates (21 to 77 post data curation) for each condition. Replicates from all conditions were recorded every experimental day, in a randomized order and location, except for some conditions that were only ran in the second half of the experimental period (Table S2). After 48 h on food, the synchronized worms were washed 6 times with M9 buffer + 0.1% Triton X100 (triton prevents them from sticking to the pipette tips), performing 5 s spins on a tabletop centrifuge (mySPIN 6, Thermo Fisher Scientific, 6000 rpm). Worms were then left in a sterile 3.5 mm diameter petri dish with 2–3 mL of M9 + 0.1% Triton X100 for 65 to 90 min. This period was added to reduce the relative difference in the time spent off food between the first and the last worms placed on the experimental plates, since this time may change their motivation for food-seeking. Individual worms were then fished with a micropipette and a 1 μL droplet containing a single worm was placed at the center of each experimental plate, outside any food patches. The plate was then covered with its lid. Each experimental round consisted of 48 plates, and 16 to 55 min elapsed between the first worm being placed on the experimental plate and the start of the recordings. The total time off food prior to the start of recordings ranged from 1.5 to 2 hours, encompassing both incubation and handling steps. The 48 plates were prepared in two sets of 24 plates, and each set started recording as soon as it was ready. Therefore, the time between a worm was placed on its experimental plate and the start of the video ranged from 8 to 28 minutes. During this time some worms moved substantially, so the first recorded position of each worm was often far from its initial one, and sometimes inside a food patch (Figure S14).
At the beginning of each recording, an LED band was slowly slided above the experimental plate, to make the bacterial patch edges visible through oblique illumination (Figure S2). Then, a white LED screen covered with a privacy filter (3M, model BPNAP004 or similar) was placed to obtain uniform illumination with adequate contrast. The plates were then recorded for 8 hours at 22°C, using a custom-made setup, built using OpenBeam (MakerBeam, Utrecht, The Netherlands) with one 8-Megapixel camera (ELP-USB8MP02G-L75, Ailipu Technology, Shen-zhen,China) filming each plate, and with fans to prevent temperature increase. Videos were recorded at a framerate of 1.2 frames per second, using custom software coded in Matlab (release 2023a, The Mathworks, Natick, MA, USA).
Tracking
Worm videos were automatically tracked using custom-made code in Matlab (Release 2023a, The Mathworks, Natick, MA, USA). Centroid trajectories were then smoothed according to the following method: let be the initial position of the centroid at time . Then, as long as the centroid remains within a radius of 2 pixels around , any movement is considered as noise. Let be the first position of the centroid that is outside of this 2 pixel radius, which happens at time . Then, all the centroid positions between time 0 and time are interpolated linearly between and , and the process restarts with as the initial position.
Alignment and scaling of the environment
The food patches were placed by a pipetting robot to maximize repeatability, but some variability is inevitable, so to increase the accuracy we programmed the robot to make four holes at the corners of a 32-mm side square with a clean pipette tip after placing the food patches (Figure S1A). These four holes allow us to correct for plate rotation, and give us a coordinate reference that is better aligned to the actual position of the robot’s pipette, and therefore better aligned to the food patches. The distance between those reference points was used for pixel-to-mm conversion. There was a 2–3% variation between the plates (Figure S1F), that we deemed low enough to use the average ratio (1 pixel = 0.0324 mm) for the whole analysis.
Detection of the food patches
Despite the high accuracy and repeatability of the pipetting robot, food patches and reference points were still slightly displaced with respect to their theoretical positions (Figure S1D). Also, different drops may have slightly different sizes, and their shape is not perfectly circular. In order to have an accurate estimation of the exact position of the edge of each food patch, we proceeded as follows.
Oblique illumination composite
Food patches are not visible with the illumination used to view worms. To solve this issue, at the beginning of every video we passed a sliding linear light behind the experimental plates (Figure S2A). Contrast at the edge of this light is extremely high, showing the edges of even the less dense food patches. We then built a composite image, taking the region with highest contrast of each frame during the sliding illumination (Figure S2B). We used this image to find the exact position of the edge of each patch: First, we started with the theoretical position of the patch, and placed 8 points, equispaced along its edge. Then, we used custom software to automatically correct these 8 points, moving them towards the maximum of radial contrast in our composite image, which indicates the edge of the patch.
We described the edge of each food patch using a spline in radial coordinates: We define the center of the food patch as the average position of the 8 reference points. Then, we transform the reference points to polar coordinates with respect to this center, and we fit a 4-th order spline to their radial coordinate, ensuring continuity in every point, and also ensuring periodicity. This spline gives a perfect circle when the reference points are equidistant to the center, and approximates very well the edges of most of our food patches when they were not perfectly circular.
Manual correction
This procedure gave excellent results in most of the food patches, but not in all of them, either because of mistakes of our contrast-detection algorithm, or because the shape of some food patches was not well described with only 8 reference points. For this reason, we also performed a step of manual correction: We selected all food patches that were closer than 100 pixels to the trajectory of the worm (i.e. all visited food patches, with a conservative margin of 100 pixels), and we reviewed them visually, adding and/or removing reference points until the spline followed the edge of the food patch with great accuracy in every point.
This procedure provided a description of the edges of every visited food patch within 1 pixel of its true position.
Data curation
Missing tracks
Our tracking algorithm did not find a worm silhouette in part of the frames of the videos. This can be due to the worm exiting the tracking arena and exploring the borders of the plate, where it is not visible (true negative), or due to the worm being lost by the tracking algorithm (false negative). In the case where the worm disappeared and reappeared in the same situation (if it disappeared outside food patches, and then reappeared outside, or if it disappeared and then reappeared in the same food patch), we infer that the worm was in this situation during the whole missing track (without interpolating positional data).
In some videos however, the worm disappeared outside and reappeared inside of a food patch (or vice versa). This was especially common in the 24-patch condition, where two of the outer patches were sometimes partially out of the tracking area (so if the worm exited the patch from its untracked side, it might then reappear outside, making visit duration unclear). When those events were short (< 1 min), we divided evenly the missing track (so if a worm disappeared inside a food patch for 60 seconds, and reappeared outside, we count it as having spent 30 of those seconds inside, then 30 outside). When those events were any longer (>1 min), we left them blank (Figure S15). For some analyses, events who start, or end with such a missing track were omitted, due to their actual duration being unclear (Figure S16).
Videos containing more than 10 minutes of blank missing tracks were excluded.
Double tracks
Our tracking system detected more than one worm in some frames. These extra frames could be due to a tracking error (false positive), or to an actual second worm that was accidentally added to the petri dish (true positive). In order to exclude videos with more than one worm, or too many false positives, we excluded the trajectories containing 1% of double frames or more.
Condensation-related errors
After six hours of videos, visible condensation sometimes formed on the lids of our plates, making the tracking unreliable. In most cases our tracking system still identified the real worm, but its contour was sometimes unreliable, for example because it included part of a condensation drop. We still used these silhouettes, because we believe that they would make our data more noisy, but not particularly biased. However, in < 4% of plates, a detected silhouette was so large that the same worm overlapped with two patches simultaneously. When this happened, we excluded the whole video.
Bad patch detection
Plates where the detected food patches overlapped with each other were excluded.
Short videos
Trajectories with less than 10,000 seconds (around 3 hours) between their first and last tracked frame were excluded.
Standardization of video duration
Some metrics, such as number of visits per food patch, depend on the total tracked time for each worm (which varies since worms can exit the tracking area for variable periods of times). When computing these metrics, we used the 25000 first seconds of tracked events in each video, and excluded any videos which did not have enough tracked time. For metrics that did not depend heavily on total duration (for example durations of individual visits), we used the full videos, and we only excluded videos shorter than 10000 seconds.
Summary
See Table S1 for a detailed summary of the data curation used for each figure.
Heatmaps in idealized landscapes
The heatmaps presented in Figure 1, 2, S4 and S5 were made by mapping all of our experimental data onto idealized landscapes with perfectly round and equidistant patches. In order to do so, the position of the pixels in the experimental plate was expressed in radial coordinates relative to the closest patch edge (so that each position was defined by the angle relative to the closest patch center, and the distance to that patch’s edge, with negative distances inside food patches). This radial position was then mapped on the idealized landscape (with perfectly aligned and circular patches), so that the new position of the worm retains the same angle and distance to the edge of the closest food patch.
For the probability of presence heatmaps (e.g. Figure 1A), we transformed the silhouettes of the worms to idealized coordinates, and for each pixel we computed the total time that a worm silhouette overlapped with it. Let be the total time that the silhouette of the -th worm overlapped with the -th pixel. The probability of presence for each pixel of Figure 1A shows the proportion of time spent in each pixel, calculated as
| (1) |
where are all the worms in condition (defined by an inter-patch distance and a food quality), and are all the pixels in the idealized landscape.
For the speed heatmaps, we computed the speed of the worm centroid for each frame, and applied that speed to all pixels ovelapping with the worm silhouette. Then, for every pixel we computed the average speed for all frames in which the worm overlapped with the pixel. Finally, we averaged the speed map across individuals.
Time spent per unit area as a function of distance to patch edge
For this analysis we again define as the total time that the silhouette of the -th worm overlapped with the -th pixel. Then, we consider the distance to the closest food patch edge (with negative distance for pixels inside the patch), and we define concentric rings of width around food patches. We call the ring containing all pixels whose distance to the edge is between and from patch . Then, the time spent per unit area in ring across visited patches of the plate (Figure 1B, 2C and first row in Figure S6) is computed as follows
| (2) |
where is the area of ring , around patch is the set of all patches visited by worm , and is the number of those patches. The previous equation provides the value for a single worm, we then averaged all the worms of each condition, and computed error bars following the bootstrap procedure described previously.
Alternative normalizations of the probability of presence
The third row of Figure S6 shows
| (3) |
where are the centers of all the rings shown in each figure.
Finally the second row in Figure S6 shows
| (4) |
where is the average area of ring across all food patches of the plate. This is the same as Eq. (2) but summing food patches instead of averaging them.
Probability and time for reaching a distance to the patch edge (Figure 4A–B)
For each worm, we extract all transits that start at the edge of a food patch, regardless of their destination (which can be the same, or another food patch, but also points where the tracking is lost, for example at the edge of the petri dish). We computed the probability to reach a given distance as , where is the number of transits where the worm reaches the target distance (regardless of the final destination of the transit), and is the number of transits where the worm returns to the original patch before reaching the target distance. Note that this analysis excludes any transit that was interrupted before reaching the target distance for any other reason (i.e. interrupted tracking, reaching the edge of the plate, or reaching a different food patch). To compute the time it took to reach a given distance we took the transits that did reach the target distance, computed the first time where the worm reached the target distance in each transit, and averaged them.
Random walk models
The random walk model presented in Figure 4 was implemented in R (Team, 2025), with computationally intensive parts written in C++ and integrated via the Rcpp package. Random numbers were generated in C++ using the PCG family of pseudorandom number generators (O’Neill, 2014).
We simulated individual trajectories using a two-dimensional run-and-tumble random walk. In this framework, the agent moves in discrete time steps of fixed duration with a constant step length . At each step, the movement direction is updated according to , where the turning angle is drawn from a uniform distribution in the interval . The position is then updated as and . Simulations were ran for a number of steps so that the total time matched the total experimental duration (8 h).
To describe the reaction of C. elegans to food patches, the step length depended on whether the walker was inside or outside a patch. This introduces two parameters, and , capturing differences in movement behavior between resource-rich and resource-poor regions.
Finite landscape simulations
Motion takes place within a circular arena of radius , corresponding to the experimental Petri plates, with circular patches placed at the same positions as in the experimental landscapes and with sizes matching the measured average patch radius (). Figure 4C (top) shows an example for the configuration with 7 food patches. Crossings with the edge of the arena are handled by interpolating the exact contact point with the edge and completing the remaining step with a random inward direction.
Infinite landscape simulations
We considered a periodic hexagonal grid mimicking the experimental arrangement but extending over an infinite domain (Figure 4C, bottom). As for the previous case, patches have the same size as in the experiments.
Model fitting
We fit the model parameters to each food quality in the finite landscapes. To do so, we systematically explored the parameter space defined by and . For each combination of parameters, we run 2000 8-h simulations on each of the four configurations, and computed four observables: The number of visits per patch, the number of patches found, the average visit duration and the average transit time. Then, for each observable we quantified the agreement between simulations in finite landscapes and experimental data using a squared relative error, computed as , where is the result of the simulation and is the experimental value. Then, we added these squared errors for the four observables and for the four spatial configurations, and chose the parameter set that minimized this overall error (see optimal parameters in Table S3).
Substitution model
The model presented in Figure 5 was implemented in Python 3.8, using libraries datatable, matplotlib (Hunter, 2007), numpy (Harris et al., 2020), opencv (Bradski, 2000), pandas (pandas development team, 2020), and scipy (Virtanen et al., 2020). It was structured as follows:
Visit and transit arrays
For each condition (defined by its each inter-patch distance and food quality), visits and transits made by all worms are pooled together. We first built a visit duration array, which stores visit durations, pooling visits to all patches, but separating visits based on their rank (first, second, ... ), so the first element of the visit duration array is a list containing the durations of all first visits, and so on. Then, we built a transit duration matrix. Each element of this matrix is actually a list of all transit durations from patch to patch . Similarly, a first transit array is built, containing for each worm the first patch it has reached, and how long it took to reach it since the start of the recording (these are not included in the transit duration matrix, which only includes patch-to-patch transits). For the worms that found a food patch before the start of the recording, this first transit duration is set to 0. Finally, a transit probability matrix is built with in each cell the number of transits between patches and , divided by the total number of observed outgoing transits from patch . Any transit that was interrupted by a blank missing track was excluded (see Data curation section).
Model for the simulations
The simulations are run in a markovian paradigm, where each node is associated to a food patch. When the agent is in a node , it has some probability of transiting to other nodes (including ) given by the transit probability matrix. Once destination has been picked, the transition duration is randomly picked from the corresponding list in the transit duration matrix. The agent then has some residency time in . If this is the visit to , the residency time is picked randomly from the element of the visit duration array.
Simulation start
A transit duration and corresponding starting food patch are randomly picked from the first transit array. This is necessary to match experimental data, as transits at the start of our experiments are typically longer than the average transit of the video.
Simulation duration
Simulations are run until 25000 s is reached, and any event beyond that threshold is truncated. These 25000 s match the one we use when computing these metrics on our experimental data (see S1).
Parameter substitution
To generate the results shown in Figure 5E, we proceed as follows.
Gray dots (full model):
The gray dots in Figure 5E correspond to the full model, where every condition is simulated with all its features (i.e. its own transit probability matrix, transit duration matrix, visit duration array, and first transit array). Each dot corresponds to the average of simulations, and the errorbars are computed as described below.
Blue bar (out-of-patch effects):
In order to generate the blue bars in Figure 5E, simulations are ran with number of food patches, transit probability matrix, transit duration matrix and first transit array from the focal condition, but with visit duration array from the baseline condition (the one with closest inter-patch distance). For example, the rightmost bar corresponds to an environment with 3 food patches, and corresponding transits between them, but visit durations are coming from the 52-patch condition. Each bar corresponds to the average of simulations.
Yellow bar (in-patch effects):
In order to generate the yellow bar (which is stacked on top of the blue bar) in Figure 5, simulations are ran with the visit duration array coming from the focal condition, but with number of food patches, transit probability matrix, transit duration matrix and first transit array from the baseline condition (the one with lowest inter-patch distance). For example, the rightmost value corresponds to an environment with 52 patches and the corresponding transits between them, but visit durations coming from the 3-patch condition. Each bar corresponds to the average of simulations.
Red bar (interaction):
The red bars in Figure 5show the difference between the full model (gray dot) and the sum of the in-patch and out-of-patch effects. This difference is the interaction between both effects, which makes the full model to give a higher result than the sum of the two effects. When this interaction is negative, the red bar is not shown.
Proportion of each effect:
The insets in Figure 5 show the proportion of each effect, computed as follows. Let be the total time per patch computed using the Full model, Out-of-patch effects only, and In-patch effects only, respectively, computed as described above. The blue dots show , the yellow dots show , and the red dots show .
Averaging and bootstrapping
Unless specified otherwise, we performed averages by first averaging the data for each worm, and then averaging these values across all the worms in the same experimental condition, thus giving equal weight to each individual. Errorbars show 95% confidence intervals, computed via bootstrapping: if there are worms of interest, a new set of worms is sampled among them with replacement, and the metric computed over these new set. This is repeated 1000 times, and errorbars are the 2.5th and 97.5th centile of the obtained metrics. We always performed the bootstrap randomizations over the initial dataset, and for each randomization we ran all the steps needed to compute a given metric. For example, in the case of the substitution model and for a given condition, we sample worms, compute all the arrays from the sampled worms (transition matrix, transit time matrix, etc.), run simulations using these arrays, and compute the average total time per patch of these simulations. This is one bootstrap replicate. We then perform of these replicates and use them to compute the confidence interval.
The only exception is the shaded areas in Figure 3F. In this case, bootstrap was performed by mixing all visit events from all worms. Then, these visits were binned by the duration of the transit preceding them. For each bin containing visits, visits were sampled with replacement and their average computed. This procedure was repeated 1000 times, obtaining 1000 averages. Solid lines show the average of these averages, and shaded areas their 2.5th and 97.5th centile.
Supplementary Material
SIGNIFICANCE.
Despite being key in understanding foraging in patchy resources, the Marginal Value Theorem (MVT) has been tested almost exclusively in relatively complex animals. We extensively tested the MVT in a simple, non-visual organism, showing that Caenorhabditis elegans increases patch exploitation time when inter-patch distance increases. This effect is partially driven by the same behavioral adaptation found in complex animals, but also by an increase in the number of patch revisits. This second driver, which had not been reported before and is probably key for non-visual organisms, requires no behavioral adaptation and produces around half of the fitness-relevant outcome. Our results highlight the need for adapting Optimal Foraging Theory to a wide range of taxa spanning from microbes to small invertebrates.
ACKNOWLEDGEMENTS
Harry F. Suter performed preliminary experiments that were essential to design this study. A.A. acknowledges support from a MESRI PhD grant through the SEVAB doctoral school (Toulouse), and a postdoctoral grant from the Fyssen Foundation, Paris. R.L.-C., acknowledges support from the Spanish Government through the predoctoral fellowship BES-2017–079643. A.P.E. acknowledges support from a CNRS Momentum grant, a Fyssen Foundation Research Grant, and grant ANR-22-CE02–0002 (ForAnInstant) from the Agence Nationale de la Recherche (ANR), which included a postdoctoral contract for R.L.-C. Some strains were ordered from the Caenorhabditis Genetics Center (CGC), which is funded by NIH Office of Research Infrastructure Programs (P40 OD010440). We thank Frederic Bartumeus, Jacques Gautrais, Jonathan Friedman, Simon Benhamou, François-Xavier Dechaume-Moncharmont, Greg J Stephens, Serena Ding, Audrey Dussutour, Julie Batut, and all members of the IVEP team (CRCA) for fruitful discussions and feedback.
Footnotes
DECLARATION OF COMPETING INTEREST
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.
DATA, MATERIALS, AND SOFTWARE AVAILABILITY
All the code for the analysis is available and commented in the following Github: https://github.com/martees/Video_analysis_PhD_2022.
BIBLIOGRAPHY
- Adler R. F., and Kotar M. (1999). Departure time versus departure rate: How to forage optimally when you are stupid. Evolutionary Ecology Research, 1, 411–421. [Google Scholar]
- Ahamed T., Costa A. C., and Stephens G. J. (2021). Capturing the continuous complexity of behaviour in Caenorhabditis elegans. Nature Physics, 17(2), 275–283. [Google Scholar]
- Al-Asmar A., Madirolas G., Bello M. D., Biancalani T., and Escudero A. P. (2022, September 19). Worm synchronization protocol (bleaching). [Google Scholar]
- Al-Asmar A., and Pérez-Escudero A. (2026). Caenorhabditis elegans foraging: From natural to laboratory conditions. Proceedings of the Royal Society B: Biological Sciences, 293(2065). [DOI] [PubMed] [Google Scholar]
- Anderson D. J., and Perona P. (2014). Toward a science of computational ethology. Neuron, 84(1), 18–31. [DOI] [PubMed] [Google Scholar]
- Arous J. B., Laffont S., and Chatenay D. (2009). Molecular and sensory basis of a food related two-state behavior in C. elegans. PLOS ONE, 4(10), e7584. 10.1371/journal.pone.0007584 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Bartumeus F., Catalan J., Fulco U. L., Lyra M. L., and Viswanathan G. M. (2002). Optimizing the encounter rate in biological interactions: Lévy versus Brownian strategies. Physical Review Letters, 88(9). 10.1103/physrevlett.88.097901 [DOI] [PubMed] [Google Scholar]
- Bartumeus F., Campos D., Ryu W. S., Lloret-Cabot R., Méndez V., and Catalan J. (2016). Foraging success under uncertainty: Search tradeoffs and optimal space use. Ecology Letters, 19(11), 1299–1313. 10.1111/ele.12660 [DOI] [PubMed] [Google Scholar]
- Bartumeus F., and Levin S. A. (2008). Fractal reorientation clocks: Linking animal behavior to statistical patterns of search. Proceedings of the National Academy of Sciences of the United States of America, 105(49), 19072–19077. 10.1073/pnas.0801926105 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Bartumeus F., Luz M. G. D., Viswanathan G. M., and Catalan J. (2005). Animal search strategies: A quantitative random-walk analysis. Ecology, 86(11), 3078–3087. 10.1890/04-1806 [DOI] [Google Scholar]
- Bartumeus F., Raposo E. P., Viswanathan G. M., and Luz M. G. D. (2014). Stochastic optimal foraging: Tuning intensive and extensive dynamics in random searches. PLoS ONE, 9(9), e106373. 10.1371/journal.pone.0106373 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Bella-Fernández M., Suero Suñé M., and Gil-Gómez de Liaño B. (2022). Foraging behavior in visual search:A review of theoretical and mathematical models in humans and animals. Psychological Research, 86(2), 331–349. 10.1007/s00426-021-01499-1 [DOI] [PubMed] [Google Scholar]
- Benhamou S. (1992). Efficiency of area-concentrated searching behaviour in a continuous patchy environment. Journal of Theoretical Biology, 159(1), 67–81. [Google Scholar]
- Benhamou S. (2007). How many animals really do the Lévy walk? Ecology, 88(8), 1962–1969. [DOI] [PubMed] [Google Scholar]
- Benhamou S. (2014). Of scales and stationarity in animal movements. Ecology letters, 17(3), 261–272. [DOI] [PubMed] [Google Scholar]
- Bénichou O., Loverdo C., Moreau M., and Voituriez R. (2011). Intermittent search strategies. Reviews of Modern Physics, 83(1), 81–129. [Google Scholar]
- Berg H. C. (2004). E. coli in Motion. Springer. [Google Scholar]
- Boussard A., Delescluse J., Pérez-Escudero A., and Dussutour A. (2019). Memory inception and preservation in slime moulds: The quest for a common mechanism. Philosophical Transactions of the Royal Society B: Biological Sciences, 374(1774). [DOI] [PMC free article] [PubMed] [Google Scholar]
- Bradski G. (2000). The OpenCV Library. [Google Scholar]
- Cassini M. H., Kacelnik A., and Segura E. T. (1990). The tale of the screaming hairy armadillo, the guinea pig and the marginal value theorem. Animal Behaviour, 39(6), 1030–1050. [Google Scholar]
- Cassini M. H., Lichtenstein G., Ongay J., and Kacelnik A. (1993). Foraging behaviour in guinea pigs: Further tests of the marginal value theorem. Behavioural Processes, 29(1–2), 99–112. [DOI] [PubMed] [Google Scholar]
- Charnov E. L. (1976). Optimal foraging, the marginal value theorem. Theoretical Population Biology, 9(2), 129–136. 10.1016/0040-5809(76)90040-x [DOI] [PubMed] [Google Scholar]
- Chen M. K., Lakshminarayanan V., and Santos L. R. (2006). How basic are behavioral biases? Evidence from capuchin monkey trading behavior. Journal of Political Economy, 114(3), 517–537. 10.1086/503550 [DOI] [Google Scholar]
- Cho C. E., Brueggemann C., L’Etoile N. D., and Bargmann C. I. (2016). Parallel encoding of sensory history and behavioral preference during Caenorhabditis elegans olfactory learning. Elife, 5, e14000. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Codling E. A., Plank M. J., and Benhamou S. (2008). Random walk models in biology. Journal of the Royal society interface, 5(25), 813–834. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Colbert H. A., and Bargmann C. I. (1995). Odorant-specific adaptation pathways generate olfactory plasticity in C. elegans. Neuron, 14(4), 803–812. [DOI] [PubMed] [Google Scholar]
- Costa A. C., Ahamed T., Jordan D., and Stephens G. J. (2024). A markovian dynamics for Caenorhabditis elegans behavior across scales. Proceedings of the National Academy of Sciences, 121(32), e2318 805121. [DOI] [PMC free article] [PubMed] [Google Scholar]
- De Petrillo F., and Rosati A. G. (2019). Ecological rationality: Convergent decision-making in apes and capuchins. Behavioural Processes, 164, 201–213. 10.1016/j.beproc.2019.05.010 [DOI] [PubMed] [Google Scholar]
- Dekkers M. P. J., Salfelder F., Sanders T., Umuerri O., Cohen N., and Jansen G. (2021). Plasticity in gustatory and nociceptive neurons controls decision making in C. elegans salt navigation. Communications Biology, 4(1), 1–14. 10.1038/s42003-021-02561-9 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Dietrich M. R., Ankeny R. A., and Chen P. M. (2014). Publication trends in model organism research. Genetics, 198(3), 787–794. 10.1534/genetics.114.169714 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Ding S. S., Romenskyy M., Sarkisyan K. S., and Brown A. E. (2020). Measuring Caenorhabditis elegans spatial foraging and food intake using bioluminescent bacteria. Genetics, 214(3), 577–587. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Ding S. S., Schumacher L. J., Javer A. E., Endres R. G., and Brown A. E. (2019). Shared behavioral mechanisms underlie C. elegans aggregation and swarming. Elife, 8, e43318. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Donahue M. J., Holyoak M., and Feng C. (2003). Patterns of dispersal and dynamics among habitat patches varying in quality. The American Naturalist, 162(3), 302–317. [DOI] [PubMed] [Google Scholar]
- Dorfman A., Hills T. T., and Scharf I. (2022). A guide to area-restricted search: A foundational foraging behaviour. Biological Reviews, 97(6), 2076–2089. 10.1111/brv.12883 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Dussutour A. (2021). Learning in single cell organisms. Biochemical and Biophysical Research Communications, 564, 92–102. [DOI] [PubMed] [Google Scholar]
- Dussutour A., Ma Q., and Sumpter D. (2019). Phenotypic variability predicts decision accuracy in unicellular organisms. Proceedings of the Royal Society B: Biological Sciences, 286(1896). [DOI] [PMC free article] [PubMed] [Google Scholar]
- Escudero A. P., Al-Asmar A., and Madirolas G. (2023, March 8). Preparation of 1L of foraging medium. [Google Scholar]
- Félix M.-A., and Duveau F. (2012). Population dynamics and habitat sharing of natural populations of Caenorhabditis elegans and C. briggsae. BMC biology, 10, 59. 10.1186/1741-7007-10-59 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Frézal L., and Félix M.-A. (2015). C. elegans outside the petri dish. eLife, 4, e05849. 10.7554/eLife.05849 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Fukasawa Y., and Ishii K. (2023). Foraging strategies of fungal mycelial networks: Responses to quantity and distance of new resources. Frontiers in Cell and Developmental Biology, 11. 10.3389/fcell.2023.1244673 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Giraldeau L.-A., and Kramer D. L. (1982). The marginal value theorem: A quantitative test using load size variation in a central place forager, the eastern chipmunk, Tamias striatus. Animal Behaviour, 30(4), 1036–1042. [Google Scholar]
- Gomez-Marin A., Stephens G. J., and Brown A. E. (2016). Hierarchical compression of Caenorhabditis elegans locomotion reveals phenotypic differences in the organization of behaviour. Journal of The Royal Society Interface, 13(121), 20160466. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Gourgou E., Adiga K., Goettemoeller A., Chen C., and Hsu A.-L. (2021). Caenorhabditis elegans learning in a structured maze is a multisensory behavior. iScience, 24(4), 102284. 10.1016/j.isci.2021.102284 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Gray J. M., Hill J. J., and Bargmann C. I. (2005). A circuit for navigation in Caenorhabditis elegans. Proceedings of the National Academy of Sciences of the United States of America, 102(9), 3184–3191. 10.1073/pnas.0409009101 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Haley J. A., Chen T., Aoi M., and Chalasani S. H. (2025). Accept–reject decision-making revealed via a quantitative and ethological study of C. elegans foraging. Elife, 13, RP103191. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Harris C. R., Millman K. J., van der Walt S. J., Gommers R., Virtanen P., Cournapeau D., Wieser E., Taylor J., Berg S., Smith N. J., Kern R., Picus M., Hoyer S., van Kerkwijk M. H., Brett M., Haldane A., del Río J. F., Wiebe M., Peterson P., … and Oliphant T. E. (2020). Array programming with NumPy. Nature, 585(7825), 357–362. 10.1038/s41586-020-2649-2 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Hills T., Brockie P. J., and Maricq A. V. (2004). Dopamine and glutamate control area-restricted search behavior in Caenorhabditis elegans. Journal of Neuroscience, 24(5), 1217–1225. 10.1523/JNEUROSCI.1569-03.2004 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Hohberg K., and Traunspurger W. (2009). Foraging theory and partial consumption in a tardigrade–nematode system. Behavioral Ecology, 20(4), 884–890. [Google Scholar]
- Hong I., and Wolfe J. M. (2023). Research on re-search: Foraging in the same patch twice. Journal of Vision, 23(9), 4970–4970. [Google Scholar]
- Houston A. I. (2009). Flying in the face of nature. Behavioural Processes, 80(3), 295–305. 10.1016/j.beproc.2008.12.007 [DOI] [PubMed] [Google Scholar]
- Hunter J. D. (2007). Matplotlib: A 2d graphics environment. Computing in Science & Engineering, 9(3), 90–95. 10.1109/MCSE.2007.55 [DOI] [Google Scholar]
- Iino Y., and Yoshida K. (2009). Parallel use of two behavioral mechanisms for chemotaxis in Caenorhabditis elegans. The Journal of neuroscience : the official journal of the Society for Neuroscience, 29(17). 10.1523/JNEUROSCI.3633-08.2009 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Iwanir S., Brown A. S., Nagy S., Najjar D., Kazakov A., Lee K. S., Zaslaver A., Levine E., and Biron D. (2016). Serotonin promotes exploitation in complex environments by accelerating decision-making. BMC Biology, 14(1), 9. 10.1186/s12915-016-0232-y [DOI] [PMC free article] [PubMed] [Google Scholar]
- Kacelnik A., and Todd I. A. (1992). Psychological mechanisms and the marginal value theorem: Effect of variability in travel time on patch exploitation. Animal Behaviour, 43(2), 313–322. [Google Scholar]
- Katzen A., Chung H.-K., Harbaugh W. T., Della Iacono C., Jackson N., Glater E. E., Taylor C. J., Yu S. K., Flavell S. W., Glimcher P. W., et al. (2023). The nematode worm C. elegans chooses between bacterial foods as if maximizing economic utility. Elife, 12, e69779. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Latty T., and Beekman M. (2009). Food quality affects search strategy in the acellular slime mould, Physarum polycephalum. Behavioral Ecology, 20(6), 1160–1167. 10.1093/beheco/arp111 [DOI] [Google Scholar]
- Lea A. M., and Ryan M. J. (2015). Irrationality in mate choice revealed by túngara frogs. Science, 349(6251), 964–966. 10.1126/science.aab2012 [DOI] [PubMed] [Google Scholar]
- Lee K. S., Iwanir S., Kopito R. B., Scholz M., Calarco J. A., Biron D., and Levine E. (2017). Serotonin-dependent kinetics of feeding bursts underlie a graded response to food availability in C. elegans. Nature communications, 8(1), 14221. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Louâpre P., Alphen J. J. M. v., and Pierre J.-S. (2010). Humans and insects decide in similar ways. PLOS ONE, 5(12), e14251. 10.1371/journal.pone.0014251 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Madirolas G., Al-Asmar A., Gaouar L., Marie-Louise L., Garza-Enríquez A., Rodríguez-Rada V., Khona M., Dal Bello M., Ratzke C., Gore J., and Pérez-Escudero A. (2023). Caenorhabditis elegans foraging patterns follow a simple rule of thumb. Communications Biology, 6(1), 1–13. 10.1038/s42003-023-05220-3 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Marshall H. H., Carter A. J., Ashford A., Rowcliffe J. M., and Cowlishaw G. (2013). How do foragers decide when to leave a patch? a test of alternative models under natural and experimental conditions. Journal of Animal Ecology, 82(4), 894–902. [DOI] [PubMed] [Google Scholar]
- Milward K., Busch K. E., Murphy R. J., De Bono M., and Olofsson B. (2011). Neuronal and molecular substrates for optimal foraging in Caenorhabditis elegans. Proceedings of the National Academy of Sciences, 108(51), 20672–20677. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Nigon V. M., and Félix M.-A. (2018). History of research on C. elegans and other free-living nematodes as model organisms. In WormBook: The online review of C. elegans biology [internet]. WormBook. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Nolting B. C., Hinkelman T. M., Brassil C. E., and Tenhumberg B. (2015). Composite random search strategies based on non-directional sensory cues. Ecological Complexity, 22, 126–138. [Google Scholar]
- Nonacs P. (2001). State dependent behavior and the marginal value theorem. Behavioral Ecology, 12(1), 71–83. 10.1093/oxfordjournals.beheco.a000381 [DOI] [Google Scholar]
- O’Bryan L. R., Lambeth S. P., Schapiro S. J., and Wilson M. L. (2020). Unpacking chimpanzee (pan troglodytes) patch use: Do individuals respond to food patches as predicted by the marginal value theorem? American journal of primatology, 82(12), e23208. [DOI] [PMC free article] [PubMed] [Google Scholar]
- O’Neill M. E. (2014). Pcg: A family of simple fast space-efficient statistically good algorithms for random number generation. [Google Scholar]
- Orjollet–Lacomme T., Lloret-Cabot R., Friedman J., and Pérez-Escudero A. (2025). Optimal foraging for simple organisms, the single-input marginal value theorem. [Google Scholar]
- Pacheco-Cobos L., Winterhalder B., Cuatianquiz-Lima C., Rosetti M. F., Hudson R., and Ross C. T. (2019). Nahua mushroom gatherers use area-restricted search strategies that conform to marginal value theorem predictions. Proceedings of the National Academy of Sciences, 116(21), 10339–10347. [DOI] [PMC free article] [PubMed] [Google Scholar]
- pandas development team T. (2020, February). Pandas-dev/pandas: Pandas. Version latest. Zenodo. 10.5281/zenodo.3509134 [DOI] [Google Scholar]
- Parker G. A., and Smith J. M. (1990). Optimality theory in evolutionary biology. Nature, 348(6296), 27–33. [Google Scholar]
- Peliti M., Chuang J. S., and Shaham S. (2013). Directional locomotion of C. elegans in the absence of external stimuli. PLoS ONE, 8(11), e78535. 10.1371/journal.pone.0078535 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Perez D. M., Greenway R., Stier T., Font-Massot N., Pertzelan A., and Ding S. S. (2025). Towering behavior and collective dispersal in Caenorhabditis nematodes. Current Biology, 35(12), 2980–2986. [DOI] [PubMed] [Google Scholar]
- Pérez-Escudero A., Rivera-Alba M., and de Polavieja G. G. (2009). Structure of deviations from optimality in biological systems. Proceedings of the National Academy of Sciences, 106(48), 20544–20549. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Petersen C., Dirksen P., and Schulenburg H. (2015). Why we need more ecology for genetic models such as C. elegans. Trends in Genetics, 31(3), 120–127. 10.1016/j.tig.2014.12.001 [DOI] [PubMed] [Google Scholar]
- Pierce-Shimomura J. T., Morse T. M., and Lockery S. R. (1999). The fundamental role of pirouettes in Caenorhabditis elegans chemotaxis. Journal of Neuroscience, 19(21), 9557–9569. 10.1523/jneurosci.19-21-09557.1999 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Pleasants J. M. (1989). Optimal foraging by nectarivores: A test of the marginal-value theorem. The American Naturalist, 134(1), 51–71. [Google Scholar]
- Pradhan S., Quilez S., Homer K., and Hendricks M. (2019). Environmental programming of adult foraging behavior in C. elegans. Current Biology, 29(17), 2867–2879. 10.1016/j.cub.2019.07.045 [DOI] [PubMed] [Google Scholar]
- Pyke G. H. (1978). Optimal foraging in hummingbirds: Testing the marginal value theorem. American zoologist, 18(4), 739–752. [Google Scholar]
- Ritvo S. (2022). Optimal foraging theory. In Vonk J. and Shackelford T. K. (Eds.), Encyclopedia of animal cognition and behavior (pp. 4833–4838). Springer International Publishing. [Google Scholar]
- Saeki S., Yamamoto M., and Iino Y. (2001). Plasticity of chemotaxis revealed by paired presentation of a chemoattractant and starvation in the nematode caenorhabditis elegans. Journal of Experimental Biology, 204(10), 1757–1764. 10.1242/jeb.204.10.1757 [DOI] [PubMed] [Google Scholar]
- Salvador L. C., Bartumeus F., Levin S. A., and Ryu W. S. (2014). Mechanistic analysis of the search behaviour of Caenorhabditis elegans. Journal of the Royal Society Interface, 11(92), 20131092. 10.1098/rsif.2013.1092 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Sawin E. R., Ranganathan R., and Horvitz H. R. (2000). C. elegans locomotory rate is modulated by the environment through a dopaminergic pathway and by experience through a serotonergic pathway. Neuron, 26(3), 619–631. [DOI] [PubMed] [Google Scholar]
- Scheer E., and Bargmann C. I. (2023). Sensory neurons couple arousal and foraging decisions in Caenorhabditis elegans. eLife, 12, RP88657. 10.7554/eLife.88657 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Schlender T., Rieger A., and Eggert F. (2024). Grocery shopping under simplified marginal value theorem predictions. Human Nature, 35(4), 451–476. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Schwarz R. F., Branicky R., Grundy L. J., Schafer W. R., and Brown A. E. (2015). Changes in postural syntax characterize sensory modulation and natural variation of C. elegans locomotion. PLoS computational biology, 11(8), e1004322. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Shettleworth S. J. (2010). Clever animals and killjoy explanations in comparative psychology. Trends in Cognitive Sciences, 14(11), 477–481. 10.1016/j.tics.2010.07.002 [DOI] [PubMed] [Google Scholar]
- Shtonda B. B., and Avery L. (2006). Dietary choice behavior in Caenorhabditis elegans. Journal of experimental biology, 209(1), 89–102. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Stephens D. W., and Krebs J. R. (1986). Foraging theory. Princeton university press. [Google Scholar]
- Stephens G. J., Bueno de Mesquita M., Ryu W. S., and Bialek W. (2011). Emergence of long timescales and stereotyped behaviors in Caenorhabditis elegans. Proceedings of the National Academy of Sciences, 108(18), 7286–7289. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Stephens G. J., Johnson-Kerner B., Bialek W., and Ryu W. S. (2008). Dimensionality and dynamics in the behavior of C. elegans. PLoS computational biology, 4(4), e1000028. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Stiernagle T. (2006). Maintenance of C. elegans. 10.1895/wormbook.1.101.1 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Suwazono K., Kuze K., Tazawa U. T., Jang M. S., Kunitomo H., Toyoshima Y., and Iino Y. (2025). Dissection of behavioral components and the role of Omega/Delta turns for the chemotaxis of C. elegans. Genes to Cells: Devoted to Molecular & Cellular Mechanisms, 30(4), e70026. 10.1111/gtc.70026 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Tasnim S., Liu A., and Jose A. (2025). Associative learning by C. elegans is variable when butanone is paired with starvation. microPublication Biology, 2025, 10.17912/micropub.biology.001568. 10.17912/micropub.biology.001568 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Team, R. C. (2025). R: A language and environment for statistical computing. R Foundation for Statistical Computing. Vienna, Austria. [Google Scholar]
- Tenhumberg B., Keller M. A., Possingham H. P., and Tyre A. J. (2001). Optimal patch-leaving behaviour: A case study using the parasitoid Cotesia rubecula. Journal of Animal Ecology, 70, 683–691. [Google Scholar]
- Virtanen P., Gommers R., Oliphant T. E., Haberland M., Reddy T., Cournapeau D., Burovski E., Peterson P., Weckesser W., Bright J., van der Walt S. J., Brett M., Wilson J., Millman K. J., Mayorov N., Nelson A. R. J., Jones E., Kern R., Larson E., … and SciPy 1.0 Contributors. (2020). SciPy 1.0: Fundamental Algorithms for Scientific Computing in Python. Nature Methods, 17, 261–272. 10.1038/s41592-019-0686-2 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Viswanathan G. M., Buldyrev S. V., Havlin S., da Luz M. G. E., Raposo E. P., and Stanley H. E. (1999). Optimizing the success of random searches. Nature, 401(6756), 911–914. 10.1038/44831 [DOI] [PubMed] [Google Scholar]
- Viswanathan G. M., Luz M. G. D., Raposo E. P., and Stanley H. E. (2011). The physics of foraging: an introduction to random searches and biological encounters. Cambridge, 10.1017/CBO9780511902680 [DOI] [Google Scholar]
- Wajnberg E., Fauvergue X., and Pons O. (2000). Patch leaving decision rules and the marginal value theorem: An experimental analysis and a simulation model. Behavioral Ecology, 11(6), 577–586. [Google Scholar]
- Ward S. (1973). Chemotaxis by the nematode Caenorhabditis elegans: Identification of attractants and analysis of the response by use of mutants. Proceedings of the National Academy of Sciences of the United States of America, 70(3), 817–821. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Watanabe Y. Y., Ito M., and Takahashi A. (2014). Testing optimal foraging theory in a penguin–krill system. Proceedings of the Royal Society B: Biological Sciences, 281(1779). [DOI] [PMC free article] [PubMed] [Google Scholar]
- Yemini E., Jucikas T., Grundy L. J., Brown A. E., and Schafer W. R. (2013). A database of Caenorhabditis elegans behavioral phenotypes. Nature methods, 10(9), 877–879. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Zimmerman M. (1981). Optimal foraging, plant density and the marginal value theorem. Oecologia, 49(2), 148–153. [DOI] [PubMed] [Google Scholar]
- Zjacic N., and Scholz M. (2022). The role of food odor in invertebrate foraging. Genes, Brain and Behavior, 21(2), e12793. 10.1111/gbb.12793 [DOI] [PMC free article] [PubMed] [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Supplementary Materials
Data Availability Statement
All the code for the analysis is available and commented in the following Github: https://github.com/martees/Video_analysis_PhD_2022.
