# Cluster Head Selection Method for Edge Computing WSN Based on Improved Sparrow Search Algorithm
## 5 Simulation and Result  
In this section, the proposed method is evaluated by evaluating the remaining energy consumption of nodes, the number of survivors, etc. Simulations were performed using Python on a computer with an Intel Core I7-7700 HQ 2.8 GHz CPU and 16 GB RAM. The experimental parameter settings are shown in the Table 1.  
In order to verify the effectiveness of the improved sparrow search algorithm, we compared the improved cluster head selection method with LEACH, ILEACH, and WOA-RCP algorithms [31; 34]. In the WSN, the remaining energy of nodes can effectively reflect the optimization of system energy consumption. As shown in Figure 3, there are 100 sensor network nodes in the monitoring area, and we analyze the remaining energy of our method and other methods after running 1000 rounds. Specifically, after running 1000 rounds, the remaining energy of our method is 34.08 \(J\), which is 26.8% more energy than WOA-RCP. Further, As shown in Figure 4, we compared the number of packets received at the edge end after running 2000 rounds. On the one hand, the more data packets the edge end receives, the more stable the system network transmission will be. On the other hand, it fully demonstrates that the ICSSA-CHS algorithm can effectively improve the network life cycle. Our system has a stronger data transmission capability when the edge end receives more data packets. The number of packets transmitted by our algorithm is \(18.25\times 10^{4}\), which is 11.2% higher than WOA-RCP. \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Value** \\ \hline Experimental area & \(150\times 150\) \\ The number of sensor network nodes & 100 \\ Number of edge nodes & 10 \\ packet size/bit & 4000 \\ The maximum number of running rounds of the network & 2500 \\ Node initialization energy/J & 0.7 \\ Fusion Data Consumption/J \(\text{bit}^{-1}\cdot\text{packet}^{-1}\) & 0.01 \\ \(E_{n}/\text{n}\cdot\text{bit}^{-1}\) & 50 \\ \(e_{fs}/\text{p}\cdot\text{bit}^{-1}\cdot\text{m}^{-2}\) & 10 \\ \(\epsilon_{mp}/\text{p}\cdot\text{bit}^{-1}\cdot\text{m}^{-2}\) & 0.0013 \\ Population size & 100 \\ Iterations & 300 \\ Ratio of vigilantes & 0.2 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Average optimization result. Figure 3: Node remaining energy after running 1000 rounds of different algorithms. We also analyze how the remaining surviving nodes change when the number of running rounds increases. Generally, the more running rounds and remaining nodes, the stronger the life cycle and data transmission capability of the network. As shown in Figure 5, as the number of running rounds increases, the number of generated nodes begins to decline after remaining unchanged. This is because as the number of running rounds increases, and the energy of some nodes is exhausted. The original LEACH protocol first dropped to 0. We introduce edge nodes through a two-layer network structure, reducing the burden on the cluster head nodes and energy consumption speed. At the same time, as the control node, the edge node uniformly adjusts and allocates the cluster head node and member nodes during data fusion and transmission, saving energy consumption in the cluster and improving the network life. Ultimately, our proposed method sustains the network lifespan over 2000 rounds. Figure 4: The number of data packets received by the edge end after running 2000 rounds of different algorithms. Figure 5: The number of remaining nodes of different algorithms after the number of running rounds increases. In addition, we analyze the relationship between the number of running rounds and the remaining energy of network nodes. Usually, the more energy left in each round, the lower the energy consumption of the node during the transmission process, which shows that our method can effectively improve the life of the network. As shown in Figure 6, it can be observed that as the number of rounds increases, the energy of network nodes decreases. This is because of the energy consumption caused by node operation.