In the simulation, food search has two phases: a roaming phase, which is a correlated random walk, and a seek phase which climbs an odor gradient to food. Seek is very efficient, although it does require a timeout to handle false odor plumes, but roaming is essentially a random walk, leaving lots of opportunities for improvement. One possible improvement is reducing repeated search by avoiding already searched areas.
Evolutionary own-trail avoidance
Some of the earliest bilaterian fossil trails show the crawling animals avoiding crossing their own trail [Sims and Kiverstein 2022], suggesting this optimization existed in even the earliest bilaterians. The fossil trails also show wall-following (thigmotaxis). By combining own-trail avoidance, wall-following, and u-turns the bilaterians generated spiral-like paths that efficiently searched the local area.
The communal unicellular slime mold Physarum polycephalum leaves a trail of slime as it moves and the slime mold avoids its own trail [Reid et al 2012]. Physarum has been studied as solving complex search like the traveling salesman problem and maze escape. Even a simple animal can implement own-trail avoidance. Robot navigation and mapping has experimented with own-trail avoidance [Balch 1993]. Ants use pheromones to make trails to food [Jackson et al 2006], which is essentially an external memory for navigation.
The simulated animal represents a chordate proto-vertebrate, and the proto-vertebrates were freely swimming filter feeders, which essentially precludes leaving an odor trail because water currents would immediately disturb the odors. For the sake of this essay, I’m ignoring this practical implausibility, because I’m interested in how memory might use existing proto-vertebrate avoidance circuits. Using breadcrumbs as external memory can be a prelude to neural internal memory [Sims and Kiverstein 2022].
Odor avoidance
Odor trail avoidance could use at least two direct action paths in the proto-vertebrate brainstem. One path goes through Hb.mv (medial ventral habenula) to R1.a (anterior hindbrain motor area), and another path goes through V.pt (posterior tuberculum) to MLR (midbrain locomotor region) to R5.rs (hindbrain reticulospinal motor). Hb.mv, R1.a, MLR, and R5.rs are all highly conserved areas in vertebrates, while V.pt is likely conserved as the equivalent to mammalian midbrain dopamine Vta (ventral tegmental area) and Snc (substantia nigra pars compacta). Other action paths exist using the cortex, but to keep the animal simple, I’m still postponing all cortical circuits.
In lampreys, the Ob.m (medial olfactory bulb) projects direction to Hb.m (medial habenula) [Stephenson-Jones et al 2012], [Suryanarayana et al 2021]. Zebrafish Ob also projects to right Hb.d (Hb.mv in mammals) to R.ip.v (ventral interpeduncular nucleus, R.ip.m medial R.ip for mammals) [Miyasaka et al 2014], [Choi JH et al 2021], [Krishnan et al 2014], [Turner 2016] which can support chemotaxis to avoid odors [Choi JH et al 2021], [Krishnan et al 2014].
The R.ip.v (R.ip.m for mammals) is interconnected with R1.a for motor and can drive taxis avoidance, including chemotaxis [Chen WY et al 2019], phototaxis [Chen X and Engert 2014], and chemotaxis [Palieri et al 2024].

Tetrapods do not have a direct Ob to Hb connection, in contrast to the lamprey and possibly fish. In a the fire-bellied toad, a basal amphibian, the Ob only projects to the habenular commissure but not to Hb itself [Freudenmacher et al 2020]. Similarly, mammals do not have a direct Ob projection to Hb.mv. Instead, Hb.mv is almost entirely driven by posterior P.se (septum) [Viswanath et al 2014], [Yamaguchi et al 2013], [Choi K et al 2016], which is mainly driven by E.hc (hippocampus). This mammalian upgrade from direct Ob sensory input to cognitive E.hc input is a major reason I’m using this Hb.mv to R.ip.m path for the essay.
V.mr (median raphe) will be important fr this essay to detect transition from roaming to avoidance, allowing U-turns or directional turns only at border crossings. When the animal first enters the avoidance odor plume, it should turn away, but it shouldn’t continue turning while it’s inside the plume.
Odor seek
I’m treating the section path through V.pt as a seek action path because of its resemblance to the Vta/Snc connectivity with MLR, and the Ob to V.pt can drive movement [Derjean et al 2014], but I haven’t seen a study showing seek functionality. In lampreys Ob.m projects to V.pt [Derjean et al 2014], which drives MLR, which drives R5.rs (hindbrain reticulospinal motor neurons) [Beauséjour et al 2022]. Zebrafish Ob.m projects to V.pt [Imamura et al 2020].

For this essay, I’m interpreting this circuit as a seek system to approach food odors. Because MLR is highly interconnected with OT (optic tectum), I’m considering this system as “tectal” although I’m not actually using OT for this essay.
An alternative breadcrumb path
An alternative path for memory could use Hb.lm (medial Hb.l – lateral habenula), which projects to V.mr.glu (glutamate V.mr) and Vta.pm (posterior-medial Vta). Vta.pm drives RTPA (real time place avoidance through S.msh.v (ventral S.msh – medial shell of the ventral striatum). V.mr.glu drives E.hc (hippocampus) theta through P.msdb (median septum and diagonal band), which can also drive RTPA itself.
Memory for avoiding repetition is the underlying goal here, but this essay is focused on a fictional breadcrumb odor, in part because the path is simpler. Although Hb.lm produces avoidance like Hb.mv, it’s more complicated to explain where the Hb.lm signal comes from. In contrast the lamprey Hb.mv is directly driven by Ob.m.

The above diagram shows a possible mammalian path for memory-based avoidance. Hb.lm is driven by S.msh (medial shell of the ventral striatum), which is associated with place preference and avoidance. Because the animal is avoiding already explored areas, this is a possible action path for mammals. However, that memory-based system requires far more neural machinery than the essay’s proto-vertebrate allows.
Medial habenula
For context (but not strictly needed for this essay), Hb.m has two areas with distinct circuits, although in mammals these two areas further subdivide into five subareas. In lampreys and fish Hb.d (mammal Hb.m) is asymmetrical. In fish, odor goes to the right Hb.m, and light input goes to the left Hb.m. The right odor input is used for chemotaxis [Chen R et al 2023], [Chen WY et al 2019], such as food seeking or avoiding predators. The light input is used as a landmark for body and head direction [Lavian et al 2024], such as using the sun as a compass.

Taxis and landmark information use different areas of R.ip. Taxis uses R.ip.m (median R.ip in mammals, ventral R.ip in fish) [Krishnan et al 2014], and direction uses R.ip.l (lateral R.ip in mammals, dorsal R.ip in fish) [Lavian et al 2024]. R.ip.l and R.ip.m correspondingly project differently. R.ip.l is interconnected with directional nuclei in R.dta (dorsal tegmental area) such as R.dtg (dorsal tegmental nucleus of Gudden) for head direction, R.vtg (ventral tegmental nucleus of Gudden), and R.nin (nucleus incertus) for eye direction. R.ip.m is connected with motivational areas such as V.mr, P.ldt (laterodorsal tegmentum) and the motor R1.a.
In mammals, Hb.m only receives input from the posterior septum, specifically P.bac (bed nucleus of the anterior commissure), P.ts (triangular septum), P.sf (septofimbrial nucleus), and P.ms (median septum) [Juárez-Leal et al 2022]. These septal areas are largely driven by E.hc. This indirect, cognitive hippocampal input for mammals contrasts with the direct sensory input for fish and lampreys.
Full habenula
For further context, Hb.l (lateral habenula) also divides into two major areas, which further subdivide into nine subnuclei. Hb.lm (medial Hb.l) will likely be important soon because it’s an avoidance path that projections directly to V.mr and Vta.pm motivational avoidance areas, but it’s not yet important for this essay. Hb.lm is important for avoidance and Hb.ll (lateral Hb.l) for failure. Hb.ll.ov (oval sub nucleus of Hb.ll) is highly studied for its role in dopamine motivation and learning, and its inputs are specific to Hb.ll.ov, which contrasts with other Hb.l inputs that are more diffuse.
Zebrafish Hb.v (Hb.l in mammals) only projects to the serotonin are V.mr, but not to dopamine areas [Agetsuma et al 2010]. Because lamprey Hb.l does project to dopamine as well as serotonin areas [Stephenson-Jones et al 2012], the zebrafish may be a secondary loss, but it does suggest that V.mr is more critical to Hb.l than the dopamine projection.

The above diagram shows a functional diagram of Hb and some of its inputs and outputs. This essay uses Hb.mv avoidance taxis for avoid the breadcrumb odor. The next essay may use Hb.lm avoidance (non-taxis avoidance) for place avoidance memory. Hb.md landmark and Hb.ll failure are not currently used in the simulation, but may become important soon.
Simulation
The essay’s simulation has the animal searching for food using a correlated random walk as its base search strategy. Adding breadcrumbs for the animal’s own path could potentially improve the search by avoiding re-searching old areas. The simulation uses an Ob to Hb.m path, which then drives R1.a motor area. If the animal detects a breadcrumb, it turns away from its current path.

The above diagram shows the simulation modules in this breadcrumb avoidance action path. HbTaxis includes both Hb.m and R.ip. The Raphe module represents V.mr and stores the current for a short time on the order of a second. The animal should only make a U-turn if it newly encounter its trail. If it’s already avoiding the trail, it should move ballistically. The Raphe module maintains the current avoidance action to enable boundary-only turns.

Simulation roam
Roaming is driven by circadian wake and by a FoodZone detection, as used in essay 43. Parts of H.l respond to the animal entering a food zone [Jennings et al 2015]. For this essay, H.l HypMove drives roam when outside a food zone and pauses inside a food zone for filter feeding. HypMove represents the SLR (subthalamic / hypothalamic locomotor region), which is part of H.l [Ji C et al 2024].

Importantly, the roaming signal needs to disable breadcrumb avoid. If the animal is in a food zone, any roaming optimization needs to stop when roaming stops. In the essay’s stimulation, I’m using R1.a HindMove as an integration point for roaming motivation with the chemotaxis.
Simulation seek
The breadcrumb avoidance needs to coordinate with the Seek module. Seek follows a target odor toward food, essentially chemotaxis. The Seek module implements a bilateral, directional seek. In lamprey the V.pt receives direct input from Ob and projects to MLR [Derjean et al 2010], [Beauséjour et al 2022], [Beauséjour et al 2024], which drives locomotion through R5.rs.chx10 (mid-hindbrain reticulospinal) [Cregg et al 2020]. The Seek module is enabled by HypMove, which represents H.l, in particular its roaming signal.

The Seek module uses an entirely different locomotion action path than the breadcrumb’s avoid action path. Seek drives MidMove, representing MLR, which projects to R5.rs.chx10 (mid-hindbrain reticulospinal motor area), which is distinct form the R1.a motor area. In contrast the breadcrumb taxis used HbTaxis to the HindMove R1.a module. These two action paths only directly interact at the spinal cord motoneurons. Because there’s not central node that manages these two action paths, they need to inhibit each other as a distributed system.
Importantly, the Seek module needs a timeout to avoid perseveration. I’m using the striatum as a timeout system, as I’ve done in that last few essays. The striatum region would likely correspond to the mammalian S.lsh (lateral shell of S.v – ventral striatum) or S.core (core of S.v) because those are involved with seeking, as opposed S.msh (medial shell of S.v), which is more involved with place.

The above screenshot shows the animal just after the striatum timeout expire. The circular teal area is an odor plume, the teal star is the food zone, and the beige walls are barriers. While Seek is active, the animal struggles against the barrier to try to follow the odor plume. When the striatum expires, the animal returns to its roaming.
Monte Carlo results
I updated the simulation framework to enable Monte Carlo experiments without using the graphical view. Each scenario timed the animal searching, finding, and eating food with success defined as nutrients in the animal’s gut. The scenarios executed 200 times. The two scenarios maps were an open field and a U-shaped trap. Each map had a scenarios with a large seek odor plume and a scenario without an odor plume.

Although the breadcrumb trail shows a small improvement in the open field, it’s a minor difference. For this simple implementation there isn’t a huge gain with the breadcrumbs. It’s possible that a better implementation would improve the results, but this essay was looking for large gains from a simple change.
The breadcrumb strategy did avoid crossing the animal’s trail more than the roaming-only strategy, but often the breadcrumbs pushed the animal away from the goal. If the animal made a mistaken turn away from the goal, the trail-avoidance would exacerbate that mistake by driving the animal to search further away from the goal. In contrast the default roam would often reverse its mistake.
The seek trap scenario found that striatum timeout with avoid was better than timeout that just disabled seek. If that result generalizes, it might help explain why the S.v (ventral striatum) output region P.v (ventral pallidum) produces avoidance when triggered by S.d2 (striatum projection neurons with D2.i inhibitory dopamine receptors) indirect path.
The seek trap also showed the need for progressively increasing timeout. Because the timeout recovery time is currently fixed, the animal could restart seeking before exiting the trap, producing a cycle of seek and timeout. The current striatum timeout matches the adenosine building on the timeframe of 120s to 180s, but it doesn’t include longer term plasticity. Plasticity would progressively increase the timeout on the order of 20 minutes to an hour.
Issues raised by the simulation
The simulation raised several issues because it integrated multiple action paths that I’d previously implemented independently.
- The breadcrumb avoid in Hb-R.ip should respect the roam and food zone calculated in H.l.
- The breadcrumb avoid is distinct from chemotaxis avoid such as avoiding predator odor, which is also in the Hb-R.ip circuit.
- How does the breadcrumb avoid interact with ARTR (anterior hindbrain turning region)?
- How does the R.pb (parabrachial) toxic-environment avoid interact with the Hb-R.ip taxis avoid?
- How does V.rn (serotonin raphe nuclei) interact with Hb-R.ip and R1.a? These regions are highly interconnected.
- Avoid itself should have a timeout. S.msh.v and Vta.pm are activated for avoidance and could serve as an avoidance timeout.
- Seek (V.pt) uses a different MLR action path and mid-hindbrain R5.rs than the anterior hindbrain R1.a motor output used by SLR roam and Hb-R.ip avoidance. How is this conflict managed? In the lamprey, inhibiting SLR does not affect the Ob to MLR to R5.rs action path [Derjean et al 2010].
- Seek needs to stop when roaming stops for a food zone.
- Seek timeout needs to progressively increase when the initial timeout is insufficient to escape the U-trap.
Roam vs seek action paths
I’m treating the roam action path as distinct from the seek path. Roam uses Hb.m → R.ip → R1.a using SLR, but seek uses V.pt → MLR → R5.rs.chx10. These two paths use similar input from innate-odor Ob.m and final output N.sp (spinal motoneurons), but everything else is independent. I’m associating the roaming path with limbic areas and seek path with tectal-associated areas, but OT (optic tectum) is not part of the essay’s simulation. The important issue here is how the two paths interact.
For the seek path I’m using the lamprey V.pt as a proto-vertebrate seek precursor to the mammalian Vta.l and S.lsh seek system.

Studies involving nicotine addiction have identified an inhibitory path in mammals from R.ip avoidance via P.ldt (laterodorsal tegmentum) and the Vta to S.lsh circuit [Wolfman et al 2018], [Kim K and Picciotto 2023]. R.ip ⊣ P.ldt → Vta.l → S.lsh. R.ip inhibits P.ldt, which inhibits Vta.l phasic dopamine, which inhibits seek.
For the simulation, I’m using P.ldt as an inhibitory path from HbTaxis to inhibit Seek. In mammals P.ldt and Ppt (pedunculo-pontine tegmentum) are distinct but related areas, but non-mammal studies do not show distinct areas, at least for the studies I’ve read. I’m assuming a proto-vertebrate would have a single Ppt/P.ldt complex. Ppt is either part of the MLR or at least highly associated with it, and Ppt is highly interconnected with OT.
Simulation model
The Hb.m roam and V.pt seek action paths described above need to interact with the hunger and food-zone driving input from H.l HypMove. In this system, H.l HypMove drives both R1.a and V.pt. In mammals H.l as SLR drives R1.a for roaming [Ji C et al 2024]. Mammalian H.l is also strongly interconnected with Vta.

The R.pb.l tactile toxic avoidance needs to interact with the R1.a roaming circuit. The simulation’s R.pb.l RpbAvoid drives avoiding in R1.a HindMove, which is almost certainly incorrect. R.pb drives avoidance for place-specific irritations like itch. This R.pb itch-avoidance projection is to hypothalamic nuclei such as H.pv and H.l, and is distinct from R.pb projections for S.a (central amygdala), and P.bst (bed nucleus of the stria terminalis), which functionally handles food-related issues like sickness. In the diagram, the dotted line from RpbAvoid to HypMove does not currently exist in the simulation, but I will need to change that connectivity in a later essay.
Discussion
The experiment explored if a simple breadcrumb odor could improve searching for food. The breadcrumb odor drives an avoidance circuit in R1.a using the same avoidance action path as for predator odors with Hb.m to R.ip. The essay’s implementation did not show a significant improvement from roaming random walk.
One possibility is that this result is accurate and a simple breadcrumb trail is not an improvement over random walk for this scenario. The breadcrumb avoids crossing the animal’s own path. When the animal makes a wrong choice away from the food, this avoidance can exacerbate the error by forcing the animal to continue searching further away instead of crossing the trail to correct the mistake.
Another possibility is that the essay’s implementation is too simplistic or is broken. While possible or even likely, I’d have expected that if breadcrumbs provide an immediate large improvement, that even a flawed implementation would show significant gains.
The most significant improvement for seeking was the timeout and subsequent avoidance when the animal gave up seeking the odor. This timeout avoidance was more effective than the breadcrumb avoidance of the seek, and both were more effective with giving up and resuming roam without an avoidance phase. The striatum as a timeout and memory device is both simpler than a complicated mental breadcrumb system and potentially more effective.
References
Agetsuma M., Aizawa H., Aoki T., Nakayama R., M. Takahoko, M. Goto, T. Sassa, R. Amo, T. Shiraki, K. Kawakami, et al. The habenula is crucial for experience-dependent modification of fear responses in zebrafish Nat. Neurosci., 13 (2010), pp. 1354-1356
Balch, T., 1993, May. Avoiding the past: A simple but effective strategy for reactive navigation. In [1993] Proceedings IEEE International Conference on Robotics and Automation (pp. 678-685). IEEE.
Beauséjour, P.A., Zielinski, B. and Dubuc, R., 2022. Olfactory-induced locomotion in lampreys. Cell and tissue research, pp.1-15.
Beauséjour PA, Veilleux JC, Condamine S, Zielinski BS, Dubuc R. Olfactory Projections to Locomotor Control Centers in the Sea Lamprey. Int J Mol Sci. 2024 Aug 29;25(17):9370.
Chen R, Xu X, Wang XY, Jia WB, Zhao DS, Liu N, Pang Z, Liu XQ, Zhang Y. The lateral habenula nucleus regulates pruritic sensation and emotion. Mol Brain. 2023 Jun 27;16(1):54.
Chen WY, Peng XL, Deng QS, Chen MJ, Du JL, Zhang BB. Role of Olfactorily Responsive Neurons in the Right Dorsal Habenula-Ventral Interpeduncular Nucleus Pathway in Food-Seeking Behaviors of Larval Zebrafish. Neuroscience. 2019 Apr 15;404:259-267.
Chen X, Engert F. Navigational strategies underlying phototaxis in larval zebrafish. Front Syst Neurosci. 2014 Mar 25;8:39.
Choi JH, Duboue ER, Macurak M, Chanchu JM, Halpern ME. Specialized neurons in the right habenula mediate response to aversive olfactory cues. Elife. 2021 Dec 8;10:e72345.
Choi K, Lee Y, Lee C, Hong S, Lee S, Kang SJ, Shin KS. Optogenetic activation of septal GABAergic afferents entrains neuronal firing in the medial habenula. Sci Rep. 2016 Oct 5;6:34800.
Cregg JM, Leiras R, Montalant A, Wanken P, Wickersham IR, Kiehn O. Brainstem neurons that command mammalian locomotor asymmetries. Nat Neurosci. 2020 Jun;23(6):730-740.
Derjean D, Moussaddy A, Atallah E, St-Pierre M, Auclair F, Chang S, Ren X, Zielinski B, Dubuc R. A novel neural substrate for the transformation of olfactory inputs into motor output. PLoS Biol. 2010 Dec 21;8(12):e1000567.
Freudenmacher, L., Schauer, M., Walkowiak, W., & von Twickel, A. (2020). Refinement of the dopaminergic system of anuran amphibians based on connectivity with habenula, basal ganglia, limbic system, pallium, and spinal cord. Journal of Comparative Neurology, 528(6), 972-988.
Imamura F, Ito A, LaFever BJ. Subpopulations of Projection Neurons in the Olfactory Bulb. Front Neural Circuits. 2020 Aug 28;14:561822.
Jackson, D.E., Martin, S.J., Holcombe, M. and Ratnieks, F.L., 2006. Longevity and detection of persistent foraging trails in Pharaoh’s ants, Monomorium pharaonis (L.). Animal Behaviour, 71(2), pp.351-359.
Jennings JH, Ung RL, Resendez SL, Stamatakis AM, Taylor JG, Huang J, Veleta K, Kantak PA, Aita M, Shilling-Scrivo K, Ramakrishnan C, Deisseroth K, Otte S, Stuber GD. Visualizing hypothalamic network dynamics for appetitive and consummatory behaviors. Cell. 2015 Jan 29;160(3):516-27.
Ji, C., Zhang, Y., Lin, Z., Zhao, Z., Jiao, Z., Zheng, Z., Shi, X., Wang, X., Li, Z., Yu, S. and Qu, Y., 2024. Activation of hypothalamic-pontine-spinal pathway promotes locomotor initiation and functional recovery after spinal cord injury in mice. bioRxiv, pp.2024-11.
Juárez-Leal I, Carretero-Rodríguez E, Almagro-García F, Martínez S, Echevarría D, Puelles E. Stria medullaris innervation follows the transcriptomic division of the habenula. Sci Rep. 2022 Jun 16;12(1):10118.
Kim, K. and Picciotto, M.R., 2023. Nicotine addiction: More than just dopamine. Current opinion in neurobiology, 83, p.102797.
Krishnan S, Mathuru AS, Kibat C, Rahman M, Lupton CE, Stewart J, Claridge-Chang A, Yen SC, Jesuthasan S. The right dorsal habenula limits attraction to an odor in zebrafish. Curr Biol. 2014 Jun 2;24(11):1167-75.
Lavian, H., Prat, O., Petrucco, L., Stih, V. and Portugues, R., 2024. The representation of visual motion and landmark position aligns with heading direction in the zebrafish interpeduncular nucleus. BioRxiv, pp.2024-09.
Miyasaka N, Arganda-Carreras I, Wakisaka N, Masuda M, Sümbül U, Seung HS, Yoshihara Y. Olfactory projectome in the zebrafish forebrain revealed by genetic single-neuron labelling. Nat Commun. 2014 Apr 9;5:3639.
Palieri V, Paoli E, Wu YK, Haesemeyer M, Grunwald Kadow IC, Portugues R. The preoptic area and dorsal habenula jointly support homeostatic navigation in larval zebrafish. Curr Biol. 2024 Feb 5;34(3):489-504.e7.
Reid, C.R., Latty, T., Dussutour, A. and Beekman, M., 2012. Slime mold uses an externalized spatial “memory” to navigate in complex environments. Proceedings of the National Academy of Sciences, 109(43), pp.17490-17494.
Sims, M. and Kiverstein, J., 2022. Externalized memory in slime mould and the extended (non-neuronal) mind. Cognitive Systems Research, 73, pp.26-35.
Stephenson-Jones M, Floros O, Robertson B, Grillner S. Evolutionary conservation of the habenular nuclei and their circuitry controlling the dopamine and 5-hydroxytryptophan (5-HT) systems. Proc Natl Acad Sci U S A. 2012 Jan 17;109(3):E164-73.
Suryanarayana, S. M., Perez-Fernandez, J., Robertson, B., & Grillner, S. (2021). Olfaction in lamprey pallium revisited—dual projections of mitral and tufted cells. Cell Reports, 34(1).
Turner KJ, Hawkins TA, Yáñez J, Anadón R, Wilson SW, Folgueira M. Afferent Connectivity of the Zebrafish Habenulae. Front Neural Circuits. 2016 Apr 26;10:30.
Viswanath H, Carter AQ, Baldwin PR, Molfese DL, Salas R. The medial habenula: still neglected. Front Hum Neurosci. 2014 Jan 17;7:931.
Wolfman SL, Gill DF, Bogdanic F, Long K, Al-Hasani R, McCall JG, Bruchas MR, McGehee DS. Nicotine aversion is mediated by GABAergic interpeduncular nucleus inputs to laterodorsal tegmentum. Nat Commun. 2018 Jul 13;9(1):2710.
Yamaguchi T, Danjo T, Pastan I, Hikida T, Nakanishi S. Distinct roles of segregated transmission of the septo-habenular pathway in anxiety and fear. Neuron. 2013 May 8;78(3):537-44.
