A Hybrid Method for Mobile Agent Moving Trajectory Scheduling using ACO and PSO in WSNs

Wireless Sensor Networks (WSNs) are usually troubled with constrained energy and complicated network topology which can be mitigated by introducing a mobile agent node. Due to the numerous nodes present especially in large scale networks, it is time-consuming for the collector to traverse all nodes, and significant latency exists within the network. Therefore, the moving path of the collector should be well scheduled to achieve a shorter length for efficient data gathering. Much attention has been paid to mobile agent moving trajectory panning, but the result has limitations in terms of energy consumption and network latency. In this paper, we adopt a hybrid method called HM-ACOPSO which combines ant colony optimization (ACO) and particle swarm optimization (PSO) to schedule an efficient moving path for the mobile agent. In HM-ACOPSO, the sensor field is divided into clusters, and the mobile agent traverses the cluster heads (CHs) in a sequence ordered by ACO. The anchor node of each CHs is selected in the range of communication by the mobile agent using PSO based on the traverse sequence. The communication range adjusts dynamically, and the anchor nodes merge in a duplicated covering area for further performance improvement. Numerous simulation results prove that the presented method outperforms some similar works in terms of energy consumption and data gathering efficiency.


Introduction
The rapid development of tiny electronic sensors has accelerated the widespread use of wireless sensor networks (WSNs) [1][2][3]. WSNs are usually composed of numerous sensors deployed randomly to detect a target area for some physical features such as temperature, humidity, and gas concentration, and it has been widely applied in smart home [4,5], smart health [6], environment detecting [7], and certain intelligent systems technologies [8][9][10][11]. These sensors are battery-powered and are self-organized in order to construct wireless sensor networks. Traditional WSNs usually adopt static sinks, and that may cause hot spot problems, which makes nodes close to the sink experience premature death due to the heavy burden of data forwarding. The hot spot problems can be mitigated using special clustering and well-designed topology controls, but they cannot solve the issue fundamentally. Recent research on sink mobility technology provides a series of novel ideas to address the problem of hot spots and has achieved great results [12][13][14][15][16][17][18][19][20][21][22][23][24][25][26][27][28][29].
One of the problems demanding prompt solution for sink mobility is the trajectory scheduling of the mobile agent. An efficient traveling path of the mobile agent can reduce the energy consumption and mitigate network latency as well. However, the path scheduling problem has been proven to be a non-deterministic polynomial hard problem (NP-hard) [12,13]. Therefore, it is difficult to acquire the optimal solution to the problem, and many researchers regard it as traveling salesman problem (TSP) [14]. Some intelligent heuristic methods such as ant colony optimization (ACO) [30], particle swarm optimization (PSO) [31], and glowworm swarm optimization (GSO) [32] are introduced for mobile agent path planning and they achieve some results. Many algorithms aim to search for a shorter path for the mobile agent and this inevitably increases the energy consumption during transmission. Therefore, it is hard to make a trade-off between different properties, and the routing protocol designing should be combined with specific applications. Another great achievement is the technology of MU-MIMO, which permits multiple receivers and senders to communicate at the same time by equipping multiple antennas [33][34][35][36]. A mobile agent with MU-MIMO can gather data more efficiently when it accesses more than one target.
The main contribution of this work can be concluded as follows. Firstly, we partition the target area into subdomains using virtual grids, and the cluster heads (CHs) are elected according to their weights. Secondly, the ACO algorithm is executed by the sink node to calculate an optimal sequence of CHs for traversing. Thirdly, the PSO algorithm is executed to select anchor nodes for mobile agents based on the traverse sequence obtained by the ACO algorithm. Fourthly, the communication range of the CHs are adjusted, and some anchor nodes can be merged to balance inter-cluster energy and to economize the sojourn time of the mobile agent. Finally, numerous simulations prove that the presented algorithm HM-ACOPSO plans a more efficient traveling path for the mobile sink as compared to some similar works. Section 2 introduces some of the latest work related to the enhancement of the performance of the network utilizing ACO or PSO and sink mobility technology. Section 3 describes the model of the network and energy and makes some basic assumptions. The traditional ACO and PSO algorithms are explained in Section 4. Section 5 details our presented HM-ACOPSO, and Section 6 demonstrates the simulation parameters of this work. Section 7 shows the simulation results and includes some analyses. Section 8 presents some discussions and proposes some future work. Section 9 concludes the paper.

Related Work
In this section, we make a brief summary of recent research which focuses on routing protocols designing and utilizing mobile technology and the ACO or PSO algorithm in WSN. A brief summarization of these protocols is shown as Table 1.

Mobile Agent-Based Routing Protocols
In Reference [15], the authors discuss the data gathering problem in order to maximize the volume of collected information in networks with self-charging sensors. By means of convex optimization, they present a distributed data collecting schema to approximate the optimal solution. In Reference [16], the authors adopt two mobile agents to gather information collaboratively. The moving trajectory of mobile agents is characterized by a Fermat spiral route, and it can be predicted according to the constant velocity and the direction of the mobile agents. The sojourn times of the clusters are different for further energy balancing.

ACO-Based Routing Protocols
In Reference [17], the authors present an energy-efficient coverage optimization algorithm called ACB-SA. ACB-SA introduces ant colony optimization (ACO) to address the network coverage problem.
In ACB-SA, each sensor can switch between the status of active and inactive freely, and the target of this work is to adopt as few active sensors as possible in order to maintain optimal network coverage area.
In Reference [18], the authors present an energy-efficient routing schema called ACO-MNCC. It utilizes the ACO algorithm to search the maximum connected covers that disjoint with each other to enhance the lifetime of the network. The pheromone denotes the experiences of hunting, and the heuristic information represents the attraction of the target sensor. Numerous experiments illustrate the energy efficiency of the presented algorithm, especially in heterogeneous WSNs. In Reference [19], the authors present a novel sensor deployment method called ACO-MCC3D in 3-D space coordinates. ACO-MCC3D contains mainly two parts. In phase-I, an improved ACO algorithm is implemented to find the potential location for node deployment, and the heuristic denotes the number of the target points the potential sensor covers. In phase-II, the redundant potential sensors will be deleted.
An improved version of ACO which utilizes three different pheromones is presented in Reference [20]. One of them used local pheromones to minimize the number of sensors and maintain a certain coverage rate. The other two pheromones are global pheromones used for active sensors selection. In Reference [21], the authors use ACO to avoid the communication blind district and decrease the cost of deployment. A load-balanced deployment schema is designed to improve the connectivity of the network. In Reference [22], the ACO algorithm is utilized for mobile sink moving trajectory scheduling. Nodes in the same subdomain select a CH in accordance with their residual energy, and the traveling path of the mobile sink is transformed into a TSP problem to minimize the network latency. The mobile sink needs to walk to each CH for data gathering.
Authors in Reference [23] present an energy-aware routing method called LTAWSN. Not only the transmission path but also the residual energy among the path is considered to update the pheromone by implementing the ACO algorithm. Simulation results prove that the selected routing path is more reasonable and energy-balancing. Authors in Reference [24] present a hybrid method which combines fuzzy logic, unequal clustering, and ACO technology called FUCHAR. During the clustering phase, sensors are divided into clusters with different sizes in accordance with their residual energy, distance from the sink, neighbor distance, degree of nodes, and so on. The network topology is mainly constructed by means of ACO to hunt for an optimal path. Additionally, the clusters are marked with different levels according to their distance from the sink, and cross-level data forwarding is conducted when necessary. Authors in Reference [25] present an original routing schema called CRT2FLACO. In CRT2FLACO, the type-2 fuzzy logic is utilized for better clustering by considering the features of residual energy, neighbor nodes amount, and destination distance. Then, ants link all the CHs for inter-cluster transmission.

PSO-Based Routing Protocols
In Reference [26], the PSO algorithm is utilized for cluster forming and inter-cluster routing. Two different kinds of sensors are randomly deployed in the target area. Nodes with higher initial energy not only detect the information of surroundings but also function as gateways for data forwarding. A novel method adopted PSO is presented to determine which gateway should be chosen as the forwarder. In Reference [27], authors enhance the performance of the algorithm presented in Reference [26] and pay more attention to energy balancing. A special particle-encoding method and multi-target fitness method are created to achieve a balance between energy efficiency and energy balancing.
In Reference [28], a novel idea for a clustering-adopting PSO has been presented in EPMS. The authors utilize several straight lines to partition the whole sensor area into subdomains, and each domain denotes a cluster. Each line is represented as an included angle and intercepts with the coordinate axis, and the fitness function describes the quality of the clustering. In Reference [29], the authors present a variable dimension PSO method for mobile sink moving trajectory planning. The mobile sink stays at the rendezvous points for data collection and the number of rendezvous is not determinate. The authors also present a novel method for particle updating using the nearest dimension.
Protocols such as ACB-SA, ACO-MCC3D, and TPACO, which do not introduce clustering technology, are restricted to small scale networks because the sink node has no assistants and it needs to process all packages. Meanwhile, protocols which only adopt a static sink like ACB-SA, ACO-MNCC, and DSBA may cause hot spot problems and result in nodes' premature death. One of the big challenges this field faces is how to combine clustering with sink mobility technology to enhance the performance of the network. Additionally, all the protocols in Table 1 are centralized, which means nodes in those protocols need control messages to have guidance for their next action. Distributed protocols are demanded to decrease the burden of control messages.

Basic Assumptions
The following are some assumptions made to simplify the network for the purpose of conducting the experiments conveniently.

•
All the sensors maintain static after deployment and they can adjust their communication distance within the communication range. • All the sensors have the same initial energy and they are all battery-powered. Once the sensor exhausts its energy, it will be useless.

•
We assume that the wireless communication link is ideal and there is no collision during data transmission and receiving. • The mobile agent is carried by an intelligent vehicle and it does not have a limitation of energy. The MU-MIMO technology is introduced for one-to-many communication. The speed and the direction of the mobile agent can be controlled freely.

•
The computation process is conducted in a sink node and the residual energy of sensors can be predicted by computation and verified in the transmitted data.

The Network Model
In this paper, the sensor field is a rectangular area, and numerous sensor nodes are randomly deployed by plane or other tools, as shown in Figure 1. Each sensor owns its unique ID which is used to recognize it. Sensor data is generated according to time, and sensors have memory for data storage.
• All the sensors have the same initial energy and they are all battery-powered. Once the sensor exhausts its energy, it will be useless. • We assume that the wireless communication link is ideal and there is no collision during data transmission and receiving. • The mobile agent is carried by an intelligent vehicle and it does not have a limitation of energy. The MU-MIMO technology is introduced for one-to-many communication. The speed and the direction of the mobile agent can be controlled freely. • The computation process is conducted in a sink node and the residual energy of sensors can be predicted by computation and verified in the transmitted data.

The Network Model
In this paper, the sensor field is a rectangular area, and numerous sensor nodes are randomly deployed by plane or other tools, as shown in Figure 1. Each sensor owns its unique ID which is used to recognize it. Sensor data is generated according to time, and sensors have memory for data storage.

The Energy Model
As the literature records [37,38], the energy consumption of sensors used in transmission is about 1000 times higher than the energy used for other purposes. Therefore, we only consider energy consumption used for transmission in our model, which is shown as Figure 2. As Figure 2 describes, the energy used in transmission is generally composed of two parts, the sending and receiving parts. The energy used in sending depends on the transmission distance. Once the signal is sent by the transmitter, it will be strengthened by the amplifier, and the amplifier

The Energy Model
As the literature records [37,38], the energy consumption of sensors used in transmission is about 1000 times higher than the energy used for other purposes. Therefore, we only consider energy consumption used for transmission in our model, which is shown as Figure 2.
• All the sensors have the same initial energy and they are all battery-powered. Once the sensor exhausts its energy, it will be useless. • We assume that the wireless communication link is ideal and there is no collision during data transmission and receiving. • The mobile agent is carried by an intelligent vehicle and it does not have a limitation of energy. The MU-MIMO technology is introduced for one-to-many communication. The speed and the direction of the mobile agent can be controlled freely. • The computation process is conducted in a sink node and the residual energy of sensors can be predicted by computation and verified in the transmitted data.

The Network Model
In this paper, the sensor field is a rectangular area, and numerous sensor nodes are randomly deployed by plane or other tools, as shown in Figure 1. Each sensor owns its unique ID which is used to recognize it. Sensor data is generated according to time, and sensors have memory for data storage.

The Energy Model
As the literature records [37,38], the energy consumption of sensors used in transmission is about 1000 times higher than the energy used for other purposes. Therefore, we only consider energy consumption used for transmission in our model, which is shown as Figure 2. As Figure 2 describes, the energy used in transmission is generally composed of two parts, the sending and receiving parts. The energy used in sending depends on the transmission distance. Once the signal is sent by the transmitter, it will be strengthened by the amplifier, and the amplifier As Figure 2 describes, the energy used in transmission is generally composed of two parts, the sending and receiving parts. The energy used in sending depends on the transmission distance. Once the signal is sent by the transmitter, it will be strengthened by the amplifier, and the amplifier will choose two different power levels to strengthen the signal according to the transmission distance. Therefore, the energy model used in sending data is also classified into two different types, the free space model (d 2 power loss) and multi-path fading model (d 4 power loss). The energy used for sending the l-bit data package can be calculated as: where E elec is the energy use of the transmitter and receiver unit. ε f s and ε mp denote the amplification coefficients for two different models, respectively. d 0 is the distance threshold for choosing different amplifier powers, which can be calculated as: The energy used for the receiver is simpler compared to the sending part, and its power is constant, the same as the transmitter. The energy used for receiving the l-bit data package can be calculated as:

Overview of Traditional ACO and PSO Algorithms
Ant colony optimization (ACO) is a searching method determined by means of previous experience [30] and enlightened by the food-hunting process of ants. When ants walk through a path, they release a material called pheromone, and pheromone can volatilize after a while. In the beginning, ants choose each path with equal probability, and the path with the shorter length costs less time for traveling. Therefore, the path with shorter length will be travelled by more ants in a given time, and the pheromone in those paths become higher. In cycles, more ants will choose the short path for food hunting to reduce the total time cost. ACO is applied to address the traveling salesman problem (TSP) [14,39] originally and it has been widely used in various fields. The working procedure of ACO is described in Figure 3.
Sensors 2019, 19, x FOR PEER REVIEW 6 of 20 will choose two different power levels to strengthen the signal according to the transmission distance. Therefore, the energy model used in sending data is also classified into two different types, the free space model ( 2 d power loss) and multi-path fading model ( 4 d power loss). The energy used for sending the l-bit data package can be calculated as: where elec E is the energy use of the transmitter and receiver unit. fs ε and mp ε denote the amplification coefficients for two different models, respectively. 0 d is the distance threshold for choosing different amplifier powers, which can be calculated as: The energy used for the receiver is simpler compared to the sending part, and its power is constant, the same as the transmitter. The energy used for receiving the l-bit data package can be calculated as:

Overview of Traditional ACO and PSO Algorithms
Ant colony optimization (ACO) is a searching method determined by means of previous experience [30] and enlightened by the food-hunting process of ants. When ants walk through a path, they release a material called pheromone, and pheromone can volatilize after a while. In the beginning, ants choose each path with equal probability, and the path with the shorter length costs less time for traveling. Therefore, the path with shorter length will be travelled by more ants in a given time, and the pheromone in those paths become higher. In cycles, more ants will choose the short path for food hunting to reduce the total time cost. ACO is applied to address the traveling salesman problem (TSP) [14,39] originally and it has been widely used in various fields. The working procedure of ACO is described in Figure 3.  PSO is another intelligent heuristic algorithm which utilizes the wisdom of the swarm [31,40,41]. Each particle commonly represents a whole solution for the problem, and the fitness function evaluates the performance of the solution represented by the particle. During each iteration, a local and a globally-optimal solution are marked for updating the location of the particles. Particles search for better solutions according to local and global optimal solutions. The working procedure of PSO is described as in Figure 4. PSO is another intelligent heuristic algorithm which utilizes the wisdom of the swarm [31,40,41]. Each particle commonly represents a whole solution for the problem, and the fitness function evaluates the performance of the solution represented by the particle. During each iteration, a local and a globally-optimal solution are marked for updating the location of the particles. Particles search for better solutions according to local and global optimal solutions. The working procedure of PSO is described as in Figure 4.

Our Presented HM-ACOPSO Algorithm
In this section, we will illustrate our presented HM-ACOPSO algorithm. HM-ACOPSO mainly contains four phases: Clustering; mobile agent shortest moving sequence searching based on ACO; further improvement of the scheduled path using anchor nodes based on PSO; and communication range adaption for energy balancing and anchor nodes merging for decreasing the sojourn time of the mobile agent. During the initial phase of the network, sensors exchange their own information that includes location and sensor ID with their neighbors in the range of communication.

Sub-Domain Division
We utilize a virtual grid to divide the sensor field into subdomains, and each subdomain represents a cluster. In order to simplify the intra-cluster communication, cluster members only communicate with their corresponding cluster head directly. In order to guarantee that any two nodes in the same subdomain can communicate with each other, the length of each subdomain should satisfy the following formula: where R is the communication range of ordinary sensors. Each subdomain elects a cluster head in accordance with the weight of each node, and the weight can be calculated using Formulas 5, 6 and 7:

Our Presented HM-ACOPSO Algorithm
In this section, we will illustrate our presented HM-ACOPSO algorithm. HM-ACOPSO mainly contains four phases: Clustering; mobile agent shortest moving sequence searching based on ACO; further improvement of the scheduled path using anchor nodes based on PSO; and communication range adaption for energy balancing and anchor nodes merging for decreasing the sojourn time of the mobile agent. During the initial phase of the network, sensors exchange their own information that includes location and sensor ID with their neighbors in the range of communication.

Sub-Domain Division
We utilize a virtual grid to divide the sensor field into subdomains, and each subdomain represents a cluster. In order to simplify the intra-cluster communication, cluster members only communicate with their corresponding cluster head directly. In order to guarantee that any two nodes in the same subdomain can communicate with each other, the length of each subdomain should satisfy the following formula: where R is the communication range of ordinary sensors. Each subdomain elects a cluster head in accordance with the weight of each node, and the weight can be calculated using Formulas (5)- (7): where E residual is the residual energy of node i and A is the set of neighbors of node i. During the initial phase of election, nodes close to the subdomain center take the lead in broadcasting a competition package which contains the node ID and weight. Neighboring nodes compare their own weights with the receiving package. If the neighbor nodes own the bigger weight, they will broadcast their own competition package. Finally, nodes with the biggest weight will be chosen as CH. The process of clustering needs to create many control messages which increase the extra energy consumption. Therefore, the network conducts the clustering procedure after several rounds. Figure 5 describes the result of the clustering.
where residual E is the residual energy of node i and A is the set of neighbors of node i .
During the initial phase of election, nodes close to the subdomain center take the lead in broadcasting a competition package which contains the node ID and weight. Neighboring nodes compare their own weights with the receiving package. If the neighbor nodes own the bigger weight, they will broadcast their own competition package. Finally, nodes with the biggest weight will be chosen as CH. The process of clustering needs to create many control messages which increase the extra energy consumption. Therefore, the network conducts the clustering procedure after several rounds. Figure 5 describes the result of the clustering.

Shortest Path Selection Based on ACO
For some delay-tolerant applications such as environment monitoring, there is no need for multi-hop communication among cluster heads which will result in a heavy forwarding burden on CHs. In our proposed HM-ACOPSO algorithm, we use a mobile agent for data collection. During each round, the mobile agent needs to traverse all the CHs and sojourn for data gathering. The moving trajectory of the mobile agent has a significant impact on the performance of the network. A vital feature for moving trajectory planning is the length of the path. A short moving path will cost less time for the mobile agent traveling. In this section, we utilize the ACO algorithm for shortest path selection. We use an undirected complete graph , G V E =< > to represent the network and V denotes the set of cluster heads and E denotes the set of edges between any two cluster heads. The following steps are used to conduct the ACO algorithm.
Step 1: m ants are randomly placed in n CHs and a matrix with m n × dimension is used to record each ant's traveling path.
Step 2: The possibility of next cluster heads that ants will choose can be calculated using Formula 8:

Shortest Path Selection Based on ACO
For some delay-tolerant applications such as environment monitoring, there is no need for multi-hop communication among cluster heads which will result in a heavy forwarding burden on CHs. In our proposed HM-ACOPSO algorithm, we use a mobile agent for data collection. During each round, the mobile agent needs to traverse all the CHs and sojourn for data gathering. The moving trajectory of the mobile agent has a significant impact on the performance of the network. A vital feature for moving trajectory planning is the length of the path. A short moving path will cost less time for the mobile agent traveling. In this section, we utilize the ACO algorithm for shortest path selection. We use an undirected complete graph G =< V, E > to represent the network and V denotes the set of cluster heads and E denotes the set of edges between any two cluster heads. The following steps are used to conduct the ACO algorithm.
Step 1: m ants are randomly placed in n CHs and a matrix with m × n dimension is used to record each ant's traveling path.
Step 2: The possibility of next cluster heads that ants will choose can be calculated using Formula (8): if j ∈ next 0 otherwise (8) where p k ij denotes the possibility that the kth ant travels from CH i to CH j and next denotes the set of CHs that ant k has not travelled. τ is the pheromone, and µ is the inspired factor, which is the reciprocal of the distance between CH i to CH j. Each ant travels all the CHs in accordance with the above possibility. α and β are two constant control factors.
Step 3: A fitness function is utilized to evaluate the quality of the traveling path of the ants' and it can be defined as follows: where Path denotes the set of edges the ant travels. The best travel path is recorded as the parameters for PSO.
Step 4: The pheromone will volatilize after a while and when an ant travels through a path, it will emit a pheromone. Therefore, the pheromone can be updated as: where ρ is the evaporation rate.
Step 5: Repeat steps 1-4 until reaching the necessary number of iterations. Finally, we record the path with the shortest length. The sample after path selection using the ACO algorithm is shown as Figure 6.
where k ij p denotes the possibility that the th k ant travels from CH i to CH j and next denotes the set of CHs that ant k has not travelled. τ is the pheromone, and μ is the inspired factor, which is the reciprocal of the distance between CH i to CH j . Each ant travels all the CHs in accordance with the above possibility. α and β are two constant control factors.
Step 3: A fitness function is utilized to evaluate the quality of the traveling path of the ants' and it can be defined as follows: ( ) e Path Fitness k e ∈ =  where Path denotes the set of edges the ant travels. The best travel path is recorded as the parameters for PSO.
Step 4: The pheromone will volatilize after a while and when an ant travels through a path, it will emit a pheromone. Therefore, the pheromone can be updated as: where ρ is the evaporation rate.
Step 5: Repeat steps 1-4 until reaching the necessary number of iterations. Finally, we record the path with the shortest length. The sample after path selection using the ACO algorithm is shown as Figure 6.  The pseudocode of the ACO-based shortest path selection is described in Algorithm 1. for k=1 to n do 11: Calculate P /* Using formula (8) */ 12: Select next visit CH k according P 13: Add CH k into C_visit 14: end for 15: end for 16: Calculate Fitness(m) /* Using formula (9) */ 17: Record the best path L 18: Update Tabu ij /* Using formula (10), (11) and (12)

Anchor Nodes Selection Based on PSO
As mentioned above, the mobile agent needs to move to the location of the CHs for data collecting. However, each sensor owns its fixed wireless communication coverage, and any two sensors which are in each other's communication range can communicate with each other freely. Therefore, the mobile agent has no occasion to reach CHs for data collecting, and the shortest path selected by ACO can be further optimized. We allocate a virtual anchor node for each cluster head and we utilize the PSO algorithm for anchor nodes selection. We still use the order that the preceding ACO achieves to traverse the anchor nodes of the CHs. Each particle represents a path across all the anchors, and we assume that the current order for traversing is A = {a 1 , a 2 , a 3 · · · · · · a n }. The dimension of each particle is 2n and the particle swarm can be denoted as: x 1 a 1 , y 1 a 1 , x 1 a 2 , y 1 a 2 · · · · · · x 1 a n , y 1 a n x 2 a 1 , y 2 a 1 , x 2 a 2 , y 2 a 2 · · · · · · x 2 a n , y 2 a n x 3 a 1 , y 3 a 1 , x 3 a 2 , y 3 a 2 · · · · · · x 3 a n , y 3 a n . . .
x n a 1 , y n a 1 , x n a 2 , y n a 2 · · · · · · x n a n , y n a n where x k a i , y k a i denotes the location of kth anchor. The target of the PSO algorithm is to minimize the traveling path of the mobile agent and we still adopt the fitness function as the ACO used. We set an initial speed for each dimension of the particle and the restriction of speed and location of particles are as follows: dis(anchor k , CH k ) < R We use the following steps to execute our POS algorithm.
Step 1: We randomly set the initial location and speed of particles. The location and speed satisfy the restriction of Formulas (14) and (15).
Step 2: The fitness value of particles is calculated in accordance with Formula (9). Each particle compares the current fitness value with its previous optimal fitness value and chooses the better one as its P best . Similarly, we compare the current global fitness value with the previous optimal global fitness value and choose the better one as G best .
Step 3: The speed and the location of particle p i is updated using the following formulas respectively.
where η denotes the inertia factor. c 1 ,c 2 denote the weight factor and they satisfy c 1 + c 2 = 1.
Step 4: After updating the speed and location, each particle checks whether the value of its speed and location exceed the boundary. If the speed exceeds the limit, it will be set as the boundary value, and if the location exceeds the limit, the location information will not be updated.
Step 5: Next, it conducts step 2 and iterates until reaching the maximal iteration number. Finally, G best represents the solution for the anchor nodes selection. The sample after the anchor nodes selection is shown as Figure 7.
We use the following steps to execute our POS algorithm.
Step 1: We randomly set the initial location and speed of particles. The location and speed satisfy the restriction of Formula 14 and Formula 15.
Step 2: The fitness value of particles is calculated in accordance with Formula 9. Each particle compares the current fitness value with its previous optimal fitness value and chooses the better one as its best P . Similarly, we compare the current global fitness value with the previous optimal global fitness value and choose the better one as best G .
Step 3: The speed and the location of particle i p is updated using the following formulas respectively.
where η denotes the inertia factor. 1 c , 2 c denote the weight factor and they satisfy 1 2 1 c c + = .
Step 4: After updating the speed and location, each particle checks whether the value of its speed and location exceed the boundary. If the speed exceeds the limit, it will be set as the boundary value, and if the location exceeds the limit, the location information will not be updated.
Step 5: Next, it conducts step 2 and iterates until reaching the maximal iteration number. Finally, best G represents the solution for the anchor nodes selection. The sample after the anchor nodes selection is shown as Figure 7.  The pseudocode of the PSO-based anchor nodes selection is described in Algorithm 2.

Communication Range Adjustment
During the initial round, sensors own the same initial energy, and the network is energy-balanced. As the number of rounds increases, the network becomes energy-heterogeneous due to the uneven deployment and heavy burden of forwarding. The clustering addresses the problem of energy unbalancing within the cluster, whereas, the unbalanced energy of the inter-cluster is still unsolved. In this paper, we adopt the method of sensor communication range adjustment to handle the unbalanced energy between different clusters. The CHs commonly consumes the most energy during the transmission with the mobile agent, and we only consider adjusting the communication range of the CHs. The communication range of each CHs is dynamic and is changed according to Formula (18).
where E Max denotes the maximal residual energy of CHs and E Min denotes the minimal residual energy of CHs. c is a regulatory factor between 0 and 1, and it usually is set as 0.5. ε is a very small constant to avoid the denominator to be zero. The sample after communication range adjustment is shown as Figure 8.

Anchor Nodes Merging
The total traveling time contains two parts, including moving time and sojourn time. The total time the mobile agent uses to complete a whole travel path can be calculated using the following formula.
The sojourn time is related to the number of anchor nodes. More anchor nodes mean that the mobile agents have to spend more time data collecting. In this paper, the MU-MIMO technology is adopted to enable the mobile agent to collect the data from multiple sensor nodes. If any anchor node is in the transmission range of multiple CHs simultaneously, we can merge the relevant anchor nodes.
Each anchor node is checked to determine whether it is in multiple CHs' transmission ranges utilizing the following equation: where (x i , y i ),(x j , y j ) are the coordinates of any two CHs and (x , y ) is the coordinate of any anchor node. We only reserve the anchor nodes which are in a conjunct communication range and remove the other anchor nodes.

Anchor Nodes Merging
The total traveling time contains two parts, including moving time and sojourn time. The total time the mobile agent uses to complete a whole travel path can be calculated using the following formula.
total total anchor sojourn The sojourn time is related to the number of anchor nodes. More anchor nodes mean that the mobile agents have to spend more time data collecting. In this paper, the MU-MIMO technology is adopted to enable the mobile agent to collect the data from multiple sensor nodes. If any anchor node is in the transmission range of multiple CHs simultaneously, we can merge the relevant anchor nodes. Each anchor node is checked to determine whether it is in multiple CHs' transmission ranges utilizing the following equation: where ( , ) i i x y , ( , ) j j x y are the coordinates of any two CHs and ( , ) x y   is the coordinate of any anchor node. We only reserve the anchor nodes which are in a conjunct communication range and remove the other anchor nodes.

Network Parameters
With the purpose of having an evaluation of our proposed HM-ACOPSO algorithm, we employ Matlab to simulate the experiment. We also compare some similar works such as ACO-TSP, VD-PSO, and LEACH with this work to highlight the outstanding performance of this work. The relevant parameters used in this paper are listed in Table 2.

Network Parameters
With the purpose of having an evaluation of our proposed HM-ACOPSO algorithm, we employ Matlab to simulate the experiment. We also compare some similar works such as ACO-TSP, VD-PSO, and LEACH with this work to highlight the outstanding performance of this work. The relevant parameters used in this paper are listed in Table 2.

ACO Parameters
In the ACO algorithm, the parameters α, β and ρ have great influence on the performance of the ACO. We make numerous attempts to find a better combination of the parameters to enhance the performance of ACO. Numerous simulations are shown in Table 3, and from Table 3, we can see that the best values for α, β and ρ are 1, 2, and 0.5 respectively.

PSO Parameters
In the PSO algorithm, η, c 1 , and c 2 also have a significant effect on the final anchor nodes selection and iteration. Different combinations of these parameters and their performances are described in Table 4. From Table 4, we can see that the best values for η, c 1 , and c 2 are 0.8, 0.4, 0.6, respectively.

Performance Evaluation
We first analyze the energy consumption of the network between different algorithms. As illustrated in Figure 9, as time rises, the energy consumption of the four algorithms increases, and LEACH rises more rapidly. We know that each of the four algorithms adopts a clustering algorithm. However, CHs are more unevenly distributed in LEACH. Some nodes may be far away from the CHs and that results in long-distance communication which consumes significantly more energy. HM-ACOPSO, VD-PSO, and ACO-TSP all introduce mobile data collectors for data gathering which conserve energy. The energy consumption of ACO-TSP increases most slowly before 5500 s because the mobile agent in ACO-TSP needs to access each CH and the transmission distance between the mobile agent and CHs is very close. Whereas, the CHs selection in ACO-TSP only considers the residual energy which causes significant energy dissipation in intra-cluster communication. VD-PSO takes energy balances into consideration so that it schedules a moving trajectory with much more energy consumption, but the energy of the whole network is much more balanced. Therefore, the energy increases steadily in VD-PSO. Our proposed HM-ACOPSO method features a more reasonable clustering method and the scheduled path is optimized so that it achieves better performance in aspects of energy consumption.
We also research the traveling path that different algorithms schedule, and the result is described as Figure 10. We can clearly see from Figure 10 that HM-ACOPSO almost has the best performance in terms of scheduled path length. There is no doubt that the ACO-TSP achieves the worst performance in terms of traveling path length because the mobile agent in ACO-TSP needs to access each CH closely to collect information. VD-PSO schedules rendezvous points of mobile agents to sojourn for information gathering, and that is much more efficient compared to ACO-TSP. However, VD-PSO does not make full use of wireless communication range and it sacrifices some performance for balancing the energy of the whole network. One of the great improvements in HM-ACOPSO is that it makes full use of the wireless communication range, and therefore, it can schedule the optimal traveling path for the mobile agent. before 5500 seconds because the mobile agent in ACO-TSP needs to access each CH and the transmission distance between the mobile agent and CHs is very close. Whereas, the CHs selection in ACO-TSP only considers the residual energy which causes significant energy dissipation in intracluster communication. VD-PSO takes energy balances into consideration so that it schedules a moving trajectory with much more energy consumption, but the energy of the whole network is much more balanced. Therefore, the energy increases steadily in VD-PSO. Our proposed HM-ACOPSO method features a more reasonable clustering method and the scheduled path is optimized so that it achieves better performance in aspects of energy consumption. We also research the traveling path that different algorithms schedule, and the result is described as Figure 10. We can clearly see from Figure 10 that HM-ACOPSO almost has the best performance in terms of scheduled path length. There is no doubt that the ACO-TSP achieves the worst performance in terms of traveling path length because the mobile agent in ACO-TSP needs to access each CH closely to collect information. VD-PSO schedules rendezvous points of mobile agents to sojourn for information gathering, and that is much more efficient compared to ACO-TSP. However, VD-PSO does not make full use of wireless communication range and it sacrifices some performance for balancing the energy of the whole network. One of the great improvements in HM-ACOPSO is that it makes full use of the wireless communication range, and therefore, it can schedule the optimal traveling path for the mobile agent. We then study the package loss rate of each algorithm. We assume that all of the communication is successful and that the packages will be dropped only when the memory of the sensors overflows. The result is demonstrated as Figure 11. The package loss rate has great relevance to the efficiency of the mobile agent data gathering. In LEACH, the sink node is static, and all the data is transmitted to it timely by multiple-hop communication. Therefore, package loss will not occur. Whereas, in HM-ACOPSO, VD-PSO, and ACO-TSP, the mobile agent is introduced to collect data, and the shorter the traveling path and the less the sojourn points are, the more efficient the mobile agent is. Our proposed HM-ACOPSO method makes full use of the wireless communication range to shorten the mobile agent traveling path and merge the sojourn points to enhance the work efficiency of the mobile agent. A long traveling path of a mobile agent is likely to induce a high package loss rate. We then study the package loss rate of each algorithm. We assume that all of the communication is successful and that the packages will be dropped only when the memory of the sensors overflows. The result is demonstrated as Figure 11. The package loss rate has great relevance to the efficiency of the mobile agent data gathering. In LEACH, the sink node is static, and all the data is transmitted to it timely by multiple-hop communication. Therefore, package loss will not occur. Whereas, in HM-ACOPSO, VD-PSO, and ACO-TSP, the mobile agent is introduced to collect data, and the shorter the traveling path and the less the sojourn points are, the more efficient the mobile agent is. Our proposed HM-ACOPSO method makes full use of the wireless communication range to shorten the mobile agent traveling path and merge the sojourn points to enhance the work efficiency of the mobile agent. A long traveling path of a mobile agent is likely to induce a high package loss rate.
will not occur. Whereas, in HM-ACOPSO, VD-PSO, and ACO-TSP, the mobile agent is introduced to collect data, and the shorter the traveling path and the less the sojourn points are, the more efficient the mobile agent is. Our proposed HM-ACOPSO method makes full use of the wireless communication range to shorten the mobile agent traveling path and merge the sojourn points to enhance the work efficiency of the mobile agent. A long traveling path of a mobile agent is likely to induce a high package loss rate. The input of PSO needs to use the output of ACO. Specifically, when we construct the particles P which represent anchor nodes, we need to use the sequence the ACO created to order the CHs. We also compare it with the anchor nodes ordered in a random way. The simulation result is shown as Figure 12. We can clearly see that the schema without ACO performs worse than the schema using ACO. The upper limit of the schema which doesn't adopts ACO is close to twice that of the schema which adopts ACO. Even if the sets of anchor nodes in the two schemas are the same, when The input of PSO needs to use the output of ACO. Specifically, when we construct the particles P which represent anchor nodes, we need to use the sequence the ACO created to order the CHs. We also compare it with the anchor nodes ordered in a random way. The simulation result is shown as Figure 12. We can clearly see that the schema without ACO performs worse than the schema using ACO. The upper limit of the schema which doesn't adopts ACO is close to twice that of the schema which adopts ACO. Even if the sets of anchor nodes in the two schemas are the same, when the mobile agent travels them in a different order, the result could be very different. That is also the reason why we need to combine the ACO with PSO rather than only using PSO algorithm. the mobile agent travels them in a different order, the result could be very different. That is also the reason why we need to combine the ACO with PSO rather than only using PSO algorithm.

Discussion and Future Work
Sink mobility as an emerging technology is widely used in various types of WSNs. One important issue which needs to be addressed is moving path scheduling which has a significant effect on the performance of the mobile agent. Much research has been done to explore efficient data gathering methods for mobile agents, and the moving schema is generally divided into three types, including the controlled moving schema, the uncontrolled moving schema, and the random moving schema. Different moving schema are applied to different applications. In the controlled moving schema, we hope the traveling path is as short as possible to decrease the network latency and reduce the loss package rate. Meanwhile, the shortest traveling path means that the mobile agent may not approach nodes and cause extra energy consumption. Meanwhile, the predictability of the mobile agent greatly enhances the reliability of the network because nodes can have the exact location of the mobile agent and the routing can be scheduled in advance. The schema of the Travelling path length(m) Figure 12. Comparison of whether to adopt ACO.

Discussion and Future Work
Sink mobility as an emerging technology is widely used in various types of WSNs. One important issue which needs to be addressed is moving path scheduling which has a significant effect on the performance of the mobile agent. Much research has been done to explore efficient data gathering methods for mobile agents, and the moving schema is generally divided into three types, including the controlled moving schema, the uncontrolled moving schema, and the random moving schema. Different moving schema are applied to different applications. In the controlled moving schema, we hope the traveling path is as short as possible to decrease the network latency and reduce the loss package rate. Meanwhile, the shortest traveling path means that the mobile agent may not approach nodes and cause extra energy consumption. Meanwhile, the predictability of the mobile agent greatly enhances the reliability of the network because nodes can have the exact location of the mobile agent and the routing can be scheduled in advance. The schema of the uncontrolled moving and random moving are mainly used in applications such as endangered animal detecting. The mobile agent is usually placed on the animals and moves with the animals, which may result in network isolation.
The traveling path planning should be determined by the specific application which demands low energy consumption or low network latency and package loss rate. In our proposed HM-ACOPSO algorithm, we also take energy balancing into consideration. The communication range of each CHs can be adjusted dynamically according to their residual energy so that the weak CHs will be protected using a close communication distance. Additionally, more mobile agents can also be adopted to collect data cooperatively to reduce energy consumption and network latency at the same time, if the budget allows for this.
Our future work will mainly focus on multiple mobile agents cooperative work which can further enhance the performance of the network. Multiple mobile agents cooperative work faces challenges as follows: Firstly, mobile agents need to communicate with each other to collect data cooperatively. How can the mobile agents communicate with each other efficiently? Then we must determine how to schedule the traveling path of each agent, which is much harder than for multiple agents than for a single mobile agent network. Finally, as the mobile agent number increases, the control messages among the network increase exponentially. How can we decrease the control messages to simply the network? These problems must be solved.

Conclusions
In this paper, we presented an efficient moving path scheduling method called HM-ACOPSO. We firstly partition the whole sensor field into several subdomains utilizing virtual grids, and then the CHs are selected in accordance with their weights. An efficient traveling loop is planned using a hybrid method with ACO and PSO. The communication range of CHs can be adjusted according to residual energy to protect the weak nodes, and anchor nodes can be merged to save sojourn time. Finally, the mobile agent moves along a predefined trajectory to traverse all the sojourn points for data collection. The simulation results prove that our presented method outperforms similar methods in terms of energy consumption and package loss rate.