Slime Mold Algorithm (SMA)

1. Algorithm inspiration

  The Slime Mold Algorithm (SMA) is an optimization algorithm based on the foraging behavior of slime molds. During foraging, slime molds undergo oscillatory contractions when they find food. In addition, a vein network of varying thicknesses will be formed between multiple food sources. The thickness of the vein network is related to the quality of the food source. When slime molds obtain food, they may still search unknown areas.

2. Algorithm introduction

2.1 Initialization phase

  In SMA, the initial slime mold population position update formula is as shown in (1):
X i = rand ∙ ( UB − LB ) + LB (1) {X_i} = rand \bullet (UB - LB) + LB \tag {1}Xi=rand(UBLB)+LBIn formula ( 1 ) , X i X_{i}Xiis the position of the i-th individual, UB UBU B andLB LBL B is the upper and lower bounds of the search range,rand randr and d are random numbers between 0 and 1.

2.2 Exploration stage

  Even though slime molds find better food sources, they will separate individuals and explore other areas in an attempt to find higher quality food sources. According to the above analysis, the update of the slime mold position can be expressed as
X ( t + 1 ) = R and ∙ ( UB − LB ) + LB , R and < z (2) LB) + LB,Rand < z \tag{2}X(t+1)=Rand(UBLB)+LB,Rand<z( 2 ) Among them,z = 0.03 z=0.03z=0.03 r a n d rand r an d is0 00 to1 1A random number between 1 .

2.3 Development stage

  When the slime mold finds food, it will shrink. Its contraction pattern can be described as
X ( t + 1 ) = { X b ( t ) + vb × ( W × XA ( t ) − XB ( t ) ) , r < p , vc × X ( t ) , r ≥ p , (3) }(t) - {X_B}(t)),r < p,} \cr &{vc \times X(t)\qquad\qquad\qquad\qquad\qquad\quad,r \ge p,} \cr \end{aligned}} \right. \tag{3}X(t+1)={ Xb(t)+vb×(W×XA(t)XB(t)),r<p,vc×X(t),rp,( 3 ) Among them,vb vbv b is[ – a , a ] [–a, a][a,a ] random number,vc vcv c is at[ – 1 , 1 ] [–1, 1][–1,1 ] parameter that oscillates within and eventually approaches zero,X b ( t ) X_{b}(t)Xb( t ) represents the current individual position with optimal fitness,X (t) X(t)X ( t ) represents the current position of the slime mold individual,XA (t) X_{A}(t)XA( t ) andXB (t) X_{B}(t)XB( t ) represents the position of two random individuals,ttt represents the current iteration number,WWW represents the weight coefficient of slime mold.
  Control parameterppp , parameteraaa and weight coefficientWWThe update formulas of W are
p = tanh ⁡ ∣ S ( i ) − DF ∣ , ( i = 1 , 2 , ⋯ , N ) , (4) p = \tanh |S(i) - DF|,(i = 1,\;2,\; \cdots ,\;N), \tag{4}p=fishyS(i)DF,(i=1,2,,N),(4) a = a r c t a n h ( − t T + 1 ) , (5) a = {\mathop{ arctanh}\nolimits} ( - {t \over T} + 1), \tag{5} a=arctanh(Tt+1),(5) W ( S m e l l I n d e x ( i ) ) = { 1 + r 1 log ⁡ ( b F − S ( i ) b F − w F + 1 ) , i < N 2 , 1 − r 1 log ⁡ ( b F − S ( i ) b F − w F + 1 ) , i ≥ N 2 , (6) W({ {SmellIndex}}(i)) = \left\{ {\begin{aligned} {1 + {r_1}\log ({ {bF - S(i)} \over {bF - wF}} + 1),i < {N \over 2},} \cr {1 - {r_1}\log ({ {bF - S(i)} \over {bF - wF}} + 1),i \ge {N \over 2},} \cr \end{aligned} } \right. \tag{6} W(SmellIndex(i))= 1+r1log(bFwFbFS(i)+1),i<2N,1r1log(bFwFbFS(i)+1),i2N,(6) S m e l l I n d e x = s o r t ( N ) (7) { {SmellIndex}} = { {sort}}(N) \tag{7} SmellIndex=sort(N)( 7 ) Among them,NNN is the population size,S ( i ) S(i)S ( i ) display No.iiFitness of i slime mold individuals, DF DFD F represents the current optimal fitness,r 1 r_{1}r1Represents [0, 1] [0,1][0,1 ] random number,TTT represents the maximum number of iterations,i < N 2 i < {N \over 2}i<2Nrepresents S ( i ) S(i)S ( i ) The top half of slime mold individuals,b F bFb F represents the best fitness obtained in the current iteration,w F wFwF represents the worst fitness obtained in the current iteration,SmellIndex SmellIndexS m e ll I n d ex represents the fitness sequence.

2.4 Algorithm pseudocode

  1. Initialize the number of slime molds NNN and the maximum number of iterationsTTT , etc.
  2. Initialize the population X i (i = 1, 2, . . ., n) X_i(i=1,2,...,n)Xi(i=1,2,...,n)
  3. While t < T t < T t<T do
  4.   Check if any slime mold individuals exceed the search space and modify them
  5.   Calculate the hunger value of each slime mold
  6.   Sort the slime molds by hunger value and find the slime mold that eats the most X b X_{b}Xband its location best F itness bestFitnessbestFitness
  7.   Use formula (6) to update parameter WWW
  8.   For i = 1 i = 1 i=1 to NNN do
  9.     If R a n d < z Rand<z Rand<z then
  10.       Use formula (2) to update the slime mold position
  11.     Else
  12.     Use formula (4) to update parameter ppp
  13.     Use formula (3) to update the slime mold position
  14.     End If
  15.   End For
  16.    t = t + 1 t=t+1 t=t+1
  17. End While
  18. Return the most eaten slime mold X b X_{b}Xband its location best F itness bestFitnessbestFitness

3. Experimental results

  SMA on 23 classic test functions (set dimension dim = 30 dim=30dim=30 ) The convergence curves in F1, F5, and F8, the test function formula is as follows:

function official Theoretical value
F1 F 1 ( x ) = ∑ i = 1 d x i 2 {F_1}(x) = \sum\nolimits_{i = 1}^d {x_i^2} F1(x)=i=1dxi2 0.00 0.00 0.00
F5 F 5 ( x ) = ∑ i = 1 n − 1 [ 100 ( x i + 1 − x i 2 ) 2 + ( x i − 1 ) 2 ] {F_5}(x) = \sum\nolimits_{i = 1}^{n - 1} {[100{ {({x_{i + 1}} - x_i^2)}^2} + { {({x_i} - 1)}^2}]} F5(x)=i=1n1[100(xi+1xi2)2+(xi1)2] 0.00 0.00 0.00
F8 F 8 ( x ) = ∑ i = 1 d − x i sin ⁡ ( ∣ x i ∣ ) {F_8}(x) = \sum\nolimits_{i = 1}^d { - {x_i}\sin (\sqrt {|{x_i}|})} F8(x)=i=1dxisin(xi ) − 418.9829 × d i m -418.9829×dim 418.9829×dim

3.1 F1 convergence curve

Insert image description here

3.2 F5 convergence curve

Insert image description here

3.3 F8 convergence curve

Insert image description here

4. References

[1] LI S M, CHEN H L, WANG M J, et al. Slime mould algorithm: a new method for stochastic optimization[J]. Future generation computer systems, 2020, 111, 300-323.

Guess you like

Origin blog.csdn.net/jiaheming1983/article/details/129346479