![]() | ||
In mathematical optimization, the firefly algorithm is a metaheuristic proposed by Xin-She Yang and inspired by the flashing behaviour of fireflies.
Contents
Metaphor
The primary purpose for a firefly's flash is to act as a signal system to attract other fireflies. Xin-She Yang formulated this firefly algorithm by assuming:
- All fireflies are unisexual, so that any individual firefly will be attracted to all other fireflies;
- Attractiveness is proportional to their brightness, and for any two fireflies, the less bright one will be attracted by (and thus move towards) the brighter one; however, the intensity (apparent brightness) decrease as their mutual distance increases;
- If there are no fireflies brighter than a given firefly, it will move randomly.
The brightness should be associated with the objective function.
Algorithm
In pseudocode the algorithm can be stated as:
Begin 1) Objective function:The main update formula for any pair of two fireflies
where
It can be shown that the limiting case
Criticism
Nature-inspired metaheuristics in general have attracted criticism in the research community for hiding their lack of novelty behind an elaborate metaphor. The firefly algorithm has been criticized as differing from the well-established particle swarm optimization only in a negligible way.