# Highly Reliable Fuzzy-Logic-Assisted AODV Routing Algorithm for Mobile Ad Hoc Networks
## 3 Proposed Fuzzy-Logic-Assisted AODV Routing Protocol
### Fuzzification  
We focus on improving the route reliability based on the shortest path criterion of the traditional AODV protocol. In the route discovery process, we propose to select the most reliable node determined by the maximum output value of fuzzy logic system considering delay, stability, and remaining energy concurrently as the relay node. In the route selection process, the most reliable route path determined by the maximum cumulative sum of fuzzy logic output values of path is reserved for data transmission. In terms of fuzzification, since the triangular membership function has more intuitive and lower computational overhead [21], the input and output metrics in this paper choose the triangular membership function to calculate the fuzzy set. In addition, considering that the node of the normalized residual energy less than 10% easily cause link interruption and the energy consumption of the routing data transmission is not affected when it is higher than 90%, thus the suitable triangular and trapezoidal membership functions [22] are chosen to establish the normalized residual energy.  
The normalized delay (ND) of nodes is expressed as the average link delay with neighboring nodes, which can be given by [16]  
\[ND(x)=\frac{\sum_{i=1}^{n}NDx(y_{i}\in N_{x})}{n}, \tag{1}\]  
where \(NDx(y)\) is normalized link delay, \(NDx(y)=d(x,y)/R\) if \(d(x,y)<R\), and \(NDx(y)=1\); otherwise, \(N_{x}\) denotes the neighbor nodes of the node \(x\), \(n\) represents the number of neighbor nodes, \(d(x,y)\) is the distance between node \(x\) and node \(y\), and \(R\) represents the longest distance that two nodes can communicate in this system. A triangular function is used to establish the membership function, as shown in Figure 2. The fuzzification process of ND is that the normalized delay value calculated according to Formula (1) is used as the abscissa, and the ordinate of the intersection point is the fuzzification language. For example, when the ND input is 0.4, the fuzzification language is {LOW:0.2, MEDIUM:0.8, HIGH:0}.  
The normalized stability (NS) of nodes [16] is given by  
\[NS(x)=1-\frac{|v(x)|-\min(y\in N\{|v(y)|\})}{\max(y\in N\{|v(y)|\})-\min(y\in N \{|v(y)|\})}, \tag{2}\]  
where \(v(x)\) is the speed of the node \(x\) and \(N\) refers to the set of all nodes--the lower the speed of the node \(x\), the higher the stability. A triangle function is used to establish the membership function of stability, as shown in Figure 3. The fuzzification process of NS, the normalized stability value calculated according to Formula (2), is used as the abscissa, and the ordinate of the intersection point is the fuzzification language. For example, when the NS input is 0.7, the fuzzification language is {LOW:0, MEDIUM:0.6, HIGH:0.4}.  
The normalized residual energy (NRE) is given by  
\[NRE(x)=\frac{E_{x}-\min\bigl{(}E_{y}\in N\{E\}\bigr{)}}{\max\bigl{(}E_{y}\in N\{E \}\bigr{)}-\min\bigl{(}E_{y}\in N\{E\}\bigr{)}}, \tag{3}\]  
where \(E_{x}=E_{0}-v_{x}*t\) refers to the remaining energy of the node \(x\), \(E_{0}\) and \(v_{x}\) are the initial energy and the energy consumption rate of the node \(x\), respectively. A higher NRE means a higher possibility of being used as a relay node. Trapezoidal and triangular functions are used to establish the membership function of NRE, as shown in Figure 4. Select the fuzzy language when the remaining energy is less than 10 percent as (LOW:1, MEDIUM:0, HIGH:0), and the fuzzy language with more than 90 percent as (LOW:0, MEDIUM:0, HIGH:1). The fuzzification process of NRE is that the normalized residual energy value calculated according to Formula (3) is used as the abscissa, and the ordinate of the intersection point is the fuzzification language. For example, when the NRE input is 0.7, its fuzzification language is {LOW:0, MEDIUM:0.33, HIGH:0.5}.  
Figure 3: Membership function of NS.  
Figure 2: Membership function of ND.