Design of Optimal localization Model for Wireless Sensor Network Nodes Using Improved Krill Herd Algorithm

Nowadays, Wireless Sensor Networks (WSNs) are significantly applied in engineering and scientific research. WSNs consist of a group of distributed space sensors that track the environment's physical conditions and control the collected data at one central location. Examples of these sensors' applications are smart cities, transport, volcano surveillance and environmental activity, earthquake monitoring, medicine, post-disaster response, and military control. Wireless sensor networks have a lot of research issues like access to the media, implementation, time synchronization, network security and localization of the nodes. One of the most critical problems in this network research is the optimum position of the sensors to have access to maximum coverage and increase network life span to decrease maintenance costs, develop and manage the network. One of the main causes of the failure in these networks is running out of sensor battery and replacing them which impose high costs to maintenance and managing of the network. In order to solve the issues related to optimization and localization, researchers have focused on the algorithms like Swarm Intelligence (SI), because they enable us to solve complicated issues of optimization and NP-Hard issues to solve optimization. However, most of these algorithms are specialized for a purpose or a special program, and the majority of the solutions are not compatible with most of the wireless network sensors. The DV-Hop is one of the most popular node algorithms. But the main problem of the DV-Hop is the possibility of error in calculating the assessed distance between the unknown node and the nodes of anchor. Therefore, minimizing this error is the key to improve this algorithm. To reduce the problem of high localization error, two meta-heuristic algorithms have been proposed based on a combination. In this paper, a new optimization method based on a combination of Krill Herd Algorithm (KHA) and Particle Swarm Optimization (PSO) called KHAPSO is suggested to improve DV-Hop. Simulation results in MATLAB 2016 show that the KHAPSO model has a lower mean error compared to the DV-Hop, DV-Hop-KHA and DV-Hop-PSO models. Also, energy consumption in the KHAPSO model is less in comparison to the other models. The KHAPSO model with 400 unknown nodes and 30 anchor nodes was able to reduce energy consumption by about 35% and at the same time 27% reduction in Average Localization Error (ALE) compared to DV-Hop.

3) Localization error and energy consumption in KHAPSO model are less than other methods. 4) Improving the DV-Hop by changing the number of steps to reduce localization error The assessments results display that KHAPSO model has less localization error compared to the DV-Hop, DV-Hop-PSO, and DV-Hop-KHA models and it has a good performance in detecting the position of unknown nodes. The paper is organized as follows: In Section 2, we will review the literature on DV-Hop and previous studies. In Section 3, we will discuss basic concepts such as the Krill Herd Algorithm and Particle Swarm Optimization. In Section 4, we will describe the steps of the KHAPSO model. In Section 5, we explain the evaluation criteria. In Section 6, we will evaluate and compare the results of the KHAPSO model and its comparison with other models, and finally, in Section 7, we will discuss the conclusions and future work.

DV-Hop
The DV-Hop is a distributed model that uses a method similar to classical distance vector routing. In this method, anchor nodes broadcasts flooding a message across the network that includes the location of the anchor nodes and the number of hop size. Each receiving sensor node stores the message with the least number of hop sizes to the node of anchor and ignores the messages with the highest number of hop size. Using DV-Hop, all sensor nodes obtain the shortest distance based on the number of hop size to all anchor nodes. Since the DV-Hop has incorrect precision of positioning, it is mostly used in large applications due to its simplicity, achievability, stability, and fewer hardware equipment. Figure (  There are two types of sensor nodes in the network. Anchor nodes, normal sensor nodes. Anchor nodes are fixed-position nodes whose position is detected by the Global Positioning System (GPS). Normal sensor nodes are in unknown positions and their position is detected by anchor nodes. The DV-Hop consists of three main steps:

First Step (Communication Detection and Distribution):
In this stage, the least number of hop size between anchor nodes and unknown nodes is calculated. Anchor nodes include a message code and a hop count counter to their neighbors, and the initial value of the hop size counter is zero. The sensor that receives the message increases the counter of the number of hop size by one unit and compares it with the value stored in its data table, if the counter of the number of hop size is less than the previous value in the data table, this value is recorded for that node and the number of the saved hop size is updated, otherwise the message will be ignored and a number of steps will be sent to the next nodes by adding a unit to the counter. At the end of this step, all the unknown sensors have a number of hop size to the anchors. Second Step (Estimation of Distance): In the second stage, the number of hop size between anchor nodes is calculated using the number of hop size between each anchor node. In this step, based on the distance of the anchor nodes from each other and the number of hop size between them, the average number of hop size is calculated according to Eq. (1). In the DV-Hop [13], each anchor node calculates the Euclidean distance to the other anchor nodes and estimates the average length using the number of hop size information. In Eq. (1), the parameters x and y are the points of geographic of the anchor nodes and j, and also the parameter h is the number of hop size between the anchor nodes.
Parameters ( , ) and ( , ) are the position of the anchor nodes of and j, N is the number of anchor nodes and ℎ is the number of hop size from the node of anchor to the anchor node j and Trilateration is used to estimate the position of each node. Nodes calculate their guesstimated distance with more than three anchor nodes. Once all the distances have been determined, the nodes use Trilateration to estimate their location. The error in this method declines with increasing the number of nodes of anchor. The distance of each unknown node from all anchor node is calculated based on the number of hop size according to Eq. (2). In each sensor node, a By arranging Eq. (4), the linear equation system Ax = b is defined according to Eq. (5).
The position of the unknown nodes is determined using the least squares method, which is calculated according to Eq. (6). In Eq. (6) is the transposition matrix A and −1 is the reverse of the matrix A. DV-Hop is straightforward to implement and unknown nodes positioning based on nodes anchorage is done, but must be improved DV-Hop positioning accuracy. According to Figure (2) the number of hop size between AB, BC and AC is defined as follows: ℎ = 2, ℎ = 5 and ℎ = 6. In the first step, the shortest number of steps between anchor nodes is identified. The value of ℎ = (30 + 95)/(2 + 6) = 15.62 , ℎ = (30 + 70)/(2 + 5) = 14.28 and ℎ = (70 + 95)/(5 + 6) = 15 . In this example, node U receives the modified value from anchor B, and then estimates its distance from the three anchors. If node U obtains the average interval from node B, the interval between it and the three anchor nodes is equal to = 14.28 × 3 = 42.84, = 14.28 × 2 = 28.56 and = 14.28 × 3 = 42.84.If node U obtains the average interval from node A, the interval between it and the three anchor nodes is = 15.62 × 3 = 46.86, = 15.62 × 2 = 31.24, and = 15.62 × 3 = 46.86. If node U obtains the average distance from node C, the interval between it and the three anchor nodes is = 15 × 3 = 45, = 15 × 2 = 30 and = 15 × 3 = 45, respectively. The guesstimated distance between the U and B is equal to 28.56, and the interval between U of A is equal to 46.86 and the U of C is equal to 45. If the real distance between U and B is 55 and the guesstimated distance is 28.56, localization error for B is 55-28.56 = 26.44. Its accuracy with real interval is approximately equal to 51%. Due to this error, the guesstimated position of the node of unknown is inaccurate.

Previous Works
A hybrid model based on DV-Hop and PSO has been suggested for localization of nodes of sensor [23]. The hybrid model reduces the relationship between unknown nodes and anchor nodes by calculating the number of hop size of all anchor nodes in unknown nodes, which significantly reduces the computational time and energy consumption of nodes. Nodes that have been displaced from their original position are guesstimated. The evaluation was performed in two areas with a size of 100100 m 2 and 5050 m 2 . The number of sensor nodes, number of nodes of anchor and transmission range were 100-350, 10-60 and 25 m, respectively. In this paper, error positioning factors and energy consumed are taken into account. The results demonstrated that the hybrid model has improved by about 67%. A model based on the hybrid of DV-Hop-GA based on random topology, C-Shaped, and W-Shaped topology has been proposed for Positioning [24]. The Positioning process saves computing time and energy consumption. Genetic Algorithm (GA) is used to estimate the interval between unknown nodes and the anchor. The assessment was performed in an environment with a size of 100-100 m 2 , 100 sensor nodes, 15 nodes of anchor and a transmission range of 25m. The results demonstrated that DV-Hop-GA had better performance and less positioning error compared to DV-Hop. The Self-Adaptive Mutation and Crossover operators based Differential Evolution (SA-MCDE) model includes a hybrid of DE and GA based on RSSI method for Positioning [25]. Crossover and mutation operators are used to better explore the solution space. The number of unknown nodes and anchor nodes were 100 and 20, respectively. The assessment results demonstrated that the percentage of Positioning accuracy in the SA-MCDE model was about 40 to 90%. In order to solve the problem of locating unknown nodes, the hybrid DV-Hop-PSO model has been used [26]. The PSO algorithm has fast search speed, high accuracy, good memory and easy use in engineering. In order to speed up convergence in the DV-Hop-PSO model, dynamic learning factors are updated. The results of experiments with 200 unknown nodes and 30 anchor nodes with a communication radius of 15 meters demonstrated that the PSO had a faster convergence speed and higher spatial accuracy than the DV-Hop nonoptimization algorithm. In [27], the PSO-based PSODV-Hop model is proposed for WSNs. The proposed model reduces the connection between nodes; hence it significantly reduces the energy consumption of the nodes. It also increases positioning accuracy without any additional hardware. Various tests have been performed to confirm the usefulness of the PSODV-Hop algorithm in 100-100 m environment with 100 sensor nodes and 10 anchor nodes. The amount of positioning error in PSODV-Hop was less compared to DV-Hop. The IDV-Hop model has been proposed to correct the distance between unknown nodes and nodes of anchor based on the Teaching Learning Based Optimization (TLBO) [28]. The purpose of the TLBO algorithm is to correct the distance in order to reduce energy consumption packet transfers. The convergence rate of the TLBO to obtain the solutions is very low. The assessment results with 100 sensor nodes and 25 anchor nodes indicated that the average localization error in IDV-Hop model was low compared to GADV-Hop and DV-Hop-PSO. Accurate positioning of sensor nodes has a major impact on the performance of WSNs. In [29] a localization method using Butterfly optimization algorithm (BOA) is presented. In order to simulate and validate the DV-Hop-BOA model, different sensor sizes from 25 to 150 nodes have been used for measurement. The performance of the DV-Hop-BOA was compared with those of the PSO and the Firefly Algorithm (FA). The assessment results demonstrated that DV-Hop-BOA had lower error and high accuracy in detecting the location of unknown nodes. A new optimization method based on intelligent water drops (IWD) algorithm and RSSI has been proposed to average the square error of anchor nodes [30]. RSSI is applied to determine the internal distances between sensor nodes. The IWD algorithm is a high-performance global optimization method that helps minimize the objective function without getting caught up in local optimizations. The assessment results with 100 sensor nodes and 20 anchor nodes confirmed that the proposed algorithm could perform better than optimization algorithms such as Ant Colony Optimization, GA and PSO. In order to increase the positioning accuracy of nodes in the three-dimensional space of WSNs, two positioning algorithms based on Bacterial Foraging Optimization (BFO) and Invasive Weed Optimization (IWO) have been proposed [31]. In the hybrid method, RSSI is used to estimate the positioning of unknown nodes. A fuzzy logic system is used to overcome the nonlinear relationship between RSSI and node location. BFO and IWO algorithms have been used to further optimize the lateral weights of anchor nodes to increase the positioning accuracy of the nodes. The simulations performed on 100 sensor nodes and 20 anchor nodes demonstrated higher accuracy of the hybrid model by 10%, stability and optimal performance of the hybrid model. Of course, the disadvantage of this method is its high cost and low speed in convergence.
The FA Positioning algorithm has been proposed due to good convergence to estimate the location information of sensor nodes [32]. FA has less computation time and a distributed positioning algorithm and it requires less spatial information exchange between the sensor nodes and the sink node. Compared to conventional algorithms, FA reduces the energy consumption of nodes. Therefore, FA increases the lifespan and reliability of WSNs. Parameters such as absorption coefficient, initial attractiveness; numbers of initial populations are set correctly for optimal convergence. Simulations with 40 sensor nodes and 8 anchor nodes demonstrated that the mean error had a rapid downward slope. In [33], GA, PSO and SFLA models have been used to improve DV-Hop in the second and third steps. In the second phase of DV-Hop, SFLA was used to correct the error. In addition, the PSO-GA model in the last step of the DV-Hop algorithm is used to minimize the Root Mean Square Error (RMSE) instead of the trilateration method. The simulations were conducted with 100 sensor nodes, 10 anchor nodes and a transmission range of 40 meters. The combined PSO-GA improves the performance of the DV-Hop by being able to minimize errors between the guesstimated and actual points of geographic. Three intelligent algorithms, namely the DE algorithm, the FA algorithm and the hybrid FA-DE model for the positioning problem are presented in [34]. Algorithms are analyzed and compared according to the complexity of time, convergence and accuracy of spatial information. The results with 40 sensor nodes and 10 anchor nodes demonstrated that the hybrid model had less error compared to FA and DE. The accuracy percentage of the hybrid model was 98%.
A new hybrid optimization model based on PSO and Variable Neighborhood Search (VNS) called HPSOVNS has been proposed for positioning [35]. The Mean Squared Error (MSE) and error of all neighboring anchor nodes are used as the objective function in the HPSOVNS model. Internal distances between sensor nodes are calculated using RSSI. HPSOVNS is a hybrid optimization method that has a high performance in finding the best solutions and minimizing the objective function without getting caught up in local optimizations. The hybrid model has increased positioning accuracy because the positive features and effective capabilities of PSO and VNS are combined with RSSI. The assessment results show that HPSOVNS performed better than PSO algorithms, and advanced positioning algorithms such as GEPM, NLLE and RSSI-LSSVR. An improved version of the Modified Shuffled Frog Leaping Algorithm (MSFLA) is proposed for accurate positioning of sensors [36]. MSFLA results are compared with Trilateration, ABC and PSO algorithms. The assessment results show that MSFLA improved the positioning estimate by more than 30% compared to trilateration. The main disadvantage of MSFLA is that it has a high computational cost.

Basic Concepts
In this section, we describe the KHA and the PSO algorithm.

Krill Herd Algorithm
Krill Herd Algorithm (KHA) [21] is a nature-inspired algorithm based on krill life that has been proposed to solve optimization problems. This algorithm was presented by ℎ and in 2012. This algorithm is based on the feeding behavior of krill. The shortest distance of each krill from the food and the gathering center of the other krill is the objective function for the krill movement. In the KHA, the KRILL movement is formulated by three main factors: • Movement induced by other krill individuals • Foraging • Random diffusion When predators such as guinea pigs, penguins or seabirds attack krill, they reduce their density by hunting krill. The formation of a group of krill after the attack depends on many factors. Crowds of krill are formed for the following purposes: to increase the density of krill and to find food. These features have been used in the construction of the KHA.
Attracting krill to crowded places and searching for food causes krill to gather around the optimal global. In this process, krill at the time of looking for food and the highest density are moving towards the best solution. In natural systems, the fit of each krill is an integration of the distance from the food and the maximum density of the krill. In multi-dimensional spaces, the algorithm must be able to search multiple dimensions; Therefore, the Lagrange model is used for the next n decision space. In this algorithm, model according to Eq. (7) is used to search for space (position).
= + + (7) In Eq. (7) is the motion induced by other krill individuals, is the foraging motion, and is the physical scattering of the krill. Each krill will impress others to maintain high density and high speed by movement. Motion induced by other krill individuals: According to theoretical discussions, krill individuals try to move towards the center of group density. To move through the local swarm density (local effect), the destination of the swarm movement (target effect) and the factors that the swarm avoid are approximated. The motion of other krill is defined according to Eq. (8).

= +
In Eq. (8) is the maximum speed and is usually considered to be equal to 0.01 m / s. In Eq. (8) is the direction of movement, which consists of two parameters: The local effect created by the neighbors (movement due to local density determined by the neighbors) and the directional effect (movement due to the density of the destination determined by the best member of the population) determined by the best krill. Neighbor influence can be considered as a ratio of attractiveness to repulsion among other krill individuals for local search. In Eq. (9) NN is the number of neighbors, indicates the suitability or value of the target function of the member of the population. The parameter is the suitability value of ℎ neighbor, which is = 1,2, … , . and represent the position of the and j members of a population.  is a small positive value so that the denominator is not zero. In Eq. (9), and are the values of the best and the worst members of the population. These vectors represent the directions of various neighbors, and each value represents the influence of that neighbor. The neighbor vector can be absorbing or repelling. The rand parameter has a random value between 0 and 1 and is intended to increase exploration. Parameter is the number of iterations and is the maximum number of iterations. There are several methods for selecting a member's neighbors from the population, one of which is to use the closest members as neighbors. To do this, a criterion is needed to measure the proximity of members to each other. Eq. (10) is used as the measurement distance to determine neighbors. the distance is less than two members of the population of the distance measurement, these two are considered together as neighbors. Vector purpose of each krill follows the krill with the best fitness value. Foraging Motion: Foraging motion is expressed with two essential effective parameters. The first is the food situation and the second is the prior experience about the food situation. foraging motion is defined according to Eq. (11).
) + (̂, ×̂, )) + (11) In Eq. (11) is equal to the feed rate (value of feed rate is 0.02), is the inertial weight of the foraging motion in the interval [0,1], is the last foraging motion (previous move). The effect of food depends on its position. At first, the food center must be found and its amount should be approximated. As , position seen by the i member of the population. Physical Diffusion (random movement): The physical diffusion of krill can be considered a random process. This motion is defined as Eq. (12).

= (1 − )
is the maximum scattering velocity and  is the vector of random direction whose values are randomly NV parameter is the total number of variables, UB and LB parameters are the upper limit and the lower limit of the j variable, respectively. The parameter is selected in the range [0,2]. It is clear that the small value of this parameter allows accurate exploration of the search space. To increase the efficiency of the search process, the reproduction operators of the GA have been added to the optimization of the krill group, which include the crossover and mutation operator. The crossover operator is defined by the probability Cr, the control, and m after according to Eq. (16). , parameter is a random number in the range [1,0].

Particle Swarm Optimization
In the PSO algorithm [22], first group members are randomly generated in the problem space, and the search for the optimal solution begins. In the general structure of the search, each individual follows the individual who has the best fit function, while not forgetting his own experience and follows the situation in which he has the best fit function. Therefore, in each iteration of the algorithm, each individual changes their next position according to two values, one is the best position that the individual has ever had ( ) and the other is the best position that has ever been created by the entire population and it is actually the best in the whole population ( ). Conceptually, for each individual in fact is that person's biological memory. is the general knowledge of the population, and when people change their position based on , they are actually trying to bring their level of knowledge to the level of knowledge of the population. Conceptually, the best particle in a group binds all the particles in a group together. The next position for each particle is determined by Eq. (18)  Parameter is the current position and vi is the speed of movement of individuals. W is a control parameter in the range of 0.4 to 0.9, which controls the current velocity ( ) with the effect of the next velocity, creating a balance between the algorithm's ability to search locally and global search. Large values w lead to global search and small values lead to local search. In order to balance local and global search, it is necessary to reduce the weight of inertia uniformly during the implementation of the algorithm. If the value of w decreases, the search is mostly done locally around the optimal answer.

KHAPSO Model
In this section, the steps of the KHAPSO model are described step by step. Unknown nodes are considered members of the krill population. The position of unknown nodes is embedded in each vector. The position vector is defined based on Eq. (20). Each vector row represents the solutions and S demonstrates the number of solutions. The objective function is defined in the proposed model based on error minimization. The matrix X is a vector space of size Sn, such a way that S is the number of solutions and n is the length of each solution. The initialization of the vectors is based on a random population of natural numbers (number of sensor nodes), so that each factor contains two variables x and y corresponding to the coordinates of the nodes of unknown.
(20) Using KHA causes each sensor node to constantly change its position to the optimal position. After determining the optimal position for unknown nodes by KHAPSO model, DV-Hop is used to calculate the position of unknown nodes. The network is based on a 2D area with m nodes of anchor and n sensor nodes. Figure (   are the coordinates of the anchor nodes i and j, respectively, and ́ is the actual distance between the two anchor nodes i and j.

́= √( − ) + ( − )
(21) Also, the distance between two anchor nodes is computed by multiplying the number of hop size and of each anchor node. The parameter is the computed distance between the two anchor nodes i and j, which is computed according to the definition of Eq. (22).
Based on Eq. (21) and Eq. (22), the error between the calculated distance ( ) and the actual distance (́) of the anchor nodes is obtained. Anchor node distance error is used to compute the correction ratio of an anchor sensor node .

= | −́|
(23) Dividing the calculated distance error (err) by the number of steps is used to correct the accuracy of anchor nodes. The distance between anchor node and unknown node t is calculated according to the definition of Eq. (24). The ℎ parameter is the number of hop size between anchor node and unknown node t.
Step (Estimating the Position of the Unknown Node): In the third stage, the position of the sensors is determined using the KHAPSO model. Foraging motion and movement created by other krill have two strategies, local and global. The strategies work in parallel to make the KH algorithm powerful in discovering optimal points. The main step in the KH algorithm is the motion created by the other krill. The solutions are generated based on updating the current status of each solution using three operators: movement induced by other krill individuals, foraging motion, and random physical diffusion. The first operator is used to encourage members to sustain a high density to find the best anchor node (this operator is used to move members to anchor nodes). The second operator is defined for the members' desire for global optimization, and it is considered a global optimization strategy for the KH algorithm (this operator is defined to attract unknown nodes to the best anchor node). The third factor is used to randomly move each member from a high-density area to a low-density area or vice versa. The PSO ensures that the hybrid model does not fall into the local optimal trap and discovers the best points based on and , and assists the KHA in discovering the optimal positions of members and j from the population. A new method is to update the position of krill members in KHA with the aim of accelerating the global convergence rate. In Eq. (25) is the position of the best member of the krill in the total particles of the PSO group and rand is a generator of random numbers that is uniformly generated in the range [0,1] and c is a learning parameter in the range 0 to 2.

Evaluation Criteria
Important factors such as Average Localization Error (ALE) and energy consumption were used for evaluation. The minimum ALE and energy consumption indicate the quality of the KHAPSO model.

Average Localization Error
Positioning error calculates the difference between the actual coordinates and the guesstimated coordinates of unknown nodes [37]. The ALE is calculated according to Eq. (31). Eq. (31) ( ̅ , ̅ ) shows the guesstimated coordinates of unknown nodes and ( , ) shows the actual coordinates of unknown nodes. The parameters R and N are equal to the transmission range and the total number of unknown nodes, respectively.

Energy Consumption in Localization Process
Since WSNs performance and coverage depends heavily on network lifetime, so in terms of energy storage is critical in the design of WSNs. The power supply is limited at the nodes and in practice, it is not possible to replace or recharge it; therefore, the available energy should be used in the best possible way. Energy consumption is a major issue in locating sensor nodes. Energy is mainly used in transmitting the message, receiving the message and the computational process in positioning. Two different types of nodes are deployed in the sensor environment, anchor nodes and unknown nodes that can be informed of their position with the help of anchor nodes. The total energy consumed during the positioning process is calculated by anchor nodes and unknown nodes according to Eq. (33) [38].
= 2 × + (32) = (1 + ) + (1 + ) + 2 × (33) In Eq. (33) ET is the energy consumed in transmission, ER is the energy consumed in reception and is the energy consumed in computational operations. The average energy consumption by the grid is calculated according to Eq. (34). N is the number of unknown nodes and M is the number of anchor nodes.

Evaluation and Results
The evaluation of the proposed model, which is a combination of KHA and PSO, was performed in MATLAB 2016 environment. Table (2) illustrates the value of the parameters for evaluation. The network consists of 100-400 unknown nodes that are randomly distributed in a 100×100 area. The sensor nodes communicate with each other via a wireless radio channel and they transmit information in a multi-way mode.

The Effect of The Number of Unknown Nodes on Localization Error
Figure (6) illustrates that the Average Localization Error decreased with increasing number of unknown nodes since if the number of nodes is more, they are placed on each other's radio range and discover the anchor node. For assessment, 100100 area with 30 anchor nodes and 25m transmission range has been used. Unknown nodes range from 50 to 400. According to Figure (6), it can be concluded that the KHAPSO model has a lower Average Localization Error compared to other models. The DV-Hop model has more errors than other models. Also, DV-Hop-KHA and DV-Hop-PSO models have more errors compared to KHAPSO model.

The Effect of the Number of Unknown Nodes on Energy Consumption
As presented in Figure (9), energy consumption increases as the number of unknown nodes raises. Because with increasing the number of sensor nodes, the computation time also increases and so, the frequency of sending and receiving in the environment increases. For simulation, an area of 100100 square meters with 30 anchor nodes and a transmission range of 25 meters is used. Unknown nodes range from 100 to 400. Energy consumption in the DV-Hop model is higher than other models. The KHAPSO model consumes less energy compared to the DV-Hop-KHA and DV-Hop-PSO models. Because in less time it can find the location of unknown nodes and prevent additional calculations.

Conclusion and Future Research
Recent developments in wireless communications and electromechanical equipment innovations have expanded the use of WSNs. Localization of sensor nodes has become one of the necessities in WSNs applications. In WSNs, some sensor nodes are aware of their position and play important roles in locating other nodes, and the location of these nodes, usually determined by GPS, is known as anchor nodes. Using anchor nodes, the location of unknown nodes can be found. But a precise localization mechanism must be used for the location of unknown nodes. In this paper, a model based on KHA and PSO for sensor node localization is proposed. PSO was used to optimize KHA. KHA solutions were optimized by PSO and KHA exploration power was increased. The results demonstrated based on different criteria that the performance of the KHAPSO model was better compared with other models. The KHAPSO model was evaluated based on the number of different unknown nodes as well as the number of anchor nodes. Evaluations demonstrated that if the number of anchor nodes is more, then the error value is less. Compared to the DV-Hop model, the KHAPSO model was able to reduce energy consumption by about 35% for 400 sensor nodes and 30 anchor nodes. A decrease in average error and at the same time, the 35 percent reduction in energy consumption means an increase in stability and life span of the network which leads to a reduction in maintenance cost and network management. Therefore, with these successful results, we concluded that the KHAPSO model was better than the DV-Hop, DV-Hop-KHA and, DV-Hop-PSO models. Issues such as optimal placement of anchor nodes in the sensor area, finding the best position for the mobile sink, and examining the optimal coverage of anchor nodes due to lack of scalability, incompatibility, and increase of computational cost should be considered as localization problems. To direction future researches, we can use a hybrid of different meta-heuristic algorithms to expressed problems. Meta-heuristic algorithms using two factors of exploration and extraction can learn in search environments and can find the best solution.
conflicts of interest: Jafarsadegh Kamfar, Hessam Zandhessami, and Mahmood Alborzi declare that they have no conflict of interest.