wordpress更改网站内容,济南网站建设鲁icp备,商丘市建设,做网站超链接一、人工旅鼠优化算法
人工旅鼠算法#xff08;Artificial Lemming Algorithm, ALA#xff09;是2025年提出的一种新型生物启发式优化算法#xff0c;受旅鼠的四种典型行为启发#xff1a;长距离迁徙、挖洞、觅食和躲避捕食者。该算法通过模拟这些行为来解决复杂的优化问题…一、人工旅鼠优化算法
人工旅鼠算法Artificial Lemming Algorithm, ALA是2025年提出的一种新型生物启发式优化算法受旅鼠的四种典型行为启发长距离迁徙、挖洞、觅食和躲避捕食者。该算法通过模拟这些行为来解决复杂的优化问题具有较强的探索和开发能力。人工旅鼠优化算法ALA 是2025年发表于SCITop期刊《Artificial Intelligence Review》的一种新型元启发式算法智能优化算法 。其灵感来源于旅鼠在自然界中的四种行为长途迁徙、挖洞、觅食和躲避捕食者。该算法通过对这四种行为进行数学建模实现对问题的优化求解在保持计算效率的同时更好地平衡勘探和开发能有效应对过早收敛、探索不足以及在高维、非凸搜索空间中缺乏稳健性等挑战。
旅鼠是一种小型啮齿动物主要分布在北极地区。当旅鼠数量过多导致食物短缺时会进行长距离迁徙它们会在栖息地挖洞形成隧道用于储存食物和躲避威胁在洞穴内旅鼠会凭借敏锐感官觅食遇到危险时旅鼠会逃回洞穴并做出欺骗性动作躲避捕食者。ALA算法分别对这四种行为建模长距离迁移和挖洞行为用于搜索空间的勘探觅食和躲避捕食者行为用于开发利用已搜索的空间 。并且采用能量降低机制动态调整勘探和开发之间的平衡增强算法逃避局部最优值并收敛到全局解决方案的能力。
算法原理
ALA 主要模拟旅鼠的以下四种行为
长距离迁徙 (Exploration)模拟旅鼠在食物短缺时进行的长距离迁徙用于探索新的搜索空间。挖洞 (Exploration)模拟旅鼠挖掘洞穴的行为用于在当前区域进行局部探索。觅食 (Exploitation)模拟旅鼠在洞穴附近觅食的行为用于开发当前已知的优质区域。躲避捕食者 (Exploitation)模拟旅鼠在遇到捕食者时的逃避行为用于进一步开发当前最优解附近的区域。
算法数学模型
初始化
初始化种群位置 Z ⃗ [ z 1 , 1 z 1 , 2 … z 1 , D i m z 2 , 1 z 2 , 2 … z 2 , D i m ⋮ ⋮ ⋱ ⋮ z N , 1 z N , 2 … z N , D i m ] \vec{Z} \begin{bmatrix} z_{1,1} z_{1,2} \dots z_{1,Dim} \\ z_{2,1} z_{2,2} \dots z_{2,Dim} \\ \vdots \vdots \ddots \vdots \\ z_{N,1} z_{N,2} \dots z_{N,Dim} \end{bmatrix} Z z1,1z2,1⋮zN,1z1,2z2,2⋮zN,2……⋱…z1,Dimz2,Dim⋮zN,Dim 其中每个维度的初始位置计算为 z i , j L B j rand × ( U B j − L B j ) z_{i,j} LB_j \text{rand} \times (UB_j - LB_j) zi,jLBjrand×(UBj−LBj)
长距离迁徙
长距离迁徙模型 Z ⃗ i ( t 1 ) Z ⃗ best ( t ) F × B M → × ( R ⃗ × ( Z ⃗ best ( t ) − Z ⃗ i ( t ) ) ( 1 − R ⃗ ) × ( Z ⃗ i ( t ) − Z ⃗ a ( t ) ) ) \vec{Z}_i(t1) \vec{Z}_{\text{best}}(t) F \times \overrightarrow{BM} \times \left( \vec{R} \times (\vec{Z}_{\text{best}}(t) - \vec{Z}_i(t)) (1 - \vec{R}) \times (\vec{Z}_i(t) - \vec{Z}_a(t)) \right) Z i(t1)Z best(t)F×BM ×(R ×(Z best(t)−Z i(t))(1−R )×(Z i(t)−Z a(t))) 其中 F F F 是方向标志计算为 F { 1 if ⌊ 2 × rand 1 ⌋ 1 − 1 if ⌊ 2 × rand 1 ⌋ 2 F \begin{cases} 1 \text{if } \lfloor 2 \times \text{rand} 1 \rfloor 1 \\ -1 \text{if } \lfloor 2 \times \text{rand} 1 \rfloor 2 \end{cases} F{1−1if ⌊2×rand1⌋1if ⌊2×rand1⌋2 B M → \overrightarrow{BM} BM 是布朗运动向量服从标准正态分布 f B M ( x ; 0 , 1 ) 1 2 π × exp ( − x 2 2 ) f_{BM}(x; 0, 1) \frac{1}{\sqrt{2\pi}} \times \exp\left(-\frac{x^2}{2}\right) fBM(x;0,1)2π 1×exp(−2x2) R ⃗ \vec{R} R 是一个随机向量计算为 R ⃗ 2 × rand ( 1 , Dim ) − 1 \vec{R} 2 \times \text{rand}(1, \text{Dim}) - 1 R 2×rand(1,Dim)−1
挖洞
挖洞模型 Z ⃗ i ( t 1 ) Z ⃗ i ( t ) F × L × ( Z ⃗ best ( t ) − Z ⃗ b ( t ) ) \vec{Z}_i(t1) \vec{Z}_i(t) F \times L \times (\vec{Z}_{\text{best}}(t) - \vec{Z}_b(t)) Z i(t1)Z i(t)F×L×(Z best(t)−Z b(t)) 其中 L L L 是一个与当前迭代次数相关的随机数计算为 L rand × ( 1 sin ( t 2 ) ) L \text{rand} \times \left(1 \sin\left(\frac{t}{2}\right)\right) Lrand×(1sin(2t))
觅食
觅食模型 Z ⃗ i ( t 1 ) Z ⃗ best ( t ) F × spiral × rand × Z ⃗ i ( t ) \vec{Z}_i(t1) \vec{Z}_{\text{best}}(t) F \times \text{spiral} \times \text{rand} \times \vec{Z}_i(t) Z i(t1)Z best(t)F×spiral×rand×Z i(t) 其中 spiral \text{spiral} spiral 是螺旋形状因子计算为 spiral radius × ( sin ( 2 π × rand ) cos ( 2 π × rand ) ) \text{spiral} \text{radius} \times \left(\sin(2\pi \times \text{rand}) \cos(2\pi \times \text{rand})\right) spiralradius×(sin(2π×rand)cos(2π×rand)) radius \text{radius} radius 是觅食范围的半径计算为 radius ∑ j 1 Dim ( z best , j ( t ) − z i , j ( t ) ) 2 \text{radius} \sqrt{\sum_{j1}^{\text{Dim}} \left(z_{\text{best},j}(t) - z_{i,j}(t)\right)^2} radiusj1∑Dim(zbest,j(t)−zi,j(t))2
躲避捕食者
躲避捕食者模型 Z ⃗ i ( t 1 ) Z ⃗ best ( t ) F × G × Levy ( Dim ) × ( Z ⃗ best ( t ) − Z ⃗ i ( t ) ) \vec{Z}_i(t1) \vec{Z}_{\text{best}}(t) F \times G \times \text{Levy}(\text{Dim}) \times (\vec{Z}_{\text{best}}(t) - \vec{Z}_i(t)) Z i(t1)Z best(t)F×G×Levy(Dim)×(Z best(t)−Z i(t)) 其中 G G G 是逃避系数计算为 G 2 × ( 1 − t T max ) G 2 \times \left(1 - \frac{t}{T_{\text{max}}}\right) G2×(1−Tmaxt) Levy ( ⋅ ) \text{Levy}(\cdot) Levy(⋅) 是莱维飞行函数计算为 Levy ( x ) 0.01 × u × σ ∥ ν ∥ 1 β \text{Levy}(x) 0.01 \times \frac{u \times \sigma}{\|\nu\|^{\frac{1}{\beta}}} Levy(x)0.01×∥ν∥β1u×σ 其中 u u u 和 ν \nu ν 是随机数 β 1.5 \beta 1.5 β1.5。
能量因子
能量因子 E ( t ) E(t) E(t) 用于平衡探索和开发 E ( t ) 4 × arctan ( 1 − t T max ) × ln ( 1 rand ) E(t) 4 \times \arctan\left(1 - \frac{t}{T_{\text{max}}}\right) \times \ln\left(\frac{1}{\text{rand}}\right) E(t)4×arctan(1−Tmaxt)×ln(rand1)
算法流程 初始化设置种群大小 N N N最大迭代次数 T max T_{\text{max}} Tmax问题维度 Dim \text{Dim} Dim并随机初始化种群位置。迭代在每次迭代中根据能量因子 E ( t ) E(t) E(t) 判断当前是探索阶段还是开发阶段。 如果 E ( t ) 1 E(t) 1 E(t)1执行长距离迁徙或挖洞行为。如果 E ( t ) ≤ 1 E(t) \leq 1 E(t)≤1执行觅食或躲避捕食者行为。 更新位置根据上述模型更新每个搜索代理的位置。评估适应度计算每个搜索代理的适应度值并更新当前最优解。终止条件如果达到最大迭代次数或满足其他终止条件输出最优解。
算法优缺点
优点ALA 具有较强的探索和开发能力能够有效避免局部最优适用于高维和复杂的优化问题。缺点对参数设置较为敏感理论保证不足处理某些复杂函数时仍有提升空间。
参考文献 [1]Xiao, Y., Cui, H., Khurma, R.A. et al. Artificial lemming algorithm: a novel bionic meta-heuristic technique for solving real-world engineering optimization problems. Artif Intell Rev 58, 84 (2025). https://doi.org/10.1007/s10462-024-11023-7
二、23个函数介绍 参考文献
[1] Yao X, Liu Y, Lin G M. Evolutionary programming made faster[J]. IEEE transactions on evolutionary computation, 1999, 3(2):82-102.
三、部分代码及结果
clear;
clc;
close all;
warning off all;SearchAgents_no50; %Number of search solutions
Max_iteration500; %Maximum number of iterationsFunc_nameF1; % Name of the test function% Load details of the selected benchmark function
[lb,ub,dim,fobj]Get_F(Func_name); tic;
[Best_score,Best_pos,cg_curve]SGA(SearchAgents_no,Max_iteration,lb,ub,dim,fobj);
tendtoc;% figure(Position,[500 500 901 345])
%Draw search space
subplot(1,2,1);
func_plot(Func_name);
title(Parameter space)
xlabel(x_1);
ylabel(x_2);
zlabel([Func_name,( x_1 , x_2 )])%Draw objective space
subplot(1,2,2);
semilogy(cg_curve,Color,m,LineWidth2.5)
title(Func_name)% title(Objective space)
xlabel(Iteration);
ylabel(Best score obtained so far);axis tight
grid on
box on
legend(SGA)display([The running time is:, num2str(tend)]);
display([The best fitness is:, num2str(Best_score)]);
display([The best position is: , num2str(Best_pos)]);四、完整MATLAB代码见下方名片