Wireless Sensor Network Target Localization Algorithm Based on Two- and Three-Dimensional Delaunay Partitions

The target localization algorithm is critical in the field of wireless sensor networks (WSNs) and is widely used in many applications. In the conventional localization method, the location distribution of the anchor nodes is fixed and cannot be adjusted dynamically according to the deployment environment. The resulting localization accuracy is not high, and the localization algorithm is not applicable to three-dimensional (3D) conditions. Therefore, a Delaunay-triangulation-based WSN localization method, which can be adapted to two-dimensional (2D) and 3D conditions, was proposed. Based on the location of the target node, we searched for the triangle or tetrahedron surrounding the target node and designed the localization algorithm in stages to accurately calculate the coordinate value of the target. The relationship between the number of target nodes and the number of generated graphs was analysed through numerous experiments, and the proposed 2D localization algorithm was verified by extending it the 3D coordinate system. Experimental results revealed that the proposed algorithm can effectively improve the flexibility of the anchor node layout and target localization accuracy.


Introduction
With the rapid development of wireless communication technology and small embedded devices, WSNs have been used in numerous applications, such as target localization [1], environmental monitoring [2], smart factories [3], and agriculture and field habitat monitoring [4]. In practice, sensor network technology is used to monitor and collect data on specific targets in the area of interest.
The precise location coordinates of the target are critical for target monitors, and the data are analysed in data centres. For example, in sensitive areas involving rescue operations, the precise location of the target is first obtained. Typically, the location coordinates of the monitored target are unknown. Therefore, designing a scheme in which a WSN is used to accurately locate the target and constantly adjust the state when the location of the target moves is critical. Furthermore, the calculation efficiency of the proposed algorithm and the energy consumption of the nodes should be balanced. The accuracy of the positioning and comprehensive performance of the algorithm determines the quality of the localization method. GPS positioning systems can achieve high accuracy, but the systems are not suitable for indoor environments and complex areas. When the location information of the target is determined using WSNs, the trajectory of the target can be estimated and drawn by combining related algorithms. The performance of positioning technology or methods markedly affects the localization accuracy and monitoring quality of WSNs.
Localization schemes are typically classified into distance-based localization schemes and distance-free localization schemes [5]. In distance-based localization scheme, the distance between the unknown node and the anchor node is estimated, whereas in the distance-free localization scheme, the location of the unknown node on the premise of uncertain distance is calculated [6]. Generally, the distance-based localization scheme exhibits a high localization accuracy, but its algorithm complexity is high, which requires computation. The distance-independent location scheme has low localization accuracy and low algorithm complexity. Range-based localization methods have been widely studied. The signal time of arrival (TOA) [7], time difference of arrival (TDOA) [8], angle of arrival (AOA) [9,10], and received signal strength (RSS) are calculated.
The ranging method based on TOA technology is simple, but it requires considerable hardware performance, numerous computations, and high equipment costs. The TDOA method is an improvement of the TOA method and can accurately measure the coordinates of the target. However, this method requires two transmission signals of different rates, which results in a large operating overhead for the network. In addition, the AOA method must calculate the angle between the transmitting and receiving ends and must communicate and transmit in a line-of-sight environment. Therefore, the AOA is not suitable for precise locations in WSNs. The development of low-cost, fast calculation speed, and accurate localization methods is critical in WSN monitoring. Received signal strength indicator-(RSSI-) based localization methods have been widely used and commercialized [11][12][13]. The lost power between the transmitted and received power can thus be converted and calculated using a mathematical model. Furthermore, equipment hardware for WSN node localization using the RSSI method is commercialized and does not require additional separate components. RSSI-based localization technology is suitable for low-cost, high-precision, and large-scale WSNs.
The triangulation method has been studied in detail in fields, such as WSN coverage, routing algorithms, and localization, which optimise the node network layout and construct an optimal triangulation network. Therefore, the aim of this study is to optimise the location distribution of sensor nodes, improve the localization accuracy and performance of the localization algorithm, and extend it to the 3D coordinate system for testing.
(1) To solve the problems of layout optimization and low localization accuracy of anchor nodes occurring in conventional localization methods, the Delaunay triangulation method was introduced, and a localization scheme was designed to estimate the location coordinates of the target (2) Based on the location of the target node, its surrounding triangle or tetrahedron were searched, and the location algorithm was designed in stages to accurately calculate the coordinate value of the target. The relationship between the number of target nodes and the number of generated graphs was analysed through numerous experiments, and the proposed 2D algorithm was verified by extending it to the 3D coordinate system (3) We designed an experimental simulation and algorithm comparison and conducted numerous experiments with various parameters to verify the localization accuracy and reliability of the algorithm The related work is reviewed in Section 2. In Section 3, the RSS channel model is presented, and related problems are described. The strategy we propose is detailed in Sections 4 and 5. In Sections 6 and 7, relevant experimental verification and algorithm comparison are designed. Concluding remarks alongside the future work are given in last section.

Related Works
The deployment method and algorithm design of anchor nodes are a research focus of target localization. In experiment tests performed by many researchers, the coordinate location distribution of anchor nodes generally occurs in the shape of a square, rectangle, and triangle [14][15][16]. Therefore, before experimentation, it is necessary to fix the location of the node in advance. If the location of the anchor node changed, the localization accuracy calculated also changed. Therefore, the fixed deployment mode of the anchor node is not suitable for the environment where nodes are randomly deployed.
Among the localization algorithm distance-based measurement, the most typical algorithms include the trilateral centroid localization, triangular measurement, least square method, and hyperbola localization algorithm. The trilateral centroid localization method has a small number of nodes and a low accuracy of target localization and is not suitable for 3D. The triangular measurement method needs to calculate the angle between the target and node, which undoubtedly increased cost. In [17], the author proposed a new sensor node localization scheme that improved the RSSI algorithm by considering power transmission and reception parameters to estimate the initial location of the node. A genetic algorithm is used to minimize the localization error, and the optimized coordinates are obtained by combining mutation and crossover operators. However, the layout optimization of the nodes is not considered, and the test environment is not suitable for 3D coordinates. In [18], two localization algorithms were designed based on anchor nodes, H-V scanning and diagonal localization algorithms, to estimate the coordinates of sensor nodes in the monitoring area. Among these algorithms, the diagonal localization algorithm belongs to the RSSI-based localization technology which can improve the localization accuracy of unknown nodes. However, the layout of anchor nodes is not sufficiently flexible to adjust dynamically according to the number of nodes, which may lead to nonsystematic errors. This method is suitable for 2D localization conditions but lacks a test of the real dimension. [19] proposed a robust ranging method to track the location of the target and used the trilateral localization method based on RSSI ranging. Consequently, the author reports the result of applying the trilateral localization technology to the measuring point and calculates the distance error between the ideal measuring point and measuring point through computer simulation. However, the computation speed of the trilateral localization method is slow, and the localization error is not accurate. In [20], the authors proposed a non-sitespecific algorithm to better estimate the relationship between the RSS and distance. The author selected the most appropriate RSS value in the original RSS values through an algorithm to reduce the outlier effect, thereby ensuring the consistency between the RSS and distance relationship. In [21], the authors analysed the influence of two types of environmental interference on the RSSI value, used Kalman filter to preprocess the RSSI, and proposed a triangle centroid localization algorithm based on weighted feature points.

2
Journal of Sensors Experiments reveal that higher localization accuracy can be achieved, but its network did not have the characteristics of a self-organizing layout and is not suitable for 3D localization. In [14], to improve the precision of inside localization and optimize the allocation of node resources in WSNs, an equal-arc trilateral localization algorithm based on RSSI is proposed from the perspective of increasing measurement precision and bettering beacon nodes layout. Compared with the square layout, the triangle layout, and the improved triangle layout, the localization accuracy of this algorithm increased by 81%, 54%, and 48%, respectively. Finally, the author revealed that the proposed equal-arc triangulation algorithm can improve the localization accuracy and reasonably control sensor costs. However, in many applications, anchor nodes usually must be self-deployed for layout, and it is not possible to prespecify whether the layout of anchor nodes is square or other shapes. Delaunay triangulation has the optimal partition mode and geometric characteristics and is applied in the research direction of geometric routing, location, coverage, segmentation, data storage, and processing [22]. Li et al. [23] proposed a simple yet effective segmentation-based approach to detect trunk position and Delaunay triangulation (DT) geometry-based localization method for autonomous robots navigating in a forest environment. Experiments show the proposed method reach accurate global localization precision without a good initial pose or GPS signal. The Delaunay division method can optimize the layout of 2D nodes, and applies to the network layout of 3D sensor nodes, based on the location coordinates of the nodes. Delaunay triangle segmentation can improve the flexibility of node layout and strengthen the correlation between anchor nodes. Therefore, we used the Delaunay partition method to optimize the Delaunay network layout for randomly deployed anchor nodes. Consequently, methods are designed to accurately estimate the coordinates of the target in 2D and 3D.

RSSI Ranging Principle and
Problem Description 3.1. RSSI Ranging Principle. WSN localization methods are categorised into two ranging localization and localization without ranging depending on whether to measure the received signal and the transmitted signal is necessary. Localization technologies based on ranging primarily include TOA, TDOA, RSSI, and AOA. However, considering comprehensive indicators such as hardware cost, network computing power, and localization accuracy, the technical method based on RSSI is primarily used, combined with the improved localization algorithm to accurately locate the target. The primary principle of using RSSI ranging technology is used to establish a signal loss or attenuation model in the propagation process to estimate the distance between the transmitter and receiver. As displayed in Figure 1, the red line represents the waveform of the signal intensity varying with the distance under the ideal path loss model, and the blue line represents the waveform of the signal interference in the environment.
The localization algorithm based on the path loss model is used to determine the parameters of the path loss model according to the received RSSI data, and the model is used to estimate the distance value or further processing. We assume that the number of RSSIs received is M, and the RSSI value i received by node k is RSSI ðs, iÞ [24]. Distance estimation was then performed based on the statistical RSSI measurement model.
where d k is the distance between the target and the anchor node k; P k and η k are the RSSI path loss model parameters of the anchor node k; and v ðk,iÞ is a zero-mean Gaussian random distribution variable whose variance is equal to σ k .
The noise in the model obeys a Gaussian distribution, and the generated random variables are processed using the average value. When estimating the distance, the median value of a set of RSSI data is used for estimation RSSI k = RSSI k = MedianfRSSI ðk,iÞ , i = 1,⋯,Mg. The median value processing method was used to eliminate the random error of the original RSSI data, where RSSI k represents the median value of the RSSI data collected by the anchor node k, which can be expressed as follows.
During propagation, the RSSI obeys the Gaussian distribution Nðμ, σ 2 Þ of the mathematical expectation μ and variance σ. The probability density function for any RSSI value is expressed as follows: where the specific expressions of μ and σ are as follows: In the subsequent experimental verification process, after multiple sets of distance values measured by the anchor node, the localization method or algorithm is used to achieve an accurate estimation of the location of the target.

Problem
Description. The method of using RSSI to determine the target distance is the first step in localization. Next, an efficient localization algorithm is designed to estimate the location coordinates of the target node. In the conventional method, a trilateral centroid localization algorithm with 3 Journal of Sensors low power consumption and fast measurement speed is used to solve the coordinates of the target. As displayed in Figure 2, the location coordinate of the node Tðx t , y t , z t Þ to be tested is considered T, and the coordinates of the three anchor nodes, A, B, and C are Aðx 1 , y 1 , z 1 Þ, Bðx 2 , y 2 , z 2 Þ, and Cðx 3 , y 3 , z 3 Þ, respectively. Thus, the principle of trilateral measurement is that the distances between the three anchor nodes of A, B, and C to the target T are r a , r b , and r c . Consequently, the circles formed by their respective measured radii intersect at a point T, and then, the location coordinates of the point T can be determined by establishing a system of equations.
However, in the test, the radii of points r a , r b , and r c are r a , r b , and r c , respectively, and their three circles cannot intersect at one point. As displayed in Figures 3 and 4, when the circles formed using the radii did not intersect at one point, Bulusu et al. [25] assumed aðx a1 , y a1 , z z1 Þ, bðx b1 , y b1 , z b1 Þ, and cðx c1 , y c1 , z c1 Þ as the intersection points formed by them. Next, determine the centre of mass of the three coordinates as the target coordinates. Thus, the approximate target coordinate value T can be obtained by calculation, and However, the accuracy of the unknown target coordinates estimated by the trilateral centroid localization algorithm is not high, particularly when a certain height difference exists between the transmitter and receiver. In the calculation process for trilateral centroid localization, constraints should be considered, which is not conducive to large-scale network operations.

WSN Target Localization Algorithm Based on 2D Delaunay
4.1. Building a 2D Delaunay Network. In the Delaunay method, the region is divided according to the location of the node and a triangular network with an optimal layout is generated. According to the properties of Voronoi [26] and Delaunay [27], only the neighbouring nodes corresponding to the adjacent edges of Voronoi generate the corresponding triangle network, and the vertices of the triangle are composed of the nodes in the Voronoi unit body and its neighbouring nodes. In a nutshell, the vertices of each triangle in the Delaunay triangle network are composed of the three nearest nodes, and each side of the triangle will not intersect. Therefore, the construction of Delaunay triangulation will markedly reduce the localization time of anchor nodes and improve localization accuracy. As shown in Figure 5, 70 anchor nodes s i were randomly located on the plane L with an area of S L , and the red dots represent the anchor nodes. Next, we used the Delaunay method to divide the area according to the 70 node coordinates s i ðx i , y i , z i Þ. In Figure 6, the area divided by Delaunay is a triangular network composed of triangles N Δ with various shapes. After the calculations are completed, in area L, the number of triangles N Δ depends on the location coordinate s i ðx i , y i , z i Þ of the node and the number of nodes n. Thus, the greater the number of nodes is, the more triangles N Δ are generated.
Initially, the number of randomly deployed nodes in area L = 200 × 200 was n (n = 100), and the number of triangles in the Delaunay triangulation obtained from the test was N Δ = 184. The number of triangles was proportional to n, as listed in Table 1, which revealed the number of triangles generated by the Delaunay method when n has different values. Table 1 indicates that as the number of nodes increases, the number of triangles generated increases accordingly. Second, the total area S 0 of the formed Delaunay graph also changed with the number of nodes and location coordinates. Consequently, as the number of nodes n  Journal of Sensors increased, the total area S 0 of Delaunay also increased, and its area ratio S 0 /S L gradually approached 100%.

Determining the Target Surrounded by Triangles.
First, the coordinates of the nodes were divided using the Delaunay method, and the inner coordinates of each triangle were determined. The distance between the target and vertices of the triangle was calculated to determine the triangle surrounded by the target. The coordinates of the target are unknown; thus, the judgement method is the core step of positioning. In Figure 7, five black dots represent five nodes with unknown coordinates. The coordinates of these five targets are: (127,135), (150,150), (145,170), (90,170), and (42,130). In a test, the coordinates of an unknown target cannot be determined in advance. Therefore, determining the triangle surrounded by the target is difficult. To address this problem, the area ratio method was used. Figures 8 and 9, display a partial diagram of a certain part of the Delaunay triangulation. The coordinates of triangles and △ABC and △BCD are known and are Aðx 1 , y 1 Þ, B ðx 2 , y 2 Þ, Cðx 3 , y 3 Þ, and Dðx 4 , y 4 Þ, respectively. Because the coordinates of the target T are unknown, the distances between the four points A, B, C, D, and T can be measured by Equation (2) as d AT , d BT , d CT , and d DT , respectively. Therefore, determining whether T is in △ABC or inside the triangle △BCD is the key in this method.
If point T is inside the triangle △ABC, then the area of the small triangle formed by T and △ABC satisfies the following conditions: The area of S ΔABC can be calculated using Equation (8), and the area of the small triangle S ΔABT , S ΔACT , S ΔBCT can be calculated using Helen formula as follows: where d 1 , d 2 , and d 3 are the distances between the vertices of targets T and ΔABC. Thus, the target T can be estimated to be specifically located in a certain triangle in the Delaunay triangulation, and a corresponding localization method can be designed to calculate the coordinates of target T. Next, the subsequent localization method is implemented in stages in a real situation.

WSN Localization Algorithm Based on 2D Delaunay
Partition. After this analysis, a target localization algorithm based on 2D Delaunay partitioning (2D-DPTL) was proposed, which is categorised into two stages to accurately locate the target. Stage 1. When the number of anchor nodes is large, method 1 is used for localization. Method 1. First, the number of known nodes n is randomly deployed in a plane with an area of L size. Then, the corresponding Delaunay triangulation is generated according to the position coordinates of the known node s i ðx i , y i Þ (i = 1, 2, ⋯, n). Thus, in the first step, the judgement method described in the previous section is used to determine a triangle surrounded by T. Next, we calculated and generated the inner coordinates s j ðx j , y j Þ corresponding to each Delaunay triangle. The coordinates of the inner point of the triangle can be calculated using the following expression:   Journal of Sensors where a i , b i , and c i are the side lengths of the triangle and ðx i , y i Þ, ðx i+1 , y i+1 Þ, and ðx i+2 , y i+2 Þ represent the vertices of the triangle corresponding to the inner centre. As displayed in Figure 10, the blue five-pointed star represents the inner point of each triangle in the Delaunay triangle network, and its number is equal to the number N Δ of triangles. The coordinates of each inner point are numbered, and the figure reveals that 126 inner points exist in total. Based on this method, the triangle surrounded by the target and its corresponding inner coordinates were determined. The red triangles in Figure 11 indicate the respective areas corresponding to the five target points. Next, the area ratio S k = S j /S m of the triangle to which the target T f ðx f , y f Þ belongs is calculated. We assume that the area of all triangles is S j , j = 1, 2, ⋯, N Δ , and the median S m = ðS j+1 , j = 1, 2, ⋯, N Δ Þ/2 or S m = ðS ðj+1Þ/2 + S ðjÞ/2+1 , j = 1, 2, ⋯, N Δ Þ/2 area of the triangle is obtained. If S j ≤ S m , then the inner coordinate G j ðx j , y j Þ of the triangle is considered to be the estimated coordinate of the target T f ðx f , y f Þ (i.e., T f ðx f , y f Þ = s j ðx j , y j Þ). If S j > S m , the centre of the triangle is used as the estimated value of T. However, this results in a large error. Thus, method 2 in stage 2 was used.
Stage 2. When the number of anchor nodes is small, method 2 is used for localization.
Method 2. When the number of anchor nodes is small, the number of triangles divided by Delaunay is small. Consequently, the area S j , j = 1, 2, ⋯, N Δ of the triangle where the target is located is too large, and the accuracy of using the inner coordinates in method 1 as target's estimated coordinates is too low. Therefore, in the first step, the method in phase 1 is used to determine the area ratio. Next, the calculated inner point G j connects the vertex coordinates of the triangles A, B, and C to which it belongs and divides it into three small triangles, as illustrated in Figure 12, which are composed of green lines. We subsequently calculated the inner coordinates G 1 ðx 4 , y 4 Þ of the small triangle where the target is located. As displayed in Figure 13, the three points A, B, and C represent a triangle formed in the Delaunay triangulation network, Gðx 0 , y 0 Þ represents its inner centre, and G 1 ðx 4 , y 4 Þ represents the inner coordinate of the small triangle △BCG. Thus, the coordinates of G 1 ðx 4 , y 4 Þ can be selected as the estimated coordinates of the target point T (i.e., G 1 ðx 4 , y 4 Þ = T f ðx f , y f Þ), when the area ratio of the area ðS l , l = 1, 2, ⋯, N L Þ of the small triangle △BCG to the area of S is S l /S ≤ 1. For example, the area ΔBCG of a triangle S Δ can be calculated using Equation (8), and S Δ is a positive value (usually the absolute value jS Δ j).
If the ratio of the area ðS l , l = 1, 2, ⋯, N L Þ of the small triangle △BCG where the target is located into the area of S m satisfies the condition S l /S m > 1, the least squares method is used for calculation. We assumed that T is inside △BCG and used Equation (2) to measure the distance between each vertex of the small triangle △BCG and T f ðx f , y f Þ; thus, The coordinates of the three vertices of △BCG are Gðx 0 , y 0 Þ, Bðx 3 , y 3 Þ, and Cðx 2 , y 2 Þ. Therefore, the following equations can be established: Then, by subtracting d 3 from d 1 and d 2 in Equation (9), the following equation can be obtained: Equation ((11) can be expressed as a linear equation [28].
Among them, Thus, the coordinate of T can be solved by the following expression: However, the distance d 1 = d T 1 G from the target T to the inner heart Gðx 0 , y 0 Þ could not be accurately determined. The distance d G 1 G is approximately estimated as the distance of d 1 , . In general, methods 1 and 2 can be used in combination in a real localization process. The proposed 2D Delaunay target localization method can locate the target quickly according to the number of nodes.

WSN Target Localization Algorithm Based on 3D Delaunay
The proposed 2D WSN localization algorithm of the Delaunay division were extended to 3D. 3D localization algorithms are suitable for practical applications. The trilateral localization method can be used to determine the approximate coordinates of the target but cannot be used to measure the height of the z-axis. Therefore, referring to the localization method in Section 5.3, the 3D localization algorithm was designed according to various stages.

Three-Dimensional Space Divided by Delaunay.
According to the content in Section 4, the Delaunay method is used to divide the coordinate points in the 2D plane, and the Delaunay figure obtained is a network composed of many triangles. When the Delaunay method is used to divide n the node 3D coordinates, the resulting graph is a 3D network composed of NðN > nÞ tetrahedrons. As displayed in Figure 14, 100 anchor nodes are randomly deployed in a space of 200 m 3 , and the blue solid dots represent nodes with known coordinates. Next, the location coordinates of these   Journal of Sensors 100 nodes are divided using the Delaunay method, and the 12 edge lengths of cube 200 m 3 were set as constrained edges. As displayed in Figure 15, the black 3D graphic network was composed of many tetrahedrons with different volumes. Comparing the graphs divided by the 2D Delaunay and 2D Delaunay methods reveals that the 2D Delaunay diagram is consisting of a triangular network composed of multiple small triangles, and the 3D Delaunay diagram is a 3D network consisting of multiple tetrahedrons. When the coordinate value of the node is fixed, the generated Delaunay network is unique.
The analysis revealed that the density of the triangular network or the 3D network after Delaunay is primarily determined by the number of nodes. Therefore, the data in Table 2 are used to verify the relationship between the 3D area size L, the number of nodes n, and the number of tetrahedrons N formed under the given conditions of the node coordinates. Table 2 denotes that the greater the number of nodes is, the greater the number of tetrahedrons is. Thus, the total volume V of the formed Delaunay graph increases with an increased number of nodes. The number of inner points primarily depends on the number of nodes, and the size of the constraint space has limited effect on it. Many experiments have revealed that the size of V is primarily determined by the number of nodes and the location of nodes. Furthermore, the ratio of the total volume V of the tetrahedron formed by Delaunay to the volume V 0 of the deployment area increases as the number of nodes increases. However, the growth of the volume percentage V/V 0 was not considerably accelerated, and the volume ratio is low and between 50% and 70%. In Section 6, the distance between nodes is set through experiments to increase the volume ratio and optimise the location distribution of anchor nodes.

Determining Tetrahedron the Target Is
In. The basic properties of Delaunay do not change with the increase in dimensionality, but the problems faced by the 3D localization method differ from those of 2D localization. When the coordinates of the nodes are divided using the Delaunay method, the inner centre of each tetrahedron should be calculated. Currently, estimating the location of the target T in the Delaunay tetrahedral network is the core step of 3D localization. The principle of the judgement strategy is similar to that of the 2D localization method in Section 4, but the method and algorithm to be calculated differ. Assuming that the vertices of each tetrahedron in the divided Delaunay   Journal of Sensors are composed of known anchor nodes, using Equations (1)-(3), the RSSI values of the three transmission points with the strongest signal strength and the four closest distances d 4≤k≤6 between the known and unknown nodes can be calculated. Although the coordinates of the target are unknown, judging that T is located inside a certain tetrahedron is the first step in proposing a 3D WSN target localization algorithm.
As displayed in Figures 16 and 17, the tetrahedron A − BCD represents a certain tetrahedron in the Delaunay 3D network, and E − BCD represents the adjacent tetrahedron. Among these technologies, the coordinates of points A, B, C, D, and E are known and represent known nodes. The coordinate position of the unknown target T is uncertain, but the distance from the vertices A, B, C, D, and E of the tetrahedron can be measured by Equation (2) To calculate the volume A − BCD of the tetrahedron, the corresponding coordinate values are substituted into the Euler tetrahedron Formula (14).
where x i , y i , and z i are the known vertex coordinates of tetrahedron A − BCD or E − BCD. The coordinates of the target T cannot be directly calculated, but the distance between each vertex of the tetrahedron can be estimated using the RSSI ranging model, which is set as d 1 , d 2 , d 3 , d 4 , and d 5 . Therefore, tetrahedron's edge length formula can be used to calculate the volume, and Equation (15) can be used to calculate the volume V l of the small tetrahedrons V ABCT , V ACDT , V ABDT , and V BCDT . Among these values, V l is a positive value. Therefore, the corresponding tetrahedral volume can be calculated using Equations (14) and (15) as follows: using the aforementioned method, we determined the tetrahedron in the Delaunay network target is inside.

3D WSN Target Localization Algorithm Based on 3D
Delaunay. A novel WSN target localization algorithm based on 3D Delaunay was proposed. According to the relationship between the number of nodes and the number of tetrahedrons after the Delaunay division, the algorithm was designed in two stages. In the first stage, the number of nodes and area range were determined. The number of tetrahedrons generated by the 3D Delaunay method was approximately three times greater than the number formed by the 2D Delaunay method. Therefore, the 3D Delaunay method was more suitable for target localization with many nodes. In the second stage, the number of nodes is small, and the analysis and design are performed with reference to the 2D Delaunay localization method. Method 1. First, we calculated the inner coordinates Iðx i , y i , z i Þ of each tetrahedron. In Figure 18, the red dots represent the inner points of each tetrahedron, the number of which is equal to the number of tetrahedrons. According to the method in Section 5.2, we find the tetrahedron surrounded by the target T and use Equation (16) to calculate the inner coordinates Iðx i , y i , z i Þ of the tetrahedron.
Assume that the vertex coordinates of the tetrahedron are ðx 1 , y 1 , z 1 Þ, ðx 2 , y 2 , z 2 Þ, ðx 3 , y 3 , z 3 Þ, and ðx 4 , y 4 , z 4 Þ. Here, S i ði = 1, 2, 3, 4Þ represents the side area of the tetrahedron, and the inner point Iðx i , y i , z i Þ of the tetrahedron can be calculated using Equation (16). In the experiment, three unknown target coordinates are given. Next, the tetrahedron where the target is located is determined by using the method described in Section 5.2. As displayed in Figure 19, the three black tetrahedrons each contain three targets.
To avoid selecting the inner points of some tetrahedrons that are too large, the coordinates of the target are assumed to be inaccurate. Therefore, the volume ratio of the tetrahedron was determined to solve the afore-mentioned problem. The volume of all tetrahedrons is V j (j = 1, 2, ⋯, N p ), where N p is the number of tetrahedrons. Next, the volume median V m = ððV j+1 Þ/2, j = 1, 3,⋯,N p Þ or V m = ðS ðj+1Þ/2 + S ðjÞ/2 Þ/2, j = 2, 4, ⋯, N p Þ of the divided tetrahedron was calculated. Assuming that the volume of the tetrahedron in which the target T is located satisfies V j ≤ V m , the tetrahedral centre coordinate G j ðx j , y j Þ can be replaced with the coordinate of the target T, that is, F f ðx f , y f Þ = I j ðx j , y j Þ. Assuming that V j > V m , the method in phase 2 is used. Stage 2. When fewer known node coordinates exist, and the formed tetrahedron volume satisfies the condition  A (x 1 , y 1 , z 1 ) A (x 1 , y 1 , z 1 ) Comparing the graphs formed by the 2D and 3D Delaunay methods revealed that the 2D Delaunay graph is a triangular network composed of multiple small triangles, while the 3D Delaunay graph is a 3D network composed of multiple tetrahedrons. When changing L, the number of tetrahedrons primarily depends on the number of nodes n. The relationship between the number of nodes divided by the 2D and 3D Delaunay methods and the number of corresponding graphics were analysed. With the same number of nodes, the number of triangles generated by the Delaunay method is considerably smaller than the number of tetrahedrons. Thus, the number of graphs generated by the Delaunay method is linearly related to the number of nodes. As displayed in Figure 22, we set the size of the 2D area to L = 200 m 2 and the 3D area to L = 200 m 3 . Next, we set the number of different nodes nð20 ≤ n ≤ 200Þ, obtain the number of triangles N Δ and the number of tetrahedrons N, and draw a scatter plot of the two. Figure 22 reveals that the number of triangles or tetrahedrons formed after the Delaunay division appears to have a linear relationship with the number of nodes n. To verify this result, linear regression analysis was performed using Excel software.
Assume that the linear equations of two of them can be expressed as follows: ð Þ, When using Excel software to analyse its linear regression characteristics, select the confidence area as 95% and the constant as 0, and generate the corresponding predictive regression and residual plots. Next, the Delaunay linear regression equation and regression characteristics of 2D and 3D data were calculated, and the linear regression equation fitting diagram shown in Figure 23 was obtained. Figure 23 displays the linear regression equation y 1 = 1:887x. Among these results, the coefficient of determination R 2 = 1 of the equation y 1 indicates that the data fit is excellent and close to 1. The value obtained by the regression analysis satisfies the condition F value = P value < 0:01, which indicates that the regression effect of the linear equation is significant. Similarly, to analyse the data obtained by the 3D Delaunay division, the equation is y 2 = 5:4132x. Furthermore, all the indicators satisfy the linear regression. Therefore, the number of triangles or tetrahedrons obtained after Delaunay division is positively linearly related to the number of nodes.
Finally, residual analysis was used for the 2D and 3D data, as displayed in the residual diagrams in Figures 24  and 25. In the figures, the two sets of data are evenly distributed on both sides of the symmetry axis x = 0, which demonstrates that the variables are linearly distributed. Finally, through afore-mentioned analysis, the number of triangles   Tables 1 and 2 were tested. First, the first row of 2D data in Table 1 reveals that when the number of nodes is small, the calculated area accounts for a low percentage. This result likely occurs because the distribution of a small number of randomly generated anchor nodes is uneven, and the distance between nodes is too close, which results in a low proportion of the area or volume of the Delaunay network. After these analyses, when the number of anchor nodes is small, initial constraints were added to the distance between the nodes generated randomly to increase the proportion of the area divided by the Delaunay method; the minimum constraint distance k is set. The distance dðs i , s j Þ ≤ k between each node Delaunay is constrained to make it evenly distributed, where k is a fixed value that can be obtained through multiple experiments.
In experiment 2, we set the phase parameters as L = 200 × 200, n = 30, and k = 25 for verification. As listed in Table 3, the experiment randomly generated 10 sets of 2D

15
Journal of Sensors data and calculated the total proportion S 0 /S L of each group of Delaunay generated areas S o and total areas S L . By comparing the data in Table 3 with the data in the first row of Table 1, setting the constraint distance value k between anchor nodes can increase the area ratio of the anchor nodes. By setting k, the utilization rate of the anchor node can be improved, and the area of the divided area can be increased. Second, the calculated average of the total area ratio of the 10 sets of data in Table 4 is 83.62%, which is an average increase of 10.18% compared with 73.44% in Table 1.
Similarly, Table 4 lists the test results of the Delaunay method, which randomly generates 3D data to verify the influence of the distance k between the constraint nodes on the Delaunay volume. First, we set the relevant parameters L = 200 × 200 × 200, n = 70, and k = 45 for the experiments. In the experiment, the 3D volume data V formed by the anchor nodes divided by Delaunay and 10 sets of data for the total volume of V 0 /V L were obtained (as listed in Table 4).
The calculated average volume ratio of Table 4 is 80.17%, which is an average increase of 19.26% compared with the 60.91% data value in Table 2 under the same conditions. Therefore, the verification and analysis of the above two sets of data reveal that when the data were initially randomly generated; adding the constraint value k of the distance between anchor nodes could increase the Delaunay generation area or volume. Consequently, the area and volume ratio of Delaunay's divided areas increased, rendering the layout of the anchor nodes reasonable.

Comparison Analysis
In this section, the proposed 2D-DPTL algorithm was compared with the centroid, amorphous, and APIT algorithms [29]. The degree of irregularity (DOI) represents the degree of irregularity of the signal and generally is a value in the range of [0,1]. DOI is defined as the distance change of the largest wireless signal per unit degree change in the signal propagation direction [29]. When the DOI value is zero, this indicates that the signal model is an ideal circular signal model. In this experiment, the node was deployed in an area L with a range of 200 × 200, and the communication range of the node was set to R c = 20 m. Through experimental tests, we set the relevant parameters of the RSSI path loss model as follows: noise standard deviation σ k = 4, path loss value η k = 2:5, and P k = −24. Next, the neighbour density (ND), anchor percentage deployment method (random deployment or uniform deployment), and other parameters were selected to verify the accuracy of the algorithm.    First, we analysed the effect of the change in the number of anchor nodes on the ALE and compared the performance of the proposed algorithm with other algorithms. Next, the parameters DOI = 0 and ND = 8 were set, and two sets of experiments were designed with various node deployment methods. As displayed in Figure 26, when nodes were deployed uniformly, the ALE of the five algorithms decreased as the percentage of anchor nodes increased. However, the ALE values of the various algorithms differed considerably. The centroid algorithm (CA) exhibited the highest ALE and did not consider the optimization of the anchor node layout, and the calculation method is not rigorous. The proposed 2D-DPTL algorithm exhibited a lower ALE value than other algorithms because the distance  17 Journal of Sensors judgement condition between nodes was added to optimize the node layout. Consequently, the proposed algorithm divided the target area twice to improve the localization accuracy and reduce the ALE of the algorithm.
Comparing Figures 26 and 27 reveals that the deployment methods differed considerably, and under the same values of other indicators, the ALE value of randomly deployed nodes was greater than that of uniformly deployed nodes. This result likely occurred because the uniform deployment of anchor nodes rendered the layout of nodes reasonable and increased the accuracy of target localization. Consequently, the ALE of the proposed algorithm was higher than that of other algorithms because the Delaunay method could optimally divide node's location according to its location coordinates from an optimal triangle network, and the location of the target was estimated, which improved location accuracy. Second, the proposed algorithm performed a secondary calculation on the problem of target's excessive localization range and reduced the ALE value of the overall network.   The effect of the change in the neighbour node density of each algorithm on its ALE was verified. With AP = 28 and uniform deployment of nodes, we set DOI = 0 and DOI = 0:1 to conduct two sets of experiments, as displayed in Figures 28 and 29, which reveal that the CA exhibited the highest ALE because this algorithm estimated the centre of mass coordinates as the target localisation and failed to reduce the localisation error. The proposed algorithm used a phased calculation method to reduce ALE.
In Figure 28, the ALE values of the amorphous and APIT algorithms decreased as the density of neighbouring nodes increased, whereas the ALEs of the CA and the proposed algorithm were not affected by a change in neighbouring node density. These results were attributed to the absence of the interaction between the target node and neighbouring nodes. Figures 28 and 29 reveal that the improvement in signal irregularity reduces the average localisation accuracy of the algorithm. Consequently, these experiments reveal that the localisation accuracy of the proposed algorithm was superior to that of the other algorithms and can be maintained within a certain range.

Conclusions
The Delaunay division method can optimize the layout of 2D nodes and can be applied to the network layout of 3D sensor nodes based on the location coordinates of the nodes. Delaunay triangle division can improve the flexibility of the node layout and strengthen the correlation between the anchor nodes. Therefore, the Delaunay partition method was used to optimize the Delaunay network layout of randomly deployed anchor nodes. Two localization algorithms were designed to accurately estimate the position of the target in 2D and 3D coordinate systems. The proposed algorithm has limitations in the network life cycle and delay and must be verified in a real-world scenario. The results of this study provide a critical important direction for future research.

Data Availability
The data used to support the findings of this study are available from the corresponding author upon request.