# 蜉蝣优化算法

蜉蝣优化算法（mayfly optimization algorithm，MA）是一种基于群体的元启发式方法（用于寻找优质解的通用搜索方法），通过模拟蜉蝣的飞行与交配行为来搜索连续目标函数的最优解，将基于速度的群体搜索与遗传交叉算子相结合。<sup>[1](https://doi.org/10.1016/j.cie.2020.106559)</sup> 该算法针对单目标优化问题设计，后世文献将其描述为粒子群优化（PSO）的一种改进，同时借鉴了遗传算法和群体智能方法。<sup>[2](https://www.cys.cic.ipn.mx/ojs/index.php/CyS/article/viewFile/5709/3946)</sup>

| 关键事实 | 详情 |
| --- | --- |
| 提出时间 | 2020年，由Konstantinos Zervoudakis和Stelios Tsafarakis在《Computers & Industrial Engineering》上提出<sup>[1](https://doi.org/10.1016/j.cie.2020.106559)</sup> |
| 灵感来源 | 蜉蝣的飞行行为与交配过程，包括婚飞舞蹈和随机飞行<sup>[1](https://doi.org/10.1016/j.cie.2020.106559)</sup> |
| 问题类别 | 单目标优化；多目标使用需要扩展<sup>[3](https://doi.org/10.3390/math11204384)</sup> |
| 原始评估 | 38个基准函数，包括13个CEC2017测试函数，与七种元启发式算法对比<sup>[1](https://doi.org/10.1016/j.cie.2020.106559)</sup> |
| 已知弱点 | 速度波动导致稳定性低、高维多峰性能差、初始参数多<sup>[4](https://www.extrica.com/article/23909)</sup> |
| 典型种群设置 | 一项已发表的比较研究中使用了50只蜉蝣，并采用阻尼舞蹈系数和飞行系数<sup>[5](https://doi.org/10.1371/journal.pone.0273155)</sup> |

## 工作原理

该算法维护独立的雄性和雌性种群。雄性执行类似PSO的搜索：每个非最优雄性的速度按以下公式更新：

\[ v_{i}^{t+1} = v_{i}^{t} + a_{1} \cdot e^{-\beta r_{p}^{2}} \cdot (\mathrm{pbest}_{i} - x_{i}^{t}) + a_{2} \cdot e^{-\beta r_{g}^{2}} \cdot (\mathrm{gbest}_{i} - x_{i}^{t}) \]

其中 \( a_{1} \) 和 \( a_{2} \) 为吸引常数，\( \beta \) 为可见度系数，\( r_{p} \) 和 \( r_{g} \) 分别为到个体最优位置和全局最优位置的距离。<sup>[3](https://doi.org/10.3390/math11204384)</sup> 最优雄性则执行婚飞舞蹈，其速度更新为 \( v_{i}^{t+1} = v_{i}^{t} + d \cdot r \)，其中 \( d \) 为婚飞舞蹈系数，\( r \) 从 \( [-1, 1] \) 中均匀抽取。<sup>[3](https://doi.org/10.3390/math11204384)</sup>

雌性被最优雄性吸引：当雌性的适应度劣于其配偶时，其速度更新为 \( v_{i}^{t+1} = v_{i}^{t} + a_{2} \cdot e^{-\beta r_{m}^{2}} \cdot (x_{i}^{t} - y_{i}^{t}) \)；否则她执行随机飞行 \( v_{i}^{t+1} = v_{i}^{t} + \mathrm{lfl} \cdot r \)，其中 \( r \) 从 \( [-1, 1] \) 中均匀抽取，\( \mathrm{lfl} \) 为随机游走系数。<sup>[3](https://doi.org/10.3390/math11204384)</sup> 婚飞舞蹈——对最优雄性的阻尼随机扰动——和随机飞行被认为是平衡探索与开发、帮助逃离局部最优的两个算子。<sup>[1](https://doi.org/10.1016/j.cie.2020.106559)</sup>

交配的工作方式类似于遗传交叉。最优雄性与最优雌性配对，每对通过以下公式产生两个后代：

\[ \mathrm{off}_{1} = a_{3} \cdot P_{1} + (1 - a_{3}) \cdot P_{2}, \qquad \mathrm{off}_{2} = (1 - a_{3}) \cdot P_{1} + a_{3} \cdot P_{2} \]

其中 \( a_{3} \) 为高斯分布随机数，\( P_{1} \)、\( P_{2} \) 为父代。<sup>[3](https://doi.org/10.3390/math11204384)</sup> 后代随后发生变异，一篇后来的混合算法论文将变异与交配并列为该算法的定义性算子。<sup>[6](https://doi.org/10.3390/biomimetics8040381)</sup>

## 执行步骤

作者记录的主循环运行如下：<sup>[7](https://sites.google.com/view/kzervoudakis/research/metaheuristics/mayfly-algorithm)</sup>

1. 初始化雄性蜉蝣种群 \( x_{i} \) 和雌性蜉蝣种群 \( y_{i} \) 及其速度。
2. 评估所有解并找到全局最优。
3. 使用上述公式更新雄性和雌性的速度与位置，最优雄性使用婚飞舞蹈更新。
4. 按适应度对蜉蝣排序。
5. 将最优雄性与最优雌性交配并评估后代。
6. 将后代随机分为雄性和雌性。
7. 用后代替换最差的解。
8. 更新个体最优和全局最优，重复直到评估预算耗尽。

参考实现在函数评估预算内对可见度系数 \( g \) 进行线性退火，\( g = g_{max} - ((g_{max} - g_{min}) / MaxFuncEvals) \cdot funcevals \)，并通过阻尼因子在每次评估时衰减舞蹈系数和随机飞行系数（\( \mathrm{fl} \)），后者不同于雌性吸引项中的吸引常数。<sup>[8](https://github.com/KZervoudakis/Mayfly-Optimization-Algorithm-Python/blob/main/ma.py)</sup> 一项已发表的比较研究使用了50个个体的种群，婚飞舞蹈系数 \( d = 5 \) 及衰减率 \( \delta_{1} = 0.8 \)，随机飞行系数 \( \mathrm{fl} = 1 \) 及衰减率 \( \delta_{2} = 0.99 \)。<sup>[5](https://doi.org/10.1371/journal.pone.0273155)</sup>

## 起源

蜉蝣优化算法由Konstantinos Zervoudakis和Stelios Tsafarakis在论文《一种蜉蝣优化算法》中提出，发表于2020年的《Computers & Industrial Engineering》。<sup>[1](https://doi.org/10.1016/j.cie.2020.106559)</sup> 作者指出该方法结合了群体智能和进化算法的主要优势，后来的同行评审文献将其描述为粒子群算法的改进，兼具PSO、遗传算法和萤火虫算法的优势，以雄性运动、雌性运动和雌雄交叉为核心步骤。<sup>[3](https://doi.org/10.3390/math11204384)</sup> 一篇2025年的引用文章同样将MA描述为PSO的改进，利用遗传交叉和局部搜索来提升PSO在复杂多维场景中的性能。<sup>[2](https://www.cys.cic.ipn.mx/ojs/index.php/CyS/article/viewFile/5709/3946)</sup>

## 变体

若干命名变体对原始算子进行了修改：

- **DESMA**（动态精英策略蜉蝣算法），由Qianhang Du和Honghao Zhu（2022年）提出，在蜉蝣框架中加入了精英策略。<sup>[5](https://doi.org/10.1371/journal.pone.0273155)</sup>
- **modMA** 加入了指数递减惯性权重、自适应柯西变异技术和增强交叉算子策略。<sup>[4](https://www.extrica.com/article/23909)</sup>
- **BBMA**（骨架蜉蝣算法）完全取消了速度项，从高斯分布中采样位置，并用Lévy飞行替代婚飞舞蹈和随机飞行，减少了参数影响。<sup>[4](https://www.extrica.com/article/23909)</sup>
- **MA-GWO** 将Lévy飞行和灰狼优化器的狩猎机制引入MA，以解决收敛精度低、稳定性差和陷入局部最优的问题。<sup>[9](https://www.springerprofessional.de/an-improved-hybrid-mayfly-algorithm-for-global-optimization/23648716)</sup>
- 一种**二进制蜉蝣优化**变体将位置更新、交配和变异适配于离散搜索空间。<sup>[10](https://xuebao.jlu.edu.cn/lxb/EN/Y2023/V61/I3/631)</sup>
- **AOBLMOA**（Zhao、Huang、Zhang和Cui，2023年）是一种混合仿生算法，融合了蜉蝣算法用于数值优化和工程设计。<sup>[6](https://doi.org/10.3390/biomimetics8040381)</sup>
- 精英协同进化蜉蝣算法（ECMA）将雄性分为精英成员和普通成员，基于婚姻市场理论改进雌性位置更新，引入自适应重力系数，并加入Lévy飞行跳出策略。<sup>[11](https://www.zjujournals.com/eng/EN/10.3785/j.issn.1008-973X.2024.07.004)</sup>

## 应用

原始论文在38个数学基准函数上评估了MA，包括13个CEC2017测试函数，与七种最先进的元启发式算法对比，报告了在收敛率和收敛速度方面的优越性，并在一个实际离散流水车间调度问题上进行了测试。<sup>[1](https://doi.org/10.1016/j.cie.2020.106559)</sup>

DESMA研究在28个基础测试函数上将其变体与基本MA、HHO、ISOS、EFWA、GBO、GWO和SMA进行比较，每个函数独立运行51次，记录平均误差和平均执行时间。DESMA取得了9个最优和16个次优结果，按平均排名位列第一，而原始MA在6个函数上表现更好。<sup>[5](https://doi.org/10.1371/journal.pone.0273155)</sup> MA-GWO在19个经典基准函数、CEC-C06 2019测试函数和5个工程设计问题上进行了验证，据报道远优于其他元启发式算法，尤其是在高维问题上。<sup>[9](https://www.springerprofessional.de/an-improved-hybrid-mayfly-algorithm-for-global-optimization/23648716)</sup>

应用包括在UCI钞票认证和冷冻疗法数据集上的神经网络结构分类，基于蜉蝣的方法与GWO-NN和PSO-NN相比，训练效果约好1–2%，测试效果约好2%，<sup>[4](https://www.extrica.com/article/23909)</sup> 以及基于气候数据预测北半球大西洋和太平洋的海平面上升。<sup>[4](https://www.extrica.com/article/23909)</sup> 一种二进制蜉蝣变体结合逆文档频率特征选择和K-means++聚类，在多个数据集上缩短了特征维度并提高了文本聚类效率。<sup>[10](https://xuebao.jlu.edu.cn/lxb/EN/Y2023/V61/I3/631)</sup>

## 局限与替代方案

同行评审评估指出了具体的失效模式。标准MA在低维问题上收敛速度优于其他群体算法，但由于速度波动，其稳定性较低，导致结果不佳。<sup>[4](https://www.extrica.com/article/23909)</sup> 在高维非线性场景的多峰函数上表现不佳，因为它无法仅依靠自身机制逃离局部最优。<sup>[4](https://www.extrica.com/article/23909)</sup> 基本MA还包含许多对结果影响很大的初始参数，其开发能力不足以实现高精度。<sup>[4](https://www.extrica.com/article/23909)</sup> 一篇多目标扩展论文补充说，原始算法是为单目标问题设计的，全局开发能力较差。<sup>[3](https://doi.org/10.3390/math11204384)</sup> 这与原始论文声称婚飞舞蹈和随机飞行有助于逃离局部最优的说法形成对比；这一分歧在文献中尚未解决。<sup>[1](https://doi.org/10.1016/j.cie.2020.106559)</sup>

关于新颖性，一篇被广泛引用的对隐喻驱动元启发式算法的批评针对灰狼、飞蛾扑火、鲸鱼、萤火虫、蝙蝠和蚁狮算法指出，“它们没有一个提出了任何新想法”，因为它们在新隐喻下复用了PSO或进化策略的组件。<sup>[12](https://iridia.ulb.ac.be/~ccamacho/publications/ITOR-Exposing.pdf)</sup> 该论文并未点名蜉蝣算法，但同样的论点直接适用，因为MA的速度更新类似PSO，其交叉是遗传的。<sup>[12](https://iridia.ulb.ac.be/~ccamacho/publications/ITOR-Exposing.pdf)</sup><sup> • </sup><sup>[3](https://doi.org/10.3390/math11204384)</sup> 与替代方案相比，DESMA数据显示GWO是最快的方法之一，而MA在运行时间上排名居中，<sup>[5](https://doi.org/10.1371/journal.pone.0273155)</sup> 综述的评估主要在低维收敛速度上支持MA。<sup>[4](https://www.extrica.com/article/23909)</sup>

## References

1. [Konstantinos Zervoudakis, Stelios Tsafarakis (2020). A mayfly optimization algorithm. Computers & Industrial Engineering.](https://doi.org/10.1016/j.cie.2020.106559)
2. [Computación y Sistemas, Vol. 29, No. 2, 2025 (citing literature)](https://www.cys.cic.ipn.mx/ojs/index.php/CyS/article/viewFile/5709/3946)
3. [Ke Yang, Dazhi Pan (2023). An Improved Mayfly Optimization Algorithm for Type-2 Multi-Objective Integrated Process Planning and Scheduling. Mathematics.](https://doi.org/10.3390/math11204384)
4. [Mayfly optimization algorithm: a review (Extrica)](https://www.extrica.com/article/23909)
5. [Qianhang Du, Honghao Zhu (2022). Dynamic elite strategy mayfly algorithm. PLoS ONE.](https://doi.org/10.1371/journal.pone.0273155)
6. [Yanpu Zhao and colleagues (2023). AOBLMOA: A Hybrid Biomimetic Optimization Algorithm for Numerical Optimization and Engineering Design Problems. Biomimetics.](https://doi.org/10.3390/biomimetics8040381)
7. [Dr. Konstantinos Zervoudakis - Mayfly Algorithm](https://sites.google.com/view/kzervoudakis/research/metaheuristics/mayfly-algorithm)
8. [ma.py (official Python implementation)](https://github.com/KZervoudakis/Mayfly-Optimization-Algorithm-Python/blob/main/ma.py)
9. [An improved hybrid mayfly algorithm for global optimization (MA-GWO)](https://www.springerprofessional.de/an-improved-hybrid-mayfly-algorithm-for-global-optimization/23648716)
10. [Feature Selection and Text Clustering Algorithm Based on Binary Mayfly Optimization](https://xuebao.jlu.edu.cn/lxb/EN/Y2023/V61/I3/631)
11. [Elite coevolutionary mayfly algorithm](https://www.zjujournals.com/eng/EN/10.3785/j.issn.1008-973X.2024.07.004)
12. [Exposing the grey wolf, moth-flame, whale, firefly, bat, and antlion algorithms: six misleading optimization techniques inspired by bestial metaphors](https://iridia.ulb.ac.be/~ccamacho/publications/ITOR-Exposing.pdf)

---
*Initially written Sep 29, 2026 · Edited: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/mayfly-optimization-algorithm

English original: https://www.edgepedia.org/mayfly-optimization-algorithm
