Firefly Algorithm: Part II
Version 1.0.0 (210 KB) by
Adisorn Owatsiriwong
This is an example code of Firefly algorithm to solve optimization problem.
It is convenient to explain the algorithm from the pseudo code. Considering the pseudo code of Firefly algorithm as given in Yang (2008)
Randomly generate n firefly populations
For k = 1: max_iterations
Initially, compute light intensity I (brightness) for each firefly
For i = 1: n
For j = 1:n (inner loop)
% update intensity for each firefly
if( < ), then move firefly i towards j
end
end
rank the fireflies and find the best global g (store the best solution for each iteration)
end
Cite As
Adisorn Owatsiriwong (2024). Firefly Algorithm: Part II (https://www.mathworks.com/matlabcentral/fileexchange/160078-firefly-algorithm-part-ii), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2023b
Compatible with any release
Platform Compatibility
Windows macOS LinuxTags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0 |