A WSN can be viewed as a distributed and self-organized network which consists of many miniature sensor devices mostly assigned throughout the sensing area randomly [1]. Recently, advance in the technology of sensor networks have been highly recognized to implement various large-scale wireless sensor technology applications such as environment monitoring, health care, agriculture, military and smart home [2,3,4]. Meanwhile, there are still numerous research fields remaining to be studied in WSN applications, including localization, data fusion, data transmission and energy efficiency. The energy shortage of sensor nodes is a crucial problem in terms of prolonging the network lifetime. Rationalizing the energy distribution of sensor nodes is a crucial challenge to improve network performance [5, 6].

Wireless routing protocol is a hot topic in the research of distributed sensor networks. The routing protocol of sensor network is responsible for the reliable transmission of data between source node and destination node, including routing selection and data forwarding. According to whether the network topology is hierarchical, network routing protocols can be classified as flat routing protocols and layered routing protocols [7].

Flat routing protocols include flooding protocol [8,9,10], sensor protocols for information via negotiation (SPIN), directed diffusion (DD) protocol. The planar routing protocol is applicable to the network with planar structure, all nodes have equal status, and the protocol is relatively simple. There are lots of relay nodes in the transmission from the source node to the destination node, and they can share the network load. However, the organization of nodes, the establishment of routing, the control and maintenance of the overhead need to occupy a large amount of bandwidth, thereby limiting the transmission rate of network data greatly. In addition, when the network scale is large, data transmission requires consuming large amounts of energy, and the scalability of the network is poor. Motivated by this aspect, the flat routing protocol applies only to smaller networks.

Layered routing protocols mainly used in hierarchical network, it divides the whole network into multiple clusters [11]. The layered protocol is proposed to reduce network resource overhead, which effectively can prolong the whole network cycle [12]. Compared to the flat routing protocols, hierarchical routing has great advantages in energy efficiency, transmission delay and packet loss rate, therefore, it is necessary to adopt the routing protocols in large networks. In the process of dividing the clusters, it can be divided into uniform clustering and non-uniform clustering techniques [13]. Both methods have their respective characteristics, the former can save the calculation cost of re-planning cluster formation, while the latter can mitigate the problem of hot nodes [14].

Recently literature shows that in the period of data dissemination, MA deployed in sensing field can reduce the network load, overcome asynchronous transmission, and decrease the loss packet rate [15, 16]. A mobile agent that roam in sensing field is controlled by autonomous programs, and it takes charge of aggregating data packets from the CHs of the whole network in complicated network environment intelligently. Many studies have shown that deploying MAs in the sensing area can facilitate effective data propagation and consolidation in WSNs.

In this paper, we propose an effective data aggregation algorithm based on empower Hamilton loop for WSNs, we combined the PEGASIS algorithm and the Hamilton loop algorithm, through a mixture of single-hop and multi-hop mechanisms, and includes a mobile agent (MA) node on the Hamilton loop, MA is responsible for receiving and fusing CHs on the path. Network performance analysis result show that the proposed routing algorithm can effectively extend network life cycle, balance network overhead and decrease propagation latency.

The rest of the paper is organized as follows. In “Related work” section, we discuss the related work of our research. “Our proposed energy-efficient routing algorithm” section provides experimental model required. In “Our proposed algorithm” section, we illustrate the algorithm in the experiment. “Performance evaluation” section presents simulation results. Finally, we make a conclusion on the current work and future plan in “Conclusion” section.

Related work

In the recent, many researchers take more efforts into using network energy properly to improve network performance [17, 18]. The routing protocols are classified into two categories to address the energy consumption problem, as the aforementioned techniques, flat routing protocols apply only to smaller networks [19], therefore, we adopt hierarchical routing protocol with respect to the clustering process.

As we all known, A classical hierarchical routing algorithm, low energy adaptive clustering hierarchy (LEACH) has been proposed in [20]. In LEACH protocol, CH collects and process network information resources from its own cluster members (CMs), and each CH transmits the data to the BS by single hop. The protocol stipulates that new CH nodes are randomly elected in each round to balance the load of sensor nodes and extend the network life cycle. The disadvantage is that the unreasonable deployment of CHs causes the consequence of unbalanced energy consumption in certain parts of the network region. Especially those nodes far away from the BS will experience premature energy exhaustion. Later on, Liu et al. [21] put forward a Genetic Algorithm based LEACH (LEACH-GA) to utilize genetic algorithm to determine the selection of CHs optimally, the algorithm optimize the threshold of CH selection, but did not take the remaining energy of CH into account.

In [22, 23], a chain-structured routing protocol, power efficient gathering in sensor information system (PEGASIS) is put forward, it is based on greedy algorithm to establish network topology. The main routing of PEGASIS is that sensor node forwards data packet to the nearest node by forming a chain among the nodes. Apparently, the shorter transmission distance become, the smaller required energy consumes in each round [24]. Generally speaking, PEGASIS reduces the energy consumption by shortening the distance of transmission, while it will cause the CHs in vicinity of the base station to relay more data and increase the transmission delay. So in this paper, in order to make up for the deficiency of this protocol, we did not use this algorithm to traverse the entire network completely, but combined with Hamilton loop algorithm to complete the data communication between networks. There are many researches on the combination of cluster and chain. Zarei et al. [25] proposed a distributed routing algorithm based on clustering routing protocol (CBRP), which is a hybrid protocol architecture cluster and tree. CBRP adopt single-hop mechanism to deliver the data packet of root node to BS. However, the inestimable shortcoming is that it contains large amounts of non-data messages between sensor nodes when delivering data to BS, leading to extra communication overhead.

EEUC (Energy Efficient Uneven Clustering) [26] is an energy efficient clustering routing algorithm. The basic principle of the algorithm is as follows. Firstly, several candidate cluster head nodes are elected by random function. Secondly, the competitive radius of CHs is measured according to the Euclidean distance between each CH to BS. Finally, when the distance between two CHs is less than their competitive radius, high-energy nodes are appointed as their joint CHs. The equation for computing the competitive radius is as follows,

$$R_{c} = (1 - c\frac{{D_{max} - D(S_{i} ,BS)}}{{D_{max} - D_{min} }})R_{c}^{0}$$

where \(R_{c}^{0}\) is a fixed value, it merely needs to guarantee normal communication between nodes? \(c\) is a constant, and the simulation result proves that the network performance achieves the most ideal effect when the optimal value is 0.5. Symbol \(D_{max}\) and \(D_{min}\) are the maximum and minimum distance of CH to BS separately, and \(D(S_{i} ,BS)\) is the distance from current CH to BS. It is obviously that the smaller the competitive radiuses of the CH node near the base station, the smaller the number of member nodes it contains, and it will have enough energy to serve as the relay node in the next rounds. This protocol can effectively alleviate the problem of non-uniform energy depletion, thus extending the network life cycle.

Recently, Scholars have invested more energy in the design, deployment and management of MA. It is a promising research direction to solve the lack of network resource by adding MA in WSNs. MA is used as the media for data communication between CHs and BS. DGMA is a data collection algorithm based on MA in dynamic WSNs [27, 28], and the algorithm design an emergency event driven program. The sequence that MA accesses throughout the network has great influences on the routing optimization and network lifetime. The MAs traverse entire sensing field to collect information from each member node. In [29], directional diffusion based on mobile agent (MADD) was proposed. Target sensor nodes propagate the announcing signal to BS when the source node in the target field detects a critical event. According to the received signal packets, the sink node statically picks out the most suitable source node to be accessed by MA, which automatically determines the priority of accessing sensors sequence in the transfer of MA. The hybrid structure algorithm plans a low latency route for WSN, and balance the unique drawback between static and mobile network structure, but it has no obvious effect on improving energy efficiency of sensor nodes.

Our proposed energy-efficient routing algorithm

Basic assumptions

In this paper, to design the clustering protocol, we make some assumptions about network model. The network structure consists of one BS, one MA and \(n\) common sensor devices, these nodes are deployed in sensing filed. Each sensor node has a specific id, the identity of sensor nodes are represented as {S1, S2, S3 ,…, Sn} respectively. We make the assumptions as follows:

  • All sensor devices are stationary and deployed randomly. Each one is denoted by a detailed coordinate.

  • Mobile agent has sufficient energy so that the problem of energy exhaustion is not considered.

  • All sensors are isomorphic and have the same ability to process data.

  • All sensor nodes have the same battery capacity and cannot harvest energy from the external environment.

Network model

In Fig. 1, we set the sensing area as square, the cluster size is not uniform, the base station is mixed in the central point of the sensing region and remains stationary all the time, and MA moves in the sensing area according to the predetermined path. In the below figure, the dotted black line with arrows represents the moving trajectory of MA, and data packets transmission among the clusters can be described as red lines.

Fig. 1
figure 1

Network model

Energy model

We present the simple radio energy consumption model in Fig. 2 [18]. Firstly, the transmitter sends k bit packet, which can be divided into signal generation stage and signal amplifier stage. The energy consumption in the signal amplifier phase is determined by the size of the packet, while the energy consumption in the signal amplifier phase is determined by the size of the packet and the distance between the receiver and the transmitter. Secondly, the receiver is responsible for gathering the packet and it also produces energy expenditure. The specific energy consumption formula can be seen in the following formula (1).

Fig. 2
figure 2

Energy model

This part mainly discusses the energy model of the network. The battery of sensor devices is a fundamental constraint with respect to the energy dissipation of the network. We regard the initial energy of sensor nodes as \(E_{0}\), and these nodes are not rechargeable. Network energy consumption mainly refers to the forwarding and receiving process of data packets, and the specific calculation formulas are respectively stated in formulas (1) and (2) [30]. Transmission energy is expressed as \(E_{Tx} (k,d)\), where coefficient \(k\) is the number of bits that forward signal packet, and \(d\) is the communication distance between the forwarding node and the receiving node.

$$\begin{aligned} E_{Tx} (k,d) &= E_{Tx - elec} (k) + E_{Tx - amp} (k,d) \hfill \\ & = \left\{ {\begin{array}{*{20}c} {k \cdot E_{elec} + E_{fs} \cdot k \cdot d^{2} ,d < d_{0} } \\ {k \cdot E_{elec} + E_{mp} \cdot k \cdot d^{4} ,d \ge d_{0} } \\ \end{array} } \right. \hfill \\ \end{aligned}$$

In this formula, the size of transmission message \(k\) = 2000 bits when each node forwards the packet, and the threshold value \(d_{0} = \sqrt {E_{fs} /E_{mp} }\). Furthermore, in energy settings, the radio energy parameter \(E_{elec}\) = 50 nJ/bit, \(E_{fs}\) = 10 pJ/bit/m and \(E_{mp}\) = 0.0013 pJ/bit/m.

$$E_{Rx} = k \cdot E_{elec}$$

The process of clustering construction

Firstly, each node in the network will randomly generate a number between 0 and 1. If the random number of sensor node is less than the preset threshold value \(T\), the node is elected as the candidate CH. Secondly, the competitive radius of the candidate CH is set. Different from the previous algorithm, the competitive radius of the EEUC algorithm is improved. By combining the Euclidean distance and residual energy between the nodes, the competitive radius of the node is more reasonably planned, as shown in formulas (3)–(6).

$$d = \frac{{D_{i} - D_{min} }}{{D_{max} - D_{min} }}$$
$$e = \frac{{nE_{ri} }}{{\sum\nolimits_{j} {E_{rj} } }}$$
$$R_{i} = \left\{ {\begin{array}{ll} \left[ {\omega \cdot d + (1 - \omega )e} \right]R_{bc} , & \quad k_{1} < c < k_{2} \\ \left[ {\omega \cdot k_{1} + (1 - \omega )e} \right]R_{bc} , & \quad c \le k_{1} \\ \left[ {\omega \cdot k_{2} + (1 - \omega )e} \right]R_{bc} ,& \quad c \ge k_{2} \\ \end{array} } \right.$$

where, \(D_{i}\) is the distance from the common sensor member node to its CH, \(D_{max}\) and \(D_{min}\) are the furthest and closest distances from the node in the sensing region to BS respectively. We use \(c\) to represent the distance between them, and \(e\) is the ratio between the residual energy of the current sensor and the average residual energy of all the sensors. In formula (5), where \(\omega\) is a regulation coefficient that is used to optimize the weight relationship between distance and energy. We set a limit on the value of \(c\), and when it exceeds this range, set a corresponding threshold for it. \(R_{bc}\) is denoted as benchmark competitive radius and take the \(R_{bc}\) = 90 m. Usually, \(k_{1}\) = 0.5 and \(k_{2}\) = 2 are used to reasonably control the competitive radius. When the distance between the two candidate CHs is less than their competition radius, the node with more energy is elected as a CH, and another candidate are disqualified.

After the election process of CHs, ordinary nodes join the appropriate cluster once receiving the broadcast information from CH. In the algorithm, we proposed three factors for selecting cluster, namely, the remaining energy of CHs, the distance from current ordinary node to BS and the distance from the node to other CHs. Finally, the fitness function \(f(i,j)\) of ordinary node \(i\) added to CH \(j\) is proposed, as shown in formula (6).

$$f(i,j) = \alpha \frac{{E_{rj} }}{{E_{0} }} + \beta \frac{{D_{j} }}{d(i,j)} + \varepsilon \frac{{\sum {D_{k} } }}{{\sum {d(i,k)} }}$$

where, \(\alpha\) is the energy regulation coefficient, \(\beta\) and \(\varepsilon\) are the regulation coefficient between the node distance from BS and another node separately. All of these coefficients are between 0 and 1, and \(\alpha + \beta + \varepsilon = 1\).

Our proposed algorithm

Clustering phase

In this paper, we use non-uniform clustering method to divide the whole sensing area. First, each node will generate a random number \(Rand_{i}\). We optimized the previous threshold setting, taking the residual energy of the node into account, and redefined the threshold \(T(n)\) as shown in formula (7).

$$T(n) = \left\{ {\begin{array}{ll} \frac{p}{{1 - p(r\bmod \frac{1}{p})}}\frac{{E_{ri} }}{{\overline{E} }},&\quad n \in G \\ 0, &\quad n \notin G \\ \end{array} } \right.$$

where \(p\) represents the expected percentage of nodes selected as CHs; \(r\) is denoted as the maximum number of rounds in the network; G is a set of common nodes that have not been selected as CHs within \({\raise0.7ex\hbox{$1$} \!\mathord{\left/ {\vphantom {1 p}}\right.\kern-0pt} \!\lower0.7ex\hbox{$p$}}\) cycles; \(E_{ri}\) represents the remaining energy of node \(i\); \(\overline{E}\) represents the average residual energy of the whole sensor network. The calculated threshold \(T(n)\) is compared with the random number \(Rand_{i}\) generated by each node. If \(Rand_{i} < T(n)\), the node is selected as the candidate CH.

Then, BS broadcasts clustering information to the entire sensing area. After receiving the broadcast, the candidate CH determines its competitive radius by using formula (3)–(5) according to the distance from the node to BS and the residual energy of the node. If the distance among the adjacent CHs is less than their competitive radius, the node with more energy is selected as the cluster head node. Once entering the clustering stage, the common node selects a suitable cluster according to the message broadcast by each CH. Taking into account the distance between nodes to BS, the distance between nodes and the residual energy of nodes, the fitness function (6) of each ordinary node is obtained. A node is declared a member node of the cluster when the maximum fitness value between the node and a CH.

Conventional hamilton loop problem

In 1857, Hamilton, a British mathematician, proposed the famous Hamilton circuit problem, which arose when the mathematician wanted to design a plan to travel around the world. Hamilton wanted to travel to all the countries, and he wanted to find a suitable path, starting from the beginning, traveling to all the countries in a certain order, as long as he could not go to the same country repeatedly and finally back to the starting point. From a mathematical point of view, a loop is designed to pass through each vertex (country) once and for all. Subsequently, this problem further evolved into a traveling salesman problem (TSP), namely, the problem of empowering Hamilton loop minimization. It not only guarantees that the constructed path is a Hamilton loop, but also requires that the selection target of the path is the minimum total distance of all paths.

The classic Hamilton algorithm is mainly to find a loop that can traverse all the CHs, so that MA can start from the BS and pass through all the CHs that are required only once and finally return to the starting point. Next, in order to reduce the total cost of MA traversing these CHs, we need to optimize the loop.

In simple terms, this problem can be handled by the enumeration method, but the calculation amount of the method is too large, reaching the number of n-1 factorial, so the enumeration method is not feasible for the complex network environment. Later, heuristic algorithm is proposed to calculate the approximate solution of the problem through the features of some optimal solutions or the features that should not be present, but the solution obtained by this method is not the optimal solution of the problem. We put forward an idea of local optimization to optimize the known Hamilton loop.

Empower Hamilton loop optimization algorithm

Step 1::

Determine the starting point of the cycle with BS. A Hamilton loop is obtained for each CH near BS using the classical algorithm;

Step 2::

Cut across the line (in the formed Hamilton loop, the current CH is regarded as the starting point of cutting, and the intermediate node is isolated, and the other nodes are connected among the three CHs connected to each other), generate an isolated CH;

Step 3::

The isolated CH node is reconnected to the loop to form a new Hamilton loop according to the principle of path energy consumption minimization, the minimum of energy consumption is measured by the weight between the cluster head nodes in formula (9);

Step 4::

If the total weight of the path changes, replace the old loop with a new loop, and take the current CH as the new starting point of the cycle, put back to step 2. Otherwise, move the starting point to the next CH, and enter step 5;

Step 5::

Determine whether the loop is completed, that is, whether the current cluster head node is a base station; if so, the algorithm terminates. Otherwise, go to step 2.

To describe the algorithm above in a brief way, we provide an intuitive process to locally optimize the moving path according to the Empower Hamilton loop optimization algorithm in Fig. 3.

Fig. 3
figure 3

The optimization of moving path

Data transmission phase

In this paper, we combined the PEGASIS algorithm and the Hamilton loop algorithm, through a mixture of single-hop and multiple hops mechanisms, and include a mobile agent (MA) node on the Hamilton loop; MA is responsible for receiving and fusing CHs on the path. Specifically, those cluster head nodes far away from BS adopt PEGASIS algorithm for multiple hops transmission. We use Hamilton loop algorithm to plan an agent itinerary when data is transmitted to CHs close to BS relatively. In the standard of distance division, we mainly decide on the competing radius of cluster head nodes. Usually, the farther away the node from BS, the larger the competition radius of the node is. Therefore, we merely need to set a threshold of \(T_{c}\), and the derivation of \(T_{c}\) follows the formula (8). Where \(c\) is the radius adjustment coefficient, the simulation results show that when \(c = 0.5\), the entire network performance is optimal.

$$T_{c} = c \cdot \frac{{\sum\nolimits_{i}^{m} {R_{i} } }}{m}$$

Furthermore, in Fig. 4a–e are used to represent CHs in different clusters respectively, meanwhile number represents the packets size of each CH calculated, d is denoted as the distance between two CHs. The weight relationship between CHs is presented by the distance between them and the size of their own packets, in the following work, we can find an optimal MS movement path through the weight relationship between them.

Fig. 4
figure 4

Weight relationship between CHs

Specific weight calculation formula is satisfied (9), where \(\alpha\) is coordination coefficient, \(d(i,j)\) represents the distance between CH \(i\) and \(j\), \(number(i)\) is denoted as the packet size of CH \(i\).

$$Weight_{i} = \mathop {\hbox{max} }\limits_{j} \left[ {\frac{1}{\alpha \cdot d(i,j) + (1 - \alpha ) \cdot number(i)}} \right]$$

Performance evaluation

In the part of experiment, we have simulated network environment in Matlab on Microsoft Windows 7 professional platform to analyze the performance of our proposal. For convenience of comparison, LEACH-GA algorithm, CBRP algorithm and EEUC algorithm were used for comparison [22, 25]. Using the energy consumption model mentioned in this article, the measurement results of each algorithm for the energy consumption from nodes, the packet forward rate of packets and delay are presented. The values of relevant experimental parameters are shown in Table 1.

Table 1 Simulation parameters

In Fig. 5, The network lifetime under different algorithms is analyzed. Compared with other algorithms, the proposed algorithm greatly extends the life cycle of the network, which is mainly reflected in the longer stable stage of the whole network and the steeper slope of node death. It is apparent that our proposed algorithm did not appear the node death phenomenon until the number of rounds is close to 1000, while all the nodes of other algorithms have almost died during this time period, and LEACH-GA algorithm has crashed when it run to 724th rounds. Based on the idea of empowering Hamilton loop to collect data packets, an optimal agent traverse route is planned. It not only extends the longevity of the node, but also achieves the effect of balanced energy consumption and alleviates the problem of energy hole.

Fig. 5
figure 5

Network lifetime

As is clearly shown in Fig. 6, in comparison with the sum of energy consumption among the other three algorithms, it is obvious that our proposed scheme is superior to other algorithms in terms of the stability period and the network lifetime. The gentler the slope is, the less energy will be consumed per round, indicating that our algorithm is more energy efficient compared with other algorithms. Our proposed algorithm will consume 10.5 joules of energy per 100 rounds approximately, while the energy consumption of the other three algorithms are 11.3, 12.2 and 14.2 respectively. As can be seen from the chart, when the number of rounds reached 1200, the total energy of the network was exhausted, while other algorithms have a network life of less than 1000 rounds. In short, the less energy consumed, the longer the lifetime of the entire network.

Fig. 6
figure 6

Energy consumption

Network average transmission delay is another important standard to evaluate network performance. The average delay time between the beginning of propagating a data and its arrival at the other node required to receive the data [31, 32]. Where, the calculation formula of the average delay is obtained from formulas (10)–(12). From the simulation performance of the experiment in Fig. 7, the LEACH-GA algorithm and the proposed algorithm proposed are relatively low in delay, and the delay difference value between our algorithm and CBRP algorithm is 80 ms and 15 ms with respect of time delay, Apparently, our algorithm is an ideal compromise algorithm, it combines the advantages of LEACH-GA and CBRP algorithm for alleviating the energy consumption and reducing the transmission delay respectively.

$$T_{averageround} = \frac{{T_{Networklifetime} }}{{Round_{{\rm max} } }}$$
$$Latency_{nodes} = \sum\limits_{i}^{n} {(T_{receive}^{{S_{i} }} - T_{send}^{{S_{i} }} )}$$
$$AverageLatency = \frac{{Latency_{nodes} }}{{T_{averageround} }}$$

In Formula (10), we calculated the average time to run a round. Symbol \(Round_{{\rm max} }\) represents the maximum rounds in the network life cycle. \(T_{send}^{{S_{i} }}\) and \(T_{receive}^{{S_{i} }}\) are time periods for sending and receiving packets respectively.

Fig. 7
figure 7

Transmission delay


In this paper, Empower Hamilton Loop based Data Collection Algorithm by Mobile Agent is proposed in Uneven Clustering for WSN. With the aim of alleviating the problem of energy hole, we adopt a non-uniform clustering method, the method mitigate transmission load of the nodes in vicinity of the base station. Furthermore, to further balance and decrease the resource expenditure of the entire network, we combined the PEGASIS algorithm and the Hamilton loop algorithm, adopts a mixture of single-hop and multiple hops mechanisms, and includes MA on the optimal Hamilton moving loop, MA is responsible for aggregating and fusing data packets from the CHs on the loop. Network performance analysis results show that the proposed routing algorithm can effectively prolong network life cycle, equalize energy consumption and reduce network delay. Although LEACH-GA algorithm delay was slightly lower than our algorithm, but it will consume the most energy consumption of each round, so its life cycle is short. The energy saving effect of our algorithm is better than CBRP and EEUC algorithm, meanwhile, the efficiency of two algorithms are not ideal in terms of transmission latency. Therefore, the proposed algorithm is more reliable and effective compared to other protocols. In the future, we intend to adjust the number of MA and change the value of the benchmark competition radius to specifically analyze the influence of these variables on network performance.