1.背景
2019年,M Jain等人受到自然界松鼠觅食行为启发,提出了松鼠搜索算法(Squirrel Search Algorithm, SSA)。
2.算法原理
2.1算法思想
SSA来源于松鼠的自然动态觅食行为,该算法模拟松鼠在不同种类树之间滑行寻找食物来源和躲避捕食者来搜索全局最优解。
2.2算法过程
根据松鼠食物的优劣,可将松鼠位置分为核桃树、橡树以及普通树, 根据松鼠搜索方法中松鼠的觅食规则和适应度函数计算松鼠位置的适应度值并按升序排列,最小适应值的松鼠位置为山核桃树,适应度值由小到大排序中位于第 2 至第 4 位的松鼠位置为橡树,其余适应度值的松鼠位置皆为普通树。(和GWO中分级领导挺像)
橡树上的松鼠向山核桃树移动
松鼠位置的第一更新模型为:
X
a
t
t
+
1
=
{
X
a
t
t
+
d
g
×
G
c
×
(
X
h
t
t
−
X
a
t
t
)
,
R
l
⩾
P
d
p
R
a
n
d
o
m
l
o
c
a
t
i
o
n
,
o
t
h
e
r
w
i
s
e
(1)
X_{\mathrm{at}}^{t+1}=\begin{cases}X_{\mathrm{at}}^{t} + d_{\mathrm{g}} \times G_{\mathrm{c}} \times ( X_{\mathrm{ht}}^{t} - X_{\mathrm{at}}^{t} ) ,&R_{\mathrm{l}} \geqslant P_{\mathrm{dp}}\\Randomlocation ,&otherwise\end{cases} \tag{1}
Xatt+1={Xatt+dg×Gc×(Xhtt−Xatt),Randomlocation,Rl⩾Pdpotherwise(1)
其中,dg 为随机滑翔距离,Xat 代表松鼠在橡树上的位置,Xht 代表松鼠在核桃树上的位置,Gc 为滑动系数实现全局与局部搜索之间的平衡,Gc= 1. 9,Pdp 是天敌的出现概率。
普通树上的松鼠向橡树上移动
松鼠位置的第二更新模型为:
X
n
t
t
+
1
=
{
X
n
t
t
+
d
g
×
G
c
×
(
X
a
t
t
−
X
n
t
t
)
,
R
2
≥
P
d
p
R
a
n
d
o
m
l
o
c
a
t
i
o
n
,
o
t
h
e
r
w
i
s
e
(2)
X_{nt}^{t+1}=\begin{cases}X_{\mathrm{nt}}^t+d_{\mathrm{g}}\times G_{\mathrm{c}}\times(X_{\mathrm{at}}^t-X_{\mathrm{nt}}^t) ,&R_2\geq P_{\mathrm{dp}}\\Randomlocation ,&otherwise&\end{cases}\tag{2}
Xntt+1={Xntt+dg×Gc×(Xatt−Xntt),Randomlocation,R2≥Pdpotherwise(2)
普通树上的松鼠向山核桃树移动
普通树上的松鼠由于已经吃了橡果,因此它们会向山核桃树移动以便储存山核桃来应对食物短缺:
X
n
t
t
+
1
=
{
X
n
t
t
+
d
g
×
G
e
×
(
X
h
t
t
−
X
n
t
t
)
,
R
3
≥
P
d
p
R
a
n
d
o
m
l
o
c
a
t
i
o
n
,
o
t
h
e
r
w
i
s
e
(3)
X_{{_{\mathrm{nt}}}}^{t+1}=\begin{cases}X_{{_{\mathrm{nt}}}}^{t} + d_{{_{\mathrm{g}}}} \times G_{{_{\mathrm{e}}}} \times ( X_{{_{\mathrm{ht}}}}^{t} - X_{{_{\mathrm{nt}}}}^{t} ) ,&R_{{_{\mathrm{3}}}}\geq P_{{_{\mathrm{dp}}}}\\Randomlocation ,&otherwise&&\end{cases}\tag{3}
Xntt+1={Xntt+dg×Ge×(Xhtt−Xntt),Randomlocation,R3≥Pdpotherwise(3)
通过计算季节性常数,对比普通树和核桃树上松鼠的适应度值。若普通树上松鼠的适应度值小于核桃树上的,认为满足季节变化条件。随后重新定义普通树上松鼠的位置,并持续迭代,直至季节条件不再满足。
季节常数:
S
c
t
=
∑
z
=
1
3
∑
k
=
1
d
(
X
a
t
,
k
t
−
X
h
t
,
k
)
2
(4)
S_c^t=\sqrt{\sum_{z=1}^3\sum_{k=1}^d\left(X_{at,k}^t-X_{ht,k}\right)^2}\tag{4}
Sct=z=1∑3k=1∑d(Xat,kt−Xht,k)2(4)
计算季节变化条件 Stc < Smin :
S
min
=
10
E
−
6
(
365
)
t
/
(
t
m
/
2.5
)
(5)
S_{\min}=\frac{10\text{E}^{-6}}{(\text{ 365 })^{t/(t_m/2.5)}}\tag{5}
Smin=( 365 )t/(tm/2.5)10E−6(5)
Smin 平衡算法的全局和局部搜索能力,较大利于全局搜索,较小利于局部走搜索。
如果季节条件满足,则重新定位普通树上松鼠的位置:
X
n
t
,
i
t
+
1
=
X
i
,
L
+
L
e
v
y
×
(
X
i
,
U
−
X
i
,
L
)
(6)
X_{nt,i}^{t+1}=X_{i,L}+Levy\times(X_{i,U}-X_{i,L})\tag{6}
Xnt,it+1=Xi,L+Levy×(Xi,U−Xi,L)(6)
在松鼠搜索算法中通过检查季节变化条件,防止算法陷入局部最优。
伪代码
3.结果展示
4.参考文献
[1] Jain M, Singh V, Rani A. A novel nature-inspired algorithm for optimization: Squirrel search algorithm[J]. Swarm and evolutionary computation, 2019, 44: 148-175.