# Enhanced Routing Algorithm Based on Reinforcement Machine Learning--A Case of VoIP Service
## 3 The Proposed e-RLRP Algorithm
### Algorithm Used in the e-RLRP to Reduce the Overhead
#### 3.2.2 Adjustment Factor  
The objective of the e-RLRP is to reduce overhead but without degrading the performance of the algorithm. Thus, after a scenario of high mobility is detected, the rise of the \(BI\) parameter should be slower to ensure that the upper limit is slowly reached, because there is a likelihood that the occurrence of mobility will repeat itself. In a scenario in which an isolated episode of mobility occurs, the climb should be a little faster. Therefore, the AF also should has responses according to the mobility of the network. It is important to note that in initial tests, we used fixed values for the frequency of Hello messages, and the results demonstrated that dynamic methods permit to obtain better results in terms of the network performance parameters used in this work. To ensure that no sudden changes occur in the AF, a scale of ten positions is defined, in which the upper limit is called \(AF_{\text{ul}}\) and the minimum value is called \(AF_{\text{ll}}\). Also in the Programmed scenario described in the Section 4.1, the convergence time (CT) of the e-RLRP, which is defined as the time elapsed between breaking a route until the algorithm converged to find a new route, was also evaluated. Experimental test results demonstrated that the average of CT is 20.6 s. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Broadcast Interval Value (s)** & **Overhead (MB)** & **Overhead Increase (\%)** \\ \hline
1.5 & 1.45 & 2.12\% gain in relation to 2.0 s \\
1.0 & 1.48 & 4.22\% gain in relation to 2.0 s \\
0.5 & 1.60 & 12.67\% gain in relation to 2.0 s \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Broadcast Interval values to obtain overhead. The \(AF\) value cannot be high to avoid be aggressive enough to \(BI\) parameter reach the \(BI_{\text{UL}}\) before the CT. Then, to calculate \(AF_{\text{ul}}\) the Arithmetic Progression (AP) or also known as arithmetic sequence is applied, with a difference between the consecutive terms equal to \(BI\), where term \(A_{1}\) is \(BI_{\text{LL}}\), \(A_{n}\) is \(BI_{\text{UL}}\) and the sum of the terms must not be greater than CT.  
To ensure that value is not reached before 20.6 s, the value is rounded to 21 s and applying the formula of the sum of a AP, the \(AF_{\text{ul}}\) value is obtained. \[\text{CT}\leq\frac{(BI_{\text{UL}}+BI_{\text{LL}})\times n}{2}. \tag{12}\]  
Applying the result of Equation (12) in the formula for the general term of a AP:  
\[BI_{\text{UL}}{=}BI_{\text{LL}}+(n-1)\times AF_{\text{ul}}. \tag{13}\]  
The value obtained for \(AF_{\text{ul}}\) is 1, then, the maximum value of \(AF\) should be 1. As previously stated, a scale of 10 position was defined. Then, the value of \(AF_{\text{ll}}\) is 0.1, and each position of that scale is increased by 0.1. Whenever mobility occurs in the network the \(AF\) is decreased in the scale. The increase will occur when there is a tendency of decrease in mobility during a period of time. This period of time called Time of Check (TC) is defined by the average between CT value and the time spent for the algorithm starting from \(BI_{\text{LL}}\) until reaching value \(BI_{\text{UL}}\) with adjustment \(AF_{\text{ll}}\). To calculate TC, first, the formula of the general term of AP is applied. The \(AF_{\text{ll}}\) is the common difference, \(BI_{\text{UL}}\) and \(BI_{\text{LL}}\) are the terms An and A1 respectively. \[BI_{\text{UL}}=BI_{\text{LL}}+(n-1)*AF_{\text{ll}}. \tag{14}\]  
Applying the result of Equation (14) in the formula for the sum of a AP and averaging:  
\[TC=\frac{CT+\frac{(BI_{\text{LL}}+BI_{\text{UL}})*n}{2}}{2}. \tag{15}\]  
The TC value is 99.7, in this way after 99.7 s if there is a tendency to reduce mobility, the AF will be increased. A mobility counter denominated \(M_{\text{counter}}\) will be used to count how many mobility events occur in the TC time period.