# 人工鱼群算法

人工鱼群算法（artificial fish swarm algorithm, AFSA）是一种群体智能优化方法，它模拟鱼群的集群行为——主要是觅食、聚群和追尾——来搜索数值问题和工程问题的最优解。它是一种基于种群的随机方法：一组人工鱼在搜索空间中移动，输出的是所找到的最佳位置，记录在公告板上。改进的和混合的变体已被应用于连续、二进制和组合优化，包括NP难问题。<sup>[1](https://sysengi.cjoe.ac.cn/EN/10.12011/1000-6788%282002%2911-32)</sup><sup> • </sup><sup>[2](https://link.springer.com/article/10.1007/s11831-022-09711-0)</sup><sup> • </sup><sup>[3](https://opus.lib.uts.edu.au/bitstream/10453/176953/2/s10462-022-10214-4.pdf)</sup> 该方法也被称为鱼群算法，在一些综述中称为人工鱼群优化（artificial fish swarm optimization, AFSO）。<sup>[4](https://adelnadjarantoosi.info/pdf/AIR2014.pdf)</sup><sup> • </sup><sup>[5](https://sciendo.com/pdf/10.21307/ijssis-2017-474)</sup>

| 关键事实 | 详情 |
|---|---|
| 问题类别 | 连续、二进制和组合优化，包括NP难问题<sup>[3](https://opus.lib.uts.edu.au/bitstream/10453/176953/2/s10462-022-10214-4.pdf)</sup> |
| 行为 | 随机移动、觅食、聚群、追尾<sup>[2](https://link.springer.com/article/10.1007/s11831-022-09711-0)</sup> |
| 主要参数 | Visual（视野距离）、Step（步长）、try_number、拥挤因子 \( \delta \in [0, 1] \)、种群规模<sup>[4](https://adelnadjarantoosi.info/pdf/AIR2014.pdf)</sup> |
| 典型设置 | Visual为变量范围长度的40%、Step为25%，\( \delta = 0.5 \)，try_number为10，种群规模为30<sup>[6](https://adelnadjarantoosi.info/pdf/AI2010.pdf)</sup> |
| 最佳状态记录 | 公告板存储任何鱼找到的最佳位置，并在每次迭代时更新<sup>[2](https://link.springer.com/article/10.1007/s11831-022-09711-0)</sup> |
| 报告的精度 | AAFSA-GE在其测试条件下于Sphere函数上达到1.81E-147的平均误差，于Ackley函数上达到4.44E-16的最佳值<sup>[7](https://www.joca.cn/EN/abstract/abstract25046.shtml)</sup> |
| 主要弱点 | 时间复杂度高、全局/局部搜索平衡差、参数固定、未利用群体成员的经验<sup>[8](https://arxiv.org/pdf/1405.4138v1)</sup> |

## 工作原理

每条人工鱼是一个候选解，位置X处的食物浓度即为适应度值f(X)。<sup>[8](https://arxiv.org/pdf/1405.4138v1)</sup> 算法包含四种觅食行为：随机移动（自由移动）、觅食（搜索）、聚群和追尾（追逐）。<sup>[2](https://link.springer.com/article/10.1007/s11831-022-09711-0)</sup> 觅食为收敛奠定基础，聚群增强稳定性和全局收敛性，追尾加速收敛；一条鱼先尝试聚群或追尾，然后觅食，最后随机移动。<sup>[2](https://link.springer.com/article/10.1007/s11831-022-09711-0)</sup>

一条鱼感知其视野范围v内的同伴，视野范围以[欧几里得距离](https://www.edgepedia.org/zh/euclidean-distance) \( \mathrm{Dis}(ij) = \lVert X_i - X_j \rVert \) 度量。<sup>[8](https://arxiv.org/pdf/1405.4138v1)</sup> 在觅食中，鱼在其视野范围内探测一个随机位置 \( X_v \)，如果该位置更优则向其移动；该更新表示为 \( X_v = X_i + \mathrm{Visual} \times \mathrm{rand}() \) 和 \( X_{\mathrm{next}} = X + \frac{X_v - X}{\lVert X_v - X \rVert} \times \mathrm{Step} \times \mathrm{rand}() \)。<sup>[9](https://pmc.ncbi.nlm.nih.gov/articles/PMC4321098/)</sup> 在聚群中，设 \( \vec{x}_c \) 为鱼群的中心位置，即焦点鱼视野范围内同伴位置的平均值；如果中心位置不劣于自身位置且该区域不过度拥挤，即在一篇综述所采用的最小化约定下 \( C(\vec{x}_c) = 0 \) 且 \( f(\vec{x}_c) \le f(\vec{x}_i) \)，则第i条鱼向 \( \vec{x}_c \) 移动一步。<sup>[3](https://opus.lib.uts.edu.au/bitstream/10453/176953/2/s10462-022-10214-4.pdf)</sup> 同样的移动在LAFSA论文的最大化约定下写作 \( X_i^{t+1} = X_i^t + \frac{X_c - X_i^t}{\lVert X_c - X_i^t \rVert} \times \mathrm{Step} \times \mathrm{rand} \)，仅当 \( n_f / n < \delta \) 且 \( Y_c > Y_i \) 时执行。<sup>[9](https://pmc.ncbi.nlm.nih.gov/articles/PMC4321098/)</sup>

拥挤因子是多样性的保障：当 \( C(x) = 1 \) 时，位置x周围区域过度拥挤，其中 \( N(x) \) 统计欧几里得距离v内的人工鱼数量，\( \delta \in [0, 1] \) 为拥挤因子；避开过度拥挤的地方可维持鱼群多样性并防止早熟收敛。<sup>[3](https://opus.lib.uts.edu.au/bitstream/10453/176953/2/s10462-022-10214-4.pdf)</sup> 公告板记录所有鱼群成员找到的最佳位置；在每次迭代结束时，将最佳鱼与存档解进行比较，如果新鱼更优则更新公告板。<sup>[2](https://link.springer.com/article/10.1007/s11831-022-09711-0)</sup><sup> • </sup><sup>[3](https://opus.lib.uts.edu.au/bitstream/10453/176953/2/s10462-022-10214-4.pdf)</sup>

## 实现方法

使用者设定五个参数：Step（移动步长）、Visual（视野距离）、try_number、拥挤因子 \( \delta \in [0, 1] \) 和种群规模；行为函数命名为AF_Prey、AF_Swarm、AF_Follow和AF_Move，其中跳跃（AF_Leap）是可选的变体行为，AF_Evaluate是用于评估的辅助例程。<sup>[4](https://adelnadjarantoosi.info/pdf/AIR2014.pdf)</sup> 流程为：随机初始化鱼的位置；对每条鱼，尝试聚群或追尾，然后觅食；如果一条鱼在尝试try_number个位置后找不到更优位置，则随机移动一步；更新公告板；重复直至终止。<sup>[3](https://opus.lib.uts.edu.au/bitstream/10453/176953/2/s10462-022-10214-4.pdf)</sup><sup> • </sup><sup>[2](https://link.springer.com/article/10.1007/s11831-022-09711-0)</sup>

基准研究中报告的典型设置为：Visual为适应度函数变量范围长度的40%、Step为25%，拥挤因子0.5，最大try_number为10，种群规模为30，在30维函数上运行1000次迭代并重复100次。<sup>[6](https://adelnadjarantoosi.info/pdf/AI2010.pdf)</sup><sup> • </sup><sup>[8](https://arxiv.org/pdf/1405.4138v1)</sup> 其他研究使用了不同的规模：LAFSA对比使用100条鱼、Visual为2.85、Delta为9、Step为1、在10维函数上最大迭代60次，<sup>[9](https://pmc.ncbi.nlm.nih.gov/articles/PMC4321098/)</sup> 而AAFSA-GE使用50条鱼、\( \delta = 0.75 \)、try_number为5、视野设为全范围 \( U - L \)、步长为0.5·visual。<sup>[7](https://www.joca.cn/EN/abstract/abstract25046.shtml)</sup>

## 起源

[浙江大学](https://www.edgepedia.org/zh/zhejiang-university)的一篇题为“一种新的智能优化方法——人工鱼群算法”的博士论文在变体文献中被引用为早期来源。<sup>[7](https://www.joca.cn/EN/abstract/abstract25046.shtml)</sup>

## 变体

自适应变体在运行过程中改变固定参数。模糊自适应变体FUF（Fuzzy Uniform Fish，模糊均匀鱼）和FAF（Fuzzy Autonomous Fish，模糊自主鱼）使用模糊系统在执行过程中控制视野和步长参数。<sup>[6](https://adelnadjarantoosi.info/pdf/AI2010.pdf)</sup> NAFSA集成了自适应、基于云理论的变异以及进化交叉/变异，Step和Visual写作双曲正切函数并在迭代中动态调整。<sup>[10](https://www.sciencedirect.com/science/article/pii/S1474667015362716)</sup> AAFSA-GE增加了视野和步长的自适应机制、混沌行为和基因交换，以提高跳出局部最优的能力。<sup>[7](https://www.joca.cn/EN/abstract/abstract25046.shtml)</sup>

混沌变体嵌入混沌搜索。混沌搜索AFSA（CSAFSA）在全局最佳鱼周围一定半径内搜索，在四个测试函数上比标准AFSA具有更高的收敛速度和更好的稳定性。<sup>[2](https://link.springer.com/article/10.1007/s11831-022-09711-0)</sup> 全局AFSA（GAFSA）与改进单纯形法结合（MS_GAFSA）在一项包含34个函数的基准研究中提高了收敛速度和优化精度。<sup>[11](https://www.scientific.net/AMM.687-691.1480)</sup>

行为增加包括跳跃行为以提高跳出局部极值的概率，以及在最小化中当适应度值超过阈值时执行的吞食行为；由此产生的IAFSO1在有限增加计算复杂度的情况下实现了更快的收敛和更高的全局搜索精度。<sup>[4](https://adelnadjarantoosi.info/pdf/AIR2014.pdf)</sup> 另一种IAFSA在最大迭代次数过半后，当鱼的自适应多样性超过Threshold1时执行吞食行为，当多样性低于Threshold2时执行繁殖行为；它在平均意义上优于标准AFSA，收敛时间有显著改善。<sup>[12](http://article.nadiapub.com/IJCA/vol6_no5/10.pdf)</sup>

混合方法将AFSA与其他优化器结合。粒子鱼群算法（particle fish swarm algorithm, PFSA）将AFSA与PSO混合，在四个著名函数上产生的结果比标准AFSA收敛更快、精度更高。<sup>[2](https://link.springer.com/article/10.1007/s11831-022-09711-0)</sup> AFSA-PSO混合方法已被用于训练前馈神经网络和求解病态线性系统。<sup>[4](https://adelnadjarantoosi.info/pdf/AIR2014.pdf)</sup> 并行自适应PAAFSA-DE利用差分进化将种群分为局部搜索和全局搜索子群，在所有测试函数上比标准AFSA收敛更快、更准确。<sup>[2](https://link.springer.com/article/10.1007/s11831-022-09711-0)</sup> FSACO混合方法将AFSA与蚁群优化结合用于路由。<sup>[13](https://pmc.ncbi.nlm.nih.gov/articles/PMC6210721/)</sup>

## 应用

已记录的应用涵盖数据聚类、图像分割、故障诊断、功率分配、深度自编码器的参数优化、无线传感器网络、能量管理、特征选择、医学诊断、训练机器学习模型和动态优化。<sup>[3](https://opus.lib.uts.edu.au/bitstream/10453/176953/2/s10462-022-10214-4.pdf)</sup> 在无线传感器网络中，FSACO混合路由协议在100个传感器的网络中的收敛速度比EEABR、IACO和SensorAnt分别快28.8%、19.7%和28.4%。<sup>[13](https://pmc.ncbi.nlm.nih.gov/articles/PMC6210721/)</sup> 用于训练前馈神经网络的AFSA-PSO混合方法在函数逼近实验中比单独使用AFSA和PSO更有效，<sup>[4](https://adelnadjarantoosi.info/pdf/AIR2014.pdf)</sup> 而将AFSA应用于旅行商问题的一个变体在2020年的一项比较中显示出比其他自然启发算法更好的收敛性能。<sup>[14](https://ijettjournal.org/archive/ijett-v68i5p206s)</sup>

## 局限与替代方案

综述指出了持续的弱点：全局搜索与局部搜索之间缺乏平衡、后期收敛速度较低、时间复杂度高、未从群体成员的经验中获益。<sup>[2](https://link.springer.com/article/10.1007/s11831-022-09711-0)</sup><sup> • </sup><sup>[5](https://sciendo.com/pdf/10.21307/ijssis-2017-474)</sup> 在标准AFSA中，视野和步长在执行过程中始终保持初始值不变；较大的初始值增加全局搜索能力，而较小的值改善局部搜索，因此初始设置强烈决定最终结果。<sup>[8](https://arxiv.org/pdf/1405.4138v1)</sup> 探索-利用平衡由δ、v和Step大小控制，自适应方案在迭代中调整这些参数。<sup>[3](https://opus.lib.uts.edu.au/bitstream/10453/176953/2/s10462-022-10214-4.pdf)</sup> 固定的拥挤因子δ导致全局最优附近的个体相互排斥，因此算法无法准确到达极值点，且每次迭代都检查拥挤度增加了计算成本。<sup>[15](http://www.biomed.bas.bg/bioautomation/2015/vol_19.2/files/19.2_03.pdf)</sup> 当随机选择的状态不满足移动条件时，鱼选择随机行为，这使得高精度难以实现，并在收敛附近导致无效计算。<sup>[15](http://www.biomed.bas.bg/bioautomation/2015/vol_19.2/files/19.2_03.pdf)</sup>

与替代方案的比较结果不一，且大多是定性的。一项实证研究报告称，AFSA由于计算复杂度高、实现困难、结果并不显著优于PSO等类似算法（PSO更易实现且表现出更好的性能）而未获得广泛接受；同一研究强调AFSA不是PSO的一个版本，且与PSO有显著差异，因为鱼的运动仅取决于当前位置和其他群体成员的情况，而非过去的个人经验。<sup>[8](https://arxiv.org/pdf/1405.4138v1)</sup><sup> • </sup><sup>[6](https://adelnadjarantoosi.info/pdf/AI2010.pdf)</sup> 配备自适应移动权重的AFSA产生的结果类似于带惯性权重的PSO，在更高维度上甚至表现更好。<sup>[8](https://arxiv.org/pdf/1405.4138v1)</sup> 面向应用的论文则引用AFSA收敛速度快、灵活、容错和高精度的优势。<sup>[13](https://pmc.ncbi.nlm.nih.gov/articles/PMC6210721/)</sup> 与遗传算法相比，综述中的比较是定性的：与GA一样，AFSA不依赖于目标函数的梯度信息，而与GA不同，它没有交叉或变异，因此更容易执行。<sup>[4](https://adelnadjarantoosi.info/pdf/AIR2014.pdf)</sup><sup> • </sup><sup>[5](https://sciendo.com/pdf/10.21307/ijssis-2017-474)</sup>

## References

1. [1000 6788(2002)11 32 (sysengi.cjoe.ac.cn)](https://sysengi.cjoe.ac.cn/EN/10.12011/1000-6788%282002%2911-32)
2. [Fish-Inspired Heuristics: A Survey of the State-of-the-Art Methods (Archives of Computational Methods in Engineering, 2022)](https://link.springer.com/article/10.1007/s11831-022-09711-0)
3. [A review of artificial fish swarm algorithms: recent advances and applications (Artificial Intelligence Review, 2022, repository copy)](https://opus.lib.uts.edu.au/bitstream/10453/176953/2/s10462-022-10214-4.pdf)
4. [Artificial fish swarm algorithm: a survey of the state of-the-art, hybridization, combinatorial and indicative applications (Artificial Intelligence Review, 2014, author-hosted copy)](https://adelnadjarantoosi.info/pdf/AIR2014.pdf)
5. [A Review of Artificial Fish Swarm Algorithm (Neshat et al., International Journal of Smart Sensing and Intelligent Systems)](https://sciendo.com/pdf/10.21307/ijssis-2017-474)
6. [Fuzzy Adaptive Artificial Fish Swarm Algorithm (AI 2010, Springer)](https://adelnadjarantoosi.info/pdf/AI2010.pdf)
7. [Adaptive artificial fish swarm algorithm utilizing gene exchange (AAFSA-GE), Journal of Chinese Computer Applications, 2022](https://www.joca.cn/EN/abstract/abstract25046.shtml)
8. [Empirical Study of Artificial Fish Swarm Algorithm (arXiv, 2014)](https://arxiv.org/pdf/1405.4138v1)
9. [Log-Linear Model Based Behavior Selection Method for Artificial Fish Swarm Algorithm (LAFSA)](https://pmc.ncbi.nlm.nih.gov/articles/PMC4321098/)
10. [A Novel Self-Adaptation Hybrid Artificial Fish-Swarm Algorithm (ScienceDirect)](https://www.sciencedirect.com/science/article/pii/S1474667015362716)
11. [On the Computational Study of Artificial Fish Swarm Algorithm and its Improvement (Applied Mechanics and Materials, 2014)](https://www.scientific.net/AMM.687-691.1480)
12. [An Improved Artificial Fish Swarm Algorithm based on Hybrid Behavior Selection (Huang, Chen & Chen, IJCA 2013)](http://article.nadiapub.com/IJCA/vol6_no5/10.pdf)
13. [Energy Efficient Hybrid Routing Protocol Based on the Artificial Fish Swarm Algorithm and Ant Colony Optimisation for WSNs (Sensors, 2018)](https://pmc.ncbi.nlm.nih.gov/articles/PMC6210721/)
14. [Solving A Combinatorial Optimization Problem Using Artificial Fish Swarm Algorithm (IJETT, 2020)](https://ijettjournal.org/archive/ijett-v68i5p206s)
15. [Study of the Artificial Fish Swarm Algorithm (BioAutomation 19.2, 2015)](http://www.biomed.bas.bg/bioautomation/2015/vol_19.2/files/19.2_03.pdf)

---
*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/artificial-fish-swarm-algorithm

English original: https://www.edgepedia.org/artificial-fish-swarm-algorithm
