2026
Manta Ray Foraging Optimization — Reimplementation and Analysis
A reproducibility study and Python implementation of MRFO and IMRFO, evaluated against benchmark test suites and a real-world container-packing problem, with two author-created algorithmic variants.
With Vedant Tolia·Max Frohman
Abstract
In this paper, we discuss our efforts to implement both the Manta Ray Foraging Optimization algorithm, designed by Zhao et al., 2019, and the Improved Manta Ray Foraging Optimization algorithm, designed by Qu et al., 2024. Both algorithms were successfully implemented in Python, which allowed for the testing of both on several benchmark test suites and a real-world combinatorial problem. We compare our results to other common metaheuristics and previous papers to understand the efficacy of MRFO/IMRFO and attempt to validate the claims presented by the previous papers. Our results are a mixed bag, showing that IMRFO is generally better than other metaheuristics, but not without weak spots.
Introduction
The Manta Ray Foraging Optimization algorithm (MRFO), introduced in 2019 by Zhao et al., translates the coordinated foraging behaviors of manta rays into a population-based optimization algorithm. The algorithm is built upon three primary movement strategies:
- Chain Foraging: individuals follow the leader to a food source
- Cyclone Foraging: the population spirals inwards in a coordinated sweep
- Somersault Foraging: individuals flip around the current best position to explore regions nearby
Though the original MRFO algorithm demonstrated promising results, it was revealed to be vulnerable to slow and premature convergence, and be prone to getting trapped in local optima, specifically in high-dimensional multi-modal landscapes. In order to address these issues, Qu et al. proposed the Improved Manta Ray Foraging algorithm (IMRFO) in 2024, which alters the baseline algorithm with three main enhancements:
- Tent Chaotic Mapping: used as an initialization strategy to improve population diversity
- Bidirectional Search: strategy used in order to simultaneously attract individuals toward the best-known solution while repelling them from the worst
- Lévy Flight: used to form perturbations that introduce occasional large random steps to escape local optima
Problem Description
The original MRFO implementation by Zhao et al. is written in MATLAB, and as far as we know, no Python implementation of IMRFO has been made publicly available. This limits accessibility for researchers and developers who work primarily in Python. Beyond accessibility, reproducibility is a known challenge with metaheuristic comparisons — small differences in implementation, parameter choices, or initialization can meaningfully change results, making independent replication important for validating the claims made in these papers.
Proposed Solution
We provide a Python implementation of both MRFO and IMRFO, translated from the original algorithmic descriptions and evaluated against their reported benchmarks. Both algorithms are built into a shared interface with several baseline optimizers including Particle Swarm Optimization (PSO), Grey Wolf Optimizer (GWO), and the Genetic Algorithm (GA), among others. We evaluate performance across the 23 classical benchmark functions from Yao et al., examine two of our own variants of IMRFO, and apply all algorithms to a practical combinatorial problem: three-dimensional cargo container packing.
Results
Yao et al. Benchmarks
IMRFO outperformed the competing algorithms for eight to ten of the benchmark functions. Only one algorithm, the Grey Wolf Optimizer (GWO), is able to truly challenge IMRFO (10-7-6 wins-ties-losses for IMRFO). Our convergence plots reflected these performances, with most benchmarks converging at similar rates but IMRFO often converging at one of the fastest rates. Finally, we calculated Friedman mean rankings for each of our 13 tested algorithms — IMRFO overall has the lowest ranking, which means it has performed the best.
Container-Packing Problem
Despite the strong results of the benchmark test suites, neither MRFO nor IMRFO appeared to surpass other metaheuristics in the container-packing problem. Overall, manta ray foraging does not appear well-suited to the container-packing problem. This could be for many reasons. It may be that the problem itself is just better-suited to other metaheuristics, like PSO. It could also be that our simplifications of container packing constrained the search space in a way that was less advantageous for a complex algorithm like IMRFO.
Reproducibility Comparison
One notable pattern is that our IMRFO results diverge more from the paper than our MRFO results do. We do not have a definitive explanation, but there are a few possible reasons. First, unlike MRFO, IMRFO has no publicly available reference implementation, so our version was built directly from the paper’s pseudocode. Any ambiguity in how the Tent mapping, bidirectional search, or Lévy flight were described could compound into implementation differences. Second, IMRFO’s additional strategies, particularly the Lévy flight random walk, likely make it more sensitive to random seeding than MRFO, meaning run-to-run variance is inherently higher.
It is also worth pointing out that this kind of reproducibility gap is a known issue in the metaheuristics literature where results are often difficult to replicate exactly, even with identical parameters, which is part of why reproducibility studies like this one are valuable.
Discussion
Overall, the results of our experimentation are positive, but not overwhelming. As expected, the Improved Manta Ray Foraging Optimization algorithm does perform better than its predecessor, Manta Ray Foraging Optimization. However, IMRFO does not consistently perform better than other metaheuristics in benchmark test suites, nor in our container-packing problem. These results are reaffirmations of the No Free Lunch Theorem, demonstrating that no metaheuristic can outperform in all cases.
Our results underscore the importance of reproducibility studies; this paper demonstrates the results as shown in Qu et al. 2024 are potentially inaccurate or not consistent. Our work also shows why it is critical for computational research to include code when possible, to reduce the chance of ambiguities in future implementations.