## Dynamic Key Sharing and Fuzzy Adaptive Route Selection
### Fuzzy Adaptive Selection of Data Forwarding Routes
#### 3.6.4 Fitness Evaluation and Path Selection  
An evaluation function computes the qualification of each path. The path with the highest qualification value is chosen as a data forwarding path. The evaluation function Q(P\({}_{i}\)) of a given path P\({}_{i}\) is given by the following equation: \begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Rule No.**} & \multicolumn{2}{c}{**IF**} & \multicolumn{2}{c}{**THEN**} \\ \cline{2-5}  & **NKIH** & **DIST** & **REVN** & **Fitness** \\ \hline
01 & Less & Near & Low & Poor \\
03 & Less & Near & High & Moderate \\
13 & Moderate & Fair & Low & Poor \\
14 & Moderate & Fair & Medium & Better \\
15 & Moderate & Fair & High & Best \\
20 & More & Near & Medium & Best \\
21 & More & Near & High & Best \\
23 & More & Fair & Medium & Better \\
24 & More & Fair & High & Best \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Fuzzy if-then rules. Figure 2: Fuzzy membership functions. (**a**) REL; (**b**) NKIH; (**c**) DIST; (**d**) Fitness. \[\mathrm{Q}(\mathrm{P}_{i})=\mathrm{F}(\mathrm{P}_{i})-\mathrm{\omega}\cdot \mathrm{N}(\mathrm{P}_{i}), \tag{14}\]  
where, \(\mathrm{F}(\mathrm{P}_{i})=\) the fitness value of path \(\mathrm{P}_{i}\) calculated through fuzzy inferencing, \(\mathrm{N}(\mathrm{P}_{i})=\) the number of all those CHs on path \(\mathrm{P}_{i}\) for which: \(\frac{CHs\text{ }  
1. Substitution: the number of current filtering nodes to be substituted with the newly chosen filtering nodes. 2. Exclusion: determination of whether or not to exclude the upstream CHs from being considered as potential filtering nodes in the future whenever their remaining energy is less than a threshold value \(\eta_{i}\). ```
1. N: set of intermediate nodes likely to be chosen as verification nodes
2. REL\({}_{i}\): remaining energy of node CH\({}_{i}\)
3. Dist\({}_{i}\): distance of node CH\({}_{i}\) from the e-CH
4. S \(\subseteq\) N: set of verification nodes to be substituted
5. output: output of the fuzzy inferencing for verification node selection
6. \(\mu\): constant
7. if output = (exclusion \(\wedge\) substitution) then
8. for each CH\({}_{i}\in\) N do
9. if REL\({}_{i}\)/Dist\({}_{i}<\mu\)then
10. N:= N - CH\({}_{i}\);
11. end if
12. end for
13. end if
14. if output = (substitution \(\vee\) exclusion) then
15. for each CH\({}_{j}\in\) S do
16. find a CH\({}_{i}\in\) N such that REL\({}_{j}\)/Dist\({}_{j}<\) REL\({}_{i}\)/Dist\({}_{i}\); and
17. Choose CH\({}_{i}\) as a verification node;
18. end for
19. end if
```  
**Algorithm 2**_SelectVN_(P\({}_{i}\)). Apparently, for a particular source cluster, a report that is delivered to the BS via a longer path consumes more energy than if it were delivered on the shortest path. However, the overall energy efficiency of our proposed scheme is due to the fact that, in the absence of adaptive path selection scheme, the shortest path always has heavy traffic. Therefore, nodes on the shortest path are depleted sooner and the shortest path may become unavailable to any source cluster in the future. Load balancing spreads energy utilization across nodes in the network, potentially resulting in longer network lifetime [35]. Since the proximity of the verification nodes improves with the passage of time, it is expected that all the verification nodes on a path P\({}_{i}\) will eventually be accommodated within \(h=L\) hops. Therefore, the early detection and filtering probability of false reports will improve resulting in energy savings. The probability of a CH\({}_{i}\) detecting a false vote is given by:  
\[p_{CH_{i}}=\left\{ \begin{array}{rl}\frac{s-1}{L}\frac{d_{\rm o}-d_{i}}{L},&d_{ \rm o}>d_{i}\geq(d_{\rm o}-L)\mbox{ when all the verification nodes are within L hops}\\ \frac{(s-1)}{L}\frac{d_{i}}{d_{\rm o}},&\mbox{ when all the verification nodes are probabilistically chosen}\\ \frac{s-1}{L}\frac{d_{\rm o}}{d_{\rm o}},&\mbox{ when all the verification nodes are randomly chosen}\\ \end{array}