Firefly Algorithm Optimization

I wrote an article titled “Firefly Algorithm Optimization” in the June 2015 issue of Microsoft’s MSDN Magazine. See

Firefly algorithm optimization (FAO) is a relatively new (2009) numerical optimization technique, where the goal is to find the values of variables for some (presumably difficult) minimization function. FAO loosely models the behavior of fireflies. Real fireflies are flying insects that can glow using bioluminescence to attract other fireflies. In FAO, there are several simulated fireflies and each represents a possible solution to the optimization problem under study.


In the MSDN article, I demonstrate how to use FAO to solve a standard benchmark problem called the Michalewicz function. The function is difficult because there are many flat areas and also there are several local minimum values in addition to the one global minimum.


Each firefly has an intensity that is proportional to the goodness of the current solution of the firefly. In each iteration of the algorithm, each firefly will be attracted to and move towards any firefly that has higher light intensity (i.e., a better solution). The higher the intensity, the more the firefly will move.

The FAO algorithm is quite similar to another swarm intelligence technique called particle swarm optimization (PSO), however the algorithm is actually quite subtle. Additionally, FAO is a meta-heuristic, meaning it’s really just a set of principles rather than a rigid prescription, so there are many, many possible FAO implementations for a given problem.

This entry was posted in Machine Learning. Bookmark the permalink.