黏菌算法(Slime Mould Algorithm, SMA)是根据黏菌的规食行为得到的一种优化算法。黏菌在规食过程中发现食物时,会有振荡收缩的特性。同时,在多个食物源之间会形成粗细不一的静脉网络,并且静脉网络的粗细与食物源的质量有关。此外,黏菌在获取食物源时,仍会有一定的概率对未知区域进行搜索。
黏菌主要有三种行为:接近食物、包裹食物和获取食物。
为了将黏菌的趋近行为建模为一个数学方程,提出了以下规则来模拟黏菌的收缩模式: X ( t + 1 ) = { X b ( t ) + v b × ( W × X A ( t ) − X B ( t ) ) , r < p v c × X ( t ) , r ≥ p (1) X(t+1)=\begin{dcases}X_b(t)+vb×(W×X_A(t)-X_B(t)),r X(t+1)={Xb(t)+vb×(W×XA(t)−XB(t)),r<pvc×X(t),r≥p(1)
控制参数 p p p、参数 v b vb vb、参数 a a a与权重系数 W W W的更新公式如下: p = tanh ∣ S ( i ) − D F ∣ (2) p=\tanh|S(i)-DF|\tag{2} p=tanh∣S(i)−DF∣(2)其中, i ∈ 1 , 2 , ⋯ , n i\in1,2,\cdots,n i∈1,2,⋯,n, S ( i ) S(i) S(i)表示第 i i i个黏菌个体的适应度值, D F DF DF为当前取得的最优适应度值。 v b = [ − a , a ] (3) vb=[-a,a]\tag{3} vb=[−a,a](3) a = arctanh ( − ( t T ) + 1 ) (4) a=\text{arctanh}(-\left(\frac tT\right)+1)\tag{4} a=arctanh(−(Tt)+1)(4) W ( S m e l l I n d e x ( i ) ) = { 1 + r ⋅ l o g ( b F − S ( i ) b F − w F + 1 ) , c o n d i t i o n 1 − r ⋅ l o g ( b F − S ( i ) b F − w F + 1 ) , o t h e r s (5) W(SmellIndex(i))=\begin{dcases}1+r\cdot log\left(\frac{bF-S(i)}{bF-wF}+1\right),\quad condition\\1-r\cdot log\left(\frac{bF-S(i)}{bF-wF}+1\right),\quad others\end{dcases}\tag{5} W(SmellIndex(i))=⎩⎪⎪⎨⎪⎪⎧1+r⋅log(bF−wFbF−S(i)+1),condition1−r⋅log(bF−wFbF−S(i)+1),others(5) S m e l l I n d e x = s o r t ( S ) (6) SmellIndex=sort(S)\tag{6} SmellIndex=sort(S)(6)其中, c o n d i t i o n condition condition表示种群中适应度排在前一半个体, o t h e r s others others表示剩下的个体, r r r表示 [ 0 , 1 ] [0,1] [0,1]之间的随机数, b F bF bF表示当前迭代获取的最佳适应度值, w F wF wF表示当前迭代最差适应度值。 S m e l l I n d e x ( i ) SmellIndex(i) SmellIndex(i)为适应度值序列(求极小值问题为递增序列)。
黏菌个体的位置更新公式如下: X ( t + 1 ) = { r a n d ⋅ ( U B − L B ) + L B , r a n d < z X b ( t ) + v b × ( W × X A ( t ) − X B ( t ) ) , r < p v c × X ( t ) , r ≥ p (7) X(t+1)=\begin{dcases}rand\cdot(UB-LB)+LB,\quad\quad \quad \quad \,rand
v b vb vb的值在 [ − a , a ] [-a,a] [−a,a]之间随机振荡,并且随着迭代次数的增加逐渐接近零。 v c vc vc的值在 [ − 1 , 1 ] [-1,1] [−1,1]之间振荡,最终趋于零,计算公式如下: v c = [ − b , b ] (8) vc=[-b,b]\tag{8} vc=[−b,b](8) b = 1 − t / T (9) b=1-t/T\tag{9} b=1−t/T(9) v b vb vb和 v c vc vc随迭代次数的变化情况如图1所示, v b vb vb和 v c vc vc之间的协同作用模拟了黏菌的选择行为。
将SMA算法与GWO、SCA和WOA算法进行对比,以文献[1]中30维的F1~F5为例。种群规模设置为 N = 30 N=30 N=30,最大迭代次数 T = 1000 T=1000 T=1000,每个算法独立运算30次。
结果显示如下:
函数:F1
GWO:best: 0,worst:0,mean:0,std:0
SCA:best: 1.2074e-07,worst:0.78621,mean:0.064539,std:0.18886
WOA:best: 7.9181e-169,worst:3.2697e-149,mean:1.148e-150,std:5.9669e-150
SMA:best: 0,worst:0,mean:0,std:0
函数:F2
GWO:best: 2.0369e-315,worst:1.2641e-189,mean:4.2135e-191,std:0
SCA:best: 9.6861e-08,worst:7.9582e-05,mean:9.8167e-06,std:1.5905e-05
WOA:best: 9.0857e-114,worst:6.2747e-104,mean:4.2066e-105,std:1.3224e-104
SMA:best: 0,worst:1.4897e-193,mean:4.9658e-195,std:0
函数:F3
GWO:best: 0,worst:0,mean:0,std:0
SCA:best: 28.0204,worst:12658.1217,mean:3151.4432,std:2934.3648
WOA:best: 754.6686,worst:42890.8096,mean:22061.4708,std:11158.2669
SMA:best: 0,worst:0,mean:0,std:0
函数:F4
GWO:best: 0,worst:3.2301e-181,mean:1.0767e-182,std:0
SCA:best: 1.479,worst:45.1446,mean:17.743,std:11.2051
WOA:best: 0.50087,worst:88.8509,mean:45.5944,std:30.4244
SMA:best: 0,worst:1.0959e-180,mean:3.6529e-182,std:0
函数:F5
GWO:best: 0.002612,worst:27.6362,mean:5.7737,std:10.8871
SCA:best: 28.0899,worst:3588.5641,mean:261.7717,std:718.9743
WOA:best: 26.5473,worst:28.5326,mean:27.1689,std:0.46015
SMA:best: 0.0010161,worst:27.287,mean:5.6596,std:10.9604
结果表明,SMA算法具有良好的鲁棒性以及寻优精度。
[1] Shimin Li, Huiling Chen, Mingjing Wang, Ali Asghar Heidari, Seyedali Mirjalili. Slime mould algorithm: A new method for stochastic optimization[J]. Future Generation Computer Systems, 2020, 111: 300-323.