Moth-flame Optimization (MFO) Algorithm toolbox

A toolbox for the Moth-flame Optimization (MFO) Algorithm for solving optimization problems
Updated 22 May 2018

View License

This is a handy toolbox for the recently proposed MFO algorithm. The main inspiration of this optimizer is the navigation method of moths in nature called transverse orientation. Moths fly in night by maintaining a fixed angle with respect to the moon, a very effective mechanism for travelling in a straight line for long distances. However, these fancy insects are trapped in a useless/deadly spiral path around artificial lights. The MFO algorithm mathematically models this behaviour to perform optimization.
The research paper:
S. Mirjalili, Moth-Flame Optimization Algorithm: A Novel Nature-inspired Heuristic Paradigm, Knowledge-Based Systems, DOI:
If you have no access to the paper, please drop me an email at and I will send you the paper.

More information can be found in:

Th original version of this algorithm can be found here:

All of the source codes and extra information as well as more optimization techniques can be found in my personal website at

I have a number of relevant courses in this area. You can enrol via the following links with 95% discount:

A course on “Optimization Problems and Algorithms: how to understand, formulation, and solve optimization problems”:

A course on “Introduction to Genetic Algorithms: Theory and Applications”

Cite As

Seyedali Mirjalili (2024). Moth-flame Optimization (MFO) Algorithm toolbox (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2011b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!