Have you ever seen a moth flying around your house? If yes, I am sure you wonder why? You may think they love your house or they try to find foods. However, the fact is that the poor little ones get distracted by artificial lights and lose their natural flying path. They all ended up in deadly spiral flying paths. Anyway, I saw many of them in my life and once decided to study about them. At the beginning, I did not mean to inspire from them to propose an optimization algorithm, but as always it eventually inspired me to simulate this behaviour in computer and propose an optimization algorithm :)
All the algorithms that I have proposed so far simulate the behaviour of natural creatures for survival. This algorithm, however, simulates the death behaviour of moths. :D I hope that you do not think I enjoy watching them dying and start blaming me :). Honestly, I always catch them and free them in fresh air when I find them in my house. Anyway, let’s talk about the optimization algorithm that I proposed recently. I am sure you could guess what the name is: Moth Optimizer?!! No, the name is Moth-flame Optimization Algorithm. In my culture and some the culture (I believe), a moth is the symbol of pure love because it gets attracted by a flame and moves towards it until death. That is actually not true as per the reason that I explained above, but this is how a lot of poets described it. Therefore, I have decided to not to ignore the role of flame in this relationship :D and named this algorithm Moth-Flame Optimization Algorithm.
Moths are fancy insects, which are highly similar to the family of butterflies. Basically, there are over 160,000 various species of this insect in nature. They have two main milestones in their lifetime: larvae and adult. The larvae is converted to moth by cocoons. The most interesting fact about moths is their special navigation methods in night. They have been evolved to fly in night using the moon light. They utilized a mechanism called transverse orientation for navigation. In this method, a moth flies by maintaining a fixed angle with respect to the moon, a very effective mechanism for travelling long distances in a straight path. Since the moon is far away from the moth, this mechanism guarantees flying in straight line. The same navigation method can be done by humans. Suppose that the moon is in the south side of the sky and a human wants to go the east. If he keeps moon of his left side when walking, he would be able to move toward the east on a straight line.
Despite the effectiveness of transverse orientation, we usually observe that moths fly spirally around the lights. In fact, moths are tricked by artificial lights and show such behaviours. This is due to the inefficiency of the transverse orientation, in which it is only helpful for moving in straight line when the light source is very far. When moths see a human-made artificial light, they try to maintain a similar angle with the light to fly in straight line. Since such a light is extremely close compared to the moon, however, maintaining a similar angle to the light source causes a useless or deadly spiral fly path for moths. This is the main inspiration of MFO.
MFO has been designed to solve single-objective optimization problems. This algorithm has been implemented in a wide range of programming languages. You can download the source code at the bottom of this page.
If you are interested in solving a multi-objective problem using MFO, you can use this code.
A user-friendly interface to run MFO algorithm with minimum coding.