# 蜻蜓算法

蜻蜓算法（Dragonfly algorithm，DA）是一种群体智能元启发式方法（一种寻找足够好解的通用搜索策略），通过模仿蜻蜓的静态与动态集群行为，求解数值优化问题，包括单目标、离散和多目标形式。每个候选解都是一只蜻蜓，在搜索空间中依据五种带权重的社会行为移动：分离、对齐、聚集、趋向食物和远离敌人。该算法连同二元版本（BDA）和多目标版本（MODA）一起发表于《神经计算与应用》（*Neural Computing and Applications*）。<sup>[1](https://doi.org/10.1007/s00521-015-1920-1)</sup>

| 关键事实 | 详情 |
|---|---|
| 提出论文 | 塞耶达利·米尔贾利利，《神经计算与应用》27(4):1053–1073，2016年5月1日发表<sup>[1](https://doi.org/10.1007/s00521-015-1920-1)</sup> |
| 核心更新 | 由五种带权重行为加惯性组合而成的步长向量，然后更新位置<sup>[2](https://link.springer.com/article/10.1186/s40807-018-0050-7)</sup> |
| 典型参数 | 种群30，迭代200次，s = 0.1，a = 0.1，c = 0.7，f = 1，e = 1，惯性0.9 → 0.2<sup>[3](https://arxiv.org/pdf/2002.12126)</sup> |
| 时间复杂度 | \( O(T \cdot N_{p} \cdot N_{p} \cdot D) \)，其中T为最大代数，\( N_{p} \)为种群规模，D为维度<sup>[4](https://www.jstage.jst.go.jp/article/transinf/E102.D/10/E102.D_2018EDP7401/_pdf)</sup> |
| 已命名变体 | BDA、MODA<sup>[1](https://doi.org/10.1007/s00521-015-1920-1)</sup>、LBDA/QBDA/SBDA<sup>[5](https://www.sciencedirect.com/science/article/abs/pii/S0950705120303889)</sup>、CDA<sup>[6](https://link.springer.com/article/10.1007/s10489-018-1261-8)</sup>、MHDA、DADE、QGDA、BMDA、INMDA、HDA<sup>[7](https://www.springerprofessional.de/a-conceptual-comparison-of-dragonfly-algorithm-variants-for-cec-/23086604)</sup>、布朗运动DA<sup>[8](https://mdpi-res.com/d_attachment/sensors/sensors-21-07542/article_deploy/sensors-21-07542.pdf?version=1636785991)</sup>、MDA<sup>[9](https://doi.org/10.1007/s13369-021-05639-y)</sup>、NDSDA<sup>[10](https://ijisae.org/index.php/IJISAE/article/view/5774)</sup> |
| 基准测试表现 | 在小型和中等函数上具有竞争力，但在所比较的算法中速度最慢，且在CEC-2019上被GWO超越<sup>[3](https://arxiv.org/pdf/2002.12126)</sup> |
| 应用 | 特征选择、工程设计、电力与能源系统、医学应用、图像处理<sup>[11](https://link.springer.com/article/10.1007/s11042-020-10255-3)</sup> |

## 工作原理

DA为每个解维护两个向量：步长向量ΔX，其作用等同于粒子群优化中的速度；以及位置向量X。因此，DA中的位置更新主要依赖PSO机制。<sup>[3](https://arxiv.org/pdf/2002.12126)</sup> 步长向量是五个行为分量加惯性的加权和：<sup>[2](https://link.springer.com/article/10.1186/s40807-018-0050-7)</sup>

\[ \Delta X_{i+1} = (s S_{i} + a A_{i} + c C_{i} + f F_{i} + e E_{i}) + w \Delta X_{i} \]

其中s、a、c、f、e分别对分离、对齐、聚集、趋向食物和远离敌人加权，w为惯性因子。新位置为当前位置加上步长：<sup>[2](https://link.springer.com/article/10.1186/s40807-018-0050-7)</sup>

\[ X_{i+1} = X_{i} + \Delta X_{i+1} \]

这五个因子引导群体在探索与开发之间切换。<sup>[8](https://mdpi-res.com/d_attachment/sensors/sensors-21-07542/article_deploy/sensors-21-07542.pdf?version=1636785991)</sup> 静态集群对应探索：蜻蜓在不同区域形成小的子群，由高对齐权重和低聚集权重促成。动态集群——一个大群沿单一方向移动——对应开发，使用高聚集和低对齐。邻域半径随迭代次数成比例增大，以驱动这一转换。<sup>[3](https://arxiv.org/pdf/2002.12126)</sup> 一次迭代中找到的最优解被视为食物源，最差解被视为敌人，因此食物项将蜻蜓拉向有希望的区域，而敌人项将它们推离较差的区域。<sup>[8](https://mdpi-res.com/d_attachment/sensors/sensors-21-07542/article_deploy/sensors-21-07542.pdf?version=1636785991)</sup>

## 实施步骤

实践者按文献报告的设置运行以下循环：种群规模30，最大迭代200次，s = 0.1，a = 0.1，c = 0.7，f = 1，e = 1，惯性因子从0.9递减至0.2，常数1.5。<sup>[3](https://arxiv.org/pdf/2002.12126)</sup>

1. 在问题边界内随机初始化蜻蜓位置和步长向量的种群。
2. 评估每只蜻蜓；将最优解记录为食物源，最差解记录为敌人。<sup>[8](https://mdpi-res.com/d_attachment/sensors/sensors-21-07542/article_deploy/sensors-21-07542.pdf?version=1636785991)</sup>
3. 由邻近蜻蜓计算分离、对齐和聚集分量，由记录的最优和最差解计算食物和敌人分量。<sup>[2](https://link.springer.com/article/10.1186/s40807-018-0050-7)</sup>
4. 用上述加权和更新每个步长向量，然后更新位置。<sup>[2](https://link.springer.com/article/10.1186/s40807-018-0050-7)</sup>
5. 随迭代推进调整邻域半径和权重，从探索转向开发。<sup>[3](https://arxiv.org/pdf/2002.12126)</sup>
6. 在达到迭代上限或其他准则时停止，返回找到的最优解（对于MODA，为一组帕累托最优解）。<sup>[1](https://doi.org/10.1007/s00521-015-1920-1)</sup>

## 起源

提出论文为《蜻蜓算法：一种求解单目标、离散和多目标问题的新型元启发式优化技术》，发表于《神经计算与应用》第27卷第4期第1053–1073页。<sup>[1](https://doi.org/10.1007/s00521-015-1920-1)</sup> 其行为核心建立在克雷格·W·雷诺兹1987年提出的鸟群、兽群和鱼群的分布式行为模型之上。<sup>[12](https://doi.org/10.1145/37402.37406)</sup> DA属于同一作者一系列群体元启发式方法中的一员，与塞耶达利·米尔贾利利、赛义德·穆罕默德·米尔贾利利和安德鲁·刘易斯（2014）提出的灰狼优化器（Grey Wolf Optimizer）并列，后者常被用作基线比较。<sup>[13](https://doi.org/10.1016/j.advengsoft.2013.12.007)</sup>

## 变体

提出论文本身即提出了二元DA（BDA）和多目标DA（MODA），并在数学测试函数和潜艇螺旋桨设计案例上进行了基准测试。<sup>[1](https://doi.org/10.1007/s00521-015-1920-1)</sup> 后续工作产生了大量修改版本：

- **带传递函数的二元DA。** BDA应用传递函数将连续搜索空间映射到离散空间；当\( r < T(\Delta X) \)时位置翻转，否则保持不变，其中r在0到1之间随机取值。后来提出了八种时变S型和V型传递函数，用于配合KNN分类器的封装式特征选择。<sup>[14](https://www.sciencedirect.com/science/article/abs/pii/S095070511830399X)</sup>
- **改进二元DA。** LBDA、QBDA和SBDA用线性、二次和正弦更新函数替代五个系数的随机更新；在18个UCI数据集上，SBDA在18个数据集中的12个上准确率优于九种对比方法。<sup>[5](https://www.sciencedirect.com/science/article/abs/pii/S0950705120303889)</sup>
- **混沌DA（CDA）。** 十种混沌映射在优化过程中调整主要运动参数；发现高斯混沌映射对性能提升最有效。<sup>[6](https://link.springer.com/article/10.1007/s10489-018-1261-8)</sup>
- **改进型DA。** 2019年的一个变体使用布朗运动修改DA。<sup>[8](https://mdpi-res.com/d_attachment/sensors/sensors-21-07542/article_deploy/sensors-21-07542.pdf?version=1636785991)</sup><sup> • </sup><sup>[15](https://onlinelibrary.wiley.com/doi/10.1155/2019/6871298)</sup>
- **变异算子DA。** 罗希特·萨尔戈特拉及其同事于2021年提出了七种变异算子版本；基于变异时钟的DA（MDA）在CEC 2005、CEC 2015和CEC 2011基准上表现优于所有对比算法。<sup>[9](https://doi.org/10.1007/s13369-021-05639-y)</sup>
- **其他混合方法。** DADE、QGDA、BMDA（应用生物地理学优化和墨西哥帽小波，由穆罕默德·礼萨·希拉尼和法拉马兹·萨菲-埃斯法哈尼于2020年提出）、INMDA和HDA已作为一个家族在CEC-2021问题上进行比较。<sup>[7](https://www.springerprofessional.de/a-conceptual-comparison-of-dragonfly-algorithm-variants-for-cec-/23086604)</sup><sup> • </sup><sup>[16](https://doi.org/10.1007/s00500-020-05340-6)</sup>
- **多目标特征选择。** 带进化种群动态的非支配排序DA（NDSDA、NDSDA_EPD、NDSDA_EPD_CM）在18个UCI数据集上的分类准确率优于现有蜻蜓算法，并减少了特征数量。<sup>[10](https://ijisae.org/index.php/IJISAE/article/view/5774)</sup>

## 应用

综述文献将DA的应用归类为工程设计、医学应用、图像处理、电力与能源系统以及经济负荷分配问题。<sup>[11](https://link.springer.com/article/10.1007/s11042-020-10255-3)</sup> [特征选择](https://www.edgepedia.org/zh/feature-selection)是一条突出的应用线，二元和改进二元变体在UCI数据集上进行了评估。<sup>[5](https://www.sciencedirect.com/science/article/abs/pii/S0950705120303889)</sup> 提出论文的MODA在真实[帕累托前沿](https://www.edgepedia.org/zh/pareto-front)未知的潜艇螺旋桨设计问题上，产生了分布高度均匀的帕累托最优解的精确近似。<sup>[1](https://doi.org/10.1007/s00521-015-1920-1)</sup>

## 局限与替代方案

**基准测试表现参差不齐。** 在基准函数TF1–TF23和CEC-C2019上，DA在小型到中型问题上相对于GWO、PSO和GA表现良好，但PSO是所比较算法中最快的，DA最慢。<sup>[3](https://arxiv.org/pdf/2002.12126)</sup> 在CEC-2019（“百位数字挑战”）上，使用1000次迭代、100个代理和30次独立运行，GWO优于其他算法，DA表现不佳。<sup>[3](https://arxiv.org/pdf/2002.12126)</sup> 这些结果与以下观点一致：DA并非在所有情况下都优于PSO等更简单的方法；尚无已发表的直接测试专门针对DA检验“没有免费午餐”的隐喻重组批评，也没有发表正式的收敛性证明。

**失效模式。** 原始DA被描述为计算代价高，探索性能差，聚集与对齐操作不平衡。<sup>[9](https://doi.org/10.1007/s13369-021-05639-y)</sup> 位置更新与前几代的种群质心相关性不佳，导致解精度低和过早收敛到局部最优，尤其是在大规模问题上，收敛时间增加而性能下降。<sup>[3](https://arxiv.org/pdf/2002.12126)</sup> 混沌DA变体稳定性低，因为许多参数和权重进入位置更新，而[布朗运动](https://www.edgepedia.org/zh/brownian-motion)修改的DA仍可能陷入局部最优。<sup>[8](https://mdpi-res.com/d_attachment/sensors/sensors-21-07542/article_deploy/sensors-21-07542.pdf?version=1636785991)</sup> 一份实践者移植笔记指出，共享收敛因子在中点处达到零，此后只有食物项和惯性仍在推动蜻蜓，因此已发表的算法在困难地形上未达最优即停滞。<sup>[17](https://pkg.go.dev/github.com/CWBudde/Dragonfly)</sup>

**运行时间。** 基本差分进化以\( O(T \cdot N_{p} \cdot D) \)时间运行，而DA和混合DA-DE以\( O(T \cdot N_{p} \cdot N_{p} \cdot D) \)运行，其中T为最大代数，\( N_{p} \)为种群规模，D为维度。<sup>[4](https://www.jstage.jst.go.jp/article/transinf/E102.D/10/E102.D_2018EDP7401/_pdf)</sup> 在80个CEC-2021基准问题上的DA变体中，DADE、QGDA、BMDA和经典DA的运行效率最高。<sup>[7](https://www.springerprofessional.de/a-conceptual-comparison-of-dragonfly-algorithm-variants-for-cec-/23086604)</sup>

## References

1. [Seyedali Mirjalili (2015). Dragonfly algorithm: a new meta-heuristic optimization technique for solving single-objective, discrete, and multi-objective problems. Neural Computing and Applications.](https://doi.org/10.1007/s00521-015-1920-1)
2. [Optimal DG placement for benefit maximization in distribution networks by using Dragonfly algorithm](https://link.springer.com/article/10.1186/s40807-018-0050-7)
3. [A Survey on Dragonfly Algorithm and its Applications in Engineering](https://arxiv.org/pdf/2002.12126)
4. [Hybridizing Dragonfly Algorithm with Differential Evolution for Global Optimization](https://www.jstage.jst.go.jp/article/transinf/E102.D/10/E102.D_2018EDP7401/_pdf)
5. [An improved Dragonfly Algorithm for feature selection](https://www.sciencedirect.com/science/article/abs/pii/S0950705120303889)
6. [Chaotic dragonfly algorithm: an improved metaheuristic algorithm for feature selection (Applied Intelligence, Springer)](https://link.springer.com/article/10.1007/s10489-018-1261-8)
7. [A Conceptual Comparison of Dragonfly Algorithm Variants for CEC-2021 Global Optimization Problems](https://www.springerprofessional.de/a-conceptual-comparison-of-dragonfly-algorithm-variants-for-cec-/23086604)
8. [Dragonfly Algorithm and Its Hybrids: A Survey on Performance, Objectives and Applications (MDPI Sensors)](https://mdpi-res.com/d_attachment/sensors/sensors-21-07542/article_deploy/sensors-21-07542.pdf?version=1636785991)
9. [Rohit Salgotra and colleagues (2021). A New Set of Mutation Operators for Dragonfly Algorithm. Arabian Journal for Science and Engineering.](https://doi.org/10.1007/s13369-021-05639-y)
10. [A Novel Non-Dominated Sorting Dragonfly Optimization With Evolutionary Population Dynamics Based Multi-Objective Approach For Feature Selection Problems (IJISAE)](https://ijisae.org/index.php/IJISAE/article/view/5774)
11. [Dragonfly algorithm: a comprehensive survey of its results, variants, and applications (Multimedia Tools and Applications, Springer)](https://link.springer.com/article/10.1007/s11042-020-10255-3)
12. [Craig W. Reynolds (1987). Flocks, herds and schools: A distributed behavioral model. ACM SIGGRAPH Computer Graphics.](https://doi.org/10.1145/37402.37406)
13. [Seyedali Mirjalili and colleagues (2014). Grey Wolf Optimizer. Advances in Engineering Software.](https://doi.org/10.1016/j.advengsoft.2013.12.007)
14. [Binary dragonfly optimization for feature selection using time-varying transfer functions](https://www.sciencedirect.com/science/article/abs/pii/S095070511830399X)
15. [A Modified Dragonfly Optimization Algorithm for Single- and Multiobjective Problems Using Brownian Motion](https://onlinelibrary.wiley.com/doi/10.1155/2019/6871298)
16. [Mohammad Reza Shirani, Faramarz Safi-Esfahani (2020). BMDA: applying biogeography-based optimization algorithm and Mexican hat wavelet to improve dragonfly algorithm. Soft Computing.](https://doi.org/10.1007/s00500-020-05340-6)
17. [github.com/CWBudde/Dragonfly (Go package documentation)](https://pkg.go.dev/github.com/CWBudde/Dragonfly)

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

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Algorithms and computational methods › Optimization and dynamic programming › Swarm intelligence optimizers

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/dragonfly-algorithm

English original: https://www.edgepedia.org/dragonfly-algorithm
