# An Efficient and Fast Hybrid GWO-JAYA Algorithm for Design Optimization
## 2 The FHGWJA Algorithm
However, the classical GWO search scheme has two inherent drawbacks: (i) since the position of the prey (optimal solution) is not known a priori, the search is directly biased toward the \(\alpha\) wolf that has a null distance from the current best record \(X_{best}\) as it corresponds to the current best record itself in view of population sorting; (ii) there is no guarantee that each new trial solutions \(\overset{\rightarrow}{X_{i,tr}}\) may improve the current best record \(\overset{\rightarrow}{X_{best}}\) or at least the corresponding individual \(\overset{\rightarrow}{X_{i}}\) stored in the previous population. In order to solve these issues, FHGWJA refines the preliminary trial solutions \((\overset{\rightarrow}{X_{i,tr}})^{pred}\) obtained in Step 1 by means of a rank-based criterion. The population defined in the previous iteration is sorted with respect to the penalized cost function values \(W_{p}(\overset{\rightarrow}{X_{i}})\). The best solution is assigned the rank 1 while the worst solution is assigned the rank 1/\(N_{\text{POP}}\): let \(rank(^{\text{(i)}})=1/i\) be the rank of the generic individual \(\overset{\rightarrow}{X_{i}}\). The average rate of variation for the penalized cost function with respect to the current best record \(\gamma^{\text{(i)}}=\Delta W_{p}{}^{\text{(i)}}/\Delta S^{\text{(i)}}\) is evaluated for each solution \(\overset{\rightarrow}{X_{i}}\). The \(\Delta W_{p}{}^{\text{(i)}}=[W_{p}(\overset{\rightarrow}{X_{i}})-W_{p}( \overset{\rightarrow}{X_{best}})]\) numerator representsthe increase in the penalized cost function that occurs when the design is perturbed by \(\Delta S^{(0)}=\|\overrightarrow{X_{i}}-X_{best}^{\rightarrow}\|\) from the current best record to the generic candidate solution \(\overrightarrow{X_{i}}\). The average rate of variation \(\gamma^{(\text{aver})}=\sum_{i=1}^{N_{\text{TOP}}}\gamma^{(i)}/N_{\text{TOP}}\) is hence defined. The refinement step size \(\mu^{(i)}\) is defined for each individual \(X_{i}\) as follows:  
\[\mu^{(i)}=Min\Bigg{\{}\left(1-rank^{(i)}\right);\left(\frac{\gamma^{(i)}}{ \gamma^{(\text{aver})}}\right)\Bigg{\}} \tag{11}\]  
The preliminary trial solution \(\left(\overrightarrow{X_{i,tr}}\right)^{\textit{preI}}\) is adjusted to the trial solution \(\overrightarrow{X_{i,tr}}\) using the following equation:  
\[\overrightarrow{X_{i,tr}}=(\overrightarrow{X_{i,tr}})^{\textit{preI}}+\frac {(\overrightarrow{X_{best}}-\overrightarrow{X_{i}})}{\|\overrightarrow{X_{ best}}-\overrightarrow{X_{i}}\|}\mu^{(i)} \tag{12}\]  
The rationale behind Equations (11) and (12) is the following. All trial solutions generated via the GWO must be evaluated to see if they improve design. Individuals ranked as high-quality solutions in the previous iteration are very likely to preserve their rank in the current iteration. However, rank may decrease if the cost function changes sharply in the neighborhood of the currently perturbed solution: for example, this may occur if the perturbed solution turns infeasible, and the penalty term increases. For this reason, Equation (11) tends to preserve the overall ranks of population individuals by setting small refinement step sizes \(\mu^{(i)}\). Since the design improves by moving from \(\overrightarrow{X_{i}}\) to \(\overrightarrow{X_{best}}\), the direction \(\overrightarrow{S_{i}}=(\overrightarrow{X_{best}}-\overrightarrow{X_{i}})\) is a descent direction with respect to the \(\overrightarrow{X_{i}}\) individual. Hence, FHGWJA attempts to perturb design along the \(\overrightarrow{S_{i}}\) direction to further reduce the cost function at least with respect to \(\overrightarrow{X_{i}}\). 1. Evaluation and modification/repair of new trial designs: elitist strategies and JAYA scheme  
The trial designs \(\overrightarrow{X_{i,tr}}\) generated via FHGWJA in Steps 1 and 2 are then evaluated. In the classical GWO, if the new design \(\overrightarrow{X_{i,tr}}\) improves the old design \(\overrightarrow{X_{i}}\), it replaces \(\overrightarrow{X_{i}}\) in the new population.