Rotated Black Hole: A New Heuristic Optimization for Reducing Localization Error of WSN in 3D Terrain

Wireless sensor network (WSN) attracts the attention of more and more researchers, and it is applied in more and more environment. The localization information is one of the most important information in WSN. This paper proposed a novel algorithm called the rotated black hole (RBH) algorithm, which introduces a rotated optimal path and greatly improves the global search ability of the original black hole (BH) algorithm. Then, the novel algorithm is applied in reducing the localization error of WSN in 3D terrain. CEC 2013 test suit is used to verify the performance of the novel algorithm, and the simulation results show that the novel algorithm has better search performance than other famous intelligence computing algorithms. The localization simulation experiment results reveal that the novel algorithm also has an excellent performance in solving practical problems. WSN localization 3D terrain intelligence computing rotated the black hole algorithm.


Introduction
Due to the maturity of microelectronics and wireless communication technology, a lot of funds and researchers are attracted by wireless sensor networks (WSNs). These technologies have promoted the development of cheap, ultrasmall, multifunctional, and smart sensor nodes (SNs), which have the ability to communicate with each other through wireless media [1]. Due to size and cost limitations, SN has limited functions and low computing power. Depending on the application, a collection of hundreds or thousands of nodes can be deployed in the area of interest. These nodes can communicate with each other through wireless media and form a network called a WSN.
More and more fields can achieve better performance with the help of WSN, such as target tracking [2], military affairs, disaster management, environmental monitoring, and so forth. In order to better perceive the target in the above scene, the location information of the sensor node is indispensable; otherwise, the information obtained by the sensor node will have a low correlation with the target to be monitored.
In order to obtain the accurate location of the sensor node, a global positioning system (GPS) module needs to be installed to provide accurate location information. However, due to the high cost and high energy consumption, it is impossible to install a GPS module on any sensor node. Without a GPS module, how to know the location of a node has become a problem that plagues researchers. In recent years, many algorithms have been proposed to calculate the positions of all sensor nodes in WSN [3]. According to the different of localization mechanisms, these algorithms can be divided into two categories: range-based localization algorithms and rang-free localization algorithms. In some localization algorithms, such as received signal strength indication (RSSI) [4], the time of arrival (ToA) [5,6], and the angle of arrival (AoA) [7] of the signal, these algorithms use specific physical data to estimate the location of unknown nodes (not equipped with GPS modules), called distance-based positioning algorithm. Although the rangebased positioning algorithm provides more accurate position information than the range-free positioning algorithm, it needs to be equipped with a specific module, which greatly increases the cost and energy consumption. WiFi distance measurement is used to improve accurate of indoor localization [8].
On the other hand, some algorithms only need the connective information of WSN and can estimate the position of unknown nodes. These algorithms are called range-free localization algorithms, such as centroid algorithm [9], distance vector-hop (DV-Hop) algorithm [10,11], and approximate point-in-triangulation test (APIT) algorithm [12].
In [13], anchor nodes are set at the border land of monitoring regions and improve the estimation of per hop distance. The enhanced PSO algorithm is proposed and used to enhance the localization accurate of WSN in [14]. The hop size of each anchor node is replaced by an average hop size of all anchor nodes in [15]. Chen et al. proposed a method which adds a reference anchor node on hop size that calculates formulate to reduce the error of hop size of each anchor node [16]. In [17], the weighted least square algorithm is introduced to reduce the localization error of DV-Hop. In [18], a model is introduced to analysis localization error of mobile Lidar.
The traditional 2D WSN has gradually been unable to meet the needs of the current society, such as smart city [19][20][21][22]. Some algorithms applied to 2D WSN must be extended to 3D WSN to adapt to new social needs. [23] proposes a method to optimize the deployment strategy of WSN in a 3D environment. Pan et al. proposed a new algorithm to optimize the coverage rate of WSN in 3D terrain [24], and a DV-Hop localization method applied in 3D terrain is proposed [25]. In [26], the authors utilize the GA algorithm to improve localization accurate of WSN in 3D terrain.
In order to find the optimal solution of engineering problems quickly and accurately, many optimization algorithms have been established, some of them are inspired by natural phenomena, and [27] has briefly introduced the swarm intelligence algorithm. For example, the most popular evolution-inspired technique is genetic algorithms (GA) [28,29] that simulates the Darwinian evolution. Differential evolution (DE) is an enhanced GA algorithm with better performance than GA [30][31][32]. Other popular algorithms are evolution strategy (ES) [33], probability-based incremental learning (PBIL) [34], genetic programming (GP) [35], Phasmatodea population evolution (PPE) algorithm [36], and biogeography-based optimizer (BBO) [37]. The particle swarm optimization (PSO) algorithm was developed based on the swarm behavior, such as fish and bird schooling in nature [38,39]. Whale optimization algorithm (WOA) [40,41] is a metaheuristic optimization algorithm by mimicking the hunting behavior of humpback whales. Grey wolf optimization (GWO) algorithm can be regarded as an enhanced PSO and achieve better performance [42,43]. The ant colony optimization (ACO) is inspired by social behavior of ants in an ant colony [44]. Bat algorithm (BA) was inspired by the echolocation behavior of bats [45]. Black hole (BH) algorithms are inspired by the black hole phenomenon [46]. The gravitational search algorithm (GSA) was constructed based on the law of gravity and the notion of mass interactions [47]. The novel algorithm called moth search algorithm (MSA) is proposed which combine Levy fly and moth search [48]. In addition, some methods are proposed to improve the search ability of algorithms, [49][50][51] introduce the concept of compact, and significantly reduce the memory usage. The surrogate method utilizes the Kriging model to enhance the algorithm run speed [52][53][54][55][56].
There are three contributions in this paper: Firstly, this study improves the search path of the black hole algorithm to improve the speed of obtaining the optimal solution. Secondly, the novel algorithm proposed in this article gets a better balance between local search ability and global search ability. Thirdly, this paper further enhances the localization accurate of WSN in 3D terrain.
The rest of the paper is organized as follows: in Section 2, the knowledge related to DV-Hop and BH algorithm are briefly introduced. The novel algorithm is shown in Section 3, and Section 4 utilizes the novel algorithm to reduce the localization error of WSN in 3D terrain. CEC 2013 test suit and simulation experiment of sensor nodes deploring are used to test the performance of novel algorithm in Section 5. Conclusion is the content of Section 6. In this localization algorithm, every node is stored in a table with three attributes which are X, Y, Hop. X and Y are the horizontal and vertical coordinates of the node, and Hop is the hop count of the node connect with other sensor nodes. In the first stage after the installation of the WSN, the hop count of all sensor nodes is initial to zero, and each anchor node (the node with the GPS module installed) broadcasts a message packet containing its localization information in the network. If a sensor node receives a message from another sensor node, the hop count between them would increase one. There may be multiple path links between any two nodes; so, the number of hops between them may have different values, but only the minimum number of hops between any two sensor nodes is reserved in DV-Hop. Secondly, the anchor node collects the number of hops and distance information between itself and other connected anchor nodes, thereby calculating the average length per hop of this anchor node. The calculating equation is presented in the following:

Related Work
where the position of ith anchor node is ðx i , y i Þ, and m is the number of all anchor nodes. The hop count between ith anchor node and jth anchor node is represented as Hop i,j , and the average length of per hop of ith anchor node is Hopsize i . Each anchor node broadcasts its own Hopsize to the network by controlling flooding. The distance between 2 Wireless Communications and Mobile Computing unknown node u and anchor node A can be calculated by Eq (2). At the same time, the unknown node u forwards the information to surrounding nodes, and the corresponding hop count is increased by 1.
Then, the location of the unknown node can be estimated by the trilateration localization method, and the localization error can be reduced by the least-squares method [10].

DV-Hop in 3D
Terrain. The wireless signal is transmitted from the transmitter to the receiver through electromagnetic radiation. Different from deploying WSN in a 2D environment, in a 3D environment, electromagnetic signals will be absorbed or blocked by surrounding obstacles. The number of obstacles determines the fading and shadowing of the signal between receiver and transmitter [57]. To detect whether the communication of nodes is blocker by surrounding terrain, a line-of-sight (LOS) algorithm is introduced. In this article, we use the Bresenham LOS algorithm, because it has a faster calculation speed, requires fewer calculation points, and does not require interpolation calculations [58]. The sensor model in WSN is a mathematical formula that characterizes the connectivity of sensors as a function of distance and terrain obstacles. This paper adopts the straightforward binary sensing model to determine whether a node is connected to the WSN. If a sensor node is within the communication radius of another sensor node, no obstacles obstruct the communication signal between them. These two sensor nodes can communicate with each other and vice versa. In order to illustrate the signal propagation in 3D terrain more vividly, Figure 1 shows the details of the LOS algorithm.
In Figure 1, there are 7 nodes on uneven terrain, named a, b, c, d, e, f , and g, which are represented by blue dots. As can be seen from the figure, nodes a and node b are connected by a green dashed line, indicating that they can communicate with each other, and this is because there is no obstacle between node a and node b that hinders signal propagation. Conversely, node b and node c are connected by a red dashed line, and they cannot communicate with each other. As there is a mountain peak between them, the signal propagation is hindered.

Black Hole
Algorithm. The black hole (BH) algorithm is one of the population-based methods which is inspired by the black hole phenomenon. In this method, a population of candidate solutions to a given problem is generated and distributed randomly in the search space.
In the proposed BH algorithm, the evolution of the population is done by moving all the candidates towards the best candidate solution in each iteration as shown in Eq. (2), and the best candidate solution is named black hole. If the population finds a better candidate solution than black hole, this solution would replace the black hole.
where X t i and X t+1 i are the locations of the ith star at iterations t and t + 1, respectively. X t BH is the location of the black hole in the search space at tth iteration. The rand is a random number between 0 and 1, and N is the number of stars (candidate solutions).
Otherwise, the black hole would engulfs the candidate solution which within the radius of its event horizon. This mechanism guarantees that the population will not be trapped in local optimal value. In order to keep the population size, a new individual will be generated randomly in search space of a problem. It is worth noting that a small number of individuals will pass through the event horizon of the black hole, which can improve the exploitation performance of the algorithm. The radius of the event horizon in the BH algorithm is calculated by the following equation: In the above formula, f BH represents the fitness value calculated according to the position of the black hole. The fitness value calculated from the position of the ith individual is denoted by f i . When the distance between an individual and the black hole is less than R, the individual will be swallowed, and the algorithm will randomly generate a new individual to maintain the population size.

Rotated Black Hole
In the original BH algorithm, the individual directly moves forward into the black hole. If the individual finds a better solution in the process, the black hole will be updated. However, in the multimodal problem, it is difficult for the intelligence computing algorithm to find a better solution on the straight path. [40] has introduced a formula which mimic the feeding behavior of whales and gotten great performance.
In order to improve the search ability of the BH algorithm in multimodal problems, the rotated model is introduced in this paper. The position update equation of population in the rotated model is presented in the following:

Rotated Black Hole Algorithm Applied on DV-Hop in 3D Terrain
In this section, the novel algorithm is applied to reduce locate error of unknown nodes in 3D terrain. [59] has proved that the intelligence computing algorithm has a distinct effect on WSN in 2D plane. In this paper, the 2D plane is extended to a 3D terrain as shown in Figure 3. This terrain is generated by the "peak" function of Matlab 2018a, and the connective state between any two nodes can be estimated by the LOS algorithm. The locate error of DV-Hop can be calculated by Eq. (6).

Wireless Communications and Mobile Computing
The position of the ith anchor node is represented by ðx i , y i , z i Þ, and ðx, y, zÞ is the estimation position of unknown node. The dist i means the real distance between ith anchor node and unknown node; so, e is the error between the real position and estimation position of unknown node in WSN. This section applies the novel algorithm to reduce the error, and the fitness function is shown as follows: where the hop count between unknown node and ith anchor node is represented by hop ui . The purpose of this article is to use the new algorithm to weigh trade-off all anchor nodes and find a suitable unknown node location.    Table 1, every data is the average of 48 test results, and the best results are marked by underline and bolt font for each function.

Results and Discussion
The optimal results of intelligence computing algorithms under the CEC 2013 were showed in Table 1, and the best result of each test problem is marked in bold. The search ability of RBH algorithm on 14 benchmark functions is better or equal than other algorithms.
In the unimodal problems, as the excellent local search ability of PSO, other algorithms are far from the PSO algorithm. In the multimodal problems, the new algorithm proposed in this paper has obtained 8 best results. The results show that the new algorithm has a strong global search ability than other comparison algorithms. Out of a total of eight composition problems, the new algorithm performed best in five, and this further verifies the novel algorithm with great global search ability. Through CREST, one conclusion was achieved that the RBH algorithm has good global search capabilities and is good at solving complex optimization problems.
In Figure 4, the details of intelligence computing algorithms to solve some optimal problems are given. Although the new algorithm cannot find a better solution than other algorithms in the early stage, it has a strong global search ability and is easy to avoid the local optimal value and finally find the optimal solution. Contrast other algorithms, the PSO has the fastest convergence rate but it has difficult jumping local optimal value; so, it is surpassed by other algorithms in the last stage. It can be seen that for complex problems, the new algorithm has an advantage due to its excellent global search ability.   Table 2 and Figure 5. The localization error is the average value of localization error of all unknown nodes which is calculated by Eq. (6). From this table, we can see that the intelligence computing algorithm effectively improves the accuracy of the DV-Hop localization algorithm, and the novel algorithm has the strongest performance in all participated compared algorithms. The biggest localization error of the original DV-Hop algorithm appears 250 nodes. Generally speaking, the positioning error is positively related to the number of nodes. The reason for this phenomenon is that each node deployment is independent and random. In the experiment of deploying 250 nodes, the signals of many nodes are blocked by the terrain; so, the experimental results of the original DV-Hop are not ideal. However, in this experimental environment, intelligent computing shows strong optimization capabilities, which greatly reduces the positioning error.  respectively, the number of nodes is 300, and the communication radius of sensor node is set to 20 m. Table 3 and Figure 6 show the simulation results.

Localization
Generally, the positioning error decreases as the number of anchor nodes increases, but when the number of anchor nodes is greater than 35, a special situation occurs in the traditional DV-Hop. Excessive location information causes trouble to the traditional DV-Hop and reduces the accuracy of positioning. DV-Hop combined with intelligent computing algorithm, especially combined with RBH algorithm, can adapt to any conditions, and no matter the number of anchor nodes, the simulation results are equally excellent.

Localization Error of WSN with Different
Communication Radii in 3D Terrain. The communication radius of the sensor node can determine the anchor node that provides location information to how many sensor nodes. So, the value of communication radius of sensor nodes is a important factor for simulation results. We install the communication radius as 14,18,22,26,30,34, and 38 to test the performance of different localization algorithms. There are 300 sensor nodes and 30 anchor nodes in this experiment, and the simulation results are presented in Table 4 and Figure 7.
From this table, we can see the influence of the communication radius on the experimental results. Different from what we originally envisioned, the increase of communication radius would increase the localization error of WSN. And without exception, all localization algorithms show this feature. The novel algorithm gets the best result at each experiment except communication radius is 30.

Conclusion
In this paper, a novel algorithm is proposed, which utilizes a rotated optimal path to greatly improve the optimal ability of the original BH algorithm, especially in multimodal problems and composition problems. The CEC 2013 test suits show that the novel algorithm has outstanding global search ability; so, the novel algorithm can easily avoid local optimal value. In addition, this paper uses a new algorithm to optimize the position of the unknown node based on the DV-Hop positioning method, thereby reducing the error of the position estimation of the unknown node. The experiments in this paper have performed simulation experiments on the number of nodes, the number of anchor nodes, and the communication radius, respectively, and all prove that the new algorithm has a good effect on the localization problem of WSN in 3D terrain.