EHPSO: An Enhanced Hybrid Particle Swarm Optimization Algorithm for Internet of Things

— Internet of Things (IOT) has found broad applications and has drawn more and more attention from researchers. At the same time, IOT also presents many challenges, one of which is node localization, i.e. how to determine the geographical position of each sensor node. Algorithms have been proposed to solve the problem. A popular algorithm is Particle Swarm Optimization (PSO) because it is simple to implement and needs relatively less computation. However, PSO is easily trapped into local optima and gives premature re-sults. In order to improve the PSO algorithm, this paper proposes the EHPSO algorithm based on Novel Particle Swarm Optimization (NPSO) and Hybrid Particle Swarm Optimization (HPSO). The EHPSO algorithm applies the principle of best neighbor of each particle to the HPSO algorithm. Simulation re-sults indicate that EHPSO outperforms HPSO and NPSO in evaluating accurate node positions and improves convergence by avoiding being trapped into local optima.

consisting of two phases is introduced in [1]. A novel localization method (NLM) utilizing the relative received signal strength of neighboring nodes to build the fingerprint database was set forth in [2]. A matrix completion algorithm using a nonlinear conjugate gradient method was proposed in [3]. Centralized localization algorithms are suggested in [4,5]. Coordinate system stitching based distributed algorithms were depicted in [6]. Hybrid localization algorithms were discussed in [7]. An error propagation aware localization algorithm was described in [8]. A modified particle swarm optimization algorithm based on gravitational field interactions was proposed in [9]. A neural network approach was implemented in [10]. Algorithms based on PSO or variants were proposed in [11][12][13]. Combining the advantages of PSO and genetic algorithm (GA), an improved FPSO + FGA hybrid method was provided in [14]. An algorithm using information of the second global best and second personal best particles to improve the search performance of the original PSO was proposed in [15]. A new hybridized version of Particle Swarm Optimization algorithm with variable neighborhood search was proposed to solve the constrained shortest path problem in [16]. The MGBPSO-GSA algorithm (combination of Mean Gbest Particle Swarm Optimization and Gravitational Search Algorithm was developed in [17].
In this paper, the Enhanced Hybrid Particle Swarm Optimization Algorithm for optimal node locations in Internet of Things is proposed. The proposed EHPSO algorithm can determine accurate node positions and improve convergence by avoiding being trapped into local optima.
The remainder of the paper is organized as follows. Section 2 provides a general description of IoT node localization using standard PSO. An improved approach and its mathematical model are explained in Section 3. Section 3 also provides the pseudo code for the implementation of the improved approach. Simulations are carried out to compare the proposed approach of this paper with other algorithms in Section 4. Conclusion is drawn in Section 5.

The Standard Particle Swarm Optimization
The Particle Swarm Algorithm, an evolutionary intelligence algorithm, was first proposed by Kennedy and Eberhart in 1995 . Comparing to other algorithms, it has many advantages. For instance, it is not easy to indulge in local optimum but is easy to implement, has high robustness and low requirement for computer hardware.

3
IoT Node Localization Based on NPSO

Problem Statement
The principals accomplishing IoT node localization utilize the a priori information of anchor nodes to determine the approximate or accurate coordinates of the target nodes. Assume that the coordinate of !"# anchor is !! ! ! ! ! !; the coordinate of the target node to be determined is !!! !!, then the distance ! ! between the ith anchor node and target node can be calculated as Therefore, the coordinates of the target nodes can be calculated as follows: The aforementioned equations hardly give a unique answer. PSO is introduced to solve the problem. Suppose that ! ! is the value of ! ! , the fitness function of PSO can be described as follows: where ! is the number of total anchor targets.

HPSO
In order to avoid being trapped in a local optimum, HPSO algorithm is suggested. During the process of hybrid, some particles are selected as parent particles in the swarm at fixed proportion in advance. Child particles as many as parent particles in volume are obtained after being charged and muted. If children's fitness function value is lower than parent's, child particles will replace parent particles and then a new swarm is achieved. The whole process can be expressed as the following equations: where !"#$% ! !" ! !"#$%!! !! ! are the child's position and velocity ly.!!"#$%& ! !" ! !"#$%&!! !! ! are the parent's position and velocity respectively.
Whereas if children's fitness function value is larger than parent's, that is to say, ! ! !"#$% ! !!! !"#!!" !, HPSO is no longer an efficient approach to solve the local optimum in that circumstance. The following method is provided to solve the problem.

Position Estimation Using PSO
In the standard PSO, the particle may be trapped into a local optimum solution and not easy for the particle to escape from it because it is only guided by its historical best solution and the global best solution. To solve this problem, an IoT-related HPSO is put forth based on NPSO proposed in [13].
According to the above discussion, the best positions of each particle and the best positions of whole swarms are critical for the particle's movement in the search space. Especially, in some certain circumstance, the best neighbor or the neighbor's neighbor may provide much better information.
Definition: the neighbors of the ith particle are identified by the mean Euclidean Metric between the ith particle and the rest of the particles. Assume that ! !" ! ! ! !! ! ! ! !! ! !! ! ! ! is the Euclidean Metric between the ith particle and the jth particle, then mdi can be calculated as follows, Thus, if !" ! ! !, we can define the jth particle as the neighbor particle. After the best neighbor ! !" !"#$ has been chosen, the following formulas are utilized to guide the If !" ! ! !!or the particle is trapped into a local optimum solution, we will redefine the neighbor as follows,

Pseudo-Code
Based on the aforementioned descriptions, the pseudo-code of the EHPSO algorithm are provided as follows: (1) Initialization: A series of parameters should be initialized in advance, including a population of M particles with random position ! ! within the transmission range, the maximum iteration, random best position of the i!th particle !! !"#$% and the best position of the whole swarm ! !"#$ !!!.

Simulation Results and Discussion
The IoT system with 15 target nodes and 5 anchor nodes is randomly deployed in a 20m!20m open area where the communication between nodes will not be disturbed by some other factors. The dimension of the EHPSO is fixed to be 50. When the precision of the fitness function attains 10-6 or the maximum iteration number approaches 100, the simulation will be terminated. According to [18], the cognitive parameters c1=c2 and inertia constant ! are set to be 1.494 and 0.6 respectively. MatlabTM 13.0 is utilized to analyze the performance of EHPSO comparing to other algorithms. Simulation platform which carries out the simulation is a laptop with Intel Core I7, 16G memory and Windows 7.

Localization Error
The aim to improve localization algorithms is to lower the localization error, which is one of the most important criterion to localization algorithm. By altering the loss index n, the amount of swarm N and the iteration number, some experiments are carried out to test the advantages of EHPSO over other localization algorithms.
As shown in Figure 1, with the value of pass loss index ! increasing, the localization error will vary correspondingly. In the rank of PSO, QJ-CMPSO and NPSO, the localization error value of PSO is the largest and EHPSO's is lower than QJ-CMPSO's at the same pass loss index.
In Figure 2, it dedicates the relationship between swarm amount and localization error when the parameters are fixed as n=2.5 and N varying from 10 to 60. Comparing the three approaches, the localization error is shrinking with the development of swarm amount approximately. At the same swarm amount, the value of EHPSO's localization error is the lowest and the value of PSO is the highest.  http://www.i-joe.org

Algorithm Convergence
The fitness function can be viewed as the localization absolute error of sensor nodes in an IoT system, whose convergence value can be used to assess the localization accuracy and algorithm convergence.
From Figure 5, it can be deduced that all the three algorithms PSO, QJ-CMPSO and EHPSO have convergence attribute, however EHPSO's convergent velocity is fastest among the three algorithms, QJ-CMPSO is the second fast.  Figure 4 shows the process of approaching global extrema during iterating. The estimated node positions approach the real positions gradually and the estimated errors become smaller with the iteration times increasing. Figure 5 shows what is achieved after an one-time localization of 20 unknown nodes, where the parameters are set as n=2.5,N=40,Tmax=100. After 10 iterations, 16 active nodes are observed and the average error is 6.47%.

Conclusion
Based on RSSI, after defining the best neighbor, the EHPSO algorithm has been proposed to determine the localization of nodes of an IoT system quickly. The pseudo-code of the EHPSO algorithm is provided and simulations have been carried out. The analysis of the simulation results leads us to the conclusion that EHPSO is a good alternative because it is simpler to implement than the PSO algorithm or the QJ-CMPSO algorithm. The EHPSO algorithm also outperforms the standard PSO algorithm and the QJ-CMPSO algorithm in many aspects.