萤火虫算法(Firefly Algorithm)是一种启发式算法,灵感来自于萤火虫闪烁的行为。萤火虫的闪光,其主要目的是作为一个信号系统,以吸引其他的萤火虫。剑桥大学的Xin-She Yang(音译:杨新社)教授提出了萤火虫算法,其假设为[1]:
- 萤火虫不分性别,这样一个萤火虫将会吸引到所有其他的萤火虫;
- 吸引力与它们的亮度成正比,对于任何两个萤火虫,不那么明亮的萤火虫被吸引,因此移动到更亮的一个,然而,亮度又随着其距离的增加而减少;
- 如果没有比一个给定的萤火虫更亮的萤火虫,它会随机移动。
亮度应与目标函数联系起来。萤火虫算法是以自然为灵感的启发式优化算法。[2]
萤火虫算法的伪代码可以概括为:
Begin
1)目标函数
2)生成一个萤火虫的初始人口
3)制定光照强度
,因此,它与
(例如,对于最大化问题
或
;
4)定义吸收系数
while(T < MaxGeneration)
for i =1:n(所有n萤火虫)
for j =1:n(n萤火虫)
if(
),
移动萤火虫i向j;
end if
吸引力与距离
;
评估新的解决方案和更新的光强度;
end for j
end for i
排名萤火虫和找到当前最佳;
end while
处理后的结果和可视化;
end
对于任何一两只萤火虫的主要更新公式
and
是
![{\displaystyle \mathbf {x} _{i}^{t+1}=\mathbf {x} _{i}^{t}+\beta \exp[-\gamma r_{ij}^{2}](\mathbf {x} _{j}^{t}-\mathbf {x} _{i}^{t})+\alpha _{t}{\boldsymbol {\epsilon }}_{t}}](//wikimedia.org/api/rest_v1/media/math/render/svg/482bdd9e7eb65f53c300071e26dc0a1c55449792)
其中
是步长参数, e
是一个矢量(服从高斯或其他的分布)。
可以证明在
的情况,FA可以简化为 准粒子群优化(PSO).事实上,,如果内环(j)条被删除,亮度
替换为当前的全球最佳
,FA基本上成为标准PSO。
离散形式的萤火虫算法(Discrete Firefly Algorithm,DFA)[3]
DFA优于现有算法如蚁群算法。
对于图像分割,基于FA-方法比Otsu的方法更为有效.[4]
同时, 离散萤火虫算法对QAP问题,Durkota已进很好的实现行[5]
针对负荷预测中的特征选择问题,应用FA实现Wrapper特征选择算法. [6]
Apostolopoulos and Vlachos对FA进行了一个重要的多目标研究[7]。同时,Yang提出了多目标萤火虫算法(Multiobjective Firefly Algorithm,MOFA),对连续优化问题有很好的效果[8]。
拉格朗日萤火虫算法用来解决电力系统优化单元承诺问题[9]。
混沌萤火虫算法(Chaotic Firefly Algorithm,CFA)也显示了算法的有效性[10]。
萤火虫算法与蚁群优化算法相结合的混合算法,能够解决金融投资组合优化
[11]。
一种基于萤火虫算法(FA)的Memetic算法(FA-MA)被用来优化支持向量机(SVR)预测模型的参数。在该FA-MA中,FA用来搜索全局解空间,而模式搜索(pattern Search) 被用来进行个体学习和局部解空间搜索。[12]
萤火虫算法已被应用到几乎所有领域科学和工程,如数字图像压缩和图像处理[13][14],特征值优化[15],特征提取和故障检测[16][17],天线设计[18][19],工程结构设计[20],
调度和旅行商问题[21][22][23],语义组成[24],化学相平衡[25], 聚类[26],动态问题[27][28],
刚性图像配准问题[29],参数选择[30][12],蛋白质折叠问题[31]等等。
Yang, X. S. (2008). Nature-Inspired Metaheuristic Algorithms. Frome: Luniver Press, UK
存档副本. [2013-05-18]. (原始内容存档于2013-05-21).
T. Hassanzadeh, H. Vojodi and A. M. E. Moghadam, An image segmentation approach based on maximum variance intra-cluster method and firefly algorithm, in: Proc. of 7th Int. Conf. on Natural Computation (ICNC), pp. 1817-1821 (2011).
K. Durkota,
Implementation of a discrete firefly algorithm for the QAP problem within the sage framework, BSc thesis, Czech Technical University, (2011).
存档副本 (PDF). [2013-05-21]. (原始内容 (PDF)存档于2012-04-25).
Hu, Z., Bao, Y., Xiong, T., & Chiong, R. (2015). Hybrid filter–wrapper feature selection for short-term load forecasting. Engineering Applications of Artificial Intelligence, 40, 17-27.
X. S. Yang, Multiobjective firefly algorithm for continuous optimization, Engineering with Computers, vol. 29, No. 2, pp. 175-184 (2013).
Rampriya B., Mahadevan K. and Kannan S., Unit commitment in deregulated power system using Lagrangian firefly algorithm, Proc. of IEEE Int. Conf. on Communication Control and Computing Technologies (ICCCCT), pp. 389-393 (2010).
L. dos Santos Coelho, D. L. de Andrade Bernert, V. C. Mariani, a chaotic firefly algorithm applied to reliability-redundancy optimization, in: 2011 IEEE Congress on Evolutionary Computation (CEC'11), pp. 517-521 (2011).
G. Giannakouris, V. Vassiliadis and G. Dounias, Experimental study on a hybrid nature-inspired algorithm for financial portfolio optimization, SETN 2010, LNAI 6040, pp. 101-111 (2010).
Horng M.-H. and Jiang T. W., The codebook design of image vector quantization based on the firefly algorithm, in: Computational Collective Intelligence, Technologies and Applications, LNCS, Vol. 6423, pp. 438-447 (2010).
M.-H. Horng, vector quantization using the firefly algorithm for image compression, Expert Systems with Applications, Vol. 38, (article in press) 12 Aug. (2011).
H. Banati and M. Bajaj, Firefly based feature selection approach, Int. J. Computer Science Issues, vol. 8, No. 2, 473-480 (2011).
R. Falcon, M. Almeida and A. Nayak, Fault identification with binary adaptive fireflies in parallel and distributed systems, IEEE Congress on Evolutionary Computation, (2011).
B. Basu and G. K. Mahanti, Firefly and artificial bees colony algorithm for synthesis of scanned and broadside linear array antenna, Progress in Electromagnetic Research B., Vol. 32, 169-190 (2011).
A. Chatterjee, G. K. Mahanti, and A. Chatterjee, Design of a fully digital controlled reconfigurable switched beam conconcentric ring array antenna using firefly and particle swarm optimization algorithm, Progress in Elelectromagnetic Research B, Vol. 36, 113-131(2012)
A. H. Gandomi, X. S. Yang, A. H. Alavi, Mixed variable structural optimization using firefly algorithm, Computers and Structures, Vol. 89, No. 23-24, pp. 2325-2336 (2011). doi:10.1016/j.compstruc.2011.08.002
U. Hönig, A firefly algorithm-based approach for scheduling task graphs in homogenous systems, Proceeding Informatics, doi:10.2316/P.2010.724-033, 724 (2010).
A. Khadwilard, S. Chansombat, T. Thepphakorn, P. Thapatsuwan, W. Chainat, P. Pongcharoen, Application of firefly algorithm and its parameter setting for job shop scheduling, First Symposius on
Hands-On Research and Development, (2011).
G. K. Jati and S. Suyanto, Evolutionary discrete firefly algorithm for travelling salesman problem, ICAIS2011, Lecture Notes in Artificial Intelligence (LNAI 6943), pp.393-403 (2011).
C. B. Pop, V. R. Chifu, I. Salomie,R. B. Baico, M. Dinsoreanu, G. Copil, A hybrid firefly-inspired approach for optimal semantic web service composition, in: Proc. of 2nd Workshop on Software Services: Cloud Computing and Applications, June, 2011.
S. E. Fateen, A. Bonilla-Petrociolet, G. P. Rangaiah, Evaluation of covariance matrix adaptation evolution strategy, shuffled complex evolution and firefly algorithms for phase stability, phase equilibrium and chemical equilibrium problems, Chemical Engineering Research and Design, May (2012). http://dx.doi.org/10.1016/j.cherd.2012.04.011
J. Senthilnath, S. N. Omkar and V. Mani, Clustering using firefly algorithm: Performance study, Swarm and Evolutionary Computation, June (2011). doi:10.1016/j.swevo.2011.06.003
S. M. Farahani, B. Nasiri and M. R. Meybodi, A multiswarm based firefly algorithm in dynamic environments, Third Int. Conference on Signal Processing Systems (ICSPS2011), Aug 27-28, Yantai, China, pp. 68-72 (2011)
A. A. Abshouri, M. R. Meybodi and A. Bakhtiary, New firefly algorithm based on multiswarm and learning automata in dynamic environments, Third Int. Conference on Signal Processing Systems (ICSPS2011), Aug 27-28, Yantai, China, pp. 73-77 (2011).
Yudong Zhang and Lenan Wu, A Novel Method for Rigid Image Registration based on Firefly Algorithm, International Journal of Research and Reviews in Soft and Intelligent Computing, vol.2, no.2, pp. 141-146 (2012).