Intelligent optimization algorithm (source code) - Dung beetle optimizer (DBO)

insert image description here

For more information, please pay attention to the official account above!

On November 27, 2022, the team of Professor Shen Bo of Donghua University, following the sparrow search algorithm, proposed a new swarm intelligence optimization algorithm - Dung beetle optimizer (DBO), which mainly simulates the dung beetle ball rolling, dancing, foraging, stealing and breeding behaviors. Follow the official account and reply to "dung beetle" to get the MATLAB source code .

inspire

  Dung beetles, also known as dung beetles, feed on animal excrement (the taste is very unique). As we all know, dung beetles have an interesting habit of kneading their feces into balls, rolling them to a reliable place to hide (preserving food), and then eating them slowly.

  The dung beetle can roll a dung ball much larger than itself, and can use celestial cues (notably the sun, moon, and polarized light) to navigate so that the dung ball rolls in a straight line; however, if there is no light source at all (that is, , complete darkness), the path of the dung beetle is no longer a straight line, but curved, sometimes even slightly rounded. Many natural factors (such as wind and uneven ground) can cause dung beetles to stray from their original direction. In addition, dung beetles are likely to encounter obstacles during the rolling process and cannot move forward. To do this, dung beetles usually climb onto the ball of dung and dance (including a series of rotations and pauses), which determines the direction of their movement.

  It can be observed from the lifestyle of dung beetles that the acquisition of dung balls has the following two main purposes: (1) some of the dung balls are used to lay eggs and raise the next generation; (2) the rest are used as food. Specifically, the dung beetles bury the dung balls, and the female dung beetles lay eggs in the dung balls. It should be noted that the dung ball is not only a place for the larvae to grow, but also provides the larvae with the food necessary for their survival. Therefore, dung balls play an irreplaceable role in the survival of dung beetles.

  Based on the above-mentioned living habits of dung beetles, and inspired by their behaviors of rolling balls, dancing, foraging, stealing and breeding, researchers proposed a dung beetle optimization algorithm for global search and local utilization.

mathematical model

roll the ball

  According to the above description, we know that the dung beetle needs to navigate through celestial cues during the rolling process, so as to keep the dung ball rolling in a straight line. To simulate the behavior of a rolling ball, the dung beetle needs to move along a given direction throughout the search space. As shown in the figure below, it can be seen that dung beetles use the sun to navigate, and the red arrow indicates the direction of scrolling.

  In the article, the authors hypothesized that the intensity of the light source would also affect the path of the dung beetle. During the rolling process, update the position of the rolling ball dung beetle as follows:

x i ( t + 1 ) = x i ( t ) + α × k × x i ( t − 1 ) + b × Δ x , Δ x = ∣ x i ( t ) − X w ∣ (1) \begin{aligned} x_i(t+1) & =x_i(t)+\alpha \times k \times x_i(t-1)+b \times \Delta x, \\ \Delta x & =\left|x_i(t)-X^w\right| \end{aligned} \tag{1} xi(t+1)Δ x=xi(t)+a×k×xi(t1)+b×Δx , _=xi(t)Xw(1)

where ttt represents the current iteration number,xi ( t ) x_i(t)xi( t ) means thettthiiat iteration tThe position information of i dung beetle,k ∈ ( 0 , 0.2 ] k\in(0,0.2]k(0,0 . 2 ] is a constant representing the deflection coefficient,b ∈ ( 0 , 1 ) b\in(0,1)b0,1 ,α \alphaα is a natural coefficient of 1 or -1,X w X^wXw is the global worst position,Δ x \Delta xΔx simulates changes in light intensity.

In formula (1), for the parameter kkk andbbbChoosing an appropriate value is critical. α \alphaα simulates that natural factors (such as wind and uneven ground) can make dung beetles deviate from their original direction, specifically,α = 1 \alpha=1a=1 means no deviation,α = − 1 \alpha=-1a=1 means deviate from the original direction. α \alphaThe value of α is determined according to the probability method to simulate a complex environment, see the algorithm below. Similarly,Δ x \Delta xThe larger Δx means the weaker the light source, which can bring two benefits: 1) During the optimization process, the entire problem space is explored as thoroughly as possible; 2) The stronger search performance is performed, reducing the possibility of falling into local optimum .

Dance

  When a dung beetle encounters an obstacle and cannot move forward, it dances to reorient itself to find a new course.

  In order to simulate the dance behavior, the author uses the tangent function (only considering the value in the interval [ 0 , π ] The value in the interval [0,\pi][0,π ] interval ) to get the new scrolling direction . Once the dung beetle has successfully settled on a new direction, it should continue rolling the ball backwards. Therefore, the position of the dung beetle is updated as follows:

x i ( t + 1 ) = x i ( t ) + tan ⁡ ( θ ) ∣ x i ( t ) − x i ( t − 1 ) ∣ (2) x_i(t+1)=x_i(t)+\tan (\theta)\left|x_i(t)-x_i(t-1)\right|\tag{2} xi(t+1)=xi(t)+tan ( θ )xi(t)xi(t1)( 2 )
θ \thetaθ is the deflection angle∈ [ 0 , π ] \in[0,\pi][0,p ] .

In formula (2), ∣ xi ( t ) − xi ( t − 1 ) ∣ |x_i(t)-x_i(t-1)|xi(t)xi(t1 ) is thesecondi dung beetle numberttt andt − 1 t-1tThe difference between 1 iteration, so the update of the dung beetle position is closely related to the current and historical information .

reproduce

  In nature, dung balls are rolled to safety by dung beetles and hidden (see Figure 4).

  In order to provide a safe environment for their offspring, it is crucial for dung beetles to choose a suitable spawning site. Inspired by the above discussion, the authors propose a boundary selection strategy to simulate the spawning area of ​​female dung beetles, defined as follows:
L b ∗ = max ⁡ ( X ∗ × ( 1 − R ) , L b ) , U b ∗ = min ⁡ ( X ∗ × ( 1 + R ) , U b ) (3) \begin{aligned} & L b^*=\max \left(X^* \times(1-R), L b\right ), \\ & U b^*=\min \left(X^* \times(1+R), U b\right) \end{aligned}\tag{3}Lb=max(X×(1R),Lb),Ub=min(X×(1+R),Ub)( 3 )
whereX ∗ X^*X represents the current local optimal position,L b ∗ L b^*Lb SumU b ∗ U b^*Ub represent the lower bound and upper bound of the spawning area respectively,R = 1 − t / T max ⁡ R=1-t / T_{\max }R=1t/Tmax T max ⁡ T_{\max } TmaxIndicates the maximum number of iterations, L b L bLb U b U b U b represent the lower bound and upper bound of the optimization problem, respectively.

  As shown in the figure below, the current optimal position X ∗ X^*X Denoted by a brown circle surrounded by small black circles representing ovules, each containing dung beetle eggs.

  Once the spawning area is determined, the female dung beetle will choose the ovum in this area to lay eggs. In the algorithm, it is assumed that each female dung beetle will only lay one egg in each iteration. And from formula (3), it can be clearly seen that the boundary range of the spawning area varies with RRThe R value changes dynamically, so the position of the ovum also changes dynamically during the iteration process, which is defined as follows:

B i ( t + 1 ) = X ∗ + b 1 × ( B i ( t ) − L b ∗ ) + b 2 × ( B i ( t ) − U b ∗ ) (4) B_i(t+1)=X^*+b_1 \times\left(B_i(t)-L b^*\right)+b_2 \times\left(B_i(t)-U b^*\right)\tag{4} Bi(t+1)=X+b1×(Bi(t)Lb)+b2×(Bi(t)Ub)( 4 )
Among them,B i ( t ) B_i(t)Bi( t ) is theiii oval atttPosition information of t iterations,b 1 b_1b1and b 2 b_2b2are two independent size 1 × D 1 \times D1×A random vector of D ,DDD is the dimensionality of the optimization problem. Note that ovules are strictly confined to the spawning area.

foraging

  Some adult dung beetles will emerge from the ground in search of food, as pictured below.

  The author called it the small dung beetle, and simulated the foraging process of the dung beetle. The boundary of the optimal foraging area is as follows:

L b b = max ⁡ ( X b × ( 1 − R ) , L b ) U b b = min ⁡ ( X b × ( 1 + R ) , U b ) (5) \begin{aligned} & L b^b=\max \left(X^b \times(1-R), L b\right) \\ & U b^b=\min \left(X^b \times(1+R), U b\right) \end{aligned}\tag{5} Lbb=max(Xb×(1R),Lb)Ubb=min(Xb×(1+R),Ub)(5)

where X b X^bXb represents the global optimal position,L bb L b^bLbb and $ U b^b$ represent the lower bound and upper bound of the optimal foraging area, respectively. Therefore, the position of the small dung beetle is updated as follows:
xi ( t + 1 ) = xi ( t ) + C 1 × ( xi ( t ) − L bb ) + C 2 × ( xi ( t ) − U bb ) (6) x_i(t+1)=x_i(t)+C_1 \times\left(x_i(t)-L b^b\right)+C_2 \times\left(x_i(t)-U b^b\right)\ tag{6}xi(t+1)=xi(t)+C1×(xi(t)Lbb)+C2×(xi(t)Ubb)(6)

Among them, xi ( t ) x_i(t)xi( t ) means theiii little dung beetlettPosition information of t iterations,C 1 C_1C1Represents a random number that obeys a normal distribution, C 2 C_2C2is ( 0 , 1 ) (0,1)(0,1 ) A random vector in the range.

theft

  Some dung beetles, known as thieves, will steal dung balls from other dung beetles, as shown below.

  It can be seen from formula (5) that X b X^bXb is the optimal food source, so it can be assumed thatX b X^bXAround b is the optimal location for competing food. During the iteration process, the thief’s location information is updated as follows:
xi ( t + 1 ) = X b + S × g × ( ∣ xi ( t ) − X ∗ ∣ + ∣ xi ( t ) − X b ∣ ) x_i(t +1)=X^b+S \times g \times\left(\left|x_i(t)-X^*\right|+\left|x_i(t)-X^b\right|\right)xi(t+1)=Xb+S×g×(xi(t)X+xi(t)Xb)
  of whichxi ( t ) x_i(t)xi( t ) means theiii thief numberttPosition information of t iterations,ggg is of size1 × D 1 \times D1×A random vector of D that obeys a normal distribution,SSS is a constant.

pseudocode

  Based on the above discussion, the pseudocode of the dung beetle optimization algorithm is as follows:

  First, let T max T_{max}Tmaxis the maximum number of iterations, NNN is the population size.

  Then, initialize all agents randomly, distributing the settings as shown in the figure below.

  Afterwards, according to different types of agents, choose an appropriate method to update the positions of the rolling ball dung beetle, egg ball, small dung beetle and thief.

  Finally, output the optimal position X b X^bXb and its fitness value.

Guess you like

Origin blog.csdn.net/hba646333407/article/details/128160453