# A New Way to Model the Wireless Sensor Network Maintenance Job

Authors: Ziqi Wei; Mike MacGregor
Journal: Wireless Communications and Mobile Computing
 (2022)

---

## Abstract

For the maintenance of an urban wireless sensor network, the staff’s travel route greatly affects the whole network’s response time. Every time the network reports an error, the staff needs to find the best route to minimize the time spent on the way to the error point. The difficulty of the problem is that although the entire network fails, the error point remains unclear. In this paper, the staff’s route planning is modeled as an NP-complete problem, MWLP (Minimum Weighted Latency Problem). It is a problem of finding the best route for a moving agent to satisfy multiple customers’ different 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, different 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 different 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 efficiency, 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.


---

## Body

## 1. 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: givenn vertices v1,⋯,vn of a weighted (both edge and vertex) graph G. The vertices’ weights are represented by wv. 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 wv) must be minimized. MWLP is presented as
(1)minπ∑v∈Gwvdπs,v.The vertices’ weights are sometimes noted as the probability of finding a treasure and limited to the interval0,1. In this case, MWLP is formulated as follows:
(2)minπ∑v∈Gprvdπs,v.By simply taking the sensor’s error probability asprv, 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–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. Section2 introduces the heuristic based on P_system. Experimental results are shown in Section 3, and Section 4 gives the conclusion.


## 2. 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 case-based reasoning. In the following, we will introduce P_system and then go to the details of the proposed composite algorithm.


### 2.1. 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 TS and mutation in GA to avoid heuristic algorithms being trapped in local optima. However, being trapped in local optima is still inevitable because of the limitations of single heuristics. Composite algorithms can avoid their limitations.


### 2.2. Heuristic Based on P_system

Based on P_system, we designed a composite heuristic algorithm to solve MWLP. The algorithm consists of six different heuristic algorithms. 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.Figure 1
Illustration of the algorithm based on P_system.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 optimization 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 pseudo-code is shown in Algorithm1.Algorithm 1: P_system algorithm
procedure P_systemini_seq=GreedyAlgweighted_map,priority_seqbest_val=ComputeValueini_seqiteration_number⟵0whileiteration_number<iteration_timedoac1_best_seq=ACO1_Algini_seqsa_best_seq=SA_Algini_seqts_best_seq=TS_Algini_seqpso_best_seq=PSO_Algini_seqga_best_seq=GeneticAlgini_seqnew_seq=combinationofthefiveseqsaboveac2_best_seq=ACO2_Algnew_seqtemp_val=ComputeValueac2_best_seqiftemp_val<best_valthenbest_val=temp_valend ifini_seq=ac2_best_seqiteration_number++end whilereturnbest_valend procedure


### 2.3. 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 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 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.


## 2.1. 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 TS and mutation in GA to avoid heuristic algorithms being trapped in local optima. However, being trapped in local optima is still inevitable because of the limitations of single heuristics. Composite algorithms can avoid their limitations.


## 2.2. Heuristic Based on P_system

Based on P_system, we designed a composite heuristic algorithm to solve MWLP. The algorithm consists of six different heuristic algorithms. 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.Figure 1
Illustration of the algorithm based on P_system.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 optimization 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 pseudo-code is shown in Algorithm1.Algorithm 1: P_system algorithm
procedure P_systemini_seq=GreedyAlgweighted_map,priority_seqbest_val=ComputeValueini_seqiteration_number⟵0whileiteration_number<iteration_timedoac1_best_seq=ACO1_Algini_seqsa_best_seq=SA_Algini_seqts_best_seq=TS_Algini_seqpso_best_seq=PSO_Algini_seqga_best_seq=GeneticAlgini_seqnew_seq=combinationofthefiveseqsaboveac2_best_seq=ACO2_Algnew_seqtemp_val=ComputeValueac2_best_seqiftemp_val<best_valthenbest_val=temp_valend ifini_seq=ac2_best_seqiteration_number++end whilereturnbest_valend procedure


## 2.3. 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 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 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.


## 3. 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 Figures2–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. 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 2
Experimental results of the map with 51 vertices.Figure 3
Experimental results of the map with 100 vertices.Figure 4
Experimental results of the map with 150 vertices.Figure 5
Experimental results of the map with 200 vertices.Figure 6
Experimental results of the map with 318 vertices.Figure 7
Experimental results of the map with 431 vertices.Figure 8
Experimental results of the map with 532 vertices.Figure 9
Experimental results of the map with 100 vertices.Table 1
Average outputs.
MapACOP_systemP_system improvementeil514.16E+033.83E+037.93%kroB1004.98E+054.52E+059.24%kroB1501.06E+069.19E+0513.3%kroB2001.42E+061.24E+0612.68%lin3183.53E+063.29E+066.8%gr4311.29E+051.31E+05-1.6%att5321.14E+071.06E+077.02%dsj10005.45E+095.11E+096.24%Figure 10
Iteration number at which ACO found the best result.Figure10 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 Table2 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.Table 2
Experimental results of ACO and the proposed P_system.
MapACOP_systemWorst resultBest resultVarianceWorst resultBest resultVarianceeil514.31E+033.90E+034.44E+033.99E+033.66E+034.41E+03kroB1005.13E+054.77E+056.39E+074.70E+054.32E+056.42E+07kroB1501.06E+069.70E+053.90E+089.52E+058.82E+052.72E+08kroB2001.46E+061.35E+064.63E+081.30E+061.17E+062.83E+04lin3183.64E+063.39E+062.15E+093.44E+063.16E+063.22E+09gr4311.32E+051.23E+052.51E+061.36E+051.26E+054.30E+06att5321.17E+071.11E+071.52E+101.10E+071.01E+072.49E+10dsj10005.55E+095.32E+092.29E+155.20E+094.90E+092.52E+15Figure 11
Best and worst results for both algorithms.


## 4. 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.



---

*Source: 5055019-2022-04-25.xml*