# Routing Protocol for Heterogeneous Wireless Sensor Networks Based on a Modified Grey Wolf Optimizer
## 5 Simulation Results  
To verify its performance, MATLAB software (MathWorks, USA) was used to simulate the HMGWO algorithm. Under the same experimental conditions, the HMGWO algorithm was compared with the SEP, DEEC, M-SEP, and FIGWO algorithms. The main simulation parameters are shown in Table 2.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Value** \\ \hline The area of the sensing region, Number of Sensor Nodes & \(100^{2}\)(m\({}^{2}\)), N = \(100\) \\ Portion of cluster heads & \(p=0.1\) \\ Packet Size & \(l=4000\) bits \\ Data Aggregation Energy Cost & \(E_{DA}=5\) nl/bit \\ Energy Cost of Transmitter/Receiver & \(E_{elc}=50\) nl/bit \\ Transmission Coefficient of Amplifier (free space) & \(\varepsilon_{f_{S}}=10\) p/bit/m\({}^{2}\) \\ Transmission Coefficient of Amplifier (multi-path space) & \(\varepsilon_{mp}=0.0013\) p/bit/m\({}^{4}\) \\ Initial energy of normal node & 0.5 \\ Ratio of Advanced Node & \(\alpha=0.1\), \(\alpha=0.2\) \\ Weight of Fitness Function & \(a_{1}=a_{2}=a_{3}=0.2\) \\ Ratio of Initial Energy of the Advanced Node to that of the & \(\beta=2\) \\ Normal Node & \\ \hline \hline \end{tabular}
\end{table}
Table 2: Simulation parameters.  
At the beginning of each round, the BS selects CHs using the algorithm proposed in this article, and each round last for 1 s. In this paper, we used the network lifetime, residual energy and the number of packets received by the BS as the evaluation indexes of the algorithm performance. However, since the HMG, SEP, DEEC, M-SEP, and FIGWO protocols are all single-hop routing protocols, the end-to-end delay was not taken into account in the indicator evaluation. The following is an explanation of indicators and nouns.  
1. Network lifetime: The period of time between the beginning of the network operation and the death of the first node, which is also known as the network stability period.
2. Network instability period: The time duration between the death of the first node and the death of all nodes.
3. Total residual energy: The sum of the remaining energy of all survival nodes. To facilitate the comparison of the total residual energy, the percentage of the total residual energy is used to represent the total residual energy [10; 20], which is calculated as follows: \[p_{t}(\mathbf{r})=E_{totR}(r)/\sum\
olimits_{j=1}^{N}E_{i}(j)\] (19) where \(p_{t}(\mathbf{r})\) is the percentage of the total residual energy in the \(r^{th}\) round; \(E_{totR}(r)\) is the total residual energy in the \(r^{th}\) round; and \(\sum\
olimits_{j=1}^{N}E_{i}(j)\) is the sum of the initial energies of all the nodes.
4. Residual energy deviation: The deviation between the node with the most residual energy and the node with the least residual energy [46]. The residual energy deviation in the \(r^{th}\) round is calculated as follows: \[D_{R}(\mathbf{r})=E_{MaxR}(r)-E_{MinR}(r)\] (20) where \(E_{MaxR}(r)\) and \(E_{MinR}(r)\) are the maximum and the minimum residual energy of the node in the network the \(r^{th}\) round. However, to facilitate the analysis of the simulation results, the residual energy deviation is compared in percentage units.
5. Throughput: The number of data packets received by the BS.