# Fuzzy Logic-Based Geographic Routing Protocol for Dynamic Wireless Sensor Networks
## 3 FLGR Protocol
### Selection Criteria and Parameters for Assessment  
To obtain a comprehensive assessment of the nodes in CNR, the selection criteria and parameters for assessment should be confirmed first. Fewer hops and a higher packet delivery rate are the goals of the FLGR forwarding mode. In addition, the scheme used to avoid the routing void problem should also be considered. Based on this, this paper gives the selection criteria of the next forwarding node:  
* The CN has a larger probability of being selected if it is farther away from EN. That is, a larger distance between the EN and CN indicates that the probability that the CN is close to the destination node is larger. * The CN that has more nodes in its CNR has a larger probability of being selected to be the next forwarding node. If there are more nodes to be selected in the CNR, the probability of selecting the optimal forwarding node is larger in the next data forwarding node. In this way, the node that has no CN in its CNR will be discarded, and thus, the routing void problem can be solved. * The CN has an advantage in being selected to be the next forwarding node if its CNs distribute more evenly along the communication boundary. According to the above selection criteria, the void node can be avoided effectively. As shown in Figure 1, in the GPSR protocol, according to the greedy forwarding mode and peripheral forwarding mode, the nodes \(n_{2},n_{3},n_{4},n_{5}\) are selected as forwarding nodes. The nodes \(n_{2},n_{4},n_{5}\) are selected as forwarding nodes according to the selection criteria of the FLGR protocol. In this way, the void node \(n_{3}\) can be discarded, and the number of hops reduces. Hence, the routing void problem can be effectively avoided by using the selection criteria above. According to the selection criteria of the FLGR protocol, the corresponding parameters of CN can be obtained: the distance to EN, relative density of the nodes in CNR, and distribution degree of the nodes in CNR. Distance to EN is the distance between CN and EN, which is denoted by \(D\) in this paper. The value range of \(D\) is \((0,r]\). Taking no account of link interruption, the larger \(D\) is, the more likely CN is to  
Figure 1: Fuzzy logic-based geographic routing protocol (FLGR) forwarding mode. approach the destination node. In this paper, the set \(C_{i}\) denotes the set of nodes in CNR of EN. For node \(n_{4}\in C_{i}\), the distance between node \(n_{k}\) and EN \(n_{i}\) can be calculated as follows:  
\[D_{ik}=\left\{ \begin{array}{ll}\|l_{k}-l_{i}\|_{2}&,C_{i}\
eq\varnothing\\ 0&,C_{i}=\varnothing\end{array} \right. \tag{3}\]  
Relative density of the nodes in CNR is the ratio of the density of nodes in CNR of CN to the density of the entire network, which is denoted by \(\eta\). In this paper, the set \(Z_{k}\) denotes the set of nodes in the CNR of CN. If \(\exists n_{v}\in C_{i}\), then \(n_{v}\
ot\in Z_{k}\). In this way, invalid routing can be effectively avoided. In FLGR protocol, a larger value of \(\eta\) indicates that there are more nodes in CNR. The probability of selecting the optimal forwarding node is larger with more nodes to be selected. Taking the example of CN \(n_{k}\), when EN \(n_{i}\) has a data message to be sent to the destination node \(n_{j}\), there are \(m\) neighbor nodes in the CNR of CN \(n_{k}\). Then, \(\eta_{kj}\) can be expressed as follows:  
\[\eta_{kj}=\frac{\rho_{kj}}{\rho_{global}}=\frac{2m*S}{n*r^{2}*\theta^{zero}_{ ij}} \tag{4}\]  
In Equation (4), \(\rho_{kj}\) denotes the density of nodes in the CNR of CN \(n_{k}\). \(\rho_{global}\) denotes the density of the entire network. The value range of \(\eta\) is \([0,+\infty)\). An increase in the value of \(\eta\), indicates that the density of the nodes in CNR increases, and the number of nodes is relatively bigger. However, the case of \(\eta>9\) is a small probability event according to statistics in the simulation in Section 4. Therefore, the situation \(\eta\in[0,9]\) is considered in this paper.