Mathematical Problems in Engineering

Mathematical Problems in Engineering / 2021 / Article
Special Issue

Theory and Methods of Wireless Cooperative Localization in Complex Scenarios

View this Special Issue

Research Article | Open Access

Volume 2021 |Article ID 6639574 | https://doi.org/10.1155/2021/6639574

Yuzhan Wu, Susheng Ding, Yuanhao Ding, Meng Li, "UWB Base Station Cluster Localization for Unmanned Ground Vehicle Guidance", Mathematical Problems in Engineering, vol. 2021, Article ID 6639574, 23 pages, 2021. https://doi.org/10.1155/2021/6639574

UWB Base Station Cluster Localization for Unmanned Ground Vehicle Guidance

Academic Editor: Ding Wang
Received30 Dec 2020
Revised07 Apr 2021
Accepted10 Apr 2021
Published23 Apr 2021

Abstract

In this paper, we seek to provide unmanned ground vehicles with positioning service using ultrawideband (UWB) technology, a high-accuracy positioning approach. UWB is chosen for two distinct reasons. First, it does not rely on global navigation satellite systems like GPS, making it able to be applied indoors or in an environment where GPS signal is unstable. Second, it is immune to interference from other signals and accurate enough to guide unmanned ground vehicles moving precisely in a complex environment within a narrow road. In this paper, three UWB base stations are aggregated as a group in a 2D space for localization. A large number of tests are performed with a UWB base station cluster in order to validate its positioning performance. Based on the experiment results, we further develop a dynamic particle swarm optimization-based algorithm and a genetic algorithm to deploy multiple clusters of UWB base stations to cover an area of interest. The performance of the proposed algorithms has been tested through a series of simulations. Finally, experiments using unmanned ground vehicles are carried out to validate the localization performance. The results confirm that the robots can follow complex paths accurately with the proposed UWB-based positioning system.

1. Introduction

Accurate positioning is essential for robot control while challenging to achieve, especially in an unstructured environment. Many applications, such as multirobot formation control and robot path planning, strongly rely on positioning accuracy either indoors or outdoors. Depending on the environment, positioning technologies can be roughly classified into outdoor localization, such as GPS, and indoor positionings, among which we can find Bluetooth, WiFi, Zigbee, and UWB technologies. As UWB-based localization can achieve higher accuracy positioning compared with other techniques, it is chosen in this paper to guide unmanned ground vehicles (UGVs).

UWB has been a particularly attractive localization technology, especially for indoor positioning. Normally, UWB base stations, also known as beacons or anchor nodes, are scattered in the area of interest. Then, a UWB tag or agent needs to communicate with several base stations to obtain its position [1, 2]. One advantage of this scheme is an area of interest can be covered with fewer base stations, reducing the cost. Its drawback is that it is challenging to achieve time synchronization among anchor nodes. Thus, complex communication protocols need to be designed to eliminate clock offset among anchors, and multiple communication packages are required between tags and anchors for distance measurements or for localization. As a result, this strategy works well for fewer tags but is unable to provide real-time positioning for a tag swarm. Besides, it is also hard to obtain accurate positions of anchors during deployment or installation when it has a long distance between two anchors, which can introduce positioning errors for the entire system.

In response to these problems, we apply UWB beacon clusters for localization. To be specific, a group of base stations can be regarded as an independent positioning device, which is able to provide highly accurate position information for tags within its coverage range. This is very useful for swarm robotic control with the leader-follower structure [35] because one cluster can be equipped on the leader robot, providing highly accurate positioning information for its followers. Since the beacons in one cluster are near each other, the installation accuracy can be guaranteed. Furthermore, it is feasible to share the same clock source among beacons in the same group, achieving clock synchronization. In this way, it is promising to realize accurate positioning with less communication, so that more tags can be supported simultaneously.

In order to demonstrate our idea, a relatively simple situation is first considered in this paper, where three base stations are combined as a group to provide 2D petitioning for tags. Plenty of experiments are carried out to test the performance of the UWB cluster to determine the proper distances among anchor nodes. Three anchors are installed as equilateral triangles with different side lengths. In order to guarantee the system performance and improve efficiency, we develop a test platform that can adjust the side length continuously and an app used to record the positions of tags automatically. Based on the experiment results, an optimal distance between a pair of base stations and the range a beacon group can cover are obtained. Secondly, two strategies are explored to deploy UWB clusters to cover an area of interest. The main challenges for these strategies are the irregularity of UWB cluster coverage, the randomness of the shape of the area of interest, and uncertainty in the number of UWB clusters. Thus, we develop two algorithms to determine the best solution to deploy beacon clusters, namely, a dynamic particle swarm optimization- (DPSO-) based method and a genetic algorithm- (GA-) based method. Finally, the experiments of UGVs are performed based on UWB positioning to validate the performance of the localization system. The results show that UGVs can follow multiple complex paths. The maximum error is within 30 cm, and the average error is around 6.7 cm. Furthermore, one beacon group can simultaneously support multiple UGVs.

The main contributions of this paper are as follows:(i)An idea is proposed to combine several UWB base stations as one positioning cluster, which can potentially support more tags simultaneously, laying the ground for future application in swarm robotics(ii)Experiments are carried out to test the positioning performance of a UWB group, concluding the tendency of positioning accuracy with the coverage range and the change of distances between base stations, which can be used as reference guidelines for the future application of UWB clusters(iii)Two algorithms are proposed to deploy UWB clusters to cover an area of interest, addressing the issues of the irregularity of UWB cluster coverage, the randomness of the shape of the area of interest, and uncertainty in the number of UWB clusters

The remaining of the paper is organized as follows. In Section 2, current works related to positioning for robots are presented. In Section 3, the developed test platform is introduced and the experiment results are provided. In Section 4, two proposed algorithms for deploying a set of UWB groups into a random area of interest are explained. In Section 5, we introduce the design of a UGV prototype and experiment results of UGVs following different trajectories under the positioning of a UWB cluster. Finally, in Section 6, concluding remarks are provided.

Positioning plays an essential role in robot control. Various positioning methods have been proposed so far, with different features and suitable applications. The most widely used positioning technique for robots in an outdoor environment is GPS [6, 7]. It is low in cost and applicable to various seniors. Two main drawbacks constrain its further applications, i.e., its dependency on satellites and its low accuracy, with positioning error reaching meters. These two drawbacks encourage the study and application of other positioning techniques on robots.

Positioning techniques that do not rely on satellites include inertial positioning [810], point cloud-based positioning [1113], and a large family of positioning techniques generally called indoor positioning techniques [1416].

Inertial positioning has a long history, and lots of great achievements have been made so far in this field. This approach estimates positions according to acceleration and is widely used in many applications such as underwater positioning since it does not rely on any external information. However, the integral of acceleration introduces cumulative errors and finally affects the estimation accuracy. So far, various hybrid positioning methods have been proposed by combining inertial positioning with other methods, such as GPS [17, 18], acoustic ranging [19], and Doppler speedometer [20].

The point cloud-based positioning includes a family of methods using kinds of sensors to detect environments around and represent sensing data as a point cloud. From the point cloud, the environment around a robot can be reconstructed. By comparing the environment with a digital map, the robot can recognize its position. Point clouds can be generated using various sensors suitable for different environments. Laser radar [11] can reach an accuracy of millimeters but is expensive. Although millimeter-wave radar costs less, it correspondingly provides few data points in space [12]. An infrared (IR) array can be equipped around a robot to provide a set of range information [21]. The provided data points are so rare that they can only be used for positioning in a structured environment. Ultrasonic sensors are used in a similar way as an IR array. Due to the low cost, they are equipped with various robots, for example, the AmigoBot [22]. From the perspective that positioning is achieved via comparing a reconstructed digital environment with a preinput map, vision-based localization can also be regarded as a special point cloud-based positioning, treating pixels as data points in the cloud. It is a rapidly developed field and various schemes have been proposed, such as positioning by recognizing landmarks [2325] or detecting motion by comparing successive images [26]. Novel algorithms are mainly based on deep learning, enabling robots to construct a 3D map with only one camera [13]. However, vision-based positioning heavily relies on a preconstructed map, making it hard to fit for dynamic environments. Furthermore, it is prone to be deceived by similar scenes.

Indoor positioning includes a family of positioning technologies suitable for GPS-denied areas, which include WiFi, Bluetooth, FRID, magnetic field, and UWB. Usually, these methods rely on beacons or base stations. For example, the WiFi-based positioning requires to predeploy a set of APs in the environment [27], and the magnetic field-based positioning method requires to preembed magnetic nails on the floor [28, 29]. At present, WiFi-based and Bluetooth-based methods mainly use the attenuation of signals to estimate distance, probably resulting in high positioning errors reaching 10 meters. The positioning accuracy may be enough for guiding customers in malls, but not enough for robot guidance. FRID-based positioning is realized by recognizing a tag when the tag is near to a reader. However, the distance between them needs to be close enough, constraining its application. Magnetic field-based positioning is precise enough to guide robots, making it suitable for automatic parking and automatic storage [30, 31]. However, the deployment of magnetic nails needs to be completed during the construction of the building. UWB-based positioning is achieved by measuring the distances between a base station and a tag using the time of flight, two-way ranging, or time of arrival, etc. The centimeter-level accuracy can be achieved by using UWB technology [3234].

In this paper, we seek for a positioning method suitable for robots moving in a complex area. This requires high positioning accuracy and working with fewer constraints. These requirements leave us limited choices. GPS, WiFi, Bluetooth, and RFID are not suitable due to large positioning errors. Furthermore, GPS is prone to fail indoors. The point cloud-based localization schemes such as IR, laser, and ultrasonic either are expensive or require pregiven maps for localization. Image-based positioning methods suffer from the same problem. As a result, UWB positioning is chosen as the solution considering the balance among performance, environment adaptation, and cost. Besides high positioning accuracy, UWB technology also has the advantages of high transmission rate, low power consumption, and strong anti-interference, making it suitable for guiding robots. In this paper, the positioning is realized based on ranging between base stations and a tag using two-way ranging. For more details about current research of UWB-based positioning, refer to [33] and other related literature studies.

3. Performance of UWB Station Cluster

As mentioned in Section 1, three UWB base stations are combined as one group in 2D space, providing positioning information for tags within the group’s coverage region, i.e., the overlap coverage region of the three base stations. To avoid bias caused by asymmetry, three base stations are initially placed as an equilateral triangle. Besides, we try to make side lengths of a triangle small so that the UWB cluster can be made as one small device. Therefore, the effect of side lengths on the localization accuracy needs to be determined by checking the positioning accuracy of tags in different locations.

3.1. Test Settings

The test platform is shown in Figure 1, which consists of two tracks with an angle of 60°. The sliders can move continuously along guide rails. TT DC motor is installed on each slider, which is reserved for automatic testing in the future. One UWB beacon is installed at the intersection of the extension of two rails, which is defined as the origin (0, 0) in the Cartesian coordinate system of the UWB cluster. The other two UWB beacons are mounted on top of the two sliders.

In order to facilitate the testing process including data recording and data analysis, a Windows app is developed as shown in Figure 2. The app can record UWB tag distances and positions, show tag trajectories, and control the movement of a UGV. It can also be used to update positions of UWB base stations.

3.2. Test Results

In this part, UWB-based ranging and positioning tests are carried out to determine the proper side edges of one UWB cluster. Due to the limitations of the physical environments, the maximum distance between a UWB tag and a base station is around 8 m in a room and around 38 m in a lobby. In order to achieve the best performance, the tests are conducted under line-of-sight propagation conditions. The absolute positions of sampling points are depicted in Figures 3 and 4 , respectively. For each point, more than 50 samples are collected.

The mean distance errors between a UWB tag and base stations are shown in Figures 5 and 6 , respectively. These experiments are carried out in a room and in a lobby in order to determine the ranging performance of UWB. In a room, the mean distance errors are less than 20 centimeters in most cases. Within 40 meters, the maximum mean distance error is less than 40 centimeters. The distance errors grow with the increase of the distance between a station and a tag, indicating by Figures 5 and 6. This implies that the positioning error will be large when a tag is far from the three base stations.

Meanwhile, mean positioning errors are measured in the same environments. The corresponding results are depicted in Figures 7 and 8 , respectively. At present, two side lengths, i.e., 50 cm and 60 cm, are verified. From Figure 7, it can be seen that the performance with two side lengths is similar. Then, more experiments are conducted in a lobby with long distance, whose results are shown in Figure 8. The mean position error increases approximately in proportion to the distance from the origin in a long-term perspective. The mean position errors are no more than 60 centimeters in most cases within a 10-meter distance. Therefore, 50 cm side length is chosen for a UWB cluster and a 10-meter distance is determined as the coverage radius of a UWB base station.

4. Region Coverage with Multiple UWB Clusters

Based on the experiment results in Section 3, both the proper side lengths of the triangle composed of three UWB base stations and the range covered by each UWB cluster can be determined.

In general, for a complex area of interest, one group of UWB base stations is unable to cover the whole area. Then, we need to find the best solutions to deploy base station groups. There are three main challenges:(1)The region covered by all the three base stations are the overlap area of three discs, which is irregular, making it hard to determine if a subarea is covered by the group(2)The area of interest is of random shape with inaccessible region(3)Because of (2), the number of UWB groups necessary to cover the area of interest cannot be determined in advance

To solve this problem, we first approximate the overlap region of the three base stations as a disc, as explained in Section 4.1. Then in Sections 4.2 and 4.3, two algorithms are proposed to deploy UWB base station groups to cover a randomly generated area. Finally, in Section 4.4, the performance of the two algorithms is compared.

4.1. Approximate the Covered Region as a Circle

In this paper, UWB positioning is achieved through ranging between base stations and tags. In 2D space, if one robot wants to determine its position, one option is to obtain distance measurements to at least three base stations that are not in a line. In our case, three base stations are located near to each other, forming a group. To determine positions with the group, a robot needs to be within the coverage range of each of them, i.e., it should be within the overlap region of the coverage range of all the three base stations, as shown in Figure 9. We call this overlap region and obviously it is irregular. To simplify the problem, needs to be approximated into a regular shape, and there are two choices. We can either use an inscribed triangle or a circumcircle to approximate , and the one whose area is closest to that of is the solution. Thus, it is required to calculate the area of , , and . To simplify the expression, in the following, , , and are used to represent the area of the corresponding region.

In our case, three base stations are located at , composing an equilateral triangle. As all the three base stations are identical in hardware configuration, the coverage range is supposed to be the same, which is a disc with a radius of . With the information, can be determined. The three vertices of are also the vertices of , which can be obtained with the following procedure.

Define the vertices as , where and are different, representing the vertex who is a cross point of disks centered by and , and this cross point is within the range of the third disk centered by . Then, we have

With the expressions above, we can determine the three vertices. Furthermore, we can obtain any edge length of by computing the distance between the corresponding two vertices. For example,

As the center of discs is placed as an equilateral triangle, thus the three vertices are equivalent, making also an equivalent triangle, whose edges have

Thus,

For , its center can be obtained with

The radius of can be measured as the distance between and a random vertex , as

So the area of can be obtained as follows:

The overlap region is a bit tricky, as shown in Figure 10. It consists of the inscribed triangle and three arch form areas, represented as , where indicates the center of the circle corresponding to the arch and . Then,

The area of can be obtained withwhere is the corresponding fan centered by and is the triangle with three vertices of , , as shown in Figure 10.

To calculate the area of , it requires its radius and its span angle . is obtained by experiments, and is lacking. To calculate , we first get two vectors starting from the center of the disk and pointing at the other two points as

Sincethen

The area of the fan can be obtained aswhere is an isosceles triangle with two edges being and the base line is the chord of the arch, whose length is

Then the area of the triangle can be calculated with Heron’s formula. Half of the perimeter is given by

Then the area is

With and ,

As the three arch form areas are equivalent, the area of then iswhere could be 1, 2, or 3.

Compared with , is a bit smaller while is a bit larger. Define the rate of approximate error as

The change of approximation error is shown in Figure 11. If the distances among base stations are small, approximate the overlap region as a disc is a better choice. In our case, according to Section 3, three base stations are placed as an equilateral triangle, whose side length is 50 cm. The error rate is 1.9023%. This means the disk can approximate the actual overlap region with a minor error. Then methods to place multiple such disks to cover an area of a random shape can be considered in the following.

4.2. Deployment with Dynamic Particle Swarm Optimization

We intend to place multiple groups of UWB base stations to provide positioning services for robots. In Section 4.1, it is shown that the irregular overlap region of the three base stations can be approximated as a disk reasonably. Then the problem becomes where to place these disks and how many such disks are needed. Therefore, the deployment scheme is a trade-off between coverage rate and cost.

Inspired by [35], a PSO-based algorithm is proposed in this paper that can dynamically adjust the number of UWB clusters. The algorithm is called dynamic PSO, or short as DPSO.

Generally, DPSO consists of two loops. The outer loop adjusts the number of station groups, while the inner loop adjusts the positions of station groups following the idea of PSO. Assume that in the iteration of the outer loop, station groups are used. Then, for its inner loops, the particles are encoded as the following sequence:where and , indicates the position of the station group.

The fitness function is set to maximize the coverage ratewhere is the valid area covered by the station groups and is the area of the valid area in the map. “Valid” refers to only the region accessible for the robots counts. To measure and in an irregular area, we mesh the map into a set of grids and estimate areas by counting the number of grids. A swarm of particles is generated randomly in the init process. Then the particles search in the solution space guided by some historical best solutions randomly, as introduced in [36]. Besides, the particle should not move out of the valid area , so that a filter is designed. According to the idea above, the pseudocode of DPSO is presented in Algorithm 1. Key functions of Algorithm 1 are detailed in Algorithms 2 and 3, respectively. A general flowchart of Algorithm 1 is shown in Figure 12.

Input: valid area , radius of approximate disk
Output: set consists of best particles with different lengths
(1)Set parameters: swarm size , iteration number
(2)Set parameters for PSO:
(3)
(4)Group number range: ,
(5)fordo
(6)
(7)
(8)
(9)
(10)fordo
(11)  fordo
(12)   
(13)   
(14)   
(15)   
(16)  end for
(17)  
(18)end for
(19)
(20)end for

Thus, Algorithm 1 has a complexity of . In Algorithm 1, the inputs are the valid area and the radius of the approximate coverage disk. The output is a set , consisting of best particles with different numbers of base station clusters. The parameters for the algorithm are set in lines 1-2. In line 4, the range of numbers of clusters to be explored is calculated. The floor is the number of groups needed to stuff the area with disks, which is , and the ceil is the number of groups needed to stuff the area with the inscribed square of the disk, which is . The loop in lines 5–20 is the outer loop, which increases the number of groups by one each time, expending the length of the particle. In each iteration, the particle swarm , the velocity set , the historical best solution for each particle , and the best solution for all particles are reset. Then, within the inner loop in lines 10–18, the velocity and position of each particle are updated randomly, affected by and . Then and are updated.

In line 6, we use function to obtain a random particle, as in Algorithm 2. The challenge here is that is of random shape, and there is a high chance that the particle obtained with a general random number generation algorithm will go out of range. To solve this problem, in , we first scatter into a set of grids and then stack the grids up into a sequence. The grids in the sequence are then labeled successively. We generate random numbers within the range of , where is the number of the grids. These random numbers are the indexes of grids chosen as elements in the particle. The complexity of Algorithm 2 is .

Input: the area of interest , particle length
Output: random particle
(1)functionGENERATEPOS
(2) Scatter into grids, stacking as a sequence :
(3)
(4)fordo
(5)  
(6)  
(7)  
(8)end for
(9)  
(10)end function

In line 7, the function GenerateVel() initializes the velocity of a particle with a zero sequence having the same size of the particle.

In line 14, we use function to ensure particles will not move out of , as in Algorithm 3. According to the encoding rule, the particle represents the coordinates of the station groups. If a station group moves out of , we just ignore the update of its position and corresponding velocity this time. Meanwhile, the updates of velocities and positions for other station groups are not affected. Algorithm 3 has a complexity of .

Input: the area , original particle, and velocity and the raw value based on them
Output: updated particle and velocity
(1)functionCONSTRAIN
(2) Number of station groups
(3)fordo
(4)  
(5)  
(6)  
(7)  
(8)  ifthen
(9)   
(10)   
(11)   
(12)   
(13)  else
(14)   
(15)   
(16)   
(17)   
(18)  end if
(19)end for
(20)end function

In lines 9, 15, and 17, the fitness function needs to be calculated to choose the best particle. As is irregular, a meshing scheme is applied to estimate the coverage rate:where is the number of grids covered by at least one of the station groups and is the number of grids in . For each grid, we calculate the distance from its center to all the center of station groups as . If , we treat the grid being covered. In this way, can be obtained.

Running this algorithm, we notice that there is a chance that the best particle with more station groups performs worse than that with fewer station groups, as shown in Figure 13. This is because in line 6 of Algorithm 1, each time the number of station groups is changed, the particle swarm is regenerated randomly. The red dots in Figure 13(a) indicate that, with 48 stations, the coverage rate is higher than that of 49 and 50 station groups. Clearly, the solution in Figure 13(b) performs better, with fewer station groups. There is a chance that the init swarm is rather bad, and we do not iterate enough times in the inner loop to obtain a good solution. It is not easy to check and decide when to increase the iteration number for the program automatically. With DPSO, the tendency is that more station groups will increase coverage rate, but not stable.

To solve this problem without increasing the iteration number, the DPSO algorithm is improved into the Elite DPSO algorithm, which ensures that the more UWB clusters are used, the better solution can be obtained. Elite DPSO is almost the same as DPSO, but line 6 in Algorithm 1 is changed as

This means that each time the group number is increased, particles are randomly regenerated, as is done in DPSO. A special particle called elite particle is also generated with function based on the best particle obtained in the last iteration of the outer loop. It should perform better than . Two kinds of are explored.

One way to generate elite particle is to add a cluster with a random position in to . In the worst case, the newly added cluster overlaps with another cluster in , resulting in . Otherwise, covers more region, ensuring that . This scheme is named as Random Elite DPSO.

Another way to generate elite particle is to add a cluster far from other clusters in , encouraging station groups to move to a relatively empty region. Assume that the newly added cluster is located at and other clusters in are located at . Then, the optimal position can be obtained with

Apparently, is a convex function, so its maximum value is obtained with on the border of the region. All grids at the border of are exhausted to obtain . This method is named Sparse Elite DPSO because it intends to encourage the locations of station groups to be sparse.

The performance of both schemes is compared, showing in Figure 14. From the figures, the Sparse Elite DPSO method performs slightly better than the Random Elite DPSO method. However, considering the computation cost on average, the Random Elite DPSO is a more reasonable choice.

4.3. Deployment with Genetic Algorithm

The DPSO methods proposed in Section 4.2 explore a set of group numbers and provide the best solutions correspondingly. However, they are unable to determine the best group number automatically. A GA-based algorithm is then developed, which can provide the best number of clusters needed to cover a region and the deployment scheme, indicating positions of clusters.

We scatter the area of interest with random shape into grids and use the center of the grids to represent them. Thus, these grids are labeled as . Then in GA, the chromosome is encoded as an element vector with the length of . Each element is either 0 or 1. If the element is 1, then a cluster is deployed at the center of grid . Otherwise, a cluster will not be deployed. This implies that(i)A cluster can only be located at the center of a grid, unable to move continuously(ii)A chromosome always represents a feasible solution because the grid sequence only contains accessible areas

The fitness function is given bywhere indicates the sum of the area only covered by one cluster, is the number of grids whose center is covered only by one cluster, and stands for the total number of grids. The ratio of and is used to estimate the fitness function value. Defining the fitness function in this way encourages clusters to cover more grids, which satisfies the target that the whole area of interest to be covered. Meanwhile, this definition can prevent the algorithm from adding too many clusters to achieve a high coverage rate because the increase of overlap rate results in a decrease of fitness value. In this way, the algorithm can adjust the number of clusters automatically.

Then a swarm of chromosomes is generated. The fitness function is used to evaluate and choose the chromosomes. A cross operator is used to create a new chromosome, and a mutation operator is applied to add randomness to the chromosomes, as the idea introduced in [37]. The algorithm is shown in Algorithm 4. Details of functions in Algorithm 4 are further introduced in Algorithms 59 . A general flowchart of Algorithm 4 is shown in Figure 15.

Input: valid area , radius of approximate disk
Output: positions for station groups:
(1) Set parameters: swarm size , iteration number
(2) Set parameter: mutation rate
(3) Set parameter: swarm creation parameter
(4) Scatter into grids, labeled as
(5) Create swarm:
(6) Initialize the best chromosome:
(7)fordo
(8)  Calculate fitness value:
(9)  Selection operation:
(10)  Cross operation:
(11)  Mutation operation:
(12)  Update the swarm:
(13)  Update the best chromosome:
(14)end for
(15)Decode:
Input:
Output: random chromosome
(1)functionGENERATECHROMOSOME
(2) Generate random numbers obey normal distribution:
(3)fordo
(4)  ifthen
(5)   
(6)  else
(7)   
(8)  end if
(9)end for
(10)end function
Input:
Output: new swarm
(1)functionSELECTION
(2)fordo
(3)  
(4)end for
(5)
(6)fordo
(7)  
(8)  
(9)end for
(10)
(11)fordo
(12)  , where
  With
  Where
(13)  
(14)end for
(15)end function
Input:
Output: new swarm
(1)functionCROSS
(2)fordo
(3)  
(4)  
(5)  
(6)  Exchange elements in after random point, obtain
(7)  
(8)  
(9)end for
(10)end function
Input:
Output: new swarm
(1)functionMUTATION
(2)fordo
(3)  fordo
(4)   ifthen
(5)    
(6)   end if
(7)  end for
(8)end for
(9)end function
Input:
Output: positions for station groups
(1)functionDECODE
(2)
(3)fordo
(4)  ifthen
(5)   
  Where is the center of
(6)  end if
(7)end for
(8)end function

In Algorithm 4, necessary parameters are set in lines 1–3. Then the area is scattered into grids, helping to calculate the fitness function value and enable us to decode the best chromosome. In line 5, the swarm is generated using a function GenerateChromosome(), and the chromosome with the biggest fitness value is chosen as the current best chromosome, which is presented in detail in Algorithm 5. Then the loop enters lines 7–14. In each iteration, the fitness values of chromosomes in the swarm are first calculated. Then go through selection operation as introduced in Algorithm 6, cross operation as introduced in Algorithm 7, and mutation operation as introduced in Algorithm 8. Finally, update the best chromosome by comparing if a better solution is obtained in this iteration. Function Decode() is used to decode the chromosome into cluster positions, which is presented in detail in Algorithm 9. Algorithm 4 has a complexity of .

Function GenerateChromosome() randomly generates a sequence whose length is the same as the number of grids in , with each element corresponding to a grid. The sequence only consists of 0 and 1, with 1 indicating a cluster to be deployed at the center of a grid. To generate such a sequence, i.e., a chromosome for the GA, we first generate random values obeying normal distribution, as line 2 in Algorithm 5. If the value is larger than parameter , it is set as 1, and 0 otherwise, as lines 4–8. Algorithm 5 has a complexity of .

It is obvious that the choice of affects the number of clusters deployed initially and affects the optimization process indirectly. Thus, setting a proper is important. Our suggestion of setting is to followwhere is a probability distribution and is the area covered by one cluster. In this paper, the normal distribution is chosen for . Then,