File Exchange

image thumbnail

Moth-flame Optimization (MFO) Algorithm toolbox

version 1.0 (218 KB) by Seyedali Mirjalili
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 (2020). Moth-flame Optimization (MFO) Algorithm toolbox (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (3)

Hello Mr. S. Mirjalili
How to hybridize BAT algorithm with Moth-Flame Optimization Algorithm if you have them in different scripts.

Thank you so much

Thanks Mr. S. Mirjalili for developing this algorithm
I have successfully implemented in solving AGC problem

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