# 细菌觅食优化算法

细菌觅食优化算法（bacterial foraging optimization algorithm, BFOA）是一种群体智能方法，它通过模拟[大肠杆菌](https://www.edgepedia.org/zh/escherichia-coli)（Escherichia coli）经由趋化、繁殖和消除-扩散来觅食营养物的过程，搜索目标函数的极小值。它是一种无梯度、基于种群的优化器：候选解就是细菌，其在搜索空间中的位置通过生物学建模的移动方式来更新，而非依赖导数信息。帕西诺（Passino）于2002年提出该方法，将其作为一种分布式优化与控制的形式。<sup>[1](https://doi.org/10.1109/mcs.2002.1004010)</sup> 原始算法通过四种操作来刻画大肠杆菌的觅食过程：趋化、群聚、繁殖和消除-扩散。<sup>[2](https://www.sciencedirect.com/science/article/abs/pii/S0925231220319172)</sup>

| 关键事实 | 详情 |
|---|---|
| 提出论文 | K.M. Passino，《面向分布式优化与控制的细菌觅食仿生方法》，IEEE Control Systems，2002<sup>[1](https://doi.org/10.1109/mcs.2002.1004010)</sup> |
| 核心算子 | 趋化、群聚、繁殖、消除-扩散<sup>[2](https://www.sciencedirect.com/science/article/abs/pii/S0925231220319172)</sup> |
| 游动规则 | 在大小为 \( C(i) \) 的一次翻转之后，若代价改善则沿同一方向重复移动，最多 \( N_{s} \) 步<sup>[3](https://ideas.repec.org/a/spr/joptap/v115y2002i3d10.1023_a1021207331209.html)</sup> |
| 繁殖规则 | 累积代价较差的一半种群死亡；较健康的一半分裂，保持种群规模不变<sup>[4](http://www.abcm.org.br/app/webroot/anais/cobem/2009/pdf/COB09-0493.pdf)</sup> |
| 扩散 | 每个细菌以概率 \( P_{\mathrm{ed}} \) 被消除并随机重新定位<sup>[5](https://research.ijcaonline.org/ncfaaiia/number1/ncfaaiia1003.pdf)</sup> |
| 已知缺陷 | 收敛速度差、早熟收敛，且随维数增加而加剧<sup>[2](https://www.sciencedirect.com/science/article/abs/pii/S0925231220319172)</sup><sup> • </sup><sup>[6](https://wseas.com/journals/mathematics/2013/b145706-283.pdf)</sup> |

## 工作原理

趋化性是能运动的细菌觅食营养物时的运动行为。<sup>[7](https://softcomputing.net/bfoa-chapter.pdf)</sup> 在BFOA中，每个细菌交替进行翻转和游动：翻转随机选取一个方向，若新位置的代价低于当前位置，则细菌沿同一方向以步长 \( C(i) \) 继续移动，最多重复 \( N_{s} \) 步。<sup>[3](https://ideas.repec.org/a/spr/joptap/v115y2002i3d10.1023_a1021207331209.html)</sup> 这是承担算法大部分工作的算子；细胞在代价曲面上逐个移动，而该曲面会因与其他细胞邻近而被削减。<sup>[8](https://cleveralgorithms.com/nature-inspired/swarm/bfoa.html)</sup>

群聚对细胞间信号传导进行建模。在压力下，细菌释放引诱剂召唤其他细菌聚集，并释放排斥剂与邻居保持最小距离，从而产生吸引与排斥的合成效果。<sup>[4](http://www.abcm.org.br/app/webroot/anais/cobem/2009/pdf/COB09-0493.pdf)</sup> 在算法中，这是加到真实代价函数上的惩罚项，其参数包括细菌数量S、最适细菌的位置、吸引的深度与宽度 \( (d_{\mathrm{attract}}, w_{\mathrm{attract}}) \)，以及排斥的高度与宽度 \( (h_{\mathrm{repellent}}, w_{\mathrm{repellent}}) \)。<sup>[9](https://sensors.myu-group.co.jp/sm_pdf/SM2535.pdf)</sup> 社会觅食的数学表述将这些引诱-排斥函数定义为：\( d_{\mathrm{attract}} \) 为细胞释放的引诱剂深度，\( w_{\mathrm{attract}} \) 为其宽度的度量，并令 \( h_{\mathrm{repellant}} \) 等于 \( d_{\mathrm{attract}} \)。<sup>[3](https://ideas.repec.org/a/spr/joptap/v115y2002i3d10.1023_a1021207331209.html)</sup>

繁殖和消除-扩散作用于种群而非个体移动。在固定次数的趋化步骤之后，细菌按累积代价排序，最不健康的一半被移除，幸存者一分为二，从而将搜索努力集中于有希望的区域。<sup>[4](http://www.abcm.org.br/app/webroot/anais/cobem/2009/pdf/COB09-0493.pdf)</sup> 随后，消除-扩散以概率 \( P_{\mathrm{ed}} \) 随机重新定位细胞，有助于逃离局部极小值，同时保持种群规模不变。<sup>[5](https://research.ijcaonline.org/ncfaaiia/number1/ncfaaiia1003.pdf)</sup> 该方法背后的生物学模型表现出格伦鲍姆（Grunbaum）所确定的性质，即觅食具有社会性，以便攀爬有噪声的营养梯度，而该形式化执行的是非梯度优化。<sup>[3](https://ideas.repec.org/a/spr/joptap/v115y2002i3d10.1023_a1021207331209.html)</sup>

## 实现方式

算法以三重嵌套循环运行：外层消除-扩散循环（索引l）、繁殖循环（k）和内层趋化循环（j），对每个细菌 i = 1, 2, …, S 执行一次趋化步骤。<sup>[7](https://softcomputing.net/bfoa-chapter.pdf)</sup> 细菌的位置记为 \( \theta(i, j, k, l) \)，分别以细菌、趋化步骤、繁殖步骤和消除-扩散事件为索引。<sup>[10](https://www.ijcaonline.org/research/volume124/number4/yldz-2015-ijca-905406.pdf)</sup> 在每个趋化步骤中，评估的适应度为 \( J(i, j, k, l) \)，并加上细胞间相互作用项 \( J_{\mathrm{cc}}(\theta, P(j, k, l)) \) 以模拟群体行为。<sup>[7](https://softcomputing.net/bfoa-chapter.pdf)</sup>

主要控制参数包括繁殖步数 \( N_{\mathrm{re}} \)、消除-扩散步数 \( N_{\mathrm{ed}} \)、消除-扩散概率 \( P_{\mathrm{ed}} \)，以及趋化步长或单位游动长度 \( C(i) \)。<sup>[5](https://research.ijcaonline.org/ncfaaiia/number1/ncfaaiia1003.pdf)</sup> Ned 较低意味着搜索较少依赖随机扩散，而较高的值会增加计算复杂度。<sup>[4](http://www.abcm.org.br/app/webroot/anais/cobem/2009/pdf/COB09-0493.pdf)</sup> 一个已发表的工程设置使用32个细菌的种群、10次趋化步骤、游动长度4、10次繁殖步骤、2次消除-扩散事件，以及0.25的消除概率。<sup>[4](http://www.abcm.org.br/app/webroot/anais/cobem/2009/pdf/COB09-0493.pdf)</sup> 在 NiaPy 库等软件实现中，消除步骤在随机抽取值低于消除概率时，在任务范围内按均匀分布重置细菌并重新评估，若适应度改善则替换最优解。<sup>[11](https://niapy.org/en/stable/_modules/niapy/algorithms/basic/bfo.html)</sup>

## 起源

帕西诺在2002年IEEE Control Systems论文《面向分布式优化与控制的细菌觅食仿生方法》中提出了细菌觅食优化，该论文对大肠杆菌的趋化觅食行为建模，给出一个通过社会性细菌觅食来模拟分布式优化的计算机程序，并将其应用于多极值函数最小化问题。<sup>[1](https://doi.org/10.1109/mcs.2002.1004010)</sup> Y. Liu 与 K.M. Passino 的配套论文《面向分布式优化的社会性觅食细菌仿生方法：模型、原理与涌现行为》于2002年发表在《Journal of Optimization Theory and Applications》第115卷第3期，提供了群聚算子中使用的细胞间信号传导形式化。<sup>[3](https://ideas.repec.org/a/spr/joptap/v115y2002i3d10.1023_a1021207331209.html)</sup> 更早的一种基于趋化的优化器——细菌趋化（bacteria chemotaxis, BC）算法——直接基于细菌趋化模型构建，并在标准局部和全局测试函数以及翼型反设计上进行了评估；平均而言，其表现与标准进化策略相似，但逊于具有增强收敛特性的进化策略。<sup>[12](https://ieeexplore.ieee.org/document/985689)</sup>

## 变体

研究很快将细菌觅食概念扩展为有名称的变体，包括快速细菌群聚算法（fast bacterial swarming algorithm, FBSA）、细菌-GA觅食算法，以及自适应细菌觅食算法（adaptive bacterial foraging algorithm, ABFO）。<sup>[13](https://onlinelibrary.wiley.com/doi/10.1155/2012/698057)</sup> 自适应变体动态改变游动步长以平衡探索与开发：自适应SABFO在搜索过程中调整每个细菌的游动长度，在仿真中优于GA、PSO和BFO，<sup>[5](https://research.ijcaonline.org/ncfaaiia/number1/ncfaaiia1003.pdf)</sup> 而ABFO0和ABFO1模型将进化分为探索和开发阶段，二者均优于原始BFO。<sup>[5](https://research.ijcaonline.org/ncfaaiia/number1/ncfaaiia1003.pdf)</sup> 四种自适应趋化步长方案（LABFA、QABFA、EABFA和FABFA）以比标准BFA更少的步骤达到最优，其中FABFA获得最低的营养值。<sup>[14](https://scialert.net/fulltext/?doi=jai.2011.207.219)</sup> 自适应趋化变体SCBFO在运行后期表现出高收敛速度，而经典BFO此时会变慢。<sup>[15](https://onlinelibrary.wiley.com/doi/10.1155/2020/2630104)</sup>

混合变体将BFOA与其他优化器结合。BFPSO用粒子群优化引导BFO，并被用于整定PID控制器增益 \( k_{p} \)、\( k_{I} \) 和 \( k_{d} \)，相比任一单独方法，减小了超调并加快了收敛。<sup>[5](https://research.ijcaonline.org/ncfaaiia/number1/ncfaaiia1003.pdf)</sup> 一种称为BSO的BFO-PSO混合方法已与Nelder-Mead算法和矩量法结合，用于设计RFID阅读器的领结天线，<sup>[5](https://research.ijcaonline.org/ncfaaiia/number1/ncfaaiia1003.pdf)</sup> 另一种BFO-PSO混合方法——速度调制BFO（velocity-modulated BFO, VMBFO）——被用于微带贴片天线谐振计算。<sup>[5](https://research.ijcaonline.org/ncfaaiia/number1/ncfaaiia1003.pdf)</sup> 其他方向包括带有参数自动化策略和交叉操作的改进BFO、BFO与[禁忌搜索](https://www.edgepedia.org/zh/tabu-search)的混合方法，以及概率导数BFO，其中移动方向从沿候选方向的导数计算出的概率矩阵中选择。<sup>[6](https://wseas.com/journals/mathematics/2013/b145706-283.pdf)</sup> TS-MBFOA是一种改进的BFOA，具有缩减的参数、约束处理算子和进化算法风格的变异算子。<sup>[16](https://www.scielo.org.mx/scielo.php?lang=pt&pid=S1405-55462023000200425&script=sci_arttext)</sup>

## 应用

已发表的应用涵盖控制器整定，包括基于BFPSO的PID增益整定<sup>[5](https://research.ijcaonline.org/ncfaaiia/number1/ncfaaiia1003.pdf)</sup>和用于两区域互联电力系统[自动发电控制](https://www.edgepedia.org/zh/automatic-generation-control)的混合BFOA-PSO PI控制器；<sup>[17](https://www.sciencedirect.com/science/article/abs/pii/S156849461300272X)</sup> 电力与网络问题，包括RFID网络调度、电力负荷预测和最优控制工程；<sup>[5](https://research.ijcaonline.org/ncfaaiia/number1/ncfaaiia1003.pdf)</sup> 以及机器学习与数据任务，如特征选择、聚类、投资组合优化、环境与[经济调度](https://www.edgepedia.org/zh/economic-dispatch)、网络分析和调度。<sup>[2](https://www.sciencedirect.com/science/article/abs/pii/S0925231220319172)</sup> BFO还被应用于设施布局、特征选择和训练核极限学习机。<sup>[18](https://link.springer.com/content/pdf/10.1007/978-3-030-53956-6_29.pdf)</sup> 天线设计反复出现，包括用于领结RFID天线的BSO与Nelder-Mead结合<sup>[5](https://research.ijcaonline.org/ncfaaiia/number1/ncfaaiia1003.pdf)</sup>以及用于微带贴片的VMBFO。<sup>[5](https://research.ijcaonline.org/ncfaaiia/number1/ncfaaiia1003.pdf)</sup> 更近期的工作将该方法应用于稳定低通IIR数字滤波器设计，<sup>[19](https://beta.iopscience.iop.org/article/10.1088/2631-8695/ae7ef4)</sup> 通过带有排列保持算子的混合离散BFO（HBFO）应用于排列流水车间调度，<sup>[20](https://doi.org/10.5267/j.ijiec.2026.6.005)</sup> 以及通过BF-MDOA应用于大规模物联网路由，BF-MDOA是一种受细菌觅食启发的多维优化算法，针对能耗（χ）、拥塞（η）、时延（γ）和丢包（δ）自适应优化路由路径和控制参数。<sup>[21](https://link.springer.com/article/10.1007/s44354-025-00001-2)</sup>

## 局限与替代方法

与其他基于种群的算法（如PSO和GA）相比，经典BFO被批评性能差、收敛慢，且其性能随维数和问题复杂度增加而恶化。<sup>[6](https://wseas.com/journals/mathematics/2013/b145706-283.pdf)</sup> 综述文献同样将收敛差和性能差记录为BFO的缺点。<sup>[2](https://www.sciencedirect.com/science/article/abs/pii/S0925231220319172)</sup> 在高维问题中，待优化参数的数量使搜索计算耗时。<sup>[10](https://www.ijcaonline.org/research/volume124/number4/yldz-2015-ijca-905406.pdf)</sup> 种群规模为6和30的经典BFOA在大多数多峰函数上失败并陷入局部最优，而小种群微变体则趋向全局最优。<sup>[10](https://www.ijcaonline.org/research/volume124/number4/yldz-2015-ijca-905406.pdf)</sup> 趋化步长体现了直接的精度-速度权衡：小步长带来高解精度但收敛慢，大步长收敛更快但精度较低。<sup>[14](https://scialert.net/fulltext/?doi=jai.2011.207.219)</sup>

基准证据不一。BFOA在CEC05无约束连续基准函数上与人工蜂群、蜜蜂算法、蚁群优化、差分进化、GA、和声搜索和PSO进行了评估。<sup>[22](https://dl.acm.org/doi/10.1016/j.ins.2011.09.005)</sup> 在18个基准函数上与免疫网络算法AiNet相比，AiNet更稳健，而BFOA在函数评估次数（即效率）方面表现最佳。<sup>[23](https://www.scielo.org.mx/scielo.php?pid=S1405-77432016000400479&script=sci_abstract&tlng=en)</sup> 在2023年TS-MBFOA与差分进化针对四个约束问题、采用相同评估预算的比较中，DEA在约束最多的问题上取得更好结果并以更少时间生成解，95%置信水平的Wilcoxon检验显示仅在3个问题上存在显著差异。<sup>[16](https://www.scielo.org.mx/scielo.php?lang=pt&pid=S1405-55462023000200425&script=sci_arttext)</sup> 相比之下，在IIR数字滤波器设计任务上，细菌觅食算法达到MSE 0.3274，比PSO（0.3455）改善5.2%，比GA（0.4022）改善18.6%，且保持了极点稳定性。<sup>[19](https://beta.iopscience.iop.org/article/10.1088/2631-8695/ae7ef4)</sup> 经典BFOA的每次迭代成本尚未见直接报道；一个2025年变体的复杂度分析给出 \( O(T_{\max} \cdot N^{2} \cdot D) \) 时间和 \( O(N^{2} + N \cdot D) \) 空间，其中群聚阶段以 \( O(N^{2} \cdot D) \) 占主导。<sup>[21](https://link.springer.com/article/10.1007/s44354-025-00001-2)</sup>

## References

1. [K.M. Passino (2002). Biomimicry of bacterial foraging for distributed optimization and control. IEEE Control Systems.](https://doi.org/10.1109/mcs.2002.1004010)
2. [A survey of bacterial foraging optimization (Neurocomputing)](https://www.sciencedirect.com/science/article/abs/pii/S0925231220319172)
3. [Biomimicry of Social Foraging Bacteria for Distributed Optimization: Models, Principles, and Emergent Behaviors (Journal of Optimization Theory and Applications, vol. 115, 2002, DOI 10.1023/A:1021207331209)](https://ideas.repec.org/a/spr/joptap/v115y2002i3d10.1023_a1021207331209.html)
4. [Bacterial Foraging Optimization Algorithm Applied to Engineering System Design (COBEM 2009)](http://www.abcm.org.br/app/webroot/anais/cobem/2009/pdf/COB09-0493.pdf)
5. [A Review of Bacterial Foraging Optimization and Its Variants and Applications](https://research.ijcaonline.org/ncfaaiia/number1/ncfaaiia1003.pdf)
6. [A superior attraction bacterial foraging optimizer for global optimization (WSEAS)](https://wseas.com/journals/mathematics/2013/b145706-283.pdf)
7. [BFOA book chapter (Bacterial Foraging Optimization Algorithm)](https://softcomputing.net/bfoa-chapter.pdf)
8. [Bacterial Foraging Optimization Algorithm | Clever Algorithms](https://cleveralgorithms.com/nature-inspired/swarm/bfoa.html)
9. [Sensors & Materials paper with BFOA swarming formula](https://sensors.myu-group.co.jp/sm_pdf/SM2535.pdf)
10. [Computational Chemotaxis in Micro Bacterial Foraging Optimization for High Dimensional Problems (IJCA)](https://www.ijcaonline.org/research/volume124/number4/yldz-2015-ijca-905406.pdf)
11. [niapy.algorithms.basic.bfo, NiaPy 2.6.1 documentation](https://niapy.org/en/stable/_modules/niapy/algorithms/basic/bfo.html)
12. [Optimization based on bacterial chemotaxis (IEEE Transactions on Evolutionary Computation, Vol. 6, Issue 1, February 2002)](https://ieeexplore.ieee.org/document/985689)
13. [Bacterial Colony Optimization (2012)](https://onlinelibrary.wiley.com/doi/10.1155/2012/698057)
14. [Adaptation Schemes of Chemotactic Step Size of Bacterial Foraging Algorithm for Faster Convergence](https://scialert.net/fulltext/?doi=jai.2011.207.219)
15. [Bacterial Foraging Optimization Based on Self-Adaptive Chemotaxis Strategy (SCBFO)](https://onlinelibrary.wiley.com/doi/10.1155/2020/2630104)
16. [Comparative Analysis of the Bacterial Foraging Algorithm and Differential Evolution in Global Optimization Problems (Computación y Sistemas, 2023)](https://www.scielo.org.mx/scielo.php?lang=pt&pid=S1405-55462023000200425&script=sci_arttext)
17. [Hybrid BFOA–PSO algorithm for automatic generation control of linear and nonlinear interconnected power systems (Applied Soft Computing)](https://www.sciencedirect.com/science/article/abs/pii/S156849461300272X)
18. [Improved Bacterial Foraging Optimization Algorithm with Comprehensive Swarm Learning Strategies (Springer, 2020)](https://link.springer.com/content/pdf/10.1007/978-3-030-53956-6_29.pdf)
19. [Design of IIR digital filters using bacterial foraging algorithm (BFA) (Engineering Research Express, IOPscience)](https://beta.iopscience.iop.org/article/10.1088/2631-8695/ae7ef4)
20. [A hybrid bacterial foraging optimization algorithm for makespan minimization in permutation flow shop scheduling](https://doi.org/10.5267/j.ijiec.2026.6.005)
21. [A bacterial foraging-inspired multi-dimensional optimization algorithm for heterogeneous and mobility-driven sustainable large-scale internet of things (Discover Networks, Springer, 2025)](https://link.springer.com/article/10.1007/s44354-025-00001-2)
22. [Performance assessment of foraging algorithms vs. evolutionary algorithms (Information Sciences)](https://dl.acm.org/doi/10.1016/j.ins.2011.09.005)
23. [Performance Profiles of the Algorithms Immune Network Algorithm and Bacterial Foraging Optimization Algorithm in Benchmark Functions (2016)](https://www.scielo.org.mx/scielo.php?pid=S1405-77432016000400479&script=sci_abstract&tlng=en)

---
*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/bacterial-foraging-optimization-algorithm

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