Skip to content

Conversation

@gunbaz
Copy link
Contributor

@gunbaz gunbaz commented Dec 3, 2025

🦗 Algorithm Description

This PR implements the Mantis Search Algorithm (MShOA), a novel bio-inspired meta-heuristic algorithm based on the aggressive hunting behavior of Mantis Shrimp.

Reference:
Sánchez Cortez, J. A., et al. (2025). "A Novel Bio-Inspired Optimization Algorithm Based on Mantis Shrimp Survival Tactics". Mathematics, 13(9), 1500.


🚀 Performance & Efficiency Benchmark

To demonstrate the algorithm's capability, I conducted a robust benchmark comparing MShOA against standard NiaPy implementations of PSO, DE, and GWO.

Test Conditions:

  • Problem: Schwefel Function (High Complexity)
  • Dimension: D=50
  • Runs: 50 independent runs (averaged)

🏆 Results:
As seen in the benchmark graph below, MShOA (Red Bar/Line) demonstrates superior performance in two key areas:

  1. Speed (Computational Efficiency):

    • MShOA: ~0.09s (Avg) ⚡
    • PSO: ~0.22s
    • GWO: ~0.27s
    • DE: ~0.94s
    • Result: MShOA is approximately 2.5x faster than PSO and 10x faster than DE.
  2. Accuracy (Convergence):

    • MShOA achieves significantly lower fitness values (better solutions) compared to all competitors, showing excellent exploitation capabilities in high-dimensional spaces.
mantis_full_benchmark1 ]

✅ Checklist

  • Algorithm implementation (mshoa.py)
  • Added MantisSearchAlgorithm to __init__.py
  • Verified against NiaPy coding standards
  • Validated with robust benchmarks (D=50, Runs=50)

Copy link
Contributor

@firefly-cpp firefly-cpp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dear @gunbaz,

Thank you for your pull request. I am not yet familiar with this metaphor‑based nature‑inspired algorithm, but it certainly looks like an interesting addition to the library.

Could you confirm whether the results of this implementation match those of the original implementation?

Also, please add a test scenario and an example, and include algo information in the Algorithms.md file.

@gunbaz
Copy link
Contributor Author

gunbaz commented Dec 4, 2025

Dear @firefly-cpp ,

Thank you for the review and the requested changes.

All pending issues have now been addressed:

The implementation has been fully aligned with the mathematical model from the original paper, and the logic has been reviewed again to ensure correctness.

A complete test scenario (test_mshoa.py) has been added and validated.

An example script (run_mshoa.py) is included for reproducibility.

Algorithm details have been added to Algorithms.md.

All Codacy issues (merge markers, long lines, trailing whitespace) have been fully resolved.

Please let me know if anything else needs adjustment.
Thank you again for your time and guidance.

@firefly-cpp
Copy link
Contributor

Thanks, @gunbaz! I think this PR is ready for inclusion in niapy.

I will ask @GregaVrbancic to publish a new version once the PR is merged. @gunbaz, when the new version is released, could you please test it?

@firefly-cpp firefly-cpp merged commit 09ca9ac into NiaOrg:master Dec 4, 2025
18 checks passed
@gunbaz
Copy link
Contributor Author

gunbaz commented Dec 5, 2025

Sure, I'll test it once the new version is released. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants