In this section, all optimization methods in the field of localization are reported. Generally, a description of the algorithm, its concept, and the mathematical formulation are reported; then, a real and meaningful application for localization purposes is described.
3.2. Levenberg–Marquardt
The Levenberg–Marquardt algorithm (LMA), or the Damped least-squares (DLS) method, is used to solve non-linear optimization problems. The LMA exploits a parameter
such that it can switch between the GD algorithm and the Gauss–Newton algorithm; practically, the LMA interpolates between the Gauss–Newton algorithm and the method of GD according to the current prediction accuracy, but at the expense of a certain convergence rate [
40]. The algorithm needs the initial guess and, if it is too far, then the error might be large, and the algorithm might not be able to give a correct global solution due to the presence of many local minima, and it might provide a local minimum which is not necessarily the global minimum. To obtain a better correct initial guess for the LMA, it is possible to use EAs in the initial phase because they do not suffer from the initial value problem.
Considering a non-linear least-squares problem, it can be expressed mathematically as follows:
where
is the vector input,
is the objective function,
is the residual and it is defined as a function such that
with the assumption of
, and
is the residual vector and is defined such that
.
The Levenberg–Marquardt algorithm is a modification of the Gauss–Newton method, and it is based on a local linearization of the residuals as follows [
40,
41,
42]:
where
is the Jacobian Matrix, and
is an infinitesimal of
. Next, the Gauss–Newton technique recursively updates in accordance with the following:
If the initial guess of the Gauss–Newton method is near the optimum of
, it will usually converge quickly; however, this is not always the case, and the method can take very large and uncontrolled steps, failing to converge. To deal with this issue and control the steps in a useful way, Levenberg [
41] and Marquardt [
42] each proposed the damping of the
matrix by a diagonal cut-off, modifying (33) as follows:
where
is a positive–definite, diagonal matrix that is the relative scale of the parameters and
is a damping parameter adjusted by the algorithm. If
is large, the steps are small along the gradient direction, and vice versa when
is small. As the method is reaching a solution,
is chosen to be small and the method converges quickly via the Gauss–Newton method.
The implementation of the Levenberg–Marquardt algorithm follows these iterative steps [
40]:
Based on the current parameter values, update the function and Jacobian values (if necessary);
Update the scaling matrix and damping parameter ;
Propose a parameter step and evaluate the function at the new parameter values ;
Accept or reject the parameter step depending on whether the cost has decreased at the new parameters;
Stop if any of the desired convergence criteria of the algorithm are met or if the limit of function evaluations or iterations has been exceeded.
The methods for the choice strategy of the damping parameter
and the scaling matrix
require specific methods (as described in [
40]) which are not further investigated in this article.
Magnetic Localization Technique Based on the Levenberg–Marquardt Algorithm
The authors in reference [
10] propose a method for the localization of a permanent magnet based on the LMA. The permanent magnet is modelled as a dipole, and the magnetic field is measured by an array of
magnetometers (16 in total). The general optimization problem can be expressed as follows:
where
is the objective function,
,
and
are the coordinates of the permanent magnet position,
and
identify the orientation of the permanent magnet,
is the number of the
-th magnetometer,
is the measured magnetic field, and
is a function representing the model of the system based on the magnetic dipole theory, and it includes the coordinates and the orientation angles.
The problem can be solved by using the LMA, but the issue is the need for a good initial guess to obtain a solution because when a too-far initial point is provided, divergence can occur. To deal with this problem, a solution could be to combine the PSO and LMA methods: the former is used to calculate an initial guess, and the second is used to calculate the local minima because it results in a faster method. The drawback of this approach is that it is not suitable for real-time applications, and the authors of paper [
10] deal with it by proposing to use only the LMA and a properly modified model of Equation (35). In the first step, the new model neglects the orientation to find only the coordinates of the permanent magnet; then, in the second step, the orientation is also obtained. The modified model is expressed as follows:
where
is a scalar quantity that represents the magnetic strength,
is the vector from the center of the permanent magnet to the
-th sensor,
is a matrix that is a function of the magnet position, and
is the averaged orientation vector, expressed as follows:
where
, and
is the one-diagonal matrix. The orientation vector is obtained by applying the following equation:
The authors claim that in such a way, a more suitable optimization problem for the LMA is obtained, and for this application, the method always provides an acceptable solution independently from the distance of the initial guess; moreover, the speed of computing is improved.
3.4. Genetic Algorithm
The GA was inspired by Darwin’s principle of survival of the fittest solutions and can solve both constrained and unconstrained optimization problems; it is based on natural selection, the process that drives biological evolution [
48]. The algorithm is implemented with the following steps:
Creation of the initial population.
Calculation of fitness of each individual.
New individual generation by adopting the following operators:
- 3.1.
Selection;
- 3.2.
Crossover;
- 3.3.
Mutation;
Calculation of fitness of each individual.
Test:
- 5.1.
If the convergence criteria are satisfied, stop.
- 5.2.
Otherwise, repeat from step 3.
It is iterative, and after the first cycle, it is repeated from step 3 until the desired criteria are satisfied. In step 1, the process begins with a set of individuals, which is called the population; each individual is a solution to the problem to be solved. An individual is characterized by a set of parameters (variables) known as genes, which are joined into a string to form a chromosome, i.e., a solution. In the second step, the fitness function of the problem determines how an individual (or solution) fits, and it measures the ability of an individual to compete with other individuals. The output is a fitness score for each individual, and the probability that an individual will be selected for reproduction is based on its score. In step 3, the new individual generation process begins, and it is composed of four operators, i.e., (i) selection, (ii) crossover, and (iii) mutation. In the selection, some individuals are chosen to generate new ones and selected individuals pass some of their genes into the next generation; in other words, some individuals are selected as parents to generate children. In general, individuals are selected based on their fitness scores, and the higher the fitness value, the higher the probability of being selected for reproduction. In the literature, there are many proposals for selection operators, and some of them are the following: roulette wheel selection, sequential selection, tournament selection, dominant selection, hybrid selection, kin selection, back controlled selection, and so on [
49]. It is important to highlight that, at every cycle, an elitist population is extracted from the population of the current iteration to directly pass some of the best individuals to the next generation. In some cases, such a procedure might give rise to problems of fast convergence, and to tackle such an issue, an adaptive elitist population strategy which changes the number of the elitist population can be implemented, as proposed in reference [
50]. After selection, the crossover operator creates new children by mixing the relative genes. For example,
Figure 7 shows the concept of the 1-crossover point operator, where two parents generate two offspring by exchanging portions of their genes. In the literature, there are many proposals for crossover operators and the authors in reference [
51] classify them in three categories: standard (such as 1-crossover point, k-crossover point, shuffle-crossover, reduced surrogate-crossover, and so on), binary (random respectful crossover, masked crossover, 1-bit adaption crossover, and so on), and application dependent (or real/tree).
Finally, the mutation operators can introduce random variation of the genes, and for this purpose, the mutation probability value is adopted, which is a random value between 0 and 100%; a value equal to zero means no-mutations are adopted, whereas a 100% value modifies all genes of the child. In general, mutations should not occur so often, but they are important because they allow for the avoidance of being stuck in local minima [
52]. For example, some mutation operators in the literature are mirror mutation and binary bit-flipping mutation, mutation based on directed variation techniques, directed mutation, and so on [
53].
Once a new population is obtained, step 4 computes the fitness values of the offspring and, finally, step 5 verifies whether the convergence criteria are satisfied or not. If not, the cycle is repeated from step 3 until a satisfactory solution is found or the maximum number of iterations is reached; over successive generations, the population evolves toward an optimal solution [
15,
48,
54].
The GA can solve a variety of optimization problems that are not well-suited for standard optimization algorithms, including problems in which the objective function is discontinuous, nondifferentiable, stochastic, or highly non-linear. Furthermore, GAs are also suitable for problems of mixed-integer programming where solutions have some components that are defined as integers.
Evolutionary Optimization Strategy for Indoor Position Estimation Using Smartphones
The authors in reference [
9] propose a smartphone-based indoor localization system adopting a sensor fusion algorithm where localization information from an Inertial Measurement Unit (IMU), Wireless Local Area Network (WLAN), Bluetooth, and magnetic field anomalies is fused to provide the estimated localization.
In the fusion step, the probability distributions of each localization information source are superimposed; in the summation, each distribution is weighted with a coefficient in the interval from 0 to 1.
For determining the weights, optimization methods can be applied; they exploit the result of some tests that were run in buildings to obtain the ground truth points (GTPs). In such a way, it is possible to estimate the weights with a Root-Mean-Square Error (RMSE)-based fitness metric, defined as follows:
Due to the high ambiguity and the unknown (mixed) stochastic distributions of the input variables, using classical search methods (e.g., gradient-based methods), the optimization quickly converges to a local minimum. Then, a global optimization procedure is needed to maximize the quality metric and avoid local extrema. Because of the building model’s non-linearities, no gradients can be easily derived analytically, and gradient-based optimization methods are not applicable. Therefore, the authors proposed the use of a GA for finding the optimal weights, and in their article, they compared the results with four other local and global optimization strategies: Hill Climbing, the Nelder–Mead method, SA, and PSO. The outcome is that the GA outperforms the other algorithms; however, the drawback is that it needs the most computing time, but it is not a particular issue because the optimization process of the parameters must only be calculated once the end of the offline phase is reached.
3.5. Quantum Genetic Algorithm
The Quantum Genetic Algorithm (QGA) exploits the concept of qubits and the superposition of states in quantum mechanics. The algorithm is explained as follows [
11,
55]. The information is represented by a quantum bit or qubit which may be in the ‘0’ state, in the ‘1’ state, or any superposition of the two states [
55]. A representation of the qubit state is given as follows:
where
and
are complex numbers that specify the probability amplitudes of the corresponding states, and
and
are the probabilities of the states to be either 0 or 1, respectively, and the condition
must be satisfied.
A system with qubits represents states at the same time, which collapse into a single state during the observing process of a quantum state.
In general, the traditional GA can use binary, numeric, or symbolic representation for a solution encoded with a chromosome. The QGA uses the qubits, where one qubit is represented as
, whilst
qubits are represented as follows:
where
for
. For example, considering
= 3 and the following chosen amplitudes of probability, a superimposition of states is represented as follows:
and the system state is expressed as follows:
It has four pieces of information at the same time, i.e., the probabilities of , , , and are , , , and , respectively. For a better comprehension of how coefficients are obtained, the coefficient of the binary number is obtained by multiplying each in the matrix (55), i.e., , whereas the coefficient of the number is obtained by . The square power of a coefficient gives the probability of the related binary number. Moreover, the second digit is always zero, because .
Because QGA computing can represent a superposition of states, it provides a better characteristic of diversity than classical approaches; Equation (56) is one qubit chromosome that represents four states at the same time, whereas, in a classical representation, at least four chromosomes (000, 001, 100, and 101) would be needed.
During the convergence process, the or of the qubit chromosomes can approach 1 or 0, giving rise to a single state.
In the QGA, a population of qubit chromosomes
at generation
is defined, where
is the size of the population, and
is a qubit chromosome with
qubits defined as follows:
Considering the main step to implement the QGA, in the initialization step of
, and all
and
of each
are set to
and it means that the qubit chromosome at
represents the linear superposition of all possible states with the same probability
, and it can be expressed as follows:
where
is the
-th state represented by the binary string
, where
can be equal to 0 or 1.
The next step is to generate a set of solutions from , and this is called the observing process, which provides at the time .
One binary solution, , for from 1 to , is a binary string of length , and is formed by selecting each bit using the probability of qubit (or ), which is compared with an value that is a randomly generated number between 0 and 1; if , then the -th element of the -th binary string is 1, or, if , it is 0. Each solution is evaluated to give a measure of its fitness. The initial best solution is then selected and stored among the solutions .
After initialization, the iterative part of the algorithm begins, and a set of binary solutions
is formed by observing the
population; each binary solution in
is evaluated to give the fitness value. In the next step, called “update
”, a set of qubit chromosomes
is updated by applying an appropriate quantum gate
. A quantum gate is a reversible gate represented by a unitary operator
acting on the qubit basis states, and it satisfies the relation
, where
is the Hermitian adjoint of
. The quantum gate is selected or designed in agreement with the considered practical problem to be solved; for example, the rotation gates can be used for knapsack problems, and it is given as follows:
where
is the rotation angle. For instance, a qubit amplitude probability
in a chromosome can be updated by a quantum rotation that is given as follows:
where
, and
is a function to determine the sign of
, and
is the variation of
. The functions
and
are chosen in agreement with the lookup table (as indicated in reference [
55]), which is based on experience and experiments;
is a key parameter because it influences the computation quality and efficiency of the method; if it is too small, the number of iterations might be too big, whereas when it is too large, the solution might be trapped into divergent locations or give rise to a premature convergence to a local optimum [
11].
Thanks to this step, the qubit chromosomes move and can converge to a better solution. In the next step, among the solutions, the best one is selected and compared with the previous best one; if the new solution is better than the previous one, the older solution is discarded; otherwise, the old one is retained. By the application of some genetic operators, it is also possible to obtain mutations and crossovers of chromosomes; the mutation gives rise to new individuals characterized by a small change, whereas the crossover allows the generation of new individuals by combining parts of two or more different chromosomes. Genetic operators make the probability of the linear superposition of states change; however, mutation and crossover are not needed in the QGA because the quantum representation provides a diversity in chromosomes and the application of genetic gates with a high probability of variation can result in worse performance.
The diversity of the QGA can provide better convergence than conventional GAs, which can deal only with fixed 0 and 1 information. Moreover, the QGA has a speed of calculation times faster than the speed of the traditional genetic method. The main steps of the QGA are summarised as follows:
Initialize of .
t = t + 1.
Observe and create .
Evaluation of
Update using quantum gates
Store the best solution among .
If max generation is not reached or convergence criteria are not satisfied, repeat from step 2.
An Adaptive Quantum-Inspired Evolutionary Algorithm for Localization of Vehicles
The authors in reference [
11] introduce a method based on an Adaptive Quantum-Inspired Evolutionary Algorithm (AQIEA) to estimate the calibration parameters for a real-size intelligent vehicle that can be driven along a non-predefined road path. They use the Differential Global Positioning System (DGPS) as a ground truth and propose an optimization-based calibration method to reduce the systematic errors of wheeled odometers (the differences between the actual wheel diameters and the nominal diameters) and the gyroscope (initial installation error due to misalignment of the sensor with the longitudinal axis of the vehicle). The diameter of the left and right rear wheels and the heading of the gyroscope are considered as the calibration parameters to be optimized to reduce the localization errors in the dead reckoning.
The dead reckoning model can be expressed as follows:
where
,
, and
are, respectively, the coordinates of the vehicle along the
and
-direction in the Cartesian coordinate system and the heading of the vehicle at time
;
is the sampling period;
is the incremental travel displacement of the vehicle, and it can be expressed as
, where
is the displacement of the right (left) rear wheel of the vehicle, and
is the heading change during the sampling period.
The wheel displacement can be expressed as follows:
where
is the increment of the encoder pulses of the right (left) during the sampling period,
is the encoder resolution of the right (left) wheel in the unit of pulses per revolution, and
is the nominal diameter of the right (left) wheel.
In the real application, this model is influenced by systematic errors and random errors; for example, considering the odometers, the former are due to differences between wheel diameters, different nominal diameters, and the misalignment of wheels; the latter is due to the limited resolution of encoders, the limited sampling rate, the condition of the road (rough surface), the wheel slippage, and so on.
The systematic errors can be compensated and by including them in the model, the displacements and heading variation are expressed as follows:
where the symbol
denotes the new variables that include systematic errors, and
,
, and
are the parameters to compensate for the right wheel diameter, the left wheel diameter, and the misalignment of the gyroscope, respectively. By considering these errors, the model represented by Equation (61) is rewritten as follows:
The positioning error
at the
-th sample is defined as the difference between the data provided by DGPS and the dead reckoning method, and it is computed by the following:
for
where
is the total number of samples.
Then, it is possible to formulate the optimization problem, which is expressed as follows:
where
is the objective function to be minimized with respect to
,
, and
, and the superscript
and
denote the low and upper limits, respectively, for the considered variables. Two different optimization objective functions are considered to determine the optimal calibration parameters; the first one is the maximum positioning error, which is defined as follows:
and the second one is the mean positioning error, defined as follows:
To solve the optimization problem, the authors use the AQIEA, which is an evolution of the QGA. In the adaptive method, the lookup table is not used because it is substituted by a different approach based on the idea of choosing as input for the quantum gate either a large value for
or a small one. The former is used when an individual is away from the optimal solution, and it needs to bring individuals quickly towards the optimal solution; the latter is used to avoid an individual moving away from the optimal solution when it is going to be reached. Then the magnitude of the rotation angle is obtained by the following:
where
and
are two positive real numbers (
),
is the maximum fitness in the current population,
is the average fitness of the individuals in the current population, and
is the fitness of the selected individual. In such a way, an adaptive change in the rotation angle magnitude of the quantum rotation gate is obtained.
The sign of the rotation angle is determined by the following:
where
is a function that provide the sign,
is the observed state (0 or 1) of the
-th qubit of the best individual, and
is a positive real number between 0 and 1. The proof of (70) is given in reference [
11].
Moreover, to improve global searching and to avoid being trapped in local optimal minima, an adaptive quantum mutation operation is introduced (unlike the traditional QGA, where mutations are not used). Given a selected chromosome in the population, the mutation operation is conducted based on a mutation probability
:
where
and
are two small positive real values between 0 and 1. It is observed, for example, that for an individual with
,
is 0 and no mutations are applied. The mutation is applied by choosing two random positions in the selected individual, and two qubits are mutated by a quantum-not gate that exchanges the values of the amplitude probabilities; the gate is defined as follows:
3.6. Differential Evolution Algorithm
The DE algorithm is a power population-based and stochastic evolutionary algorithm to solve continuous global optimization problems that can be constrained or unconstrained; it maintains a population of candidate solutions and creates new candidate solutions by combining existing ones according to its formula and then keeping whichever candidate solution has the best score or fitness on the considered optimization problem. In this way, the optimization problem is treated as a black box that provides a measure of quality given by a candidate solution.
The main steps of the DE algorithm are as follows: (i) generate the initial population of the specified size; the population evolves by using (ii) mutation, (iii) crossover, and (iv) selection operators during each generation; and (v) step (ii) is repeated until a termination criterion is obtained [
56].
In the initialization step, a number
of populations is set and each of them has a number
of
-dimensional vectors (
is a number related to the nature of the problem), which are potential solutions to the problem. The
-th individual, i.e., the
-th
-dimensional vector, is given as follows:
where
identifies the number of the generation. Initial individuals are set with the following formula:
where
and
are vectors which identify the limits of the solution, and
is a function to generate random individuals with a normal distribution.
In the mutation step, mutation vectors
are generated for each individual of a population, which is called the target vector. The basic mutation strategies are as follows [
57]:
where
,
,
,
, and
are integers randomly generated in the range between 1 and
,
is a scale factor, and
is the best individual vector in a population during the
-th generation.
As for the crossover step, trial (or test) vectors
are created by crossing each individual
(or target vector) and the corresponding mutation vector
; it needs to form a set of trial vectors used in the selection step; there are two types of crossover methods largely used in the literature: binomial and exponential. In the former, the test vector is given as follows:
where CR is the crossover factor in the range 0 and 1 and controls the probability that a component of a trial vector is obtained from either a mutant or a previous individual, and j is between 1 and
. In this method, the distribution of the number of parameters inherited from the mutant is (almost) binomial. On the other hand, in the latter, a random integer
in the range
is chosen and it is the component starting point for the crossover process. The components for the trial vector
are donated from the mutated vector until a Bernoulli experiment linked to a probability
is true [
58].
In the end, in the selection step, the objective function of the problem is evaluated for all generated trial vectors and the corresponding target vectors; the best one is selected, and it is a new individual of the next generation. The selection is given as follows:
There are two main differences between the GA and DE algorithm: (i) the GA is conducted by changing some genes in the chromosomes, while in the DE algorithm, the mutant individuals are obtained by adding the difference between two individuals to a third individual, which has a stronger global search capability; (ii) in the traditional GA, offspring individuals replace their parent individuals with a certain probability, while in the DE algorithm, such a condition only happens when the fitness of the offspring is better than the fitness of their parents; in such a way, a greatly increased convergence speed is provided [
59].
Visible Light Communication Using a Modified Differential Evolution Algorithm
Authors in reference [
59] have developed a Visible Light Communication (VLC) system where the VLC positioning model is transformed into a global optimization problem and a DE algorithm is used to calculate the z-coordinate of the receiver by adopting a modified DE algorithm that is called the self-adaptive DE algorithm; in this work, the 3D problem is reduced to a 1D problem, improving the speed of localization. Because the individual dimension is one (only the z-coordinate), the crossover process is ignored. The 3D positioning strategy exploits some specific equations to calculate the overlapped area of three circles determined by the position of the sources and the target, and is obtained by the projection on the
-y plan; the DE algorithm is used to solve the specific equation and calculate the z-coordinate by finding the optimal fitness value; the
and
coordinates are calculated by exploiting three equations for trilateration in the projection plan.
The proposed algorithm has three steps: (i) the generation of the population, (ii) calculation of the fitness, and (iii) mutation operator. The fitness function evaluates the quality of each of the candidate solutions in the population. In the VLC-based 3D positioning system, the individual with the smallest overlapped area can be regarded as the estimated position. The fitness equation can be treated as the overlapped area
and is represented as follows:
If no overlapped area is formed between the three circles, the fitness is zero; the presumed height is increased by 0.2 m for each iteration until the overlapped area appears. If the fitness , then the currently estimated height jumps out of the iteration loop and it is considered as the optimal solution ; otherwise, the iteration process goes on (step (iii)). In the case that the number of iterations reaches the maximum, and the fitness is still higher than , the algorithm goes back to step (i).
The authors considered three types of DE algorithms: (i) DE/rand/1/binomial; (ii) DE/current-to-best/1/binomial; and (iii) the proposed self-adaptive DE algorithm. The first and the second are two traditional DE algorithms which adopt the strategy given in (75) and in (77), respectively; furthermore, the DE/current-to-best/1/binomial benefits from its fast convergence because the best solutions in the search space are used and its performance is better than the performance of the DE/rand/1/binomial algorithm. As for the third algorithm, the proposed self-adaptive DE algorithm is derived on the following observation: as the iteration number increases, the difference among individuals is reduced, and therefore a smaller amount of adjustment is needed because an individual has a better fitness and most of its information can be retained; on the contrary, when the number of iterations are low, the solution is still far from the optimal solution and a larger scaling factor might help the exploration process. Then, the authors proposed the following variation:
where
is defined as follows:
where
and
are the best and worst individuals in the population, namely the vectors with the lowest and highest fitness values in the entire search space, and
is a constant added to avoid the zero division. In such a way, the scaling factor varies between the maximum
and minima
values according to its difference with the best individual at each generation.
3.7. Mind Evolutionary Algorithm
The Mind Evolutionary Algorithm (MEA) is a method which emulates the learning modes and activities of the human mind. Unlike genetic-based algorithms, which use mutation, crossing, and selection operators, in the MEA, an evolutionary process is also exploited but with the difference that two operations named similartaxis and dissimilation are adopted to overcome the drawback of the bad solutions generated during the mutation process; furthermore, every generation’s evolutionary information is memorized, and it is used to guide the evolution toward the global optimum [
60].
The MEA steps are defined as follows:
In the initialization, two main spaces are considered: the superior group space, which is composed of
superior groups, and the temporary group space with
temporary groups. Every group is initialized with
individuals, which are generated by considering an individual as the center and adopting a uniform distribution to generate the other individuals around the center. Furthermore, every individual is scored in agreement with their adaptability to the search space [
60,
61].
The similartaxis and local competition phase aims to make the subgroups mature by performing a local competition. In every group, individuals compete with each other to find the local optimum. To create a new generation, a winner who has the best score is selected, and a new generation is created around it. Then, individuals are scored again to identify if there is a better new solution or to keep the previous one; in such a way, a new generation can be created, competition starts again, and so on. The information of every new winner is recorded on the local billboard of the group. The generation process in a group continues until the maximal and minimal scores within one group satisfy the mature condition; then, the information related to the mature group is stored in the global billboard. The process to make the group mature is named similartaxis and is performed for both superior and temporary space [
60,
61].
In the dissimilation and global competition phase, all groups compete against each other by observing the information reported on the global billboard. If, in the temporary space, there is a group with a higher score than any group in the superior space, then this temporary group will replace the bad groups in the superior space. Moreover, if the score of any mature group in the temporary space is lower than the score of any group in the superior one, this temporary group will be discarded, and new ones will be generated in the temporary space with random values. The generation process is called dissimilation, and in such a way, the similartaxis can continue in every group [
60,
61].
The aforementioned operations are repeated until the scores of the groups in the superior space are so high that they cannot be further improved. At this point, the algorithm is considered convergent, and the winning individual of the group with the best score in the superior space is the global optimum [
61]. The architecture of the MEA is reported in
Figure 8 [
60].
A Mind Evolutionary Algorithm-Based Geomagnetic Positioning System for Indoor Localization
The authors in reference [
60] propose a solution to solve the problem in the pedestrian dead reckoning field where a large error is introduced when a walker goes backwards or laterally but the position is still updated forward. To address this problem, they propose a system for the indoor localization of smartphones based on magnetic positioning and the pedestrian dead reckoning (PDR) method, which are fused using an Extended Kalman Filter (EKF).
To improve the performance of magnetic positioning, the MEA-based heuristic searching strategy is adopted to search for the optimal magnetic position.
The geomagnetic features are extracted using a three-axis magnetometer installed on a smartphone. The magnetic vector measured in the device coordinate reference system is transformed into the equivalent vector in the geographic coordinate reference system in order to obtain a measurement that is independent of the attitude of the device. The transformation can be expressed as follows:
where
is the magnetic vector in the geographic coordinate system,
is the matrix for the transformation, and
is the magnetic vector in the device coordinate system.
Then, five magnetic features for matching are extracted from and they are the three magnetic vector components, the horizontal component of the magnetic field, and the magnitude of the vector.
A fine-grained magnetic database is constructed by linearly interpolating the features and the coordinates. Once the fingerprint has been obtained, the MEA can be performed to estimate the magnetic position. The proposed algorithm exploits the large number of samples that are provided by the measurement process, which can be considered to be at a high frequency; over an interval time of one second, these samples generate many temporary positions that are used to generate a population for the MEA; by considering an epoch every second identified by
, the population
can be represented as follows:
where
is the
-th individual (i.e., the estimated position) of
,
and
are the coordinates values,
is the number of the sample, and
is the sampling frequency. The score is calculated considering the following formula:
where
is the previous estimated magnetic position.
As the first step, the MEA initializes the population (using the data generated by measurements), and the temporary individuals (i.e., the geomagnetic positions) are scored using Equation (88). The positions with higher scores are selected as centers of the superior groups, whereas the positions with lower scores are selected as centers of the temporary groups. Around the centers, individuals of the population are generated with a random distribution, and they are scored using Equation (88).
As the second step, the MEA executes the similartaxis where individuals within the same subgroup compete by comparing their scores. The second step is completed when the mature condition is obtained.
In the end, as the third step, the MEA executes dissimilation for the global competition. The MEA executes similartaxis and dissimilation until convergent conditions are satisfied and the individual with the best score in the mature superior groups is selected as the estimation of the final magnetic position.
3.8. Particle Swarm Optimization
PSO algorithms are based on a simplified social model that tries to emulate the behavior of a swarm of animals such as bees or birds that are searching for a food source. It can be explained as follows [
15,
62].
PSO finds a solution by exploiting information from each individual of the population (or swarm) and also information from the swarm as a whole. At the beginning of the process, the number of particles in the swarm and the number of iterations are set, and an initial population distributed throughout the design space is randomly generated. In the next step, the position of each particle is updated using the following formula:
where
is the
-th individual in the swarm,
is the
-th iteration,
is the velocity vector of the
-th individual at the
-th iteration, and
is the time increment. At the beginning, the velocity vector of each particle is initialized randomly and is updated at each iteration using the following formula:
where
is the inertial parameter,
and
are random numbers between 0 and 1,
and
are the trust parameters,
is the best point found so far by the
-th particle, and
is the best point found by the swarm. The search behavior of the algorithm is controlled by the inertial parameter
; the larger the value, the larger the focus in global searching, whereas the smaller the value, the larger the focus in local searching; reference values for these two extremes are 1.4 and 0.5, for either a more focused global search or for more focused local search, respectively [
15]. The
and the
are two trust parameters; the former, also referred to as cognitive memory, indicates how much the particle trusts itself, whereas the latter, also referred to as social memory, indicates how much the particle trusts the group. The
can be defined as either considering some best points among a subset of particles or considering the best point among all particles of the swarm. The values of
,
, and
parameters must be tuned in agreement with the managed problem.
The main drawbacks of the method are the tuning parameters and the fact that it is an inherently unconstrained optimization algorithm. The last one is a common characteristic of most of the evolutionary algorithms; researchers have tried to deal with this problem by proposing many constraint-handling techniques for evolution, and among these, the penalty function approach is the most widely used because it has the advantage that it is easy to implement [
15].
3.8.1. Particle Swarm Optimization-Based Artificial Neural Network (PSO-ANN)
The authors in reference [
63] use an Artificial Neural Network (ANN) to solve the fingerprint localization problem by exploiting the Received Signal Strengths Indicator (RSSI) of the Wi-Fi signal in an indoor environment. The ANN provides the localization of the target, and it is trained by a traditional PSO algorithm; this approach provides a strong learning skill which allows one to better deal with complicated indoor environments. Traditionally ANNs are trained by exploiting a backpropagation algorithm that is characterized by a feedforward propagation of signals and a backpropagation of errors; this approach requires significant time for training and can be easily trapped in a local minimum. To solve these issues, authors adopt the PSO algorithm to find the parameters of the trained ANN; they define the following:
- (i)
Each fingerprint is composed by , where is the RSSI value at time of the -th Wi-Fi source, and is the position of the collected fingerprint.
- (ii)
The particle of the PSO is given as , where and represent the weight and bias of the -th neuron.
- (iii)
The updating equations for the particle position and velocity are defined by the following:
where
is the velocity in the
-th iteration,
is the particle in the
-th iteration,
and
are two acceleration coefficients, and
and g
are the personal best position and global best position in the
-th iteration, respectively,
and
are two random constriction coefficients in the range (0, 1) sampled from a uniform distribution to prevent explosion and induce particles to converge on optima, and
is the inertia factor which helps to control the ability of particles to jump out of the local optimum and find the global optimum.
Considering the above definitions, the proposed algorithm follows these steps:
Set the particle group size M, the max iteration number , and the expected error e. Then, initialize randomly the initial position and velocity of the particles;
For all RSSI training sets , put in the ANN model and compute the ANN output ;
Update the pbest and gbest according to the distance between the predicted position and the real position ;
Update the particle position and velocity according to Equation (91);
Repeat steps 3 and 4 until the distance between and the real position is less than the expected error or the max iteration number n has been reached.
3.8.2. Particle Swarm Optimization-Based Minimum Residual Algorithm
The authors in reference [
64] adopt an RSSI range-based localization method for a mobile robot working in an indoor environment where the localization is estimated by a Minimum Residual (MinRe) localization algorithm based on PSO.
According to the principle of MinRE localization, the sum of the target’s squared residual between the real and the measured distances is given as follows:
where
is the function to be minimized,
is the real vector position to be found on the target,
is the vector position of the
-th anchor node,
is the total number of nodes, and
is the measured distance from the RSSI, which can be expressed as
, where
is the unknown real distance and
is the noise.
The term
represents the Euclidean distance between
and
and it can be expressed as follows:
where
,
and
are the coordinates of the position of the target
, and
,
, and
are the coordinates of the position of the
. If there is no error,
would be zero.
The PSO algorithm is applied to estimate the position of the target and the final problem can be written as follows:
Setting the number of particles , the maximum number of iterations , considering as the index of the particle updating iteration for this problem, and as the index of the -th particle, the solution of the problem follows these steps:
Initialization, where the particles and their initial velocity are generated randomly within the target environment: , and . The fitness of the -th particle is calculated and the initial individual best value is set: . The initial global best fitness of the particle swarm is the particle which achieves the minimum of and it is represented as where .
Particle velocities and positions, which are updated in agreement with the individual best and global best values at
-th iteration for
.
where
is the inertia weight that controls the exploration search region,
and
are the acceleration constants between 0 and 2, and
and
are random numbers between 0 and 1.
The updating of the optimal particle and optimal swarm is initiated:
The stopping criterion is checked: if , then set and go to step 2; otherwise, the estimated position is .
The estimated is the position at the time where the localization is estimated.
3.8.3. Mobile Robot Localization Based on PSO and Simultaneous Perturbation
The authors in reference [
65] propose a mobile robot localization based on the PSO estimator where the system exploits the dynamic optimization to find the best robot pose estimate, recursively. The proposed solution is an alternative to using EKF or PF. PSO searches recursively and stochastically along the state space for the best robot pose estimation. Unlike the localization based on PF, in the proposed method, the resampling step (where samples with negligible weights are discarded and substituted by resampling) is not required, and no noise distribution is required either. The robot localization
at the
-th epoch is modelled like a Markov process (a random process in which the future is independent of the past given the present), where the initial distribution is
. Considering a maximum, a posteriori point of view, the localization estimation can be considered as an optimization problem, where the process seeks to estimate the pose that maximizes the a posteriori probability density, defined as follows:
where
is the history of the estimated positions, and
is the history of the observations. By applying Bayes, the posterior over the robot path is given by the following:
where
is a normalizing constant. The problem can be reformulated as follows:
where
and
is an index to count the epochs. After some mathematics passages, the objective function can be expressed as follows:
where
considers the previous history for all the
epochs; it is suitable for an iterative application.
Now, the following is considered: (i) the motion model that gives the robot pose at time
. Specifically, this is considered as follows:
where
is a non-linear function,
is the Gaussian noise distribution with covariance matrix
, and
is the control; (ii) the measurement model for the observed
feature is defined as follows:
where
is the function of the model,
is the measurement Gaussian noise distribution with covariance matrix
; (iii) the state transition probability density
derived from the robot motion model and the observation probability density
derived from the observation model the problem is rewritten in the following form:
where
and
, where
and
are the estimated measurement vector and the estimated state vector, respectively; then, the fitness function can be written as follows:
It is a quadratic and strictly convex function; the problem is solved using PSO, which can be applied to complex problems such as non-linear and non-differentiable problems.
It is now assumed that the current particles of PSO are given as follows:
where
is an
dimensional vector, and
represents each candidate solution
to the optimization problem at iteration
at time
. In standard PSO, the local information of an objective function obtained, for example, from the gradient, is not exploited. This means that even if a search point of PSO around the optimal value exists, the particle could go past the optimum point, since local information is not considered; nevertheless, the searching ability of PSO can be improved when gradient information is considered, but with the risk of being trapped in a local minimum and missing the global solution of the problem. In order to overcome this problem, authors combine PSO with the Simultaneous Perturbation (SP) method and gradient. The SP is a method that is given as follows:
where
is a positive constant,
and
are a perturbation vector and its
-th element, which is determined randomly, and
represents the
-th element of
, which estimates the gradient.
As proposed in reference [
66], the combination of PSO and SP gives rise to the following equations:
where
is the particle,
is the best value of the particle,
is the best value of the swarm,
and
are two positive numbers in a predefined range, and
is a gain coefficient. To provide global and local search capabilities at the same time, and keeping in the meantime population diversity, the authors define a combination of PSO and SP, given as follows:
where
,
are positive coefficients,
and
are random numbers in the interval (0, 1),
is the maximum velocity limited to 10% of the dynamic range of the variables on each dimension,
is the inertial weight,
is a positive constant, and
is the gradient of the objective function.
3.10. Bat Algorithm
The bat algorithm (BA) idea is inspired by the echolocation behavior of bats to find food; in nature, they usually emit short pulses, and when they encounter food, they change the frequency to tune the echolocation time and increase the location accuracy of the prey [
68]. The parameters of loudness and frequency determine the global search capability, and if a bat is near its scope, the impulse rate increases, whereas loudness decreases. In the standard bat algorithm, each individual
has a defined position
and velocity
in the search space, which are updated iteration by iteration with the following set of equations:
where
is the
-th iteration,
is the current global optimal solution,
is the frequency of the
-th individual,
,
, and
is a random vector in the range [0, 1] with uniform distribution.
To implement the local search strategy, the following equation is considered:
where
is a random number in the range [−1, 1] and
is the average loudness of the population.
The global search is controlled by loudness
and pulse rate
, which are updated with the following equations:
where
is the amplitude decrease rate and is a constant term, and
is a constant. The initial values of loudness
and pulse rate
are set in the initialization.
The steps of the standard algorithm are as follows:
Initialize, for each bat, the position and velocity parameters and randomly generate the frequency with Equation (117).
Update the position and velocity of each bat with (115) and (116).
For each bat, generate a random number in the range [0, 1];
if , then update the temp position with (118) and calculate the fitness value for the corresponding -th bat.
For each bat, generate a random number in the range [0, 1];
if and if , where is the fitness function, then update the loudness with (119) and the pulse rate with (120).
Sort each individual based on fitness values and save the best position.
If the final condition is met, then exit; otherwise, go to step 2.
Mobile Robot Localization Based on the Leader-Based Bat Algorithm
The authors in reference [
69] propose a modified BA to solve the mobile robot global localization problem, which is often characterized by complex multimodal beliefs. In some problems, the standard BA might provide a premature convergence solution. Authors propose the leader-based bat algorithm (LBBA), introducing leaders who can influence the behavior of other individuals. This gives rise to more stable particle movements at multiple local optimum points, providing a convergence to the global optimum in more complex environments.
The LBBA is a nonparametric filter with individuals, and each of them approximately corresponds to one region in the search space. The a priori states of individuals are represented by a set of random samples, and this enables the simultaneous representation of multiple optimal locations.
Unlike the standard BA, the LBBA uses both the best global and the best individual . The last one enables a higher diversity of solutions in the population, and, in addition, the performance and efficiency in the search for the global optimum are improved thanks to the adoption of leaders, who promote the creation of different colonies, decreasing the randomness of flight.
To determine the target position, the following object function is defined:
where
is the measurement performed by the simulated sensor of the
-th individual, and
is the measurement performed by the real robot sensor.
The main steps of a general LBBA are as follows:
Step 1. Initialization of , where . Define the number of leaders .
Define the number of leaders .
Initialization of frequency , impulse rate , and amplitude .
Assess the fitness of each bat using the fitness function .
Determine leaders with the fitness function.
Define the best global bat and the relative best fitness: and .
Step 2. Compute the following:
- -
;
- -
;
- -
, where is a temporary variable.
Step 3. If then , where is the best global variable, and is a random displacement variable.
Step 4. Estimate the fitness of using .
Step 5. Define new leaders .
Step 6. If and , then compute the following:
- -
;
- -
;
- -
;
- -
.
Step 7. If then compute , and .
Step 8. If the condition is met, return ; otherwise, repeat from step 2.
Authors claim that the LBBA has better performances when compared to other algorithms for robot localization such as PF and PSO, showing the ability to escape from local minima in highly complex environments. Moreover, it also succeeds in solving the robot’s kidnapping problem without premature convergences.
3.12. Simulated Annealing
The SA algorithm is a random-search technique that is based on the analogy between the process of metal crystalline formation from the liquid phase, and the process of searching for an optimal minimum in a problem. If the cooling process is too rapid, then the metal will solidify into a sub-optimal configuration. If the cooling process takes the proper time, the crystals within the material will solidify optimally into a state of minimum energy, which is the ground state associated with the optimal global solution to the problem. This is a heuristic method that does not need any particular assumptions and can be used for non-linear and non-convex problems; in particular, it results in a suitable technique for solving combinatorial optimization problems.
The main steps of the SA algorithm are as follows [
73]:
Generate a random initial solution vector for the system and then evaluate it using the objective function .
Initialize the temperature .
Perturbate the previous solution to obtain a neighboring . Evaluate the new solution.
A new solution is accepted as a new solution if is better than .
Otherwise, accept the new solution with a probability ,
where .
Reduce the system temperature according to the cooling schedule.
Repeat from step 3 until a stopping criterion is met (number of cycles or .
In the SA problem, temperature is a parameter that controls the probability in step 5. During the iterations, the lower the temperature, the lower the probability of accepting a bad solution. This mechanism helps the procedure to avoid being stuck in a global minimum at the beginning of the iterations, because it allows the algorithm to jump out of the minima looking for better solutions. To obtain a good result, it is important to properly set the initial value of temperature . If the value is too high, then it takes more cycles to converge, and vice versa; if the value is too small, the algorithm may provide a local optimum.
In step 6, the choice of an appropriate cooling scheme is important for the algorithm’s success. In the literature, there are several types of schemes, and they can be classified as either monotonic or adaptive. The former consists of a static decrease in the temperature at every iteration independently of the goodness of the solutions and independently of the current explored neighborhood structure, whereas the last one considers the quality of transitions, adopting mechanisms for the temperature decrease that can adopt also reannealing techniques [
73].
Simulated Annealing-Based Localization in Wireless Sensor Network
The authors in reference [
74] propose a SA localization (SAL) method for wireless sensor networks. It aims to estimate the position of sensors by determining the position of a set of anchors and the measured distance between them and the sensors. However, several factors can influence distance measurements, such as synchronization, multipath, fading, Non-Line of Sight (NLoS) conditions, and other sources of interference. To estimate the real distance of the sensor with a minimum error, the authors propose to solve the optimization problem with the SAL method. The objective function is defined as follows:
where
is number of non-anchor nodes,
is the set of neighbors of the
-th node,
and
are the estimated distance and the measured distance of node
with its neighbor
, respectively.
The adopted cooling scheme for temperature is , where is the cooling rate that is determined empirically. The solutions are perturbated as , where is chosen to span the whole set of allowable moves and is used to bias the generation of random moves at a lower .
3.13. Ant Colony Optimization
Ant Colony Optimization (ACO) is a probabilistic method, and it was initially proposed to solve the Travelling Salesman Problem (TSP); in general, ACO is suitable for solving problems in which the searched solution is the best path through a graph. It is inspired by the behavior of an ant seeking a path between its colony and food. The ants live in a colony, roam around it looking for food, and communicate with each other by using pheromones which can be released on the ground when insects are moving. Once an ant finds some food, the insect brings it as much as possible back to the colony and, during the travel, it releases pheromones in agreement with the quantity and quality of the found food. Other ants can smell it, and when they come out of the colony looking for food, they choose the path with higher pheromones. The higher the pheromone along a route, the higher the probability that an ant chooses that path. In such a way, more ants follow the path, more pheromones are deposited, and the path has a higher probability of being chosen. After some iterations, the ants will choose the shortest path, which is expected to be the optimum of the problem.
Mathematically, the algorithm is explained as follows [
75]. ACO can be understood considering a simple graph,
, with two nodes, where
represents the nodes of the graph (the nest
and the food source
),
represents two links,
and
, between nodes with length
and
, respectively, such that
. The artificial pheromone trails are modelled for each path by
and
and they indicate the strength of the pheromone trail on the corresponding path. Every ant chooses with a probability given as follows:
where
identifies the
-th link; about the lengths, it is
, which means that link
has a higher probability. As for returning, every ant uses the same path chosen in the outward journey, and it updates the artificial pheromone value associated with the used link with the following equation:
where
is a parameter of the model. It can be inferred that the shorter the path, the higher the amount of added pheromones. At each step (or iteration), all the ants are initially placed in node
and each of them moves from the nest to the food source. The evaporation of the pheromone is simulated by the following:
where
is in the range
and regulates the pheromone evaporation. Finally, all ants return to the nest and reinforce their chosen path, as reported above. Iteration by iteration, the shortest path will be the one with the highest pheromones, and then, with the highest probability.
For real combinatory optimization problems with more than two nodes, the solution is constructed as follows [
76]. Each of the
ants is randomly placed on a chosen node and then at each node, a state transition rule is iteratively applied. The unvisited nodes, the pheromone trail strength, and the length between two nodes bias the ant’s choice. The partial tour is stored in a memory called the tabu list which needs to determine at each construction step the nodes to be visited, to guarantee that a feasible solution is built, and to retrace the trail of the related ant once it has been completed. When all ants end up constructing a path, the pheromones are updated using evaporation and new deposition; short paths are updated with a higher quantity of pheromones. The algorithm is summarized as follows [
76]:
Set parameters and initialize pheromone trails.
Construct solutions.
Apply local search.
Update trails.
If termination conditions are not met, repeat from step 2.
There are different versions of ACO and historically, the first presented version was called the Ant System (AS); some variants of the ACO algorithms (here not investigated) are the Elitist AS (EAS), Rank-based AS (RAS), MAX–MIN Ant System (MMAS), Ant Colony System (ACS), and Hyper-Cube Framework (HCF).
ANN Topology Optimized by ACO
The author in reference [
77] deals with the problem of finding a continuous path for a robot from an initial position to a goal position where collisions against static objects must be avoided. The proposed system exploits an ANN that provides the optimum path, and it is trained by adopting the swarm intelligence-based reinforcement learning (SWIRL) method based on PSO and ACO. Because the training process of Multi-Layer Perceptron (MLP) for pattern classification problems can be considered as graph problems where the neurons are vertices and the connections are directed edges (links), PSO is exploited to provide the best ANN connection weights, whilst the ACO is used to optimize the topology of the ANN. In such a way, the SWIRL provides both an appropriate architecture for the problem and the trained connection weights of the network.
At each step of the iteration process, the PSO is applied to adjust ANN connection weights within a given topology structure. Focusing only on the ACO algorithm, it is used to allocate training iterations among a set of candidate network topologies. The desirability
for the
-th ANN is given as follows:
where
is the number of hidden nodes; each
-th ANN represents a topology of a set of ANNs with different numbers of hidden nodes. The pheromone concentration
is initialized to 0.1, and it is expressed as follows:
where
is the rate of evaporation,
is the number of ants returning from the
-th neural network,
is the global best for
,
is the sum of all the current global bests, and
is the index iteration of the ACO. Each ant represents one training process for the PSO. During each ACO step, the ants go out into the topology space of ANNs, and they choose an ANN using a probability criteria, given as follows:
where
and
are constant factors which control the relative influence of pheromones and desirability, respectively [
77].
3.14. Whale Optimization Algorithm
The Whale Optimization Algorithm (WOA) is a metaheuristic method inspired by the hunting behavior of humpback whales, and it has been proposed by authors in reference [
78]. The algorithm mimics three behaviors: (i) encircling prey or siege predation, (ii) spiral bubble-net feeding maneuver, and (iii) searching for prey. In the first one, a whale is in a location looking for prey to encircle; at the beginning, the locations (or solutions) are random, and the current best solution, defined as the best search agent, is found by exploiting the fitness function; the other search agents or candidate solutions move iteration by iteration towards the current best one. Mathematically, the behavior of each whale can be modelled by the following:
where
is the
-th iteration,
and
are coefficient vectors,
is the position vector of the best solution obtained so far,
is a candidate position vector, and the dot (
) represents the element-by-element multiplication. Furthermore, it is possible to express
and
, where
is linearly decreased from 2 to 0 iteration by iteration, and
is a random vector in the range [0, 1] that allows it to reach any position of the design space. The used vectors in this explanation have the same dimension as the input vector of the problem; however, the algorithm can be applied to a problem with a dimension greater than three even if the algorithm is inspired by the analogy of a moving whale in a three-dimensional space.
In the second behavior (spiral bubble-net feeding manoeuvre), two approaches are adopted: the shrinking encircling mechanism and the spiral updating position. The former needs to push the
vectors towards
and it consists in decreasing the value of
iteration by iteration; in such a way, considering that
is random, the result is that
is composed by random values in the range [
]. As for the second approach, to mimic an encircling movement, a spiral equation is created between the position of a whale and the best position; it is expressed as follows:
where
indicates the distance of the
-th candidate solution (or whale) to the best solution obtained so far,
is a constant for defining the shape of the exponential spiral, and
is a random number in the range [−1, 1]. Considering the analogy with whales, they are swimming around their candidate location prey within a shrinking circle and along a spiral-shaped path simultaneously. To update the position of whales and to mimic the simultaneous behavior of the shrinking encircling mechanism and the spiral model, in the algorithm they are chosen randomly with a probability of 50% in each iteration. The two approaches are expressed as follows:
where
is a random number in the range [0, 1].
In the search for prey behavior, whales look for a prey location, randomly giving the algorithm the global searching capability. It is expressed as follows:
where
is a random position vector chosen from the current whale population.
The WOA pseudo code is composed of four main parts, and they are given as follows [
78]:
Initialize the whale population with .
Calculate the fitness of each search agent.
Define the best search agent .
While :
For each search agent:
Update , , , , and .
If : {
- -
If , update the position of the current search agent by (134).
- -
Elseif , select a random search agent and update the position of the current search agent by (139).
}
Elseif , update the position of the current search agent by (136).
End of for loop.
Check if any search agent goes beyond the search space and amend it.
Calculate the fitness of each search agent.
Update whether a better solution has been found.
.
End.
Return
In this basic version of the proposed WOA, other evolutionary operations are not included, but they might have been included by allowing hybridization with other evolutionary search schemes.
Three Magnetic Targets Using Individual Memory-Based WOA and LM Algorithm
The authors in reference [
79] deal with multi-permanent magnet localization, exploiting an array of magnetometers. The aim is to estimate the location of the permanent magnets inside the human body by measuring the magnetic field. To obtain the best estimation of the measurements, the authors propose an improved WOA combined with the LM algorithm.
Each magnetometer in the array measures the magnetic flux that is given by the linear superposition of the flux densities generated by each permanent magnet. The objective function
of the total error is obtained by considering the sum of the three errors between the measured values by the magnetometers and the theoretical values; it is given as follows:
where each
represents one of the triaxial components of the magnetic flux density measured by the
-th magnetometer,
is the theoretical value of one of the triaxial components of the magnetic flux, and
is the total number of magnetometers. A generic component
is given by the superimposition of the magnetic fields generated by all permanent magnets, and it includes the distance variables between each permanent magnet and each magnetometer.
The name of the proposed algorithm is the Individual Memory-based Whale Optimization and Levenberg–Marquardt (IMWO-LM) algorithm; the IMWO algorithm is used to provide an approximate solution of each magnet pose, which is given as a guess input to the LM algorithm, which is suitable for finding the local minima.
In the proposed IMWO, is defined as the number of whales and each of them searches for a solution of dimension ; the vector position for the -th whale is defined as . The three behaviors presented in the WOA are here modified to give whale the ability of self-memory and to always remember the previous best position. The IMWO behaviors are defined as follows:
Search for prey. The current search agent position is updated considering both the position of the randomly selected whale and the historical optimal position. It is given as follows:
where
identifies the
-th iteration,
identifies the search agent,
is the current position,
is the historical optimal position,
is the random distance between the current position and its historical optimal position,
is a randomly selected search agent,
is the random distance between a randomly selected search agent and current search agent,
and
are weight vectors defined as in the WOA, and
is the newly updated location of the
-th search agent.
Encircling prey or siege predation. The best candidate search agent
of the current population is considered the target prey at each iteration; search agents have memory and can remember the previous best position. It is given as follows:
where
is the random distance between the optimal candidate search agent and the current search agent, and
is the optimal candidate search agent in the whole population so far. In such a way, the current search agent is updated to different positions around
and
Spiral bubble-net feeding maneuver or bubble predation. The helix-shaped movement of the whale is obtained using the spiral equation, considering the position of the current search agent, its historical optimal position, and the position of the optimal candidate search agent. The current position is given as follows:
where
is the distance between the current search agent and the optimal candidate search agent,
is a constant for defining the shape of the exponential spiral,
is linearly decreased from 1 to −1 throughout iterations, and
and
are random numbers in the range [0, 1].
The upper and lower boundary of the pose parameters are set, and at each iteration, the algorithm must check if the search agents violate them.