# 蜜獾算法

蜜獾算法（HBA）是一种受自然启发的元启发式算法，模拟蜜獾的觅食行为来搜索数值优化问题的最优解，返回一次运行中找到的最佳解位置及其目标值。它属于基于群体、隐喻驱动的算法家族，其构建方式使两种觅食行为——挖掘和寻蜜——分别映射到探索和开发阶段。

| 关键事实 | 详情 |
|---|---|
| 提出者 | 法特玛·A·哈希姆及其同事，《数学与计算机模拟》，2021/2022 <sup>[1](https://doi.org/10.1016/j.matcom.2021.08.013)</sup> |
| 问题类别 | 连续数值（全局）优化；存在二进制和多目标变体 <sup>[2](https://dergipark.org.tr/tr/pub/ogummf/article/1477088)</sup> |
| 核心参数 | \( \beta = 6 \)（获取食物的能力）和 \( C = 2 \)（密度常数），来自敏感性分析 <sup>[3](https://www.nature.com/articles/s41598-023-43622-9)</sup> |
| 密度因子 | \( \alpha = C \times \exp(-t/t_{\max}) \)，在运行过程中从 \( C \) 递减趋向 0 <sup>[4](https://ideas.repec.org/a/eee/matcom/v192y2022icp84-110.html)</sup> |
| 原始评估 | 24 个基准函数、CEC'17 测试集和四个工程设计问题，与十种算法对比 <sup>[4](https://ideas.repec.org/a/eee/matcom/v192y2022icp84-110.html)</sup> |
| 官方代码 | MATLAB Central File Exchange 上的公开 MATLAB 实现 <sup>[5](https://www.mathworks.com/matlabcentral/fileexchange/98204-honey-badger-algorithm)</sup> |
| 已知弱点 | 过早收敛、陷入局部最优、后期搜索缓慢 <sup>[6](https://www.mdpi.com/2313-7673/10/2/92)</sup> |

## 工作原理

HBA 维护一个由 \( N \) 个候选解组成的种群，每个候选解称为一只蜜獾，并反复将它们移向目前找到的最佳位置，即猎物位置 \( x_{\text{prey}} \)。该隐喻区分了两种觅食模式：挖掘猎物，建模探索；跟随蜜导鸟前往蜂巢，建模开发。<sup>[4](https://ideas.repec.org/a/eee/matcom/v192y2022icp84-110.html)</sup>

三个控制量塑造了搜索过程。<sup>[4](https://ideas.repec.org/a/eee/matcom/v192y2022icp84-110.html)</sup> 强度 \( I \) 由猎物位置的源强度 \( S \) 和猎物与第 \( i \) 只蜜獾之间的距离 \( d_{i} \) 计算得出。<sup>[4](https://ideas.repec.org/a/eee/matcom/v192y2022icp84-110.html)</sup> 密度因子 \( \alpha = C \times \exp(-t/t_{\max}) \) 随迭代次数 \( t \) 递减，随时间减少随机性并平滑从探索到开发的过渡；\( C \) 是不小于 1 的常数，默认为 2。<sup>[4](https://ideas.repec.org/a/eee/matcom/v192y2022icp84-110.html)</sup><sup> • </sup><sup>[3](https://www.nature.com/articles/s41598-023-43622-9)</sup> 标志位 \( F \) 在随机数 \( r_{6} \leq 0.5 \) 时设为 1，否则设为 \( -1 \)，翻转搜索方向以帮助逃离局部最优。<sup>[4](https://ideas.repec.org/a/eee/matcom/v192y2022icp84-110.html)</sup>

在挖掘阶段，位置更新遵循类心形运动：

\[ x_{\text{new}} = x_{\text{prey}} + F \times \beta \times I \times x_{\text{prey}} + F \times r_{3} \times \alpha \times d_{i} \times \left| \cos(2\pi r_{4}) \times \left[ 1 - \cos(2\pi r_{5}) \right] \right| \]

其中 \( \beta \geq 1 \)（默认 6）是蜜獾获取食物的能力，\( r_{3}, r_{4}, r_{5} \) 是 0 到 1 之间的随机数。<sup>[4](https://ideas.repec.org/a/eee/matcom/v192y2022icp84-110.html)</sup><sup> • </sup><sup>[3](https://www.nature.com/articles/s41598-023-43622-9)</sup> 在寻蜜阶段，更新是更简单的引导移动：

\[ x_{\text{new}} = x_{\text{prey}} + F \times r_{7} \times \alpha \times d_{i} \]

其中 \( r_{7} \) 是 0 到 1 之间的随机数。<sup>[4](https://ideas.repec.org/a/eee/matcom/v192y2022icp84-110.html)</sup>

## 实现步骤

实践者运行以下循环 <sup>[4](https://ideas.repec.org/a/eee/matcom/v192y2022icp84-110.html)</sup><sup> • </sup><sup>[3](https://www.nature.com/articles/s41598-023-43622-9)</sup>：

1. 在边界之间均匀初始化 \( N \) 个蜜獾位置，\( x_{i} = lb_{i} + r_{1} \times (ub_{i} - lb_{i}) \)，其中 \( r_{1} \) 是 \( [0,1] \) 中的随机数。
2. 评估每个位置并将 \( x_{\text{prey}} \) 设为最佳位置。
3. 在每次迭代 \( t \) 中，计算 \( \alpha = C \times \exp(-t/t_{\max}) \)、强度 \( I \) 和标志位 \( F \)。
4. 对每只蜜獾，应用挖掘方程或寻蜜方程，并评估新位置。
5. 更新 \( x_{\text{prey}} \) 并重复，直到达到 \( t_{\max} \) 次迭代或其他停止准则。

两个用户定义参数 \( \beta \) 和 \( C \) 强烈影响性能；首次提出该算法的论文在 CEC 复合函数 2 上的敏感性分析发现 \( \beta = 6 \) 和 \( C = 2 \) 时适应度最佳，后续应用采用这些值。<sup>[4](https://ideas.repec.org/a/eee/matcom/v192y2022icp84-110.html)</sup><sup> • </sup><sup>[3](https://www.nature.com/articles/s41598-023-43622-9)</sup> 作者的官方 MATLAB 实现已公开。<sup>[5](https://www.mathworks.com/matlabcentral/fileexchange/98204-honey-badger-algorithm)</sup>

## 起源

HBA 由法特玛·A·哈希姆及其同事在《蜜獾算法：求解优化问题的新型元启发式算法》中报道，发表于《数学与计算机模拟》2021 年，期刊第 192 卷，第 84 至 110 页，于 2022 年出版。<sup>[1](https://doi.org/10.1016/j.matcom.2021.08.013)</sup><sup> • </sup><sup>[4](https://ideas.repec.org/a/eee/matcom/v192y2022icp84-110.html)</sup><sup> • </sup><sup>[7](https://portal.mardi4nfdi.de/wiki/Publication:2666510)</sup> 该论文在 24 个标准基准函数、CEC'17 测试集和四个工程设计问题上评估了该算法，将其与十种知名元启发式算法进行比较，包括模拟退火、粒子群优化、协方差矩阵自适应进化策略、L-SHADE、飞蛾扑火优化、象群优化、鲸鱼优化算法、蝗虫优化算法、热交换优化和哈里斯鹰优化，并报告了相对于这些方法在收敛速度和探索-开发平衡方面的优越性。<sup>[4](https://ideas.repec.org/a/eee/matcom/v192y2022icp84-110.html)</sup>

## 变体

一项综述性元分析统计了 52 项提出改进 HBA 的研究、20 项混合 HBA 研究和 101 项原始算法的应用。<sup>[8](https://doi.org/10.1016/j.fraope.2024.100141)</sup> 命名的变体修改了不同阶段：

- **GOHBA** 用帐篷混沌映射替代初始化，替换密度因子，并加入黄金正弦策略；在 23 个测试函数中的 14 个以及两个实际工程设计问题上取得了最优平均值。<sup>[6](https://www.mdpi.com/2313-7673/10/2/92)</sup>
- **MSHBA** 加入立方混沌映射初始化、随机搜索策略、精英切向搜索和差分变异；在 29 个 IEEE CEC 2017 基准函数中的 26 个上表现优异，并应用于四个工程设计问题。<sup>[9](https://www.mdpi.com/2313-7673/10/9/581)</sup>
- **IMOHBA** 将 HBA 扩展到多目标问题，具有帕累托解的动态存档、拥挤距离和轮盘赌领导者选择，以及来自共生生物搜索算法的经修改的互利阶段；在 CEC2009 函数和工程问题上进行了测试。<sup>[10](https://link.springer.com/article/10.1007/s11227-025-07177-y)</sup>
- **BinHBA** 使用 S 形传递函数将连续算法转换为二进制算法，包括时变变体，加上均匀交叉，在 27 个背包问题上进行了测试。<sup>[2](https://dergipark.org.tr/tr/pub/ogummf/article/1477088)</sup>
- 2024 年的一种量子 HBA 结合动态对立学习、拉普拉斯交叉和差分变异，用于模糊前端产品设计。<sup>[11](https://pmc.ncbi.nlm.nih.gov/articles/PMC11154476/)</sup>
- **EHBA** 加入[莱维飞行](https://www.edgepedia.org/zh/levy-flight)和折射对立学习，在 18 个基准函数和 IEEE CEC2017 测试集上验证 <sup>[12](https://sage.cnpereading.com/doi/10.3233/JIFS-213206)</sup>，另一种改进 HBA 在 10 个函数和 5 个工程问题上使用威尔科克森秩和、弗里德曼和曼–惠特尼 U 检验与七种元启发式算法进行了比较。<sup>[13](https://www.techscience.com/cmc/v76n2/53990)</sup>

## 应用

已发表的应用跨越多个领域。在电力系统中，HBA 已被用于可靠性约束的动态发电扩展规划。<sup>[3](https://www.nature.com/articles/s41598-023-43622-9)</sup> 在机器学习中，一种与 NSGA-II 和核极限学习机混合的多目标 HBA 被应用于十八个基准数据集上基于包装器的特征选择。<sup>[14](https://ijeecs.iaescore.com/index.php/IJEECS/article/download/35684/18660)</sup> 在医学成像中，一种改进 HBA 被应用于脑肿瘤 MRI 图像的多级阈值分割。<sup>[15](https://link.springer.com/article/10.1007/s10586-024-04525-0)</sup> 工程设计问题，包括约束结构设计，出现在原始评估和许多变体论文中。<sup>[4](https://ideas.repec.org/a/eee/matcom/v192y2022icp84-110.html)</sup><sup> • </sup><sup>[9](https://www.mdpi.com/2313-7673/10/9/581)</sup>

## 局限性与替代方案

后来的作者指出了基础算法的具体弱点。密度因子从 C 开始并呈指数递减趋向 0，这种方法可能导致过早收敛到局部最优，特别是在复杂高维问题上。<sup>[6](https://www.mdpi.com/2313-7673/10/2/92)</sup> 其他报告的问题包括后期搜索性能缓慢和容易陷入局部最优 <sup>[9](https://www.mdpi.com/2313-7673/10/9/581)</sup>、收敛精度低、在高维复杂问题上全局优化能力不足，其中一种多策略变体报告相对于原始 HBA 性能优化了 88% <sup>[16](https://www.ecice06.com/EN/10.19678/j.issn.1000-3428.0066465)</sup>，以及开发和收敛速度方面的困难。<sup>[15](https://link.springer.com/article/10.1007/s10586-024-04525-0)</sup>

原始论文的比较集包括粒子群优化、协方差矩阵自适应进化策略、L-SHADE、鲸鱼优化算法、哈里斯鹰优化和其他六种算法。<sup>[4](https://ideas.repec.org/a/eee/matcom/v192y2022icp84-110.html)</sup>

HBA 也处于关于隐喻驱动元启发式算法的更广泛争议之中。肯尼思·瑟伦森描述了新型隐喻方法的“海啸”，并批评了该领域以隐喻驱动的新颖性概念。<sup>[17](https://onlinelibrary.wiley.com/doi/10.1111/itor.12001)</sup> 2021 年《群体智能》上的一篇评论认为，基于隐喻的元启发式算法经常以新术语重新包装已知概念，并且与过时算法进行有偏的、不可相提并论的比较会给出错误的性能图景。<sup>[18](https://link.springer.com/article/10.1007/s11721-021-00202-9)</sup> 对六种此类算法（包括灰狼、飞蛾扑火、鲸鱼、萤火虫、蝙蝠和蚁狮）的分析发现，没有一个提出哪怕一个新想法，大多数使用粒子群优化概念。<sup>[19](https://iridia.ulb.ac.be/~ccamacho/publications/ITOR-Exposing.pdf)</sup> 这些批评针对的是通用类别和其他命名算法；没有已发表的研究专门证明 HBA 是现有方法的重新包装，因此其独立新颖性仍是一个开放问题。

## References

1. [Fatma A. Hashim and colleagues (2021). Honey Badger Algorithm: New metaheuristic algorithm for solving optimization problems. Mathematics and Computers in Simulation.](https://doi.org/10.1016/j.matcom.2021.08.013)
2. [Binary Honey Badger Algorithm enhanced with time-varying sigmoid transfer function and crossover strategy (BinHBA)](https://dergipark.org.tr/tr/pub/ogummf/article/1477088)
3. [Reliability constrained dynamic generation expansion planning using honey badger algorithm (Scientific Reports, 2023)](https://www.nature.com/articles/s41598-023-43622-9)
4. [Honey Badger Algorithm: New metaheuristic algorithm for solving optimization problems (Mathematics and Computers in Simulation, vol. 192)](https://ideas.repec.org/a/eee/matcom/v192y2022icp84-110.html)
5. [Honey Badger Algorithm - File Exchange - MATLAB Central](https://www.mathworks.com/matlabcentral/fileexchange/98204-honey-badger-algorithm)
6. [GOHBA: Improved Honey Badger Algorithm for Global Optimization (MDPI Biomimetics, 2025)](https://www.mdpi.com/2313-7673/10/2/92)
7. [MaRDI portal record for the HBA paper](https://portal.mardi4nfdi.de/wiki/Publication:2666510)
8. [A comprehensive survey of honey badger optimization algorithm and meta-analysis of its variants and applications](https://doi.org/10.1016/j.fraope.2024.100141)
9. [Multi-Strategy Honey Badger Algorithm for Global Optimization (MDPI Biomimetics, 2025)](https://www.mdpi.com/2313-7673/10/9/581)
10. [An improved multi-objective honey badger algorithm based on global searching strategy (IMOHBA, Journal of Supercomputing)](https://link.springer.com/article/10.1007/s11227-025-07177-y)
11. [Differential Mutation Incorporated Quantum Honey Badger Algorithm with Dynamic Opposite Learning and Laplace Crossover for Fuzzy Front-End Product Design (2024)](https://pmc.ncbi.nlm.nih.gov/articles/PMC11154476/)
12. [An enhanced honey badger algorithm based on Lévy flight and refraction opposition-based learning for engineering design problems (Journal of Intelligent & Fuzzy Systems)](https://sage.cnpereading.com/doi/10.3233/JIFS-213206)
13. [An Improved Honey Badger Algorithm through Fusing Multi-Strategies (IHBA, CMC)](https://www.techscience.com/cmc/v76n2/53990)
14. [Multi-objective HBA combined with NSGA-II for wrapper-based feature selection (MOHBNSGA2, IJEECS)](https://ijeecs.iaescore.com/index.php/IJEECS/article/download/35684/18660)
15. [An improved honey badger algorithm for global optimization and multilevel thresholding segmentation: real case with brain tumor images (Cluster Computing, 2024)](https://link.springer.com/article/10.1007/s10586-024-04525-0)
16. [Improved Honey Badger Algorithm Based on Multi-Strategy and Its Applications](https://www.ecice06.com/EN/10.19678/j.issn.1000-3428.0066465)
17. [Metaheuristics, the metaphor exposed (Sörensen, International Transactions in Operational Research)](https://onlinelibrary.wiley.com/doi/10.1111/itor.12001)
18. [Metaphor-based metaheuristics, a call for action: the elephant in the room (Swarm Intelligence)](https://link.springer.com/article/10.1007/s11721-021-00202-9)
19. [Exposing the grey wolf, moth-flame, whale, firefly, bat, and antlion algorithms: six misleading optimization techniques inspired by bestial metaphors (author's copy)](https://iridia.ulb.ac.be/~ccamacho/publications/ITOR-Exposing.pdf)

---
*Initially written Sep 29, 2026 · Reviewed: Sep 30, 2026 · Edited: Sep 30, 2026; Oct 15, 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/honey-badger-algorithm

English original: https://www.edgepedia.org/honey-badger-algorithm
