# Fuzzy Logic-Based Geographic Routing Protocol for Dynamic Wireless Sensor Networks
## 3 FLGR Protocol
### Selection Process Based on Fuzzy Logic
#### 3.5.3 Defuzzification  
Through the two stages in fuzzy logic system above, the comprehensive assessments of all CNs can be obtained. However, when selecting the next forwarding node from the CNs, it is generally necessary to sort and compare the comprehensive assessments of all CNs. Hence, the comprehensive assessment of CN should be expressed by numerical values. Therefore, the defuzzification process should be conducted next.  
Defuzzification transforms the fuzzy set into certain determined values, to conduct the subsequent mathematical calculation. The subordinating degree function of parameter \(E\) is as follows:  
\[\mu_{E\_very\ low}(x)=\left\{\begin{array}{ll}0,\quad x<0\quad\ or\quad x>1 \\ \\ \dfrac{x^{2}}{e0.01},\qquad 0\leq x\leq 1\end{array}\right. \tag{16}\]  
\[\mu_{E\_low}(x)=\left\{\begin{array}{ll}0,\quad x<0\qquad\ or\quad x>1\\ \\ e\dfrac{(x-0.25)^{2}}{0.01},\quad 0\leq x\leq 1\end{array}\right. \tag{17}\]  
\[\mu_{E\_middle}(x)=\left\{\begin{array}{ll}0,\quad x<0\qquad or\quad x>1\\ \\ e\dfrac{(x-0.5)^{2}}{0.01},\quad 0\leq x\leq 1\end{array}\right. \tag{18}\]  
\[\mu_{E\_high}(x)=\left\{\begin{array}{ll}0,\quad x<0\qquad or\quad x>1\\ \\ e\dfrac{(x-0.75)^{2}}{0.01},\quad 0\leq x\leq 1\end{array}\right. \tag{19}\]  
\[\mu_{E\_very\ high}(x)=\left\{\begin{array}{ll}0,\quad x<0\quad or\quad x>1 \\ \\ e\dfrac{(x-1)^{2}}{0.01},\quad 0\leq x\leq 1\end{array}\right. \tag{20}\]  
Figure 6 shows the subordinating degree function of parameter \(E\):  
\begin{table}
\begin{tabular}{c c c c c} \hline \multirow{2}{*}{**ID**} & \multicolumn{3}{c}{**IF**} & \multicolumn{2}{c}{**THEN**} \\ \cline{2-5}  & \(\mathbf{D}\) & \(\mathbf{\eta}\) & \(\mathbf{\Omega}\) & \(\mathbf{\eta}\) \\ \hline
1 & near & low & bad & very low \\
2 & middle & middle & middle & middle \\
3 & far & high & excellent & very high \\ \(\cdots\) & \(\cdots\) & \(\cdots\) & \(\cdots\) & \(\cdots\) \\ \hline \end{tabular}
\end{table}
Table 5: Part of fuzzy reasoning rule base.  
In the defuzzification stage, the graded mean integration representation method (GMIRM) [22] is adopted. The graded mean integration evaluation \(P(x)\) of fuzzy number \(x\) is as follows:  
\[P(x)=\frac{\int_{0}^{1}\left(\frac{h\left(2\delta-\sqrt{-\sigma_{L} ^{2}\times\ln h}+\sqrt{-\sigma_{R}^{2}\times\ln h}\right)}{2}\right)dh}{\int_{0} ^{1}hdh} \tag{21}\]  
In Equation (21), \(\sigma_{L}\) denotes the standard deviation of the left half of normal function, \(\sigma_{R}\) denotes the standard deviation of the right half of normal function, and \(\delta\) is the mean value of normal function.  
In FLGR, when the fuzzy number \(x\) belongs to the very low set, the graded mean integration evaluation \(P(x)\) can be further simplified as follows:  
\[P(x)=\frac{\int_{0}^{1}\left(\frac{h\left(\delta+\sqrt{-\sigma_{R} ^{2}\times\ln h}\right)}{2}\right)dh}{\int_{0}^{1}hdh} \tag{22}\]  
When the fuzzy number \(x\) belongs to the very high set, the graded mean integration evaluation \(P(x)\) can be further simplified as follows:  
\[P(x)=\frac{\int_{0}^{1}\left(\frac{h\left(\delta-\sqrt{-\sigma_{L} ^{2}\times\ln h}\right)}{2}\right)dh}{\int_{0}^{1}hdh} \tag{23}\]  
When the fuzzy number \(x\) belonged to the low, medium and high set, \(\sigma_{L}=\sigma_{R}\), and the graded mean integration evaluation \(P(x)\) can be further simplified as follows:  
\[P(x)=\delta \tag{24}\]  
Through the defuzzification by GMIRM, the comparison table between the fuzzy sets and their corresponding values can be obtained as presented in Table 6:  
Figure 6: Subordinating degree function of parameter \(E\).