# Random Exploration and Attraction of the Best in Swarm Intelligence Algorithms
## 4 Revision of the PSO and GWO Algorithms
### The GWO Algorithm  
The GWO algorithm is claimed to be inspired by gray wolf hunting behavior. The ideas behind GWO can be summarized as  
1. Suppose that somehow the position of the optimum is known. Each agent should move closer to the optimum; more precisely, the next position of each agent should be within a neighborhood of the optimum. Such a neighborhood is large at the beginning and it is reduced monotonically. 2. Due to the position of the optimum being unknown, each agent moves according to the following procedure: calculate a preliminary next position of the agent, assuming that * the optimum is on the best-evaluated agent. * the optimum is on the second-best evaluated agent. * the optimum is on the third-best evaluated agent. * the effective next position of the agent is the average of the three preliminary next positions. The first idea can be implemented as follows. \[\chi_{i}^{k+1}=\chi^{*}+v_{i}^{k} \tag{21}\]  
where \(\chi^{*}\) is the optimum (assumed to be known) and \(v_{i}\) is a vector that depends on the distance between \(\chi^{*}\) and \(\chi_{i}^{k}\). The vector \(v_{i}\) can be large at the beginning but must become smaller as the algorithm progresses. Using the notation presented in Section 2, the GWO algorithm proposed in [19] is given by (21) with  
\[v_{i}^{k} =-\rho_{\pm s}\circ\left[\chi_{a}^{*}-\chi_{i}^{k}\right] \tag{22a}\] \[\chi_{a}^{*} =\rho_{2}\circ\chi^{*} \tag{22b}\]  
where \(\chi_{a}^{*}\) stands for apparent optimum and it is within a neighborhood of \(\chi^{*}\) and \(s\) is a scaling factor that is equal to 2 at the beginning and decreases linearly till 0. Since the optimum \(\chi^{*}\) is unknown, in [19], expressions (21) and (22) are modified to be  
\[\chi_{i}^{k+1} =\frac{1}{3}(N_{\alpha}+N_{\beta}+N_{\delta}) \tag{23a}\] \[N_{\alpha}=\chi_{\alpha}^{k}+v_{\alpha};\quad v_{\alpha}=-\rho_{ \pm s}\circ\left[\chi_{\alpha}^{*}-\chi_{i}^{k}\right];\quad\chi_{\alpha}^{*} =\rho_{2}\circ\chi_{\alpha}^{k}\] (23b) \[N_{\beta}=\chi_{\beta}^{k}+v_{\beta};\quad v_{\beta}=-\rho_{\pm s }\circ\left[\chi_{\beta}^{*}-\chi_{i}^{k}\right];\quad\chi_{\beta}^{*} =\rho_{2}\circ\chi_{\beta}^{k}\] (23c) \[N_{\delta}=\chi_{\delta}^{k}+v_{\delta};\quad v_{\delta}=-\rho_{ \pm s}\circ\left[\chi_{\delta}^{*}-\chi_{i}^{k}\right];\quad\chi_{\delta}^{*} =\rho_{2}\circ\chi_{\delta}^{k} \tag{23d}\]  
where \(\chi_{\alpha}^{k}\), \(\chi_{\beta}^{k}\) and \(\chi_{\delta}^{k}\) are the best-evaluated search agents at generation \(k\). The symbols \(N_{\alpha}\), \(N_{\beta}\), and \(N_{\delta}\) stand for the next position if the optimum were at \(\chi_{\alpha}^{k}\), \(\chi_{\beta}^{k}\), and \(\chi_{\delta}^{k}\), respectively. It is worth noting that, like PSO, the GWO also performs REAB procedures. In GWO, REAB procedures are even more explicit because when \(s>1\), random exploration is favored, and when \(s<1\), attraction of the best is more significant. A Criticism of Algorithms Inspired by Animal Behavior  
Inspiration from animal behavior has the advantage of having a guide to move the agents and name the algorithm for easy identification. However, there are several drawbacks:* Somehow, a comparison of animal behavior with the search for an optimum using artificial agents is loose. Animals have many characteristics that search agents do not. They have senses (sight, smell, and hearing), and their movements are restricted by their own bodies and the environment; they move in a 3-dimensional space. Agents do not have senses, their motions are discontinuous, and they move in n-dimensional space. * It is common to extend or stretch the analogy of animal-agent almost arbitrarily. For example, in GWO, it is said that (a) an agent does not move to the optimum but to a neighborhood of the optimum because the prey is in movement; (b) at the beginning, the neighborhood where the agent can move is large because there is an \"exploration\" stage; (c) exactly three agents are used as leaders because, in the wolf pack, there are three different kinds of wolves.