2.1. Ant Colony Optimization Algorithm
Ant Colony Optimization (ACO) algorithm is a heuristic optimization algorithm that simulates the behavior of an ant colony. In the process of searching for food or returning to the nest, ants release a special chemical, pheromone, on the paths they travel. When choosing the next path to take, the ants will choose the path with higher pheromone concentration with a certain probability. This probability is related to the concentration of pheromone on the path and the heuristic information about the path. The heuristic information is usually defined according to the characteristics of the problem, for example, in the Traveler’s Problem (TSP) problem [
5,
6], the heuristic information can be the reciprocal of the distance between cities; the closer the distance, the higher the value of the heuristic information, and the higher the probability that the ants will choose that path. The principle mainly includes path finding and pheromone updating, and the algorithm includes the following two processes:
The first stage is path finding optimization, let the ant is located in the city
, the probability that it chooses the next city
,
can be expressed by the following equation:
where
is the pheromone concentration on the path
,
is the heuristic information on the path
,
and
are the relative importance factors of the pheromone and the heuristic information respectively, and
is the set of cities that the ants
can choose next.
The second stage is pheromone updating, which is further divided into two parts: global pheromone updating and local pheromone updating. When all ants have com pleted a path search, the pheromone on the path will be updated according to the length of the path they have traveled. The shorter the path is, the better the path is, and the more pheromone is added on it. The global update formula for pheromone is:
where
is the pheromone concentration on the path(i,j) at the moment t,
is the volatilization coefficient of the pheromone,
, which indicates the degree of volatilization of the pheromone over time,
is the incremental amount of pheromone left by the ants on the path, and is the total number of ants.
In the process of constructing a path, ants will locally update the pheromone of an edge every time they pass by that edge, in order to enhance the possibility of that path to be selected by the subsequent ants, and at the same time, to give the ants a certain ability to explore new paths. The local pheromone update formula is:
where δ is the local pheromone update factor and
is the initial pheromone concentration.
Figure 1.
Flowchart of ACO optimization algorithm.
Figure 1.
Flowchart of ACO optimization algorithm.
2.2. Positioning Techniques Based on RSSI Ranging Model
Ranging methods based on Received Signal Strength Indication (RSSI) have been widely studied and applied in the field of indoor localization. In order to estimate the actual distance between the anchor node and the target node, researchers have devel oped a variety of RSSI ranging models, among which the most representative ones include the free space propagation model, the attenuation factor model, and the log arithmic path loss model [
7]. In indoor positioning technology, the logarithmic path loss model is the most commonly used model in RSSI ranging [
8]. This model is based on the characteristic that the intensity of the wireless signal increases exponentially with distance in the propagation process, and this relationship is used to project the physical distance between the mobile node and the signal transmitting node. Specifically, the relationship between wireless signal strength and physical distance can be described by a mathematical function as:
where PL(d) denotes the path loss at the distance between the transceiver nodes at ; denotes the path loss at the distance between the transceiver nodes at PL
; n is the path attenuation factor, which is related to the specific environment.
If
is used to denote the transmit power of the transmitting node and
denotes the received signal strength of the receiving node, the RSSI for the particle
to the beacon
can be expressed as:
In practical applications,
is usually taken as 1 m, and
is the received signal strength at 1m. The combination of Equations (1) and (2) can simplify the ranging model of the particle
to the beacon
as follows:
2.3. HIPACO Algorithm Design
Aiming at the problems that traditional ant colony optimization algorithm tends to fallinto local optimum, slow convergence speed and parameter sensitivity when deal ing with complex optimization problems, this paper constructs a new localization framework with dynamic balance characteristics by improving the path exploration ability of ant colony algorithm and utilizing it for RSSI node localization. The over all process consists of four stages: initialization stage, global exploration stage, local development stage, and feedback adjustment stage. The initialization phase generates the particle swarm and establishes the pheromone matrix; the global exploration phase performs large-scale search by soldier ant particles; the local exploitation phase performs fine search by worker ant particles; and the feedback adjustment phase dynamically updates the pheromone weights.
2.3.1. The Fitness Function (RMSE) and Batch Evaluation
The fitness function is used to represent the localization error to assess the merit of the particle position, which is defined as the Euclidean distance between the estimated position of the particle and the actual distance extrapolated from the RSSI data:
where X =(x,y,z)is the estimated position of the target (particle position), is the position of the i beacon, is the distance between the target and the the i beacon calculated according to RSSI, and m is the number of beacons. Evaluating the fitness concentration can guide the algorithm to balance global exploration and local exploitation, dynamically optimize the search strategy, and improve the convergence speed and accuracy. Batch evaluation of fitness, on the other hand, saves time overhead to a certain extent, and its specific operation can be divided into three matrices: initial position matrix, calculating prediction distance matrix and calculating error matrix.
2.3.2. Initialization Phase
In this stage,n particles are randomly generated, each particle i is randomly distributed in 3D space, and each particle is uniformly initialized with the pheromone value Φ(t) i in the initialization stage. In order to realize the dynamic balance between exploration and exploitation, inspired by biology, the algorithm introduces the concepts of “worker ants” and “soldier ants”, where the ratio of worker ants is set to λ , and the ratio of soldier ants is set to 1 − λ . The worker ants are responsible for local development, searching around the current optimal solution, which can quickly converge to the potential optimal region and improve the local search accuracy; the soldier ants are responsible for global exploration, jumping out of the current optimal region through random perturbation, avoiding the algorithm from converging to the local optimal region too early, and enlarging the search scope. The collaboration between the two significantly improves the localization accuracy and robustness, and can effectively avoid falling into the local optimal solution.
After initializing the population an evaluation of the initial fitness will be performed and the best adapted particle will be noted as the global optimal particle (i.e., the best particle in history) at the location
. Then the main iterative loop will be entered and the parameters will be updated at the beginning of each iteration. In order to balance the development and exploration ability of the algorithm, the proportion of worker ants decreases with the increase of iteration number; the local search radius decays with the square of iteration number, focusing on local optimization in the later stage; the pheromone decay coefficient decreases linearly to accelerate the pheromone volatilization rate of ordinary particles, and
Figure 2 shows the dynamic parameter change curve.
Figure 2.
Trend of dynamic parameters.
Figure 2.
Trend of dynamic parameters.
is the current number of iterations
is the maximum number of iterations.
decreases gradually, allowing for fast exploration of a wide area in the early stage and focusing on the neighborhood of the potential optimal solution in the later stage. This updating method is based on random perturbation, which is based on the position of the global optimal particle and randomly perturbs the position of the particle for exploration. Equation (7) shows the change in the proportion of worker ants:
To avoid numerical problems caused by out-of-bounds, make sure that the particle position is always within the search space. Particle positions are constrained to the set 3D space each time the particle is updated.
2.3.3. HIPACO Algorithm Design
Worker ant particles are mainly focused on local development responsible for fine search,worker ants approach the global optimal solution through pheromone weighted learning mechanism.The first i particle,X is updated at the following position:
where dir denotes random direction of 1or -1. denotes element-by-element multi plication,the higher the pheromone concentration,the higher the learning rate of the particle for the current position.L(t) i For this reason the step size factor of the particle in this step, the lower the adaptation the smaller the step size, to realize the search process from coarse to fine. The calculation formula is
where
obeys a normal distribution with mean 1 and standard deviation 0.2 to control the magnitude of the update,
is base learning factor;
to prevent de-zeroing errors,and
for Pheromone fitness weight .
and
denote the fitness and pheromone concentration of the particle at the current position, respectively. The higher the pheromone concentration, the greater the learning rate of the particle in the corresponding dimension.
2.3.4. Soldier Ant Global Exploration Phase
Soldier ants perform a global search based on Gaussian perturbation and elite guidance with the aim of quickly exploring a wider area, with the following formulation.
Based on the global optimal position of
, the noise factor of
and the random number
obeying the standard normal distribution are introduced for perturbation, and the noise factor
changes dynamically with the iterative process, which is calculated as follows:
where
is Dynamic decay factor . This mechanism enhances the ability of the algorithm to jump out of the local optimum, which is an optimization innovation of the traditional ACO global search capability.
2.3.5. Mechanisms for Updating Pheromone
(Pheromone guidance is performed uniformly by soldier ants and worker ants) The pheromone-guided updating mechanism accelerates the search process by using pheromones to guide the particles. The higher the pheromone concentration, the particles are guided there for searching and accelerate the convergence. After the position update of worker ants and soldier ants, all the particles including soldier ants and worker ants will be evaluated and ranked in terms of fitness, and in this paper, the top 20% will be set as the elite particles, and the pheromone concentration of the elite particles will be enhanced, and the enhancement coefficient will be decreased with the iteration, so as to avoid the late over-exploitation.
where
denotes a random distribution in the interval
. The pheromone of non-elite particles decays exponentially: the position update equation is:
where
is the initial decay rate and
denotes the random distribution in the interval
, the dynamic tuning strategy allows the algorithm to focus on exploration (high decay rate) in the early stage and exploitation (low decay rate) in the later stage. In order to alleviate the search bias in high-dimensional space, the sinusoidal modulation function is uniformly introduced:
This operation periodically adjusts the pheromone concentration in each dimension to ensure a balanced 3D spatial search.
After the pheromone position is updated the new position will be evaluated in batch and for particles with improved fitness the position and fitness will be updated , otherwise the failure counter will be increased.
2.3.6. Algorithmic Flow
In this paper, we propose an ant colony optimization (ACO) as the main framework, which is named as the improved fusion heuristic algorithm (HIPACO) by introducing the pheromone guidance mechanism, dynamic pheromone weighting factor, multi-stage search strategy and adaptive perturbation mechanism for estimation.
Figure 3.
Update according to pheromone position.
Figure 3.
Update according to pheromone position.
Firstly, the parameter configuration and solution space definition are completed by “initialization population”. Subsequently, the algorithm enters the core loop module, which sequentially performs the start of iteration, computation of fitness, and conver gence determination. The convergence decision node constitutes the control center of the process. If the convergence condition is not met, the algorithm sequentially updates the strategy, applies hybrid reproduction (including the crossover and mutation oper ations of the genetic algorithm), and updates the pheromone matrix (based on the ant colony optimization mechanism), which creates a synergistic feedback between the strategy adjustment and the evolution of the population. If the convergence thresh old is reached, the iteration is terminated and the global optimal solution is output. The process design integrates the dual characteristics of evolutionary algorithms and population intelligence algorithms to maintain population diversity through hybrid reproduction, and at the same time combines the positive feedback mechanism of pheromone to accelerate the local search.The flow of the HIPACO algorithm is shown in Figure 4
Figure 4.
Overall flowchart of HIPACO localization algorithm.
Figure 4.
Overall flowchart of HIPACO localization algorithm.