## 4 Proposed Method
### Data Routing Stage  
#### 4.2.1 Routing Algorithm Using GJO  
The goal of the routing problem we will now solve is to reduce the maximum possible transmission distance between CHs in a routing path. The goal of the routing problem we will now solve is to reduce the maximum possible transmission distance between CHs in the routing path. This section describes how to use the GJO [33] optimization algorithm for optimal path selection for wireless sensor networks.  
The starting population is generated by random initialization in the GJO methodology, yet this approach is vulnerable to the issue of an excessively dispersed or locally concentrated population.  
Due to this circumstance, the population diversity of the classic GJO algorithm is inadequate, which significantly impairs the ensuing iterative optimization search.  
Thus, in order to broaden the algorithm's search space and boost population variety, we chose to initiate the population in this study using a backward learning technique.  
The following is the definition of the reverse learning strategy:  
Let \(X_{i}^{t}=\left[x_{i,1}^{t},x_{i,2}^{t},\cdots,x_{i,j}^{t},\cdots,x_{i,d}^{t}\right]\) be the \(i\)th individual of the current population. The general inverse learning strategy produces a general inverse solution of \(X_{i}^{t}\) as \(\mathcal{O}_{i}^{t}=\left[o_{i,1}^{t},o_{i,2}^{t},\cdots,o_{i,j}^{t},\cdots,o_{ i,d}^{t}\right]\).  
\[o_{i,j}^{t}=Z(k)\big{(}A_{i}^{t}+B_{i}^{t}\big{)}-x_{i,j}^{t} \tag{28}\]  
\[Z(k)=[aZ(k-1)+c]modM \tag{29}\]  
\[A_{j}^{t}=min\Big{(}x_{(i,j)}^{t}\Big{)}.B_{j}^{t}=max\Big{(}x_{(i,j)}^{t} \Big{)} \tag{30}\]  
\(M\) is an enormous positive number, \(a\) is the multiplier of the interval \((0,M)\), and \(c\) is incremental. \(Z(0)\) is the seed of the random number. \(Z(k)\) approximately obeys a uniform distribution in the interval \([0,M-1]\); its maximum period is \(M\), and \([Z(k)/M]\) approximately obeys a uniform distribution in the interval \([0,1)\).  
The two primary steps of the GJO algorithm are finding prey and encircling and attacking it. These processes represent the exploration and exploitation of populations, respectively.  
1. The stage of exploration or hunting for prey This section proposes GJO's exploration plan. Jackals can sense and follow their prey due to their innate instincts, yet sometimes the prey escapes and is hard to catch. As a result, the females follow the males and lead the pack in search of additional prey. \[Y_{1}(t)=Y_{M}(t)-E.|Y_{M}(t)-rl.Prey(t)|\] (31) \[Y_{2}(t)=Y_{FM}(t)-E.|Y_{FM}(t)-rl.Prey(t)|\] (32) where \(t\) is the current iteration. \(Prey(t)\) represents the prey's position vector, while \(Y_{M}(t)\) and \(Y_{FM}(t)\) represent the locations of the male and female jackals. The updated positions of the male and female jackals with respect to the prey are shown by \(Y_{1}(t)\) and \(Y_{2}(t)\). \(E\) indicates the prey's evasive energy and is represented by Equation (33): \[E=E_{1}*E_{0}\] (33) The prey's initial energy level is represented by \(E_{0}\), while its decreasing energy is represented by \(E_{1}\). \[E_{0}=2*r-1\] (34) where \(r\) can be any integer between 0 and 1. \[E_{1}=c_{1}*(1-(t/T))\] (35) where \(c_{1}=1.5\); the rounds of iteration are denoted by \(T\) and \(rl\) is calculated by Equation (36): \[rl=0.05*LF(y)\] (36) LF is calculated by Equation (37): \[LF(y)=(0.01\times(\mu\times\sigma))/\left(\left(\left|v^{((1/\beta))}\right| \right)\right)\] (37) where \(\mu\) and \(v\) are random numbers between 0 and 1, \(\beta=1.5\) \[Y(t+1)=(Y_{1}(t)+Y_{2}(t))/2\] (38) (2) The stage of exploitation or encircling and leaping for prey The mathematical model of joint roundup of male and female jackals is shown in Equations (39) and (40): \[Y_{1}(t)=Y_{M}(t)-E.|rl.Y_{M}(t)-Prey(t)|\] (39) \[Y_{2}(t)=Y_{FM}(t)-E.|rl.Y_{FM}(t)-Prey(t)|\] (40) Finally, the position vector \(Y_{1}\) is used as the optimal path.