一、人工旅鼠优化算法
人工旅鼠算法(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,j=LBj+rand×(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(t+1) = \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) Zi(t+1)=Zbest(t)+F×BM×(R×(Zbest(t)−Zi(t))+(1−R)×(Zi(t)−Za(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×rand+1⌋=1if ⌊2×rand+1⌋=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(t+1) = \vec{Z}_i(t) + F \times L \times (\vec{Z}_{\text{best}}(t) - \vec{Z}_b(t)) Zi(t+1)=Zi(t)+F×L×(Zbest(t)−Zb(t))
其中, L L L 是一个与当前迭代次数相关的随机数,计算为:
L = rand × ( 1 + sin ( t 2 ) ) L = \text{rand} \times \left(1 + \sin\left(\frac{t}{2}\right)\right) L=rand×(1+sin(2t))
觅食
觅食模型:
Z ⃗ i ( t + 1 ) = Z ⃗ best ( t ) + F × spiral × rand × Z ⃗ i ( t ) \vec{Z}_i(t+1) = \vec{Z}_{\text{best}}(t) + F \times \text{spiral} \times \text{rand} \times \vec{Z}_i(t) Zi(t+1)=Zbest(t)+F×spiral×rand×Zi(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) spiral=radius×(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_{j=1}^{\text{Dim}} \left(z_{\text{best},j}(t) - z_{i,j}(t)\right)^2} radius=j=1∑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(t+1) = \vec{Z}_{\text{best}}(t) + F \times G \times \text{Levy}(\text{Dim}) \times (\vec{Z}_{\text{best}}(t) - \vec{Z}_i(t)) Zi(t+1)=Zbest(t)+F×G×Levy(Dim)×(Zbest(t)−Zi(t))
其中, G G G 是逃避系数,计算为:
G = 2 × ( 1 − t T max ) G = 2 \times \left(1 - \frac{t}{T_{\text{max}}}\right) G=2×(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_no=50; %Number of search solutions
Max_iteration=500; %Maximum number of iterationsFunc_name='F1'; % 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);
tend=toc;% 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',LineWidth=2.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)]);