# Bat Optimized Link State Routing Protocol for Energy-Aware Mobile Ad-Hoc Networks
## 3 Research Methods and Materials
### The Bat Algorithm  
In 2010, a meta-heuristic search algorithm known as the Bat Algorithm (BA) was proposed by [PERSON] et al. [20]. This bat-inspired algorithm relies on the echolocation behavior of the bats to determine the location of prey and to differentiate the insects existing in extreme darkness with varying degrees of emission pulse rates and loudness [21]. This research involves the emission of bat calls to the outer environment, followed by an analysis of the resulting echo sounds that bounce back. The objects' locations are detected, and the distance between the various targets is calculated through an assessment of the sound delay. The emitting sounds are loud pulses with different properties depending on the hunting tactics and species. These echolocation sound pulses are then characterized according to three different characteristics, namely, pulse frequencies, pulse emission rate, and loudness/intensity. The echolocation of the bats and the associated parameters are then examined through numerical optimizing algorithms [22]. The resultant bat algorithm is tested empirically, and the use of single or multi-objective standardized functions is employed to further compare this algorithm with other algorithms [23]. Algorithm 1 shows the basic BA according to [20]:  
```
1. begin
2. while (\(t<\) Max number of iterations)
3. Generate new solutions by adjusting frequency;
4. update velocities and locations [(1) to (3)];
5. if (rand \(>r_{i}\))
6. Select a location among the best locations
7. Generate a local location from the selected locations;
8. end-if
9. Generate a new location by flying randomly;
10. if (rand \(<l_{i}\) & \(f\) (\(x_{i}\)) \(<f\) (\(\pi\)))
11. Accept the new locations;
12. Increase \(r_{i}\) and reduce \(a_{i}\)
13. end-if
14. Rank the bats and find the current best \(\pi\);
```  
**Algorithm 1**The basic BA  
Bats use echolocation to determine the distance and the differences between prey, food, and other obstacles. Assume that a random velocity of \(v_{i}\) is used by the bats to fly to a fixed position \(x_{i}\) with the frequency of \(f_{min}\) with different wavelengths and loudness of \(l_{0}\) in search of prey. The wavelengths or frequencies of the emitted pulses can be automatically adjusted, and the bats can calibrate their pulse emission rate \(r\) in the range (0, 1) depending on how close they are to their target. Regardless of the variance in their loudness, the loud volume varied between a huge positive value, \(l_{0}\) and a minimal constant value of \(l_{min}\). Figure 4 shows the mathematical bat algorithm. In the initial stage, the bat population and their position, i.e., \(x_{i}\), velocity \(v_{i}\) and frequency \(f_{min}\), respectively, must be identified. The mobility of all these virtual bats can be discerned after updating their positions and velocities for the time step \(t\), using Equations (1)-(3) in the following manner:  
\[f_{i}=f_{min}+(f_{max}+f_{min})\beta, \tag{1}\]  
where;  
\[v_{i}^{t}=v_{i}^{t-1}+\left(x_{i}^{t-1}+\pi\right)f_{i}, \tag{2}\]  
where;  
\[x_{i}^{t}=x_{i}^{t-1}+v_{i}^{t}, \tag{3}\]  
where \(\beta\)\(\epsilon\) (0, 1) represents the vector arbitrarily derived according to the uniform distribution. The variable \(\pi\) denotes the current global best position (solution) that is located after the solutions obtained from m bats are compared. An arbitrary number is employed after the solutions from the current best bat solutions are selected. Nonetheless, the pulse emission rate \(r_{i}\), is less than the number, and a different solution is accepted based on the present best solutions and is explained as follows:  
\[x_{new}=x_{old}+el^{t}, \tag{4}\]  
where \(\epsilon\)\(\epsilon\) (\(-1\), 1) represents a random number, and \(l^{t}\) = \(<\)\(l_{i}^{t}\)\(>\) refers to the average loud volume of the bats present in the generation. Moreover, the loud volume \(l_{i}\) along with the pulse emission rate \(r_{i}\) would be updated.