Gray Wolf Optimizer (GWO)

1. Algorithm inspiration

  Gray Wolf Optimizer (GWO) is a swarm intelligence optimization algorithm proposed by Mirjalili et al., a scholar at Griffith University in Australia, in 2014. Inspired by the pack hunting behavior of gray wolves. The GWO algorithm simulates the leadership hierarchy and hunting mechanism of gray wolves in nature. Gray wolves are divided into four types to simulate hierarchies. In addition, the three main stages of finding prey, surrounding prey, and attacking prey are simulated.

2. Algorithm introduction

2.1 Initialization

  In GWO, in order to mathematically simulate the social hierarchy of wolves, the optimal solution is defined as alpha ( α αα ) is used to simulate the position of the leading wolf (first-order wolf). Therefore, the second and third best solutions are named beta(β βb )和delta(d dδ ) is used to model the positions of second-order and third-order wolves. The remaining candidate solutions are assumed to be omega(ω ωω ) is used to simulate the position of the subordinate wolf (fourth-order wolf). In the GWO algorithm, hunting (solving) is given byα αα狼、b bβ狼和d dDelta Wolf Guidance. ω ωω wolf followed these three wolves.

2.2 Searching for prey (exploration phase)

  Gray wolves are mostly based on α αα狼、b bβ狼和d dSearch for delta wolf's location. They separate from each other in search of prey and then converge to attack the prey. To mathematically model divergence, use random values ​​greater than1 11 or less than− 1 -1- 1 AA_A to force individual gray wolves to deviate from their prey. This is primarily used for algorithm exploration and enables GWO to conduct global searches. As shown in Figure 1,∣ A ∣ > 1 |A|>1A>1 forces the gray wolf to stray from its prey in the hope of finding stronger prey. Another component of GWO that facilitates exploration isCCC , which is calculated using equation (4), is a random number in the range[0, 2] [0,2][0,2 ] . This parameter gives the prey random weights to strengthen (C > 1 C > 1C>1 ) or decrease (C < 1 C < 1C<1 o'clock) The influence of prey position on the gray wolf's next position, the calculation formula is shown in formula (1).
Insert image description here

Figure 1 Attacking prey and finding prey

2.3 Development stage

2.3.1 Rounding up prey

  During the hunt, gray wolves surround their prey. To mathematically model the wraparound behavior, the following equation is proposed:
D = ∣ C ⋅ X p ( t ) − X ( t ) ∣ (1) D = \left| { C \cdot { { X}_{\rm {p}}}(t) - X(t)} \right|\tag{1}D=CXp(t)X(t)(1) X ( t + 1 ) = X p ( t ) − A ⋅ D (2) X(t + 1) = { X_{\rm{p}}}(t) - A \cdot D\tag{2} X(t+1)=Xp(t)AD( 2 ) Among them,ttt represents the current iteration number,AAA andCCC is the coefficient,X p X_{p}Xpis the position of the prey, is the position of the prey, X ( t ) X(t)X ( t ) is thettthThe position of generation t . AAA andCCThe calculation method of C is as follows:
A = 2 a ⋅ r 1 − a (3) A = 2 a \cdot { r_1} - a \tag{3}A=2a _r1a(3) C = 2 ⋅ r 2 (4) C = 2 \cdot { r_2}\tag{4} C=2r2( 4 ) Among them,r 1 r_{1}r1 r 2 r_{2} r2is [ 0 , 1 ] [0,1][0,1 ] random value. To simulate approaching prey,AAA is between[ − a , a ] [-a,a][a,a random value in a ] , where aaa changes from 2 2during the iteration2 reduced to0 00

2.3.2 Attack prey

  Gray wolves have the ability to identify the location of prey and hunt them. Hunting usually consists of α αα wolf takes command,β ββ狼和d dDelta wolves also occasionally participate in hunting. The mathematical model of an individual gray wolf tracking the position of prey is described as follows:
D α = ∣ C 1 ⋅ X α − X ∣ (5) { { D}_\alpha } = \left| { { { C}_1} \cdot { { X}_\alpha } - X} \right|\tag{5}Da=C1XaX(5) D β = ∣ C 2 ⋅ X β − X ∣ (6) { { D}_\beta } = \left| { { { C}_2} \cdot { { X}_\beta } - X} \right|\tag{6} Db=C2XbX(6) D δ = ∣ C 3 ⋅ X δ − X ∣ (7) { { D}_\delta } = \left| { { { C}_3} \cdot { { X}_\delta } - X} \right|\tag{7} Dd=C3XdX( 7 ) Among them,D α D_{α}Da, D β D_{β}DbD δ D_{δ}DdRepresent α α respectivelyα狼、b bβ狼和d dδThe distance between the wolf and other individuals;X α X_{α}Xa, X β X_{β}XbX δ X_{δ}XdRepresent α α respectivelyα狼、b bβ狼和d dδThe current position of the wolf;C 1 C_{1}C1 C 2 C_{2} C2and C 3 C_{3}C3is a random number, XXX is the current location of the gray wolf individual.
X 1 = X α − A 1 ⋅ ( D α ) (8) { { X}_1} = { { X}_\alpha } - { { A}_1} \cdot ({ { D}_\alpha }) \tag{8}X1=XaA1(Da)(8) X 2 = X β − A 2 ⋅ ( D β ) (9) { { X}_2} = { { X}_\beta } - { { A}_2} \cdot ({ { D}_\beta })\tag{9} X2=XbA2(Db)(9) X 3 = X δ − A 3 ⋅ ( D δ ) (10) { { X}_3} = { { X}_\delta } - { { A}_3} \cdot ({ { D}_\delta })\tag{10} X3=XdA3(Dd)( 1 0 ) Where,X 1 X_{1}X1 X 2 X_{2} X2and X 3 X_{3}X3Respectively represent the α αα狼、b bβ狼、d dδ wolf influence,ω ωωWolf 's adjusted position. The average value is taken here, that is: X (t + 1) = X 1 + X 2 + X 3 3 (11) X( t
+ 1) = { { { { { X}_3}} \over 3}\tag{11} X(t+1)=3X1+X2+X3( 1 1 )   The location update method of the gray wolf can be represented by Figure 2.
Insert image description here

Figure 2 Schematic diagram of gray wolf’s location update

2.4 Algorithm pseudocode

  1. Initialize the gray wolf population X i (i = 1, 2, . . ., n) X_{i}(i=1,2,...,n)Xi(i=1,2,...,n)
  2. Initialize a, A, C, t = 0 a,A,C,t=0a,A,C,t=0
  3. Calculate the fitness value of each gray wolf individual
  4. X a X_{a}Xa= The gray wolf individual with the best fitness value
  5. X β X_{β}Xb= The gray wolf individual with the second highest fitness value
  6. X δ X_{δ}Xd= The gray wolf individual with the third highest fitness value
  7. While t < M a x t < Max t<Max
  8.   For i = 1 i = 1 i=1 to NNN do
  9.     Use formula (11) to update the current position of the gray wolf individual
  10.   End For
  11.   Update aaa A A A andCCC
  12.   Calculate the fitness values ​​of all gray wolf individuals
  13.   update X a X_{a}Xa, X β X_{β}XbX δ X_{δ}Xd
  14.    t = t + 1 t=t+1 t=t+1
  15. End While
  16. Return the optimal solution X α X_{α}Xa

3. Experimental results

GWO in 23 classic test functions (set dimension dim = 30 dim=30dim=The convergence curves in F5, F6, and F7 of 3 0 ), the test function formula is as follows:

function official Theoretical value
F5 F 5 ( x ) = ∑ i = 1 d − 1 [ 100 ( x i + 1 − x i 2 ) 2 + ( x i − 1 ) 2 ] {F_5}(x) = \sum\nolimits_{i = 1}^{d - 1} {[100{ {({x_{i + 1}} - x_i^2)}^2} + { {({x_i} - 1)}^2}]} F5(x)=i=1d1[100(xi+1xi2)2+(xi1)2] 0.00 0.00 0.00
F6 F 6 ( x ) = ∑ i = 1 d ( x i + 5 ) 2 {F_6}(x) = {\sum\nolimits_{i = 1}^d {({x_i} + 5)} ^2} F6(x)=i=1d(xi+5)2 0.00 0.00 0.00
F7 F 7 ( x ) = ∑ i = 1 d i × x i 4 + r a n d o m [ 0 , 1 ) {F_7}(x) = \sum\nolimits_{i = 1}^d {i \times x_i^4 + random[0,1)} F7(x)=i=1di×xi4+r a n d o m [ 0 ,1) 0.00 0.000.00

3.1 F5 convergence curve

Please add image description

3.2 F6 convergence curve

Insert image description here

3.3 F7 convergence curve

Insert image description here

4. References

[1] S. Mirjalili, S. M. Mirjalili, A. Lewis. Grey Wolf Optimizer[J]. Advances in Engineering Software, 2014, 69, 46-61.

Guess you like

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