# 灰狼优化器

灰狼优化器（gray wolf optimizer, GWO）是一种群体智能元启发式方法（通用的求解搜索方法，不针对特定问题），它模仿灰狼的领导层级和狩猎行为，用于搜索单目标连续优化问题的最小值。该方法由 S. 米尔贾利利（S. Mirjalili）、S. M. 米尔贾利利（S. M. Mirjalili）和 A. 刘易斯（A. Lewis）于 2014 年在《工程软件进展》（*Advances in Engineering Software*）上提出<sup>[1](https://research-repository.griffith.edu.au/server/api/core/bitstreams/a5b4826e-f238-4257-86b1-bf10fe1d3e1b/content)</sup>，输出的是由一群搜索代理找到的单个最优解；其多目标扩展版本 MOGWO 则返回一组帕累托权衡解<sup>[2](https://www.sciencedirect.com/science/article/abs/pii/S0957417415007435)</sup>。作者发布了 MATLAB 代码和工具箱，并声明该算法是为单目标问题设计的<sup>[3](https://seyedalimirjalili.com/gwo)</sup>。它的吸引力在于简单：一篇系统综述指出它只有两个主要参数 \( a \) 和 \( C \)，因此易于实现<sup>[4](https://link.springer.com/article/10.1007/s10462-026-11585-8)</sup>，官方代码在 MATLAB Central File Exchange 上的下载量已达数万次<sup>[5](https://www.mathworks.com/matlabcentral/fileexchange/44974-grey-wolf-optimizer-gwo)</sup>。

| 关键事实 | 详情 |
|---|---|
| 求解对象 | 单目标连续优化；MOGWO 将其扩展到多目标问题并输出帕累托集<sup>[2](https://www.sciencedirect.com/science/article/abs/pii/S0957417415007435)</sup> |
| 来源 | S. 米尔贾利利、S. M. 米尔贾利利和 A. 刘易斯，《工程软件进展》69:46–61, 2014<sup>[1](https://research-repository.griffith.edu.au/server/api/core/bitstreams/a5b4826e-f238-4257-86b1-bf10fe1d3e1b/content)</sup> |
| 层级结构 | Alpha、beta 和 delta 是三个最优解；所有其他代理（omegas）围绕它们更新<sup>[1](https://research-repository.griffith.edu.au/server/api/core/bitstreams/a5b4826e-f238-4257-86b1-bf10fe1d3e1b/content)</sup> |
| 控制参数 | 仅有 \( a \)（从 2 线性衰减到 0）和 \( C \)，外加种群规模和迭代次数<sup>[4](https://link.springer.com/article/10.1007/s10462-026-11585-8)</sup><sup> • </sup><sup>[6](https://iopscience.iop.org/article/10.1088/1742-6596/2308/1/012002/pdf)</sup> |
| 探索/开发划分 | 在线性衰减下，一半迭代用于探索（\( \lvert A \rvert \ge 1 \)），一半用于开发<sup>[1](https://research-repository.griffith.edu.au/server/api/core/bitstreams/a5b4826e-f238-4257-86b1-bf10fe1d3e1b/content)</sup> |
| 主要弱点 | 在多模态和高维问题上早熟收敛和陷入局部最优<sup>[4](https://link.springer.com/article/10.1007/s10462-026-11585-8)</sup> |
| 独立基准测试 | 在 CEC 2014 函数上仅次于差分进化（D=30 时 Friedman 秩为 2.04 对 1.43）<sup>[7](https://www.maa.reapress.com/journal/article/download/47/35/155)</sup> |

## 工作原理

GWO 按适应度将种群排入社会层级：最适应的解为 alpha，第二和第三优的为 beta 和 delta，其余候选者为 omegas<sup>[1](https://research-repository.griffith.edu.au/server/api/core/bitstreams/a5b4826e-f238-4257-86b1-bf10fe1d3e1b/content)</sup>。狩猎通过保存三个最优解并迫使所有其他代理围绕它们更新位置来模拟，最终位置是三个领导者所定义区域内的一个随机位置<sup>[1](https://research-repository.griffith.edu.au/server/api/core/bitstreams/a5b4826e-f238-4257-86b1-bf10fe1d3e1b/content)</sup>。

包围猎物由两个方程建模<sup>[1](https://research-repository.griffith.edu.au/server/api/core/bitstreams/a5b4826e-f238-4257-86b1-bf10fe1d3e1b/content)</sup>：

\[ \vec{D} = \lvert \vec{C} \cdot \vec{X}_{p}(t) - \vec{X}(t) \rvert, \qquad \vec{X}(t+1) = \vec{X}_{p}(t) - \vec{A} \cdot \vec{D} \]

其中 \( \vec{X}_{p} \) 是猎物位置，\( \vec{X} \) 是一只狼的位置，系数向量为

\[ \vec{A} = 2\vec{a} \cdot \vec{r}_{1} - \vec{a}, \qquad \vec{C} = 2 \cdot \vec{r}_{2} \]

\( \vec{r}_{1} \)、\( \vec{r}_{2} \) 为 [0, 1] 内的随机向量，\( \vec{a} \) 随迭代从 2 线性递减到 0<sup>[1](https://research-repository.griffith.edu.au/server/api/core/bitstreams/a5b4826e-f238-4257-86b1-bf10fe1d3e1b/content)</sup>。后来的文献称 \( A \) 为收敛因子，\( C \) 为摆动因子<sup>[8](https://www.nature.com/articles/s41598-024-64526-2)</sup>。由于 \( \vec{A} \) 在 \( [-2a, 2a] \) 内随机取值，\( \lvert \vec{A} \rvert \geq 1 \) 时迫使狼偏离猎物（探索），\( \lvert \vec{A} \rvert < 1 \) 时向猎物收敛（开发）；\( C \) 从不递减，在整个运行过程中提供随机加权以避免陷入局部最优<sup>[1](https://research-repository.griffith.edu.au/server/api/core/bitstreams/a5b4826e-f238-4257-86b1-bf10fe1d3e1b/content)</sup><sup> • </sup><sup>[4](https://link.springer.com/article/10.1007/s10462-026-11585-8)</sup>。

## 实现方式

官方 MATLAB 实现遵循固定循环<sup>[9](https://github.com/alimirjalili/GWO/blob/master/GWO.m)</sup>：

1. 在搜索空间边界内随机初始化所有代理的位置，并初始化 alpha、beta 和 delta 的位置与得分。
2. 评估每个代理的适应度，若有代理胜过某个领导者，则更新相应的领导者。
3. 设置 \( a = 2 - l \cdot (2/\text{Max\_iter}) \)，随迭代计数器 \( l \) 从 2 线性递减到 0。
4. 对每个 omega，用包围方程从 alpha、beta 和 delta 领导者计算三个候选位置，并取平均：\( \text{Positions}(i,j) = (X_{1} + X_{2} + X_{3})/3 \)。
5. 将越界代理拉回边界，然后从第 2 步重复，直到达到最大迭代次数；alpha 的得分为输出。

使用者只需设置种群数量和迭代次数<sup>[6](https://iopscience.iop.org/article/10.1088/1742-6596/2308/1/012002/pdf)</sup>。一项使用 23 个基准函数的受控 GWO 与 PSO 对比研究发现，增大种群规模（15 到 30）和迭代次数（100 到 500）对大多数函数的收敛有正面影响<sup>[10](https://dergipark.org.tr/en/download/article-file/1267393)</sup>。

## 起源

GWO 论文将其行为模型归功于 C. 穆罗（C. Muro）、R. 埃斯科贝多（R. Escobedo）、L. 斯佩克特（L. Spector）和 R.P. 科普平格（R.P. Coppinger）2011 年的一项模拟研究，其中狼群狩猎策略从简单规则中涌现；所采用的阶段为追踪、追赶和接近猎物；追逐、包围和骚扰直至其停止移动；以及攻击<sup>[1](https://research-repository.griffith.edu.au/server/api/core/bitstreams/a5b4826e-f238-4257-86b1-bf10fe1d3e1b/content)</sup><sup> • </sup><sup>[11](https://doi.org/10.1016/j.beproc.2011.09.006)</sup>。该算法属于粒子群谱系：赛义德阿里·米尔贾利利（Seyedali Mirjalili）于 2014 年 1 月在 MATLAB Central File Exchange 上发布了官方源代码<sup>[5](https://www.mathworks.com/matlabcentral/fileexchange/44974-grey-wolf-optimizer-gwo)</sup>，2016 年赛义德阿里·米尔贾利利和安德鲁·刘易斯（Andrew Lewis）提出了鲸鱼优化算法<sup>[24](https://www.sciencedirect.com/science/article/abs/pii/S0965997816300163)</sup>，一篇批判性分析将其模型描述为 GWO 和飞蛾火焰模型的结合，二者都是 PSO 的变体<sup>[12](https://doi.org/10.1016/j.advengsoft.2016.01.008)</sup>。

这一批评很直接。一篇题为《揭露灰狼、飞蛾火焰、鲸鱼、萤火虫、蝙蝠和蚁狮算法》的论文认为，GWO 的数学模型是 SPSO-2011 的变体：两者都为每个粒子定义一个超三角形并使用其质心作为新位置，区别仅在于使用哪些顶点，而 GWO 的所有组件都对应于先前为 SPSO-2011 及相关粒子群提出的组件的特例<sup>[13](https://doi.org/10.1111/itor.13176)</sup>。同一论文还主张，该隐喻没有贡献任何有效的设计选择，此类算法的动机建立在对无免费午餐定理的错误理解之上。

## 变体

已命名的变体改变了基础算法的不同部分：

- **MOGWO** 增加了非支配解档案、网格机制和从档案中选择 alpha、beta 和 delta 狼的领导者选择方案，产生帕累托集<sup>[2](https://www.sciencedirect.com/science/article/abs/pii/S0957417415007435)</sup>。
- **mGWO** 用指数衰减替代 \( a \) 的线性衰减，将 70% 的迭代分配给探索、30% 分配给开发，而非 50/50<sup>[14](https://onlinelibrary.wiley.com/doi/10.1155/2016/7950348)</sup>。
- **I-GWO** 引入基于维度学习的狩猎（DLH）策略以改善探索-开发平衡和种群多样性<sup>[15](https://www.sciencedirect.com/science/article/abs/pii/S0957417420307107)</sup>。
- **二元 GWO**（Emary、Zawbaa 和 Hassanien，2015）将更新适配于二元特征选择搜索<sup>[16](https://doi.org/10.1016/j.neucom.2015.06.083)</sup>；改进的二元版本通过 S 形和 V 形传递函数将 GWO 与 PSO 结合<sup>[17](https://www.mdpi.com/2076-3417/15/2/489)</sup>。
- **RGWO** 放弃狩猎过程中猎物静止的假设，使用概率分布（Levy、Cauchy、Gamma、Gauss、Weibull）建模动态猎物位置<sup>[18](https://journals.riverpublishers.com/index.php/DGAEJ/article/download/15247/12283/46973)</sup>。
- **IGWO**（Wang 和 Li，2019）加入差分进化和适者生存淘汰机制<sup>[19](https://doi.org/10.1038/s41598-019-43546-3)</sup>。
- **GWO-EPD** 将 GWO 与进化种群动力学结合<sup>[20](https://doi.org/10.1007/s00521-014-1806-7)</sup>。

2024 年的一篇综述列出了更多变体，包括 AGWO、EN-GWO、DE-GWO、I-GWO 和 GWO-CS<sup>[21](https://link.springer.com/article/10.1007/s10462-024-10821-3)</sup>。

## 应用

原始论文将 GWO 应用于三个经典工程设计问题——拉伸/压缩弹簧、焊接梁和压力容器——外加一个光学工程问题<sup>[1](https://research-repository.griffith.edu.au/server/api/core/bitstreams/a5b4826e-f238-4257-86b1-bf10fe1d3e1b/content)</sup>。多篇综述列出了在电力系统、调度、[特征选择](https://www.edgepedia.org/zh/feature-selection)和图像分割中的应用<sup>[22](https://dergipark.org.tr/en/pub/gujs/article/820885)</sup>。特征选择是文献最多的领域：二元 GWO 就是为此设计的<sup>[16](https://doi.org/10.1016/j.neucom.2015.06.083)</sup>，改进的二元版本在九个高维癌症基因表达数据集上达到最高 0.95 的平均分类准确率，同时选择的特征最少<sup>[17](https://www.mdpi.com/2076-3417/15/2/489)</sup>。I-GWO 在压力容器设计、焊接梁设计以及 IEEE 30 节点和 118 节点系统的最优潮流上进行了评估<sup>[15](https://www.sciencedirect.com/science/article/abs/pii/S0957417420307107)</sup>。

## 局限与替代方案

2014 年的论文在 29 个测试函数上将 GWO 与 PSO、GSA、DE、EP 和 ES 进行了基准对比。GWO 在单模态函数 F1、F2 和 F7 上优于所有其他算法，作者将其归因于其开发算子，并在六个 CEC 2005 复合函数中的一半上优于所有其他算法，在其余函数上保持竞争力<sup>[1](https://research-repository.griffith.edu.au/server/api/core/bitstreams/a5b4826e-f238-4257-86b1-bf10fe1d3e1b/content)</sup>。这些作者也承认，使用基础算子时 GWO“容易停滞在局部解中”<sup>[1](https://research-repository.griffith.edu.au/server/api/core/bitstreams/a5b4826e-f238-4257-86b1-bf10fe1d3e1b/content)</sup>，这一缺陷也在一项专门的验证研究中被记录<sup>[23](https://doi.org/10.1016/j.knosys.2019.01.018)</sup>。

独立比较对原始结果有所修正。在一项 CEC 2014 研究（23 个函数，维度 10 到 100，51 次运行，500,000 次函数评估）中，差分进化取得了最佳平均 Friedman 秩（D=30 时为 1.43），GWO 第二（2.04）；GWO 的秩从 D=10 时的 1.87 退化到 D=100 时的 2.57，表明三领导者包围机制随着搜索空间增大而效果下降<sup>[7](https://www.maa.reapress.com/journal/article/download/47/35/155)</sup>。

反复出现的弱点在各来源中一致：早熟收敛和探索-开发平衡不佳，种群多样性在复杂、多模态或高维问题上迅速下降，后期偏向开发加剧局部最优停滞<sup>[4](https://link.springer.com/article/10.1007/s10462-026-11585-8)</sup>。三领导者平均法将 omega 的新位置计算为从领导者的系数和距离向量导出的三个候选位置的平均值，当领导者陷入局部极小值时该方法失效<sup>[8](https://www.nature.com/articles/s41598-024-64526-2)</sup>，而 \( a \) 的线性衰减被批评为不反映非线性搜索过程<sup>[8](https://www.nature.com/articles/s41598-024-64526-2)</sup><sup> • </sup><sup>[25](https://www.nature.com/articles/s41598-024-57262-0)</sup>。2024 年的一篇综述指出，现有变体在大规模 CEC 2022 和 CEC 2013 问题上没有突破<sup>[21](https://link.springer.com/article/10.1007/s10462-024-10821-3)</sup>。狼的隐喻是否在改头换面的粒子群之外增添了任何东西仍有争议：上述批评说没有，而该算法的简单性、免费代码和在某些问题类别上的竞争性结果解释了它的持续使用。

## References

1. [Grey Wolf Optimizer (Mirjalili, Mirjalili & Lewis, Advances in Engineering Software 69 (2014) 46–61), accepted manuscript](https://research-repository.griffith.edu.au/server/api/core/bitstreams/a5b4826e-f238-4257-86b1-bf10fe1d3e1b/content)
2. [Multi-objective grey wolf optimizer: A novel algorithm for multi-criterion optimization (Expert Systems with Applications)](https://www.sciencedirect.com/science/article/abs/pii/S0957417415007435)
3. [GWO, author's official page (Seyedali Mirjalili)](https://seyedalimirjalili.com/gwo)
4. [Grey wolf optimizer and whale optimization algorithm: a systematic review (Artificial Intelligence Review)](https://link.springer.com/article/10.1007/s10462-026-11585-8)
5. [Grey Wolf Optimizer (GWO), MATLAB Central File Exchange (official source code by Seyedali Mirjalili)](https://www.mathworks.com/matlabcentral/fileexchange/44974-grey-wolf-optimizer-gwo)
6. [Comparative analysis of optimization strategies by software complex 'Metaheuristic nature-inspired methods of global optimization' (Journal of Physics: Conference Series)](https://iopscience.iop.org/article/10.1088/1742-6596/2308/1/012002/pdf)
7. [Metaheuristic Algorithms with Applications (independent comparison study)](https://www.maa.reapress.com/journal/article/download/47/35/155)
8. [An improved gray wolf optimization algorithm solving to functional optimization and engineering design problems (Scientific Reports, 2024)](https://www.nature.com/articles/s41598-024-64526-2)
9. [GWO.m, official MATLAB source code (alimirjalili/GWO)](https://github.com/alimirjalili/GWO/blob/master/GWO.m)
10. [Solution of Test Problems with Grey Wolf Optimization Algorithm and Comparison with Particle Swarm Optimization (Köybaşı & Yazıcı, 2020)](https://dergipark.org.tr/en/download/article-file/1267393)
11. [C. Muro and colleagues (2011). Wolf-pack (Canis lupus) hunting strategies emerge from simple rules in computational simulations. Behavioural Processes.](https://doi.org/10.1016/j.beproc.2011.09.006)
12. [Seyedali Mirjalili, Andrew Lewis (2016). The Whale Optimization Algorithm. Advances in Engineering Software.](https://doi.org/10.1016/j.advengsoft.2016.01.008)
13. [Exposing the grey wolf, moth-flame, whale, firefly, bat, and antlion algorithms: six misleading optimization techniques inspired by bestial metaphors](https://doi.org/10.1111/itor.13176)
14. [Modified Grey Wolf Optimizer for Global Engineering Optimization (Mittal, Singh & Sohi, 2016)](https://onlinelibrary.wiley.com/doi/10.1155/2016/7950348)
15. [An improved grey wolf optimizer for solving engineering problems (I-GWO, Expert Systems with Applications)](https://www.sciencedirect.com/science/article/abs/pii/S0957417420307107)
16. [E. Emary, Hossam M. Zawbaa, Aboul Ella Hassanien (2015). Binary grey wolf optimization approaches for feature selection. Neurocomputing.](https://doi.org/10.1016/j.neucom.2015.06.083)
17. [Improved Binary Grey Wolf Optimization Approaches for Feature Selection Optimization (MDPI Applied Sciences, 2025)](https://www.mdpi.com/2076-3417/15/2/489)
18. [Realistic Grey Wolf Optimizer (RGWO)](https://journals.riverpublishers.com/index.php/DGAEJ/article/download/15247/12283/46973)
19. [Jie-Sheng Wang, Shu-Xia Li (2019). An Improved Grey Wolf Optimizer Based on Differential Evolution and Elimination Mechanism. Scientific Reports.](https://doi.org/10.1038/s41598-019-43546-3)
20. [Shahrzad Saremi, Seyedeh Zahra Mirjalili, Seyed Mohammad Mirjalili (2014). Evolutionary population dynamics and grey wolf optimizer. Neural Computing and Applications.](https://doi.org/10.1007/s00521-014-1806-7)
21. [Improved multi-strategy adaptive Grey Wolf Optimization for practical engineering applications and high-dimensional problem solving (Artificial Intelligence Review)](https://link.springer.com/article/10.1007/s10462-024-10821-3)
22. [Application of Grey Wolf Optimization Algorithm: Recent Trends, Issues, and Possible Horizons (Gazi University Journal of Science)](https://dergipark.org.tr/en/pub/gujs/article/820885)
23. [Peifeng Niu and colleagues (2019). The defect of the Grey Wolf optimization algorithm and its verification method. Knowledge-Based Systems.](https://doi.org/10.1016/j.knosys.2019.01.018)
24. [S0965997816300163 (sciencedirect.com)](https://www.sciencedirect.com/science/article/abs/pii/S0965997816300163)
25. [A grey wolf optimization-based modified SPWM control scheme for a three-phase half bridge cascaded multilevel inverter, Scientific Reports](https://www.nature.com/articles/s41598-024-57262-0)

---
*Initially written Sep 29, 2026 · Reviewed: Sep 30, 2026 · Edited: Sep 30, 2026 · Last review: Sep 30, 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/gray-wolf-optimizer

English original: https://www.edgepedia.org/gray-wolf-optimizer
