The Standard Firefly Algorithm (FA)

This demo shows how the firefly algorithm (FA) works.

You are now following this Submission

The standard firefly algorithm is inspired by the flashing patterns of tropical fireflies. This demo solves a function of d=10 dimensions. It is straightforward to extend it to solve other functions and optimization problems.

The details can be found in the book: Xin-She Yang, Nature-Inspired Optimization Algorithms, Elsevier Insights, (2014). https://www.sciencedirect.com/book/9780124167438/nature-inspired-optimization-algorithms

Cite As

XS Yang (2026). The Standard Firefly Algorithm (FA) (https://au.mathworks.com/matlabcentral/fileexchange/74769-the-standard-firefly-algorithm-fa), MATLAB Central File Exchange. Retrieved .

Xin-She Yang, Nature-Inspired Optimization Algorithms, Elsevier Insights, (2014)

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
2.0.0

This is an updated, but simpler version.

1.0.0