## 2 Materials and Methods
### Proposed Chronological Wild Geese Optimization (CWGO) Algorithm  
During the WSN simulation, the optimal CH and routing path for data transmission is selected using the chronological wild geese optimization algorithm, which integrates the chronological concept within the wild geese optimization algorithm (WGA). WGA is a bio-inspired algorithm based on the swarm behavior of wild geese in nature, drawing on traits such as group migration, evolution, and natural attrition. This algorithm is designed to handle complex, high-dimensional optimization tasks efficiently with low computational demands, making it straightforward to implement. In the WGA, individuals adjust their positions based on interactions with neighboring members. The algorithm operates through several stages: group migration, foraging, reproduction and evolution, death, migration, and structured evolution. Although WGA has these advantages, it has not been widely applied to solve large, real-time complex problems. By integrating a chronological concept, the convergence rate of WGA is further improved, as this concept enables updating solutions over various time intervals. After selecting CH, the next step is to identify the optimal route for data transmission to enhance energy efficiency and communication reliability. The CWGO method is employed to determine the best path from  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Wireless Technology**} & \multicolumn{4}{c}{**Parameters**} \\ \cline{2-5}  & **Range** &
\begin{tabular}{c} **Energy** \\ **Consumption** \\ \end{tabular} & **Data Rate** & **Frequency** \\ \hline LoRa & Up to 10 km & Low & 50 Kbps & 433 MHz, 868 MHz, 915 MHz \\ \hline Zigbee & 10–100 m & Low & 250 Kbps & 868 MHz, 915 MHz, 2.4 GHz \\ \hline Wi-Fi & Up to 100 m & Medium & 0.1–54 Mbps & 2.4 GHz \\ \hline Bluetooth Low Energy (BLE) & Up to 100 m & Low & 1 Mbps & 2.4 GHz \\ \hline \hline \end{tabular}
\end{table}
Table 2: Summary of wireless technologies parameters.  
several available routes, evaluating factors such as delay, distance, estimated energy, and trust value. The pseudocode of the proposed CWGO algorithm is presented in Algorithm 1.  
```
Input: Initialize population \(y_{1}\), \(R_{k}^{e=1}=[0]\)
```  
Begin  
Measure fitness with \(Fit_{1}=\frac{1}{5}\big{[}\delta_{1}+(1-\delta_{2})+(\xi_{p})+(1-\theta)+(LLT) \big{]}\), and \(N=y_{1}\)  
Identify personal best \(H_{k}\) and global best K for all geese  
While \(N\leq N_{max}\)  
Sort the members from best to worst  
For\(k=1:y\)  
Pick the organized wild geese \(e-1,\ e+1\), and \(e+2\)  
For\(z=1:W\)  
Estimate \(R_{k}^{e}\) with \(R_{k,z}^{e+1}=(f_{1,z}R_{k,z}^{e}+f_{2,z}(R_{k+1,z}^{e}-R_{k-1,z}^{e}))+\)  
\(f_{3,z}(H_{k,z}^{e}-Y_{k-1,z}^{e})+f_{4,z}(H_{k+1,z}^{e}-Y_{k,z}^{e})+f_{5,z}(H _{k+1,z}^{e}-Y_{k+1,z}^{e})-f_{6,z}(H_{k-1,z}^{e}-Y_{k+2,z}^{e})\)  
Endfor  
For\(z=1:W\)  
Determine \(Y_{k,z}^{m}\) with \(Y_{k,z}^{m}=H_{k,z}^{e}+f_{7,z}f_{8,z}((N_{z}^{e}+H_{k+1,z}^{e}-2H_{k,z}^{e})+R _{k,z}^{e+1})\)  
Endfor  
Determine \(Y_{k,z}^{m}\) with \(Y_{k,z}^{m}=H_{k,z}^{e}+f_{9,z}f_{10,z}(H_{k+1,z}^{e}-H_{k,z}^{e})\)  
Endfor  
Check feasibility  
Endfor  
\(N=N+y\)  
Estimate \(y\) with \(y=round(y_{1}-(y_{1}-y_{2})\big{(}\frac{N}{N_{max}}\big{)})\)  
Endwhile  
end ```  
**Algorithm 1**Pseudocode of CWGO