A New Way to Model the Wireless Sensor Network Maintenance Job

For the maintenance of an urban wireless sensor network, the sta ﬀ ’ s travel route greatly a ﬀ ects the whole network ’ s response time. Every time the network reports an error, the sta ﬀ needs to ﬁ nd the best route to minimize the time spent on the way to the error point. The di ﬃ culty of the problem is that although the entire network fails, the error point remains unclear. In this paper, the sta ﬀ ’ s route planning is modeled as an NP-complete problem, MWLP (Minimum Weighted Latency Problem). It is a problem of ﬁ nding the best route for a moving agent to satisfy multiple customers ’ di ﬀ erent demands as much as possible. To solve the problem, we propose a heuristic algorithm which borrows the idea from a biological computing model called P_system. In the proposed algorithm, di ﬀ erent classic heuristics work as separate “ membranes ” to accomplish their own jobs. They also collaborate under some mechanism to search for a better result. We designed the cell ’ s structure to balance the di ﬀ erent heuristics ’ time consumption and searching capacity. With this design, all the heuristics can cooperate properly in the proposed heuristic algorithm. To enhance the algorithm ’ s e ﬃ ciency, we also introduced a way to run it in parallel. The numerical experiments show that the proposed algorithm is very competitive compared with classic heuristic algorithms and helps eliminate the whole network delay as well.


Introduction
Koutsoupias et al. described the following situation in 1996: a treasure is hidden in one certain cave in a mountain area. An adventurer is trying to find it. However, the mountain area is full of different caves, and they all look alike. The good news is that the adventurer has a treasure map. Every cave's position and the probability of whether the treasure is placed inside it are marked on the map. Now, the adventurer is planning his search path. His goal is to minimize the distance he will travel before finding the treasure. The problem the adventurer is facing is called the Graph Searching Problem (GSP) in [1]. Wu renamed it MWLP in [2]. Two years later, Sitters proved it to be NP-hard in [3].
MWLP is formulated as follows: given n vertices v 1 , ⋯, v n of a weighted (both edge and vertex) graph G. The vertices' weights are represented by wðvÞ. MWLP is looking for a tour π, starting at a fixed vertex s and visiting every other vertex of G. For this tour, the sum of all the vertices' weighted latencies (first arrival times of all the vertices d π ðs, vÞ multiplied by their weights wðvÞ) must be minimized. MWLP is presented as The vertices' weights are sometimes noted as the probability of finding a treasure and limited to the interval ð0, 1. In this case, MWLP is formulated as follows: By simply taking the sensor's error probability as prðvÞ, MWLP can help to model the mobile agent's route planning problem in a wireless sensor network. To minimize the expression above, we shall minimize the time maintenance staff uses to find the failed sensor. Compared to TSP (Travelling Salesman Problem) and MLP (Minimum Latency Problem), MWLP pays more attention to the nodes' requirements in the network, which makes it more suitable for this environment.
MWLP can be seen as the vertex-weighted generalization of the Minimum Latency Problem (MLP), which is widely studied and proved to be NP-hard in [4]. Koutsoupias et al. also proposed a way to convert MWLP into MLP in polynomial time in [1]. With that approach, any algorithm designed for MLP can be used to solve MWLP. However, in practical cases, because of the shortcomings of the conversion process (weight expression form and graph structure are limited, as we explained in [5]), this method is inefficient. Wu proposed a DP (dynamic programming) algorithm to solve some special MWLPs in [2]. To the best of our knowledge, besides this, neither exact nor approximate algorithms designed for MWLP have been proposed. Though it can find the global optimum in a relatively short time, Wu's method still has the drawbacks of all DP algorithms.
Heuristic algorithms are a fast developing research field during the past several years. Different heuristic algorithms are designed for MLP, such as [6][7][8][9]. In recent years, using composite heuristic algorithms to solve NP-hard problems is becoming a trend. For example, Ha et al. proposed a metaheuristic combining tabu search (TS) and Variable Neighbourhood Search (VNS) to solve MLP in [10]. They used VNS to find the next feasible solution and TS to avoid searching one solution multiple times. Lenin et al. proposed a metaheuristic for a problem very similar to MLP which combined TS and simulated annealing (SA) in [11]. Their algorithm added the tabu list into an SA algorithm. The experimental results showed that the composite algorithm produced better results compared to either SA or TS alone. In [6], Ahmed proposed a hybrid genetic algorithm which combines the genetic algorithm (GA) and local search to solve MLP and got good results. Koutsoupias' conversion method can be used to apply these algorithms to MWLP. However, the problem scale will expand dramatically. It will cause both time and space consumption to increase exponentially, which makes a heuristic algorithm designed for MWLP necessary. In [5], we studied the heuristics used to solve MWLP. Five classic heuristic algorithms including TS, SA, GA, Particle Swarm Optimization (PSO), and ant colony optimization (ACO) were all redesigned to solve MWLP and tested effectively.
In this paper, we propose a heuristic algorithm based on our previous research. We borrowed the idea from P_system and optimized the five classic heuristics to embed them into the P_ system structure. We also applied two ACO methods with different pheromone update mechanisms. We evaluated our approach with the widely used dataset for graph theory problems, TSPLib. The experiments show that this metaheuristic yields greatly improved results compared to the classic heuristics.
The rest of this paper is organized as follows. Section 2 introduces the heuristic based on P_system. Experimental results are shown in Section 3, and Section 4 gives the conclusion.

The Algorithm Based on P_system
P_system (also known as membrane computing) is a computational model proposed by Păun in [12]. Păun is a computer scientist whose research field is biological computing. Inspired by the biological cell's structure, he proposed the P_system model to simulate the process that a cell uses to handle compounds in a circulation system consisting of multilayer membranes. Thanks to the advantage of its inherent structure, many other algorithms can easily be embedded into a P_system, so that many metaheuristic algorithms based on P_system have been proposed recently.
For instance, Niu et al. proposed a metaheuristic algorithm based on the structure of P_system and used ant colony optimization to solve the Capacitated Vehicle Routing Problem (cVRP) in [13]. Another heuristic algorithm, which is also based on the structure of P_system, was given by Yan et al. in [14]. They used SA to communicate between different membranes to solve the weight optimization problem for casebased reasoning. In the following, we will introduce P_system and then go to the details of the proposed composite algorithm.

Introduction of P_system.
Similar to other natural computation models, P_system is inspired by an existing process in the natural environment. It simulates the chemical processes that occur between different layers of the membranes within a cell. During processing, the cell is considered a frame. The chemical compounds within it are the subjects that are involved in the process. When passing through a membrane, the compounds are involved in some chemical reactions with other compounds or some prestored catalysts inside the membrane. Through iterations of this process, new compounds are produced and then involved in subsequent processing. The final output is produced after some stopping criterion is met.
In general, a P_system consists of three parts: the hierarchical structure of membranes, a multiset to represent the objects, and the evolutionary rules. The hierarchical structure of membranes defines the computing architecture. It limits the sequence and affiliation of different membranes. The object multiset represents the developing state during the computing process. The evolutionary rules define the method P_system uses to develop the results. The hierarchical membrane structure guarantees that the architecture can handle multiple heuristics in one algorithm.
The composite heuristic algorithm based on P_system has attracted much attention for two reasons. The first is that the computing model's structure is very suitable for combining multiple algorithms. The second is that the no-free-lunch (NFL) theorem guarantees its computational capacity.
The famous NFL theorem was proposed and proven by Wolpert and Macready in [15]. It proves that if an algorithm performs well on a certain class of problems, then it necessarily pays for that with degraded performance on the set of all remaining problems. That is, different algorithms have specific advantages and disadvantages when solving one certain problem. Composite algorithms can synthesize the advantages of different algorithms, which in theory gives them better searching ability than the individual components considered separately. People designed various mechanisms such as diversification in They are PSO, TS, SA, GA, and two different ACOs. The two ACOs update their pheromone data in different ways. Though one of them produces better results (noted as ACO2 in this paper) than the other (noted as ACO1) in most circumstances when they are used alone to solve MWLP, as shown in [5], we choose to use both of them in the composite algorithm because of the NFL theorem. The parameters of the heuristics are the same as in [5]. The algorithm's main structure is shown in Figure 1. As shown in the illustration, the "cell" consists of five inner membranes and an outer membrane. The five inner membranes are independent of each other, whereas they are all connected to the outer membrane. The inner membranes conduct PSO, TS, SA, GA, and ACO1, respectively, and the outer membrane runs ACO2. Previous experiments showed that ACO2 produces the best results among the six heuristic algorithms when they are running alone (same iteration number) to solve MWLP. Therefore, we consider ACO2 as the most suitable algorithm for the outer membrane.
When using this metaheuristic to solve MWLP, the mobile agent's route is stored in vertex arrays. Ten arrays are included in a group. The groups are considered the compounds to be transmitted between membranes. At the beginning, a group of vertex arrays is generated by using a greedy algorithm. This group is used as the initial solutions of the inner membranes. After the five optimization processes (inner membranes) are performed, each of them outputs a group of vertex arrays, consisting of the ten best solutions found by each heuristic. The five groups are combined as the initial solutions of the outer membrane. After the outer membrane finishes its optimiza-tion process, it outputs a group of the ten best solutions. This group of solutions is returned to the inner membranes as their initial solutions. At this time, the algorithm comes back to the starting state. We call this an iteration. The algorithm will iterate a predetermined number of times until the outer membrane outputs the final solution. The procedure's pseudocode is shown in Algorithm 1.

Parallel Technique.
It is obvious that the heuristic contains relatively many subalgorithms that make its computing scale large. Due to this, the time consumption of the P_system is its main drawback. However, thanks to the use of the membrane computing model, the whole optimization procedure

Wireless Communications and Mobile Computing
can be designed to run in parallel. The five inner membranes are mutually independent. None of them needs to use the others' outputs.
Based on the analysis above, we designed a parallel procedure. The main program creates five threads corresponding to the five inner-membrane heuristics. They are allocated to different CPU cores to run at the same time. When a thread completes, it sends its result to the main program and terminates. The main program waits until the five threads are all finished. Then, the main program combines the 5five threads' outputs as the outer    Wireless Communications and Mobile Computing membrane's input. In other words, by running the sixth to the tenth line in the pseudo-code at the same time, some parts of the original algorithm can run in parallel. By using this strategy, the composite algorithm's running time drops impressively. The results of our experiments will be given in the fourth section.

Experimental Environment and Results
As in [5], the experiments were all run on a small-scale server. It is equipped with two Intel(R) Xeon(R) E5-2670 v3 @ 2.30 GHz CPUs (each has 8 cores) and 64 GB memory.
The operating system is Windows® Server 2012. We used MATLAB® R2017b. The same as the experiments in [5], we applied ACO (the outer membrane in the proposed algorithm), SA, TS, GA, and PSO as the competitive comparison for this paper. The algorithms' parameters are all the same as we set in [5]. Considering that the proposed heuristic is relatively powerful, we determined to test it in a wider range from 51 vertices to 1000 vertices. Rather than randomly generating the test map, we choose instances from TSPLib. They are eil51, kroB100, kroB150, kroB200, lin318, gr431, att532, and dsj1000, respectively. The vertices' weights are allocated randomly. We coded our P_system to run in parallel to save time. As in [5], all the problem instances are tested by the algorithms for 100 times. The outputs and running time for every map are all stored for later analysis.
We use ACO (which performed the best among the classic heuristics) and P_sys algorithms as representatives to illustrate the performance of the P_sys algorithm. The results of all the tested algorithms are shown from Figures 2-9. Table 1 shows the average outputs and running time for both algorithms to search the maps 100 times. For all but one instance, the output from the P_system was better than that from ACO by at least 6%. The performance of this proposed P_system is so good that we do not need to divide the problems into different scale groups. The P_system is able to find a better solution than ACO except for map gr431. For this map, we recorded the iteration number at which ACO found its best value and stopped improving. Then, for 100 runs on the full set of maps, we calculated the average iteration number at which the best value was found on each map. The values are shown in Figure 10.

Wireless Communications and Mobile Computing
The horizontal axis is the number of vertices in the map, and the vertical axis is the average iteration number at which the best value was found. Figure 10 shows that the iteration number at which the best value was found decreases as the number of vertices increases-except in the case of map gr431. That is, as the scale of the problem increases, ACO tends to be trapped in a local optimum earlier. That may occur because as the problem scale increases, different local optima tend to get further away from each other. When ACO finds a local optimum, the algorithm is unable find a second local optimum that is far away. This leads us to hypothesize that the exceptional behaviour for map gr431 in Table 1 is because the map was relatively small.
To test this hypothesis, we captured the best and worst results for both ACO and our P_system (see Table 2 and Figure 11). These results show that the optimal value found for map gr431 is quite low, nearly matching the value for map eil51, which has 51 vertices. That is, map gr431 seems exceptional compared with the other maps in TSPlib, in terms of the results on this problem. For a map like this, we may not need an algorithm like the proposed P_system, which is able to search every possible direction of the search space. A simpler algorithm like ACO works better in this case. So in the case of map gr431, the proposed P_system did not have an advantage from using more heuristics. Instead, because of the existence of those additional heuristics, ACO did not perform the best in its task as an outer membrane.

Conclusion
In this paper, we propose a new way to model the urban WSN's maintenance job. A heuristic based on the structure of P_system is also designed to help solve MWLP. The proposed heuristic combines several well-known heuristics: TS, SA, GA, PSO, and ACO. Our experimental results show that this metaheuristic is more powerful than ACO in most cases, especially those with large numbers of vertices. Considering that our previous results given in [5] show that ACO gives the best results of all the individual heuristics used in our P_ system, we can say that the proposed P_system has been demonstrated to be the most powerful approach overall as it yields better results. One exception has been observed in this paper where the proposed P_system performed slightly worse than ACO. Improving performance in this case is the priority in our future research. One possible solution may be finding a method to let the inner membranes cooperate with each other to empower the P_system to select better results.

Data Availability
The experimental results and the maps we used in the experiment will be found through the following link: https://drive .google.com/drive/folders/ 1XKDtCPHpJj2aAhiEYO3Wa4bhSIMFTJBU?usp=sharing.

Conflicts of Interest
The authors declare that they have no conflicts of interest.