Abstract
In wireless sensor networks (WSNs), due to the limited energy of sensor nodes, how to design efficient hierarchical routing algorithms to balance network resources and extend network life is an important problem to be solved. Aiming at the problems such as random selection of cluster head, redundancy of working node, and construction of cluster head transmission path, which affect network energy consumption, this paper proposes a multihop routing algorithm based on path tree (MHRAPT) to optimize the network energy. Firstly, some nodes are those close to the base station and have large remaining energy which are selected to construct a cluster head set. Then, after clustering, each cluster is divided into different regions, and in each region, nodes with residual energy greater than the average residual energy of the cluster are selected as a working node. Finally, the cluster heads are sorted according to their distance from base station, and the next hop node is selected for each cluster head in turn until a path tree rooted at base station is formed completely, leading to data transmission from working node to base station. Simulation results show that the proposed algorithm can effectively reduce network energy consumption, balance network resources, and prolong network life cycle.
1. Introduction
Wireless sensor networks (WSNs) have been widely used in many fields including environmental monitoring, smart space, military reconnaissance, and medical systems [1–4]. However, how to efficiently use energy of the network node is still a valuable problem to be studied in WSNs [5, 6]. Cluster routing algorithms are effective methods of energy management related to WSNs [7, 8], the most classic of which is the LEACH algorithm proposed by Daanoune et al. [9]. This algorithm divides nodes in the network into cluster heads and cluster members by clustering, which can fully use network node resources and effectively lengthen the life cycle of the network. In addition, algorithms such as PEGASIS [10] and TEEN [11] employed clustering idea to reduce the number of nodes those directly communicate with base station. By periodically changing cluster head, the energy consumption is balanced among nodes in the network; it is used to prolong the network life cycle.
Although the LEACH algorithm has good energy saving effects, it still has some problems. For example, the LEACH algorithm completely relies on a random number to select cluster heads. As a result, some nodes with less residual energy may be selected as cluster heads for several times, resulting in the death of those nodes. In addition, cluster head or working node that has a long distance from the base station may consume a large amount of energy in transmitting.
2. Related Work
Many research works have been done to improve the LEACH algorithm. Using the isolated node method, Leu et al. proposed a clustering routing algorithm to prolong the network life cycle [12]. Leu et al.’s algorithm constructs a cluster head selection threshold according to the node’s own remaining energy and the average remaining energy of all nodes and assigns nodes with more energy as the cluster head preferentially, then uses distance between isolated nodes and base station to judge whether isolated nodes should directly communicate with the base station or else. Thus, premature death of cluster heads and isolated nodes due to excessive energy consumption may be avoided. Neamatollahi et al. developed a clustering routing algorithm using the mechanism of cluster head rotation [13]. The algorithm utilizes the current remaining energy of the cluster heads to determine whether to reselect the cluster head. It not only ensures that the cluster head has enough energy but also reduces the energy consumption caused by repeated clustering. However, in literatures [12, 13], the way in which the cluster head transmits data to the base station is singlehop transmission. If the distance between the cluster head and the base station is far, the cluster head will die prematurely because of large energy consumption corresponding to long distance transmission.
To solve the problem of energy consumption caused by long distance communication between cluster head and base station, the literature [14] proposed an IMHTLEACH algorithm by combining the LEACH algorithm with multihop strategy. This algorithm assigns the different level of cluster heads according to the distance between the cluster heads and the base station. The lowlevel cluster heads nearby the base station are selected as the relay nodes, and the network energy consumption is reduced by the multihop transmission method. However, this algorithm fastens the structure of WSNs and may reduce the diversity of cluster head alternative paths. Arora et al. proposed a distributed multihop routing approach (DMATEB) to tackle this problem [15]. The DMATEB algorithm marks the cluster head that is closer to the base station than the current cluster head as neighbor cluster heads and then selects the cluster head with the largest remaining energy in the neighbor cluster heads as the next hop, which effectively reduces the network energy consumption. However, Arora et al.’s algorithm does not consider the transmission energy consumption between cluster heads. If some cluster heads far from base station are selected as the relay, they will still consume a lot of energy too. In short, the existing algorithms are mainly focused on saving energy of WSNs, while balance energy consume of WSNs is rarely considered.
3. Contribution
In this paper, inspired by the idea of LEACH, this paper proposes a multihop routing algorithm using path tree (MHRAPT) to optimize network energy. The MHRAPT algorithm is composed of three stages such as the cluster heads selecting, working nodes assigning, and transmission paths generating. In WSNs, the proposed algorithm can reduce network energy consumption and balance energy consumption of different nodes, thus significantly improving the energy utilization rate and leading to life cycle extension of WSNs. Overall, the main contributions of this paper can be summarized as follows:(i)A cluster head selection strategy with network energy balancing is developed. This strategy not only avoids the data inverse transmission caused by cluster heads far from the base station but also prevents cluster heads with less residual energy premature death caused by energy consumption in data transmitting. Thus, MHRAPT effectively prolongs the network life cycle(ii)A working node selection strategy based on cluster region division is developed to construct the set of working nodes. This strategy can dynamically wake up nodes with more residual energy to perform some tasks, thus avoiding network resource waste caused by using excessive node of WSNs. Thus, MHRAPT can effectively save the energy of WSNs(iii)In traditional data transmission, multiple cluster heads transmit data to the base station by forming a data link. Thus, faults of any cluster head in the data link may lead to data transmission failure. To improve the stability of data transmission, MHRAPT assigns the path weight of the path tree according to the directivity of the cluster head data transmission, the residual energy of the cluster head, the data transmission energy consumption, and so on
The remainder of this work is organized as follows. Section 4 introduces the system model and conventional method, including the network model, improved energy consumption model, and main steps of the LEACH algorithm. Section 5 describes the implementation process of the MHRAPT algorithm in detail. To evaluate the proposed algorithm, some simulation results are presented in Section 6; besides, some analyses are done in this section. Section 7 summarizes all works of this paper.
4. System Model and Conventional Method
4.1. System Model
4.1.1. Network Model
Assume that sensor nodes are randomly deployed in the square area. Base station (BS) is located at the center of the square area. The network model is shown in Figure 1.
Moreover, three assumptions related to the model of WSNs are as follows:(1)Each sensor node has limited energy, and their initial energy is the same(2)Each sensor node has its own ID, and their positions are fixed after deployment(3)The location of the base station is fixed, its energy is unlimited, and its information processing and storage capabilities can always meet the network requirements
4.1.2. Energy Consumption Model
The energy of sensor nodes is mainly used to transmit data, receive data, and process data [16]. Figure 2 shows the energy consumption model of sensor.
Let and denote the energy consumption of sensor related to transmitting data and receiving data, respectively. Similar to the model of sensor energy. Consumption described in [17], can be defined aswhere , , and are the energy consumption of transmitter, energy consumption of receiver, and energy consumption of amplifier, respectively; and are coefficient amplify of free space and coefficient amplify of multipath, respectively; is the energy consumption of 1bit data processing related to node, is bits of data; is the distance between the transmitter and receiver; and is the critical communication distance.
4.2. LEACH Algorithm
The LEACH algorithm divides the working process into several rounds, and each round is composed of clustering stage and data transmission stage. Details of LEACH are described as follows.
4.2.1. Clustering Stage
In the LEACH algorithm, whether or not, a nodeinside a cluster to be assigned as cluster head is determined by cluster head selection threshold described by equation (3). Namely, a node is assigned as a cluster head if is greater than a uniformly distributed random number between 0 and 1.where is the percentage of cluster head in the total number of nodes in the WSNs, is the number of running rounds, and is the noncluster head set in the cycle of .
Once a node is assigned as a cluster head, it should broadcast signal, and each noncluster head according to the received signal strength joins in the nearest cluster.
4.2.2. Data Transmission Stage
In the data transmission stage, each node within cluster sends monitoring data to the cluster head in sequence. After fusing the received data, the cluster head transmits data to the base station.
5. The Proposed MHRAPT Algorithm
Using models described in Sections 4, this paper proposes the MHRAPT algorithm to optimize and balance energy consumption of WSNs. The overall framework of the MHRAPT algorithm is shown in Figure 3.
According to the overall framework of MHRAPT algorithm, some details related to the cluster head selection are discussed, the working node selection and data transmission path selection in this section.
5.1. Strategy for Cluster Head Selection
Cluster head selection is performed in the cluster routing algorithm based on the cluster head selection threshold. Suppose sensor nodes are randomly distributed in the square area of . The optimal number of cluster head [18] and the optimal percentage of cluster head to the total number of all nodes are shown in the following:
In equation (5), the cluster head selection threshold is constructed by probability [10], factor relating to distance between and base station, and remaining energy factor .wherewhere and are weight parameters of and, at the same time, ; , is the coordinate of base station, is the coordinate of node , , and ; and is the remaining energy of , and is the initial energy of . Besides, is the node set that has not been selected as the cluster head in the cycle of .
Observing equations (4)–(8), it is obvious that some nodes with properties such as being closer to base station and larger remaining energy have large cluster head selection threshold, thus having greater probability of being selected as the cluster head. In addition, nodes selected as the cluster head are added to the cluster head set , and the nodes not selected as the cluster head are added to the noncluster head set .
5.2. Strategy for Working Node Selection
It is obvious that using all nodes in WSNs to work may consume excess energy. Therefore, it should partition each cluster to reducing number of working nodes while guaranteeing network coverage.
An example is used to describe in Figure 4 to illustrate the details of partition. Assume that the farthest distance between cluster head and cluster member is and the maximum sensing radius of node is . Thus, the cluster’s coverage area is a circle with the position of cluster head as the center and a radius . is defined as the circular area with the position of cluster head as the center and as the radius; is the ring area with the position of cluster head as the center and as the inner radii and outer radii, respectively. It can be found that the area of cluster may be divided into eight parts which are marked as ①~⑧, respectively.
In Figure 4, it is clear that sensing range of nodes in each part of areas and nodes in each part of areas can cover the entire cluster since the maximum sensing radius of node is .
So, it should, respectively, choose working nodes in each part of the entire cluster to guarantee sensing range of nodes covering the entire cluster. In addition, it can compare the remaining energy of node with the average remaining energy of all nodes described in equation (9) to determine whether or not assign nodeis the working node.
In equation (9), is the set of all nodes within the cluster, is the remaining energy of node , is the cardinal of the . Specifically, if , the node joins in the working node set . On the contrary, the node joins in the sleep node set . Assuming the remaining energy of each node in a part of cluster less than , it should assign the node with the largest remaining energy as the working node.
5.3. Strategy for Data Transmission Path Selection
In the data transmission phase, multihop transmission strategy can be used to reduce energy consumption caused by long distance singlehop data transmission. This paper constructs path tree which assigns cluster head as the branch node so that each cluster head can transmit data to the base station along its branch path. The path tree between the base station and cluster head is shown in Figure 5.
Models of path tree construction are described in the following:where is a new cluster head set by sorting the elements in the cluster head set , is the cardinal of , is the th cluster head, is the coordinate corresponding to , and is the coordinate corresponding to base station. It can conclude the details of path tree construction as follows. Firstly, sorting cluster head according to the distance between cluster head and base station, cluster head should choose the cluster head closer to the base station as parent node. Secondly, it successively assigns the parent node to each cluster head according to ascending order of the distance between the cluster head and the base station. Now, taking as an example (Figure 6), it chooses the cluster head , , and in to display the details related to path tree construction.(Step 1)Add first branch node of path tree and record path information.
According to equations (10) and (11), cluster head closest to the base station, so as described in equation (12) can directly choose the base station as the parent node of itself (Figure 6(b)). Meanwhile, as described in equations (13), (14), and (15),records path information itself.where(Step 2)Add cluster head other than to path tree, and record path information of themselves.
Assuming that the cluster head of currently selected parent node is ( and ), the set of all optional parent nodes of is defined as . Specifically, in Figure 6(c), and .
Whether or not choosing as the parent node of the is determined by the path weight described inwhere
Observing equations (16) to (20), it can be concluded that path weights are positively correlated with the remaining energy of and negatively correlated with the energy consumption of data transmission from to , respectively. Thus, it may choose the node with the largest path weight in the as the parent node of and record path information related to .(Step 3)Determine whether or not should be assigned children nodes of the base station.
After selecting the parent node, can obtain the total communication energy consumption by searching its record information first. Then, total energy consumption related to direct communication between and base station can be obtained by equation (14). Therefore, it decided whether should be assigned as children nodes of the base station by condition threshold described in
If , should be assigned as children nodes of the base station and update its path information, else, not.(Step 4)Determine whether or not path tree is constructed completely.
If current cluster head is the last element of , it means the path tree is completed; otherwise, it will go back step 2 to select the parent node of the next cluster head. As shown in Figure 6(d), sequentially execute step 2, step 3, and step 4 to select the parent node of cluster head and so on, until all cluster heads in have been selected.
In summary, the pseudocode related to path tree constructing is shown in Pseudocode 1.

The symbolic instructions in the path tree building steps above are shown in Table 1.
5.4. MHRAPT Algorithm
The MHRAPT algorithm improves the traditional methods including cluster head selection, working node selection, and data transmission path selection. The flow chart of MHRAPT algorithm is shown in Figure 7.
In order to clearly describe the MHRAPT algorithm, some pseudocodes are shown in Pseudocode 2.

6. Simulation Results and Analysis
In this section, it uses the performance comparison of different approaches to demonstrate the advantages of the proposed MHRAPT algorithm.
6.1. Experimental Parameters
In order to verify the feasibility and effectiveness of the proposed MHRAPT algorithm, it is compared with three algorithms IMHTLEACH [14], DMATEB [15], and CEED [19] in terms of cluster head energy consumption, network energy balance, and network node survival time through MATLAB simulation platform.
Assume that sensor nodes are randomly deployed in a monitoring area with an area of , and base station is located at the center of the monitoring area (Figure 8).
The parameters used in the simulation are given in Table 2.
6.2. Cluster Head Energy Consumption
6.2.1. Transmission Path of Cluster Head
When cluster head transmits data to base station, it will cause different energy consumptions due to different transmission paths. Taking the network running to the 500th round as an example, Figure 9 shows the cluster head transmission paths in the CEED, DMATEB, IMHTLEACH, and MHRAPT.
(a) CEED (500th round)
(b) DMATEB (500th round)
(c) IMHTLEACH (500th round)
(d) MHRAPT (500th round)
Comparing the four subgraphs in Figure 9, under the condition that cluster heads are located at the same position, the cluster head transmission path of the CEED algorithm adopts chain structure, so that the data transmission appears to be oriented away from the base station. However, the cluster head transmission paths of DMATEB, IMHTLEACH, and MHRAPT algorithms adopt tree structure to avoid the deviation and improve the stability of data transmission from cluster head to base station. However, the data transmission paths of cluster heads related to three algorithms are very different due to their different path selection strategies. The MHRAPT algorithm takes the directivity and path weight of the data transmitted from the cluster head to the base station into full consideration to construct the path tree as the data transmission path of the cluster head. Comparisons of four algorithms demonstrate the effectiveness of the MHRAPT algorithm.
6.2.2. Energy Consumption of Cluster Head
Figure 10 shows the curve of total energy consumption of cluster head. It describes the energy consumption of transmitting between the cluster head and the base station, over the number of the network running rounds.
In this figure, the curves of four algorithms all show an upward trend, but they have different rates of rise. It is clear that when network runs to the 900th round, the rising rate of the corresponding curve of four algorithms decreases. The reason is that the number of selected cluster heads decreases due to the death of a large number of nodes in the network. It is clear that energy consumption of the MHRAPT algorithm is always lower than that of the other three algorithms. Specifically, when the network runs to the 1100th round, the total energy consumption of the cluster head of CEED, DMATEB, IMHTLEACH, and MHRAPT algorithms is 15.2732 J, 10.5168 J, 9.3494 J, and 7.0444 J, respectively. Compared with the other algorithms, the MHRAPT algorithm saves 53.9%, 33.1%, and 24.7% of energy, respectively. The above analysis shows that the MHRAPT algorithm can effectively reduce cluster head energy consumption.
6.2.3. Average Remaining Energy of Cluster Head
Figure 11 shows the average remaining energy of cluster heads of CEED, DMATEB, IMHTLEACH, and MHRAPT at different times during the network operation.
As can be seen from this figure, the curves corresponding to the four algorithms keep decreasing; that is, the average residual energy of the cluster head keeps decreasing, but the curve corresponding to the MHRAPT algorithm is always higher than curve corresponding to the other three algorithms. Specifically, when the network runs to the 1000th round, the average remaining energy of the cluster head of CEED, DMATEB, IMHTLEACH, and MHRAPT algorithms is 0.0343 J, 0.0599 J, 0.0604 J, and 0.1329 J, respectively. Compared with the other three algorithms, the average remaining energy of the cluster head of the MHRAPT algorithm is 74.2%, 54.9%, and 54.6% higher, respectively. This shows that in the same running time, the MHRAPT algorithm can effectively save the energy consumption of cluster head.
6.2.4. Balance of Energy Consumption of Cluster Head
Meanwhile, in order to measure the balance of energy consumption of cluster head, the proximities and of cluster head are introduced in equations (22) and (23), respectively.
In equations (22) and (23), and are proximity of maximum remaining energy and minimum remaining energy to average remaining energy of cluster head, respectively, is the average remaining energy of all nodes, is the maximum remaining energy, and is the minimum remaining energy. The smaller and are (that is, and are closer to ), the more balanced the cluster head energy consumption is. The parameter indexes of the cluster head of CEED, DMATEB, IMHTLEACH, and MHRAPT algorithms are shown in Table 3.
It can be seen from Table 3 that maximum remaining energy , minimum remaining energy , and average remaining energy of the MHRAPT algorithm are 0.6030 J, 0.4455 J, and 0.5495 J, respectively. Compared with the other three algorithms, the remaining energy of the cluster head of the MHRAPT algorithm is the largest. In addition, of the MHRAPT algorithm is 9.74%, which is 71.24%, 14.93%, and 23.76% lower than those of the other three algorithms, indicating the maximum remaining energy is the closest to the average remaining energy of the cluster head of the MHRAPT algorithm. Similarly, of the MHRAPT algorithm is 18.92%, which is 57.3%, 50.79%, and 32.9% lower than those of the other three algorithms, indicating the minimum remaining energy is the closest to the average remaining energy of the cluster head of the MHRAPT algorithm. According to the above analysis, the MHRAPT algorithm can effectively balance energy consumption.
6.3. Network Energy Balance
Network nodes are deployed at different locations in the monitoring area. The remaining energy of each node is different at each round. Taking the network running to the 500th round as an example, it can prove the validity of the MHRAPT algorithm for balancing network energy consumption by comparing the residual energy of nodes in different locations in the CEED, DMATEB, IMHTLEACH, and MHRAPT.
In Figure 12, square box indicates the base station, which is located at the center of the monitoring area. The distribution of the remaining energy of nodes in Figures 12(a)–12(c) are approximately convex; i.e., the remaining energy of nodes located near the center of monitoring area is higher and far from the center of monitoring area is lower, and the difference of remaining energy between nodes is large. However, the distribution of remaining energy of nodes in Figure 12(d) is approximately horizontal, indicating that no matter whether it is a node in the center of monitoring area or a node far from the center of monitoring area, the difference of remaining energy between nodes is small. The above analysis shows that the MHRAPT algorithm can effectively balance network energy. Meanwhile, in order to illustrate the change of total remaining energy of all nodes in the four algorithms, Figure 13 shows the trend of total remaining energy of all nodes in the network.
(a) Remaining energy of CEED
(b) Remaining energy of DMATEB
(c) Remaining energy of IMHTLEACH
(d) Remaining energy of MHRAPT
It can be shown from Figure 13 that the total remaining energy corresponding to four algorithms decreases as the network running time increases. During network operation, the total remaining energy corresponding to the MHRAPT algorithm is always greater than the other three algorithms. When the total remaining energy of the network is 0, the round of running of CEED, DMATEB, IMHTLEACH, and MHRAPT is 1201, 1196, 1329, and 1577, respectively. This means that the total remaining energy of the MHRAPT algorithm is reduced to 0 at the latest, which indicates that the MHRAPT algorithm has the longest energy utilization time; i.e., the MHRAPT algorithm can effectively reduce network energy consumption and prolong energy utilization time.
6.4. Network Node Survival Time
In the process of network operation, with the increase of node energy consumption, dead nodes will gradually appear in the network. The number of survival nodes of WSNs versus the number of round running relating to different algorithms is given in Figure 14.
It can be seen from Figure 14 that with the operation of the network, the curves corresponding to four algorithms have a clifflike downward trend. When the first dead node appears in the network, the round of running of CEED, DMATEB, IMHTLEACH, and MHRAPT is 410, 439, 617, and 864, respectively. Compared with the other algorithms, the MHRAPT algorithm is the latest when the first dead node appears and prolongs the death time of the first node: 110.7%, 96.8%, and 40%, respectively. Besides, compared with the other algorithms, the MHRAPT algorithm prolongs the death time of all nodes (31.3%, 31.9%, and 18.7%, respectively). This is because the MHRAPT algorithm preferentially uses the working nodes with large residual energy in each round of operation and constructs the path tree for the cluster head when transmitting data, thereby effectively delaying death time of the node. According to the above analysis, the MHRAPT algorithm can effectively prolong the life cycle of WSNs.
7. Conclusions
It is important to solve the problem of sensor node energy consumption in WSNs. Based on the LEACH algorithm, this paper comprehensively considers the impact of cluster head selection, working node selection, and data transmission path selection on network energy consumption, and the MHRAPT algorithm based on path tree is proposed for network energy reduction and balance. This algorithm combines the probability of node being selected as cluster head, the distance factor between node and base station, and the node’s residual energy factor to improve cluster head selection threshold. Within each cluster, an eightpart region partition method is introduced to reduce the number of working nodes; besides, a path tree is constructed and the transmission path from the cluster head to the base station is optimized too. The proposed MHRAPT algorithm can effectively reduce cluster head energy consumption, balance network energy consumption, and prolong the network life cycle.
Data Availability
Supporting data come from our modeling and simulation.
Conflicts of Interest
The authors declare that they have no conflicts of interest.
Acknowledgments
This work was supported by the National Science Foundation Council of China (61771006, 61976080, U1804149, and 61701170), the Key Research Projects of University in Henan Province of China (21A413002, 19A413006, and 20B510001), the Programs for Science and Technology Development of Henan Province (192102210254), and the High Quality Postgraduate Demonstration Course Program of Henan University (English Professional Courses) (SYL18030207).