Request for MATLAB Code of Elephant Search Algorithm (ESA)
Afficher commentaires plus anciens
Hi everyone,
I’m looking for a MATLAB implementation of the Elephant Search Algorithm (ESA) for optimization problems. I couldn’t find an existing code online, and I’d appreciate it if someone could share a working implementation or guide me on how to code it based on its original paper.
If anyone has experience implementing ESA in MATLAB or can point me to a useful resource, I’d be very grateful.
Thanks in advance!
7 commentaires
Star Strider
le 9 Mar 2025
Posting the code could help.
There are any number of reasons for the author not having responded in the last 2+ days. I would not give up on that possibiity.
Sina
le 10 Mar 2025
Star Strider
le 10 Mar 2025
When you get it working so that it can be put into a function, test it, document it, with internal comments to explain how it works as well as external documentation explaining how to use it, then upload it to the File Exchange.
Sam Chak
le 10 Mar 2025
While you can randomly populate the male and female elephants of various ages within different search ranges and determine the current best location based on the best fitness, I do not understand whether the process of removing aging elephants and accounting for newly born baby elephants is absolutely necessary for the ESA iterations to efficiently continue searching until the number of training epochs reaches the predetermined limit.
Pseudocode for Elephant Search Algorithm:

Sina
le 10 Mar 2025
Sam Chak
le 10 Mar 2025
Hi @Sina
For practical reasons, it's probably a good idea to run a simple script for one or two epochs before implementing the full iteration loop. This allows you to observe how the elephants (candidate solutions) move in the search space, whether they converge too quickly or spread out as expected. It saves time in debugging later, when analyzing results across many iterations would be more complex.
A simple convex test function for running the ESA script for two epochs would be a Quadratic Bowl function:
within the domain
. The function is smooth and has a well-defined global minimum at
, making it suitable for testing exploration behavior. You can initialize a small herd consisting of approximately 10 elephants and use the randi() function to maintain the candidate solutions in integer form.
Please remember to post the MATLAB script here for testing and discussion.
Sina
le 11 Mar 2025
Réponses (2)
Image Analyst
le 6 Mar 2025
0 votes
You might find some interesting things in the File Exchange:
Looks like lots of elephants there.
7 commentaires
Sina
le 7 Mar 2025
Image Analyst
le 8 Mar 2025
It seems like every animal has their own algorithm. There must be dozens of them. How is the elephant algorithm different than the numerous other animal-inspired algorithms?
Sina
le 8 Mar 2025
Sam Chak
le 8 Mar 2025
If you can tell us your true objectives of using only the ESA to solve optimization problem, perhaps we can advise one or two things.
Sina
le 8 Mar 2025
Sam Chak
le 9 Mar 2025
Hi @Sina
Unfortunately, I do not write optimizer code because I am not the inventor. It may be now to consider a Plan B while awaiting a response from the inventor of the ESA.
Since you still have time before the seminar, you can select another optimizer with which you feel confident and comfortable working. There are currently over 500 different metaheuristic optimization algorithms documented, some of which are available in MATLAB code on File Exchange and GitHub. You need not regard ESA as a Holy Grail-level optimizer.
Walter Roberson
le 9 Mar 2025
I have a seminar in a few weeks, and one of the algorithms I need to use to solve an optimization problem is this algorithm.
Time to get writing the code yourself. No-one hanging around seems to have to code for it, and it is rather unlikely that anyone will volunteer to code it up just because you need it.
Catégories
En savoir plus sur Direct Search dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
