In this section, the experimental results are outlined and a performance comparison of the proposed algorithms and other artificial intelligence methods are offered. All algorithms are implemented in the MATLAB simulator on a personal computer, and do not require a professional biological laboratory or biological experimental operation. The experimental platform includes AMD Ryzen 3 4300U with Radeon Graphics 2.70 GHz CPU, 8.00 GB RAM, 64-bit Windows 10 operating system, and MATLAB R2018a simulation software. MATLAB R2018a is a popular simulation software and a strong matrix computing platform used to develop algorithms and analyze data on a personal computer. A series of experiments are designed to evaluate the position accuracy and computing performance of the proposed algorithms in static WSNs. Additionally, related artificial intelligence algorithms include Particle Swarm Optimization (PSO) [
4,
35,
36], the Artificial Bee Colony (ABC) [
8,
29], Convolutional Neural Networks (CNN) [
18,
19], Fuzzy Logic (FL) [
22,
34], Ant Colony Optimization (ACO) [
22,
37], the Genetic Algorithm (GA) [
23,
38], and the Artificial Fish Swarm Algorithm (AFSA) [
24].
Three main metrics are compared in the following experiments, including the positioning accuracy, position error per node, and computing time. Some varying parameters are evaluated, including the nodes’ communication range, the total number of sensor nodes, the total number of anchor nodes in random distribution topologies, and the population size of the corresponding algorithm. It is assumed that the optimal solution obtained by solving the coordinates of the unknown node Nj is , and the actual coordinates are . The position accuracy is expressed as the average error per communication range between the coordinates and , which can be used to measure the superiority of an algorithm. The position error is expressed as the deviation between the estimated coordinates and the exact coordinates . The accuracy is calculated using Equation (23), and then the positioning error e is calculated by the difference between the fitness function values of the last two iterations.
For swarm intelligence algorithm, different population size or different parameters will affect the solution accuracy or speed. This paper mainly illustrates the applicability of this algorithm. The population size of 20 is feasible for most AI algorithms and easy to compare. For the sake of fairness, the simulation parameters in the different algorithms are unified as much as possible. Only 20 plant individuals (
m = 20) are used in our algorithm, and the simulation parameters used in the different algorithms remain unchanged in every test. The PSO [
4,
35,
36] sets the population size
m = 20, the location limitation as 0.5, the speed limitation as [−0.5, 0.5], the self-learning factor as c1 = 1.5, and the social learning factor as c2 = 1.5. The ABC [
8,
29] sets the searching capability limit = 100, the population size
m = 20, and the neighbor size NI = 10. The parameters of the CNN [
18,
19] are set as a convolutional neural network with three convolution cores, eight input channels (c
in = 3), and eight output channels (c
out = 3). The learning rate of the offset item is twice that of the weight. The extension edge is set to 0, the weight is initialized to Gaussian, and the value of the constant offset item is always 0. The parameters of FL [
22,
34] are set as
m = 20 classes, five fuzzy linguistic valuables, {NB, NS, Z, PS, PM}, namely {negative big, negative small, zero, positive small, positive big}, and use Mamdani fuzzy reasoning. The parameters of ACO [
22,
37] are set as the pheromone importance = 1.0, the importance of heuristic factors = 5.0, the pheromone volatilization factor = 0.1, and
m = 20 ants. The GA [
23,
38] sets the population size
m = 20, the chromosome length Lind = 20, the crossover probability px = 0.7, and the mutation probability pm = 0.01. AFSA [
24] sets the fish number
m = 20, the maximum number of attempts = 100, the perceptual distance = 1.5, the congestion factor = 0.5, and the fish step = 0.2.
5.1. Algorithm Comparison in Terms of Positioning Accuracy
In this section, simulation experiments are performed to survey the positioning accuracy of the proposed algorithm and other position algorithms in random wireless sensor networks with a communication range
r. The generated WSN topology is in an area of 100 m × 100 m, which includes a number of sensor nodes with some anchor nodes. All sensor nodes are randomly distributed and have the same communication radius.
Figure 4 presents the influence of four indicators on the positioning accuracy in the same network topologies, which is calculated from Equation (23). In this section, several scenarios are considered to discuss the influence of the main parameters, especially the communication range, the total number of sensor nodes, the percentage of anchor nodes, and the population size, on the accuracy of the proposed algorithm and other position algorithms. In this series of scenarios, the topology is based on the random deployment of nodes with an empty area in WSNs.
Figure 4a shows the scenario of the communication range vs. the positioning accuracy (200 sensor nodes, 20% anchor nodes, population size
m = 20). Here, the communication range
r varies from 10 m to 40 m, and the increase affects the positioning accuracy. As we can see from
Figure 4a, the positioning accuracy of all algorithms tends to increase with increasing communication range because there are more connections. Furthermore, it can be noted that the proposed algorithm has higher positioning accuracy, especially when the communication range is 20 m. The proposed method outperforms the other algorithms in terms of positioning accuracy.
Figure 4b provides the scenario of the total number of sensor nodes vs. the positioning accuracy (communication range
r = 20 m, 20% anchor nodes, population size
m = 20). The total number of sensor nodes varies from 100 to 500, and the percentage of anchor nodes and communication range
r are fixed at 20% and 20 m, respectively. As can be seen from
Figure 4b, the positioning accuracy is increasing with the total number of sensor nodes from 100 to 500 because the total number of anchor nodes of the WSN is increasing, and there are more connections between more nodes deployed in the same area. Furthermore, higher positioning accuracy is achieved by the proposed method in approximately
n = 300, but most other algorithms achieve positioning accuracy below 0.75. Therefore, the proposed algorithm shows better positioning accuracy and stability as the number of anchor nodes increases.
Figure 4c shows the scenario of the percentage of anchor nodes vs. the positioning accuracy (communication range
r = 20 m, 200 sensor nodes, population size
m = 20). The percentage of anchor nodes varies from 10% to 40%, but the total number of sensor nodes and the communication range
r are fixed at 200 and 20 m, respectively. In this scenario, it can be seen that both the proposed algorithm and CNN [
18,
19] algorithms achieved a higher positioning accuracy versus the percentage of anchor nodes compared with the other algorithms. Although all algorithms tend to improve with the increasing percentage of anchor nodes, the proposed algorithm outperforms other algorithms with higher positioning accuracy and does not require a high density of anchor nodes.
Figure 4d displays the scenario of the population size vs. positioning accuracy (communication range
r = 20 m, 200 sensor nodes, 20% anchor nodes). The percentage of anchor nodes, the total number of sensor nodes, and the communication range
r are fixed at 20%, 200, and 20 m, respectively. The population size
m ranges from 10 to 50. It can be seen from
Figure 4d that all algorithms achieve smaller growth in positioning accuracy versus the population size as compared with the increasing communication range in
Figure 4a and the increasing percentage of anchor nodes in
Figure 4c. As can be observed, different population sizes can affect the solution’s accuracy or speed of swarm intelligence algorithms. A population size of 20 is not sufficiently large for many AI algorithms; however, it is enough for us to test the feasibility of our APC algorithm. Nevertheless, the proposed algorithm still achieves satisfactory accuracy.
Table 3 shows a comparison of the node positioning data statistics between the proposed algorithms and the other algorithms in terms of the minimum, maximum, and average position error. Therefore, the proposed APC algorithm is suitable for use as an accurate positioning method with high accuracy.
5.2. Algorithm Comparison in Terms of the Iterative Error
In this section, simulation experiments are performed to survey the iterative error of the proposed algorithm and other position algorithms in random wireless sensor networks with a communication range
r. The generated WSN topology is in an area of 100 m × 100 m, which includes a number of sensor nodes with some anchor nodes. All of the sensor nodes are randomly distributed and have the same communication radius.
Figure 5 shows the influence of four indicators on the iterative error in the same network topologies, which is calculated by the error between the last two iterations. Several scenarios are considered in this section to discuss the influence of the main parameters, especially the communication range, the total number of sensor nodes, the percentage of anchor nodes, and the population size, on the error of the proposed algorithm and other position algorithms. In this series of scenarios, the topology is based on the random deployment of nodes with an empty area in WSNs.
Figure 5a shows the scenario of communication range vs. iterative error (200 sensor nodes, 20% anchor nodes, population size
m = 20). Here, the communication range
r varies from 10 m to 40 m, and the increase does not greatly affect the iterative error. As can be seen from
Figure 5a, the iterative errors of all algorithms tend to remain stable as the communication range increases since there is less of an effect on the iterative error. Furthermore, it can be noted that the proposed algorithm has a lower iterative error.
Figure 5b provides the scenario of the total number of sensor nodes vs. the iterative error (communication range
r = 20 m, 20% anchor nodes, population size
m = 20). The total number of sensor nodes varies from 100 to 500, and the percentage of anchor nodes and the communication range
r are fixed at 20% and 20 m, respectively. As can be seen from
Figure 5b, the iterative error decreases as the total number of sensor nodes ranges from 100 to 500 because the total number of anchors increases and the possible connections increase. In comparison with the proposed algorithm, it is observed that the iterative error is below ±0.01%. Therefore, the performance of the proposed algorithm is comparable with those of the other positioning algorithms.
Figure 5c shows the scenario of the percentage of anchor nodes vs. the iterative error (communication range
r = 20 m, 200 sensor nodes, population size
m = 20). The percentage of anchor nodes varies from 10% to 40%, but the total number of sensor nodes and communication range
r are fixed at 200 and 20 m, respectively. In this scenario, the iterative error of all the algorithms tends to decrease with the increase in the percentage of anchor nodes because more anchors may help to position unknown nodes. The proposed algorithm achieved a lower iterative error versus the percentage of anchor nodes as compared with the other algorithms; it also shows better stability with the increasing number of anchor nodes. The APC algorithm does not require a high density of anchor nodes and can be used in low-density anchor networks.
Figure 5d displays the scenario of the population size vs. the iterative error (communication range
r = 20 m, 200 sensor nodes, 20% anchor nodes). The percentage of anchor nodes, the total number of sensor nodes, and communication range
r are fixed at 20%, 200, and 20 m, respectively. The population size
m varies from 10 to 50. It can be seen from
Figure 5d that the iterative error of all the algorithms tends to decrease with the increase in the population size because a larger population size may help to position unknown nodes. The proposed algorithm can achieve a lower iterative error versus the population size as compared with the other algorithms.
Table 4 shows a comparison of the node positioning data statistics between the proposed algorithms and the other algorithms in terms of the minimum, maximum, and average positioning error, respectively. Hence, the proposed APC algorithm is suitable for use as an accurate positioning method with a low iterative error.
5.3. Algorithm Comparison with Regard to Computing Time
In this section, simulation experiments are performed to survey the computing time of the proposed algorithm and other position algorithms in random wireless sensor networks with a communication range
r. The generated WSN topology is in an area of 100 m × 100 m, which includes a number of sensor nodes with some anchor nodes. All sensor nodes are randomly distributed and have the same communication radius.
Figure 6 presents the influence of four indicators on the computing time in the same network topologies on the same personal computer. In this section, several scenarios are considered to discuss the influence of the main parameters, especially the communication range, the total number of sensor nodes, the percentage of anchor nodes, and the population size, on the computing time of the proposed algorithm and other position algorithms. In this series of scenarios, the topology is based on the random deployment of nodes with an empty area in WSNs.
Figure 6a shows the scenario of the communication range vs. computing time (200 sensor nodes, 20% anchor nodes, population size
m = 20). Here, the communication range
r varies from 10 m to 40 m, and the increase affects the computing time. As can be seen from
Figure 6a, the positioning computing time of all the algorithms tends to increase with the increasing communication range because there are more connections and more complex topologies. Furthermore, it can be noted that the proposed algorithm has shorter computing times, but the computing time of CNN [
18,
19] is too costly. At the same positioning accuracy, the proposed method outperforms the CNN [
18,
19] algorithm and other algorithms in terms of computing time.
Figure 6b provides the scenario of the total number of sensor nodes vs. the computing time (communication range
r = 20 m, 20% anchor nodes, population size
m = 20). The total number of sensor nodes varies from 100 to 500, and the percentage of anchor nodes and communication range
r are fixed at 20% and 20 m, respectively. As can be seen from
Figure 6b, the computing time of all algorithms increases with the total number of sensor nodes because of the increasing node density and the presence of more connections between nodes of the WSN in the same area. Furthermore, shorter computing times are achieved by the proposed method; however, among all of the algorithms considered, the CNN [
18,
19] algorithm requires the longest computing times. In comparison, it is observed that the computing time of heuristic algorithms is below 1.5. Therefore, the proposed algorithm outperforms all the other positioning algorithms and shows a better computing time and searching stability with the increasing number of anchor nodes.
Figure 6c shows the scenario of the percentage of anchor nodes vs. the computing time (communication range
r = 20 m, 200 sensor nodes, population size
m = 20). The percentage of anchor nodes varies from 10% to 40%, but the total number of sensor nodes and communication range
r are fixed at 200 and 20 m, respectively. In this scenario, it can be seen that all the algorithms achieved shorter computing times versus the percentage of anchor nodes, but the CNN [
18,
19] algorithm requires longer computing times compared with the other algorithms. The proposed algorithm outperforms the CNN [
18,
19] algorithms, with computing times approximately three times lower.
Figure 6d displays the scenario of the population size vs. the computing time (communication range
r = 20 m, 200 sensor nodes, 20% anchor nodes). The percentage of anchor nodes, the total number of sensor nodes, and the communication range
r are fixed at 20%, 200, and 20 m, respectively. The population size
m varies from 10 to 50. It can be seen from
Figure 6d that both the proposed algorithm and other heuristic algorithms can achieve an increased computing time versus the population size, which means longer convergence times for solving the positioning problem. In contrast, the computing performance of the CNN [
18,
19] algorithm deteriorates sharply with the increase in convolution kernels, and it is difficult even to complete the positioning task on a personal computer.
Table 5 shows a comparison of the data statistics between the proposed algorithm and the other algorithms in terms of the minimum, maximum, and average computing times. Therefore, the proposed APC algorithm is suitable for use as a fast positioning method in large-scale WSNs with shorter computing times.
5.4. Theoretical Performance Analysis and Advantages
This section further explores the underlying reasons behind the experimental results in the previous sections. The theoretical analysis of time and space performance is shown in
Table 6. Related algorithms include the proposed APC algorithm, Particle Swarm Optimization (PSO) [
4,
35,
36], Artificial Bee Colony (ABC) [
8,
29], Convolutional Neural Networks (CNN) [
18,
19], Fuzzy Logic (FL) [
22,
34], Ant Colony Optimization (ACO) [
22,
37], the Genetic Algorithm (GA) [
23,
38], the Artificial Fish Swarm Algorithm (AFSA) [
24], Simulated Annealing (SA) [
25], Grey Wolf Optimization (GWO) [
31], the Firefly Algorithm (FA) [
31], the Sparrow Search Algorithm (SSA)[
42], the Coot Bird Algorithm (CBA) [
43], the Fruit Fly Optimization Algorithm (FOA) [
44], and the Whale Optimization Algorithm (WOA) [
45].
For a fair comparison, it is assumed that all algorithms use the same iteration steps t to solve the positioning problem in WSNs with n nodes. The time performance and space performance of APC are nearly linear and are related to the scale n of WSNs, the population size m of the artificial plant community, and the number t of iterations.
From
Table 6, it can be seen that the time performance and space performance of the APC, ABC [
8,
29], FL [
22,
34], CNN [
18,
19], PSO [
4,
35,
36], ACO [
22,
37], GA [
23,
38], AFSA [
24], GWO [
31], FA [
31], SSA [
42], CBA [
43], FOA [
44], and WOA [
45] are related to the scale
n of the WSNs, the number
t of iterations, and the population size
m of the artificial intelligence swarm. All of these heuristic algorithms are better than CNN [
18,
19] in terms of time performance and space performance, but CNN may achieve better accuracy. The time performance and space performance of the CNN [
18,
19] are related to the scale
n of the WSNs, the population size
m of convolution cores, the number
cin of input channels, and the number
cout of output channels. However, there are no artificial individuals or swarm learning in SA [
25] and its performance depends on the search strategies.
For a WSN with
n nodes and the same iteration steps
t, different iterative algorithms use different artificial individuals with the same number of
m to search for the optimal positioning solutions, such as the artificial plant individuals (APC), particles or birds (PSO [
4,
35,
36]), artificial bees (ABC [
8,
29]), artificial neurons (CNN [
18,
19]), fuzzy classes (FL [
22,
34]), artificial ants (ACO [
22,
37]), chromosomes (GA [
23,
38]), artificial fish (AFSA [
24]), grey wolves (GWO [
31]), fireflies (FA [
31]), sparrows (SSA [
42]), coot birds (CBA [
43]), fruit flies (FOA [
44]), and whales (WOA [
45]). The computing performance of CNN [
18,
19] is strongly related to network structure and is independent of time.
Furthermore, a theoretical comparison of the positioning accuracy between the APC and related algorithms is presented
Table 7. The main comparison factors for positioning accuracy include variable population size, optimal solution preserving, global searching capability, and fitness comparison per iteration.
Compared with traditional artificial intelligence algorithms, APC has some advantages.
First, the variable population size accelerates the convergence performance. Only individuals with high fitness can survive the growing operation, while individuals with low fitness die. During fruiting, the population size recovers, and the individuals with higher fitness can produce more fruits.
Second, the optimal solution in each iterative computation can be well preserved as a parthenogenesis fruit for the next seeding operation. The optimal solution calculated in each iteration has the highest priority in the APC algorithm. In traditional AI algorithms, the optimal solution is randomly changed and can easily be covered by new generations.
Third, seeding and fruiting operations provide good global searching capabilities. In each seeding operation, a small number of new seeds will be generated through random seeding. In the fruiting operation, the individuals will learn from each other, and the individuals with high fitness can produce a greater number of different fruits which can increase the search ability near the feasible solutions.
Forth, fitness comparison per iteration is conducted three times in the APC algorithm, while it is usually only conducted once in other AI algorithms. The seeding, growing, and fruiting operations can compare fitness per iteration to provide good local searching capabilities. In the seeding operation, the fruits with high fitness can survive and be seeded by a probability ps, while the fruits with low fitness die. In the growing operation, the seeds with high fitness can survive with a probability pg, while the seeds with low fitness die. In the fruiting operation, the individuals with high fitness can produce more fruits by a probability of pf.
Fifth, there are few parameters and the operation is simple. Seeding, growing, and fruiting are simple binary logic operations, which require few computing resources and are quick to execute.
Last, the proposed APC algorithm has low costs, low communication overheads, no additional requirements for equipment, low power consumption, and better positioning accuracy. It can obtain accurate positioning solutions without requiring a high density of anchor nodes or extra hardware.
Unlike traditional artificial intelligence algorithms with a fixed population size and only one fitness comparison per iteration, the population size of the APC algorithm is variable and the fitness comparison is implemented three times per iteration. Regarding the theoretical performance comparison, the APC algorithm can easily obtain accurate solutions and can also be applied in as many areas as mainstream artificial intelligence algorithms; moreover, its time performance and space performance are similar to those of other popular algorithms. The universality of seeding, the selectivity of growing, and the diversity of fruiting effectively balance the algorithm’s global search ability and fast convergence ability. The experimental results of APC, along with the reference algorithms, will be analyzed and surveyed in the next section with reference to additional comparisons.