Firefly Algorithm — Swarm Optimization via Bioluminescence
Firefly Algorithm (FA) · Also known as: FA, Firefly Optimization, Ateşböceği Algoritması (Firefly Algorithm)
The Firefly Algorithm (FA), introduced by Xin-She Yang in 2008 and formally published in 2010, is a nature-inspired swarm metaheuristic that models the bioluminescent attraction behaviour of fireflies. Each candidate solution is a firefly whose brightness represents its objective-function value; dimmer fireflies move toward brighter ones with an attraction force that decays with distance, driving the swarm toward optima without gradient information.
Read the full method
Sign in with a free account to read this section.
Method map
The neighbourhood of related methods — select a node to explore.
When to use it
The Firefly Algorithm suits continuous, gradient-free optimization problems — particularly multimodal landscapes where several competing optima exist. It requires no distributional assumptions and works with any population size and iteration budget, making it applicable without minimum sample constraints. It is well-suited to engineering design, hyper-parameter tuning, and scientific model fitting where the objective is expensive or non-differentiable. It is not appropriate for purely discrete or combinatorial problems without modification.
Strengths & limitations
- Automatic sub-swarm formation: fireflies naturally cluster around multiple optima simultaneously, making it inherently suited to multimodal problems.
- Gradient-free: the algorithm requires only objective-function evaluations, not derivatives, so it applies to black-box and non-differentiable problems.
- Conceptually simple: only two key parameters (β₀ and γ) govern the search, keeping tuning tractable.
- No distributional assumptions on the search space or objective function.
- Scales poorly to very high-dimensional spaces (typically beyond a few hundred variables) because the all-pairs attraction calculation grows quadratically with population size.
- Performance is sensitive to the choice of the light-absorption parameter γ; a poorly chosen γ collapses the swarm prematurely or prevents convergence.
- Suitable only for continuous optimization; discrete or combinatorial variants require non-trivial modification and are not directly supported.
Frequently asked
How do I choose the light-absorption parameter γ?
γ controls how quickly attraction decays with distance. A practical starting rule is to set γ so that the characteristic distance 1/√γ is on the order of the search-space diameter. Then sweep γ over a small grid and pick the value that gives the best convergence on a representative test run.
How does the Firefly Algorithm compare to Particle Swarm Optimization?
Both are swarm metaheuristics, but PSO uses global and personal best memories to guide movement, while FA uses pairwise attraction. FA's pairwise mechanism allows natural sub-swarm formation around multiple optima, giving it an intrinsic advantage on multimodal landscapes; PSO often converges faster on unimodal problems.
Can the Firefly Algorithm handle discrete or combinatorial problems?
Not directly in its standard form, which is defined over continuous spaces. Discrete variants exist in the literature (using permutation representations or binary encodings), but they require problem-specific adaptation and are not part of the original formulation.
How many fireflies (population size) should I use?
The original papers suggest 25–40 fireflies for moderate-dimensional problems. For higher dimensions, increase the population proportionally. Bear in mind that the all-pairs attraction step is O(n²) in population size, so very large populations increase computation time substantially.
Sources
- Yang, X.S. (2010). Firefly Algorithm, Stochastic Test Functions and Design Optimisation. International Journal of Bio-Inspired Computation, 2(2), 78-84. DOI: 10.1504/IJBIC.2010.032124 ↗
- Yang, X.S. (2014). Nature-Inspired Optimization Algorithms. Elsevier. ISBN: 978-0-12-416743-8
How to cite this page
ScholarGate. (2026, June 1). Firefly Algorithm (FA). ScholarGate. https://scholargate.app/en/optimization/firefly-algorithm
Which method?
Set this method beside its closest kin and read them side by side — the library lays the books on the table; the choice is yours.
- Cuckoo SearchOptimization↔ compare
- Differential EvolutionOptimization↔ compare
- Genetic AlgorithmOptimization↔ compare
- Grey Wolf OptimizerOptimization↔ compare
- Particle Swarm OptimizationOptimization↔ compare