# Memetic Chains for Improving the Local Wireless Sensor Networks Localization in Urban Scenarios +
## 5 Memetic Algorithm Chains for the Node Location Problem
### MA-VND-Chains Pseudo-Code
#### 5.2.1 Definition of the Individuals of the LS in the NLP  
The MA optimization [69] allows the exploration of adjacent regions in the evolutionary process through the application of the LS to the most different and the elite individuals of the population keeping the balance between diversification and intensification respectively. The introduction of the most diverse individuals proves essential for preserving the genetic diversity throughout the optimization, thus resulting in a greater degree of exploration in the solution environment. This exploration results vital for avoiding local maximums, especially for highly restrictive scenarios where the existence of considerable NLOS conditions, such as the one presented in this paper, may direct the MA into a non-optimal solution. Moreover, due to the geometry of these obstacles, minimal changes in the node location may induce significant deviations in the fitness value of the individuals. Therefore, the application of a further LS improves the avoidance of these obstacles, resulting in a considerable enhancement in location accuracy. The definition of the most diverse individuals is achieved throughout the measurement of dissimilarity among solutions. Therefore, a comparative between every sensor location among individuals is performed, as presented in [44]. Figure 3: Pseudocode for the memetic algorithms (MA) optimization process followed for the NLP. On the other hand, the introduction of the elitist individuals into the LS enhances the optimization performance. The intensification of the best suited individuals along the information preserved in their LS Chains achieves a significant improvement in the convergence and final solution of the algorithm. The balance between intensification and diversification obtained from combining the elite and most diverse individuals, along the introduction of LS Chains and the Intensity parameters achieves a considerable improvement for the overall MA optimization performance. Moreover, the application of the LS algorithm is regulated throughout the MA convergence with the introduction of the LS Depth. As the algorithm progresses, the convergence thereof begins. Therefore, it increases the frequency of the LS to be executed and the likelihood of obtaining the best individual of its neighborhood. LS Intensity allows the evaluation of the elite individuals to detect if they could be improved through LS or it would be better to introduce a new individual of the population looking for the diversification of the algorithm. The intensity allows the detection of potentially promising individuals who could be significantly improved when they are running in the LS. In each iteration, the evaluation analyses factors that help the determination of the best candidates for the application of the LS procedure. The calculation of the value of the intensity requires the comparative analysis of how much the fitness improves after LS execution, how often the result of the fitness values is increased through LS, and how much scope for improvement an individual has ahead. Therefore, in a first step, it is necessary to determine the value of the optimality of each individual involved in the LS before the application of the procedure, and later when the LS execution ends, the algorithm analyzes his fitness back. The results show how much the individuals have improved by the exploration of the LS in comparison with the GA selected individual. The selection of an individual for the application of the LS looks for the obtention of the best-adapted individual in a bounded region (i.e., the neighborhood of the individual). The more frequently an individual is selected, the less likelihood to produce an enhancement in its optimal value. Thus, the application of the LS without producing further improvements in the fitness of the individual must penalize this individual allowing a reduction in the possibilities of the selection of the individual in future applications of the LS.