# An Efficient and Fast Hybrid GWO-JAYA Algorithm for Design Optimization
## 2 The FHGWJA Algorithm  
The new hybrid metaheuristic algorithm FHGWJA developed in this study is now described in detail. The algorithm is composed of seven steps: (i) initialization; (ii) preliminary definition of trial solutions with the classical GWO; (iii) rank-based refinement of preliminary trial solutions defined with the classical GWO; (iv) evaluation/repair of trial solutions with elitist strategies and JAYA-based schemes; (v) population reordering to define the new best and worst individuals and update of the \(\alpha\)-\(\beta\)-\(\delta\) wolves trying to avoid stagnation; (vi) convergence check; (vii) end of optimization search and output. Step 1. InitializationFHGWJA randomly generates a population of \(N_{\text{POP}}\) candidate designs (i.e., wolves) as:  
\[x_{j}^{i}=x_{j}^{L}+\rho_{j}^{\;i}\;\;(x_{j}^{\;U}-x_{j}^{L})\;\;\; \begin{cases} j=1,\ldots,NDV\\ i=1,\ldots,N_{\text{POP}}\end{cases}  \tag{1}\]  
where \(NDV\) is the number of optimization variables; \(x_{j}^{L}\) and \(x_{j}^{\;U}\), respectively, are the lower and upper bounds of the jth optimization variable; \(\rho_{j}^{\;i}\) is a random number in the (0,1) interval. In the minimization problem of the \(W(\overset{\rightarrow}{X})\) function (depending on \(NDV\) variables stored in the solution vector \((\overset{\rightarrow}{X})\) subjected to \(N_{\text{CON}}\) inequality constraint functions \(G_{\text{K}}(\overset{\rightarrow}{X})\leq 0\), the penalized cost function \(W_{\text{P}}(\overset{\rightarrow}{X})\) is defined as follows:  
\[W_{p}(\overset{\rightarrow}{X})=W(\overset{\rightarrow}{X})+p\cdot\psi \tag{2}\]  
where \(p\) is a penalty coefficient. The penalty function \(\psi\) is defined as follows:  
\[\psi=\sum_{k=1}^{N_{\text{cons}}}\bigl{(}\max\bigl{(}0,g_{j}\bigr{)}\bigr{)}^{2} \tag{3}\]  
The \(W_{p}(\overset{\rightarrow}{X})\) penalized cost function coincides with the \(W(\overset{\rightarrow}{X})\) cost function if the trial solution \(\overset{\rightarrow}{X}\) satisfies optimization constraints. No penalty function is defined in the case of unconstrained optimization problems. Any equality constraint \(H(\overset{\rightarrow}{X})=0\) included in the optimization problem is transformed into two inequality constraints \(G(\overset{\rightarrow}{X})\leq 0\) and \(-G_{\text{K}}(\overset{\rightarrow}{X})\leq 0\). Candidate solutions are sorted in terms of penalized cost function: the current best solution \(\overset{\rightarrow}{X_{best}}\) and the worst solution \(\overset{\rightarrow}{X_{worst}}\), respectively, correspond to the lowest and highest values of \(\psi\). Step 2. GWO phase: preliminary generation of new trial designs  
FHGWJA utilizes the classical GWO scheme to preliminarily generate the new trial designs. The best three individuals stored in the population are ranked as wolves \(\alpha\), \(\beta\), and \(\delta\). The other individuals of the population are ranked as wolves \(\omega\). Wolves encircle the prey during the hunt. Such a behavior is mathematically described as follows:  
\[\overset{\rightarrow}{D}=\left|\overset{\rightarrow}{C}\cdot\overset{ \rightarrow}{X_{p}}\right|-\overset{\rightarrow}{X_{it}} \tag{4}\]  
\[\overset{\rightarrow}{X_{it+1}}=\overset{\rightarrow}{X_{p}}-\overset{ \rightarrow}{A}\cdot\overset{\rightarrow}{D} \tag{5}\]  
In Equations (4) and (5), it denotes the current iteration, \(\overset{\rightarrow}{A}\) and \(\overset{\rightarrow}{C}\) are coefficient vectors, \(\overset{\rightarrow}{X_{p}}\) is the position vector of the prey, and \(\overset{\rightarrow}{X_{it}}\) is the generic grey wolf (i.e., search agent) of the population updated in the current iteration to the new solution \(\overset{\rightarrow}{X_{it+1}}\). The \".\" notation denotes the term-by-term multiplication between vectors that leads to defining another vector.