# Energy-Efficient Spatial Query-Centric Geographic Routing Protocol in Wireless Sensor Networks
## 3 QTGrid Routing Protocol
### CH and PCH Election
#### 3.2.2 PCH Election
Other simulation parameters are shown in Table 2.

In all scenarios, the sink node was located at the center of the network and other nodes were randomly deployed. For illustrating the performance of QTGrid, we compared the network lifetime and spatial query of different protocols by calculating the average value of 100 trails with different random seeds in the following Figures 8-11 (the confidence interval range with 95 percent of target values). Unless the sense data from the query area could not be transmitted to the sink node, we considered the network fail and stopped the simulation. ### Network Lifetime

Network lifetime is defined as the average energy consumption of the network and the number of nodes surviving. The entire region was evenly divided into four parts, and the completion of spatial queries for each sub-region is regarded as a cycle. Comparisons of QTGrid with three other protocols in terms of average energy consumption for target areas with 200, 400, and 800 sensor nodes are shown in Figure 8a-c, respectively. All the protocols reselected their CHs every 10 rounds. \begin{table}
\begin{tabular}{c c} \hline
**Parameters** & **Values** \\ \hline Network size (\(m\times m\)) & \(160\times 160\) \\ Location of the Sink Node & Network center \\ Nodes’ initial energy (\(J\)) & 10 \\ Cluster heads’ energy threshold (\(J\)) & 4 \\ \(E_{elec}\) (\(n\))/bit) & 50 \\ \(e_{amp}\) (\(p\))/bit/m2) & 10 \\ Computation cost of Data aggregation \(E_{da}\) & 3 \\ (\(n\))/bit/signal) & 5 \\ Computation cost of routing \(E_{r}\) (\(n\))/bit/signal) & 5 \\ Number of network layers/Number of nodes & 5 \\ Radius of the intra-cluster communication (\(m\)) & 28.28 \\ Radius of the inter-cluster communication (\(m\)) & 56.56 \\ Size of the data packet (\(bits\)) & 500 \\ Size of the packet header (\(bits\)) & 200 \\ \hline \end{tabular}
\end{table} 
Table 2: Simulation parameters. Figure 8: The comparison of the average network energy consumption. (**a**) Network with 200 nodes; (**b**) network with 400 nodes; (**c**) network with 800 nodes. Figure 9: _Cont._

The QTGrid protocol improved the CH selection method of DTBDC to balance the CHs' energy consumption with the other intra-cluster nodes. Compared with GCCR, QTGrid reduced the frequency and distance of communication between nodes in the cluster to save energy based on the structural advantages of the quadtree. From Figure 8, we can observe the following:

1. Among the four routing protocols, QTGrid had the lowest average energy consumption, whereas GeoGrid had the highest one. Specifically, the average energy consumption of QTGrid was about 0.043 (200 nodes), 0.051 (400 nodes), and 0.075 J/round (800 nodes) lower than GeoGrid; about 0.032 (200 nodes), 0.043 (400 nodes), and 0.058 J/round (800 nodes) lower than GCCR; about 0.038 (200 nodes), 0.036 (400 nodes), and 0.049 J/round (800 nodes) lower than QTBDC. 2. When the number of nodes was 200, the average energy consumption of GCCR was about 0.006 J/round lower than that of QTBDC, but when the number of nodes was 400 and 800, the average energy consumption of GCCR was about 0.007 and 0.009 J/round higher than that of QTBDC, respectively. Compared with GCCR, QTDBC reduced the maximum length of data transmission and increased the number of forwarding hops to reduce the transmission duration. In the case of a network with few nodes (200 nodes), candidates for the next hop routing nodes tended to be few and resulted in routing paths that were not the shortest, which consumed much node energy to some extent. The above problem changed when many nodes were available in the network (400 and 800 nodes). A comparison of the number of surviving nodes is shown in Figure 9a-c. Figure 9 indicates that under the same constraints, GeoGrid had the fewest surviving nodes. QTGrid had more surviving sensor nodes and achieved a longer network lifetime than the three other protocols. When the number of nodes increased, the node death rate became slower in the QTGrid algorithm.