Skip to content
All library documents

Firefly Algorithm: Distance-Weighted Attraction and Swarm Search

Article MQL5 articles

Summary

This article explains the Firefly Algorithm, a population-based optimizer inspired by fireflies moving toward brighter neighbors. Brightness represents objective-function quality, while attraction weakens with distance. Less attractive fireflies move toward more attractive ones; those without a visible better neighbor move randomly. A random movement term supports exploration, and the method can be used for continuous or discrete optimization.

The article discusses how the distance absorption parameter affects behavior: too little absorption can draw the population toward a local optimum, while too much makes movement resemble random search. It proposes scaling distances before calculating attraction to reduce dependence on problem dimensions and ranges. The article also describes a modified implementation and reports that performance depends strongly on parameter settings, with possible clustering around local extrema. Its test discussion is incomplete in the supplied text, so it provides no basis for judging comparative performance or suitability for trading decisions.

Key ideas

  • Fireflies represent candidate solutions, and objective-function quality determines their brightness.
  • Attraction declines with distance, allowing the population to split into smaller groups during search.
  • Random movement helps explore when a firefly has no more attractive neighbor.
  • The absorption, attraction, and randomness settings can materially affect convergence and local-search behavior.
  • Scaling distance is proposed to make attraction less dependent on the search problem's dimensions and bounds.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.