View full-text article in PMC Biomimetics (Basel). 2024 Oct 19;9(10):643. doi: 10.3390/biomimetics9100643 Search in PMC Search in PubMed View in NLM Catalog Add to search Copyright and License information © 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/). PMC Copyright notice Algorithm 2 hill–valley Input: p1,p2–two individuals;Output:valleyExists–a Boolean value indicating whether there is a valley between the two individuals; 1:valleyExists← False; 2:for each t∈Samples (Samples is a fixed array of real values within [0, 1]) do 3: p3←p1+(p2−p1)·t; 4: if fit(p3)<min{fit(p1),fit(p2)} then 5: valleyExists← True; 6: break; 7: end if 8:end for