# A Clustering WSN Routing Protocol Based on k-d Tree Algorithm
## 5 Simulation and Results Analysis
### Other Tests Performed  
As a complement to the results obtained, we performed tests with 100, 300, and 400 nodes on areas of proportional size, maintaining the same node density of the 200-nodes tests. These tests were performed in a scenario with random node deployment. Energy assignment for 100, 300, and 400 nodes was also proportional to the 200-nodes tests. For these tests, we only took into account the average values of metrics, using the same metrics of the 200-nodes tests. In the evaluation of a random scenario with 100, 200, 300, and 400 nodes, the average of CH nodes in the scenario is not relevant. However, the lower variability shown in the variance confirms \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Protocol** & **LEACH (r)** & **LEACH-C (r)** & **H-kdtree (r)** & **LEACH (d)** & **LEACH-C (d)** & **H-kdtree (d)** \\ \hline Min & 7.478 & 6.88 & 4.611 & 7.652 & 6.04 & 4.988 \\ Q1 & 11.47 & 21.3 & 4.611 & 8.928 & 48.12 & 4.988 \\ Average & 20.5 & 40.61 & 4.815 & 21.46 & 33.77 & 5.25 \\ Q3 & 22.07 & 57.88 & 5.05 & 25.64 & 48.12 & 5.53 \\ Max & 55.46 & 87.03 & 5.05 & 61.5 & 79.84 & 5.635 \\ Normalized & 1 & 1.9809 & 0.2348 & 0.10468 & 1.6473 & 0.25609 \\ average & 0.2185 & 0.55136 & 0.00003998 & 0.4729 & 0.35932 & 0.00006838 \\ \hline \hline \end{tabular}
\end{table} 
Table 7: Jitter with 200 nodes. (r) random—(d) deterministic. The values of the table are on a scale of \(10^{-3}\). \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Protocol** & **LEACH (r)** & **LEACH-C (r)** & **H-kdtree (r)** & **LEACH (d)** & **LEACH-C (d)** & **H-kdtree (d)** \\ \hline Min & 22,630 & 20,267 & 140,400 & 12,060 & 5096 & 133,200 \\ Q1 & 66,410 & 65,741 & 145,900 & 40,210 & 49,350 & 135,100 \\ Average & 97,940 & 107,854 & 145,900 & 104,300 & 101,705 & 136,500 \\ Q3 & 131,900 & 149,547 & 150,300 & 154,400 & 149,510 & 137,600 \\ Max & 178,200 & 190,903 & 150,300 & 172,200 & 192,501 & 141,500 \\ Normalized & 1 & 1.0122 & 1.4896 & 1.0649 & 1.0384 & 1.3937 \\ Variance \(\times 10^{6}\) & 2154.20 & 2285.91 & 9.49 & 3502.15 & 3346.94 & 12.3741 \\ \hline \hline \end{tabular}
\end{table} 
Table 8: Throughput with 200 nodes. (r) random—(d) deterministic. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Protocol** & **LEACH (r)** & **LEACH-C (r)** & **H-kdtree (r)** & **LEACH (d)** & **LEACH-C (d)** & **H-kdtree (d)** \\ \hline FND & 24 & 47 & 38 & 37 & 51 & 35 \\ HND & 113 & 99 & 94 & 122 & 103 & 96 \\ LND & 134 & 164 & 131 & 144 & 180 & 140 \\ \hline \hline \end{tabular}
\end{table} 
Table 9: Comparison of network lifetime with respect to FND, HND and LND with 200 nodes. (r) random—(d) deterministic. H-kdtree's characteristic on-demand CH node selection mechanism, maintaining its variance 83% below LEACH and LEACH-C as shown in the Table 10.  
Regarding energy value, results show that H-kdtree maintains energy levels that are very close to those of LEACH, and therefore does not show an improvement in this area. However, H-kdtree shows a significant improvement in QoS as compared to LEACH and LEACH-C as shown in the Table 11.  
Table 12 shows the use of an on-demand mechanism implies that the protocol only reacts to a change requested by the network. In the case of H-kdtree's CH node selection mechanism, this means that it will only be used as a response to receiving a \"Death\" packet. Note that the number of nodes close to death is the number of CH nodes. Death node in H-kdtree is stepped, and in LEACH and LEACH-C it is incremental. H-kdtree shows an improvement in delay reduction, with values over 60% as compared to LEACH y LEACH-C, as shown in Table 13.  
H-kdtree shows a 95% jitter reduction as compared to LEACH and LEACH-C, as shown in Table 14.