Cluster Head Relocation Based on Selfish Herd Hypothesis for Prolonging the Life Span of Wireless Sensor Networks

Clustering achieves energy efficiency and scalable performance in wireless sensor networks (WSNs). A cluster is formed of several sensor nodes, one of them selected as the cluster head (CH). A CH collects information from the cluster members and sends aggregated data to the base station or another CH. In such a hierarchical WSN, some nodes are possibly moveable or nomadic (relocated periodically), while others are static. The mobility of sensor nodes can improve network performance and prolong network lifetime. This paper presents the idea of mobile, solar-powered CHs that relocate themselves inside clusters in such a way that the total energy consumption in the network is reduced and the network lifetime is extended. The positioning of CHs is made in each round based on a selfish herd hypothesis, where the leader retreats to the center of gravity. Based on this idea, the CH-active algorithm is proposed in this study. Simulation results show that this algorithm has benefits in terms of network lifetime and in the prolongation of the duration of network stability period.


Introduction
Nowadays, wireless sensor networks (WSNs) are used in various application areas such as ecological monitoring, traffic control, healthcare, and industrial automation.A WSN contains sensor nodes that can sense the physical environment for data acquisition, data computation, and communication [1].
A sensor node has limited processing capabilities and contains signal-processing circuits, microcontrollers, and wireless transmitters or receiver antennas.Sensor nodes send their collected data to the base station (BS), if the BS is within communication range.Otherwise, the data are sent to other sensor nodes through routing protocols.A BS is a device that has more energy capacity, processing power, and memory than common sensor nodes.
The batteries of the sensor nodes do not require recharging from the time these nodes are randomly deployed in the sensing fields.Therefore, prolonging the lifespan of a WSN is a hot research topic.The lifespan of a WSN can be measured by using certain parameters such as the time that all of the sensor nodes lose their transmitting capabilities (all dead).Various energy efficiency techniques can prolong the lifespan of WSNs, such as the following:
Routing techniques affect the energy conservation of sensor nodes since the communicating module of a sensor node consumes considerably more energy than the computing module [16].The energy consumed during communication mostly depends on the distance between the sending and the receiving nodes.Therefore, many routing solutions have been proposed on how to optimize the distance.
Clustering in hierarchical WSNs reduces the number of nodes, which send data to the BS.Several nodes form a cluster, and one of them is elected as the cluster head (CH).The CH collects information from normal nodes and sends aggregated data to the BS or to other CHs (Figure 1).Thus, CHs consume considerably more energy than normal nodes and die faster.
Routing techniques affect the energy conservation of sensor nodes since the communicating module of a sensor node consumes considerably more energy than the computing module [16].The energy consumed during communication mostly depends on the distance between the sending and the receiving nodes.Therefore, many routing solutions have been proposed on how to optimize the distance.
Clustering in hierarchical WSNs reduces the number of nodes, which send data to the BS.Several nodes form a cluster, and one of them is elected as the cluster head (CH).The CH collects information from normal nodes and sends aggregated data to the BS or to other CHs (Figure 1).Thus, CHs consume considerably more energy than normal nodes and die faster.The majority of clustering algorithms randomly select several sensor nodes as CHs.This random selection of CHs causes uneven energy consumption.Consequently, the energy load on every sensor node should be balanced in order to avoid a reduction of network lifespan.Many factors, such as the number of cluster members and their distance to the BS, can impact on the energy consumption of CHs [17].Also, from a global viewpoint, the energy dissipation of the network is affected by the distribution of the CHs.For example, if the CHs are close to one another, energy dissipation will be unevenly distributed.The location of CHs affects network lifetime significantly.By relocating the CHs to better locations, network load can be balanced and lifetime can be prolonged.From another viewpoint, the ability of the sensors to sense a particular phenomenon is spatially limited.Most of the sensors must be in their location most of the time.Moving or relocating all the sensors (in the clusters) from their initial positions can cause two serious problems:

•
It is possible that the sensing of the phenomenon (in the whole area and throughout the time of interest) will not be done correctly.

•
It is possible that the sensor nodes will not have enough energy to move during the next round (a concept that will be discussed later).
To this direction, the motivation of our work was to introduce an algorithm that will relocate a small number of CHs (usually 5-7 CHs in each round) in a hierarchical WSN in order to prolong network lifetime.
In this article, we propose an algorithm (called CH-active) that relocates CHs.By moving to the center of masses, the CH minimizes the distance to the cluster members and saves energy during receiving.The CH also helps the other cluster members as they save energy (the distance decreases) while transmitting to the CH.The majority of clustering algorithms randomly select several sensor nodes as CHs.This random selection of CHs causes uneven energy consumption.Consequently, the energy load on every sensor node should be balanced in order to avoid a reduction of network lifespan.Many factors, such as the number of cluster members and their distance to the BS, can impact on the energy consumption of CHs [17].Also, from a global viewpoint, the energy dissipation of the network is affected by the distribution of the CHs.For example, if the CHs are close to one another, energy dissipation will be unevenly distributed.The location of CHs affects network lifetime significantly.By relocating the CHs to better locations, network load can be balanced and lifetime can be prolonged.From another viewpoint, the ability of the sensors to sense a particular phenomenon is spatially limited.Most of the sensors must be in their location most of the time.Moving or relocating all the sensors (in the clusters) from their initial positions can cause two serious problems:

•
It is possible that the sensing of the phenomenon (in the whole area and throughout the time of interest) will not be done correctly.

•
It is possible that the sensor nodes will not have enough energy to move during the next round (a concept that will be discussed later).
To this direction, the motivation of our work was to introduce an algorithm that will relocate a small number of CHs (usually 5-7 CHs in each round) in a hierarchical WSN in order to prolong network lifetime.
In this article, we propose an algorithm (called CH-active) that relocates CHs.By moving to the center of masses, the CH minimizes the distance to the cluster members and saves energy during receiving.The CH also helps the other cluster members as they save energy (the distance decreases) while transmitting to the CH.
The idea of moving the CH to the center of masses is based on the behavior of many animal species, as elaborated in the selfish herd hypothesis by Hamilton [18].In this hypothesis, selfish prey group members move to the center of the group in order to avoid predator attack from outside.Hamilton argues that individuals within the herd behave selfishly by moving towards the center, leaving the other members on the periphery of the herd and exposing them to attack by predators.The dominant members are placed in a favorable and secure position and the subordinate members move into the higher risk zone.The domain of risk can be estimated by the construction of a Voronoi diagram around the members of the group.Such architecture is formed by a set of convex polygons, where all the points, inside the polygon, are closer to the corresponding member than to any other member in the field.
In our framework, we used the behavior model in the Hamilton theory, but our motivation was completely different.In our algorithm, unlike Hamilton's theory, the movement of the CH is beneficial to this "selfish" CH and also to all other cluster members.The CH protects itself and the other nodes from fast battery drain by shortening the communication distances between sensors.By moving to the center of the masses, the CH minimizes the distance between cluster members and saves energy while receiving data.In our algorithm, the CH also helps other cluster members, as they will save energy while transmitting to the CH.In order to avoid an aggregation of nodes (and thus losing effective coverage of the sensing field), each time after receiving all of the messages, the CH in the CH-active algorithm moves back to the initial position, aggregates data, and sends them to the sink.
The main contributions of the CH-active algorithm are the following ones: 1.
The CH-active algorithm minimizes the energy consumed in the communication module of each sensor node, while it overburdens the CH during cluster formation.CH-active does not use a fuzzy logic (FL) model to predicate the expected residual energy of each sensor node (i.e., the predicated remaining energy for being selected as a CH).Instead of this, CH-active relocates solar-powered CHs.Actually, it relocates a small number of nodes (usually 5-7 CHs in each round) in a WSN, as we shall see in Section 5.As the CH moves to the center of the mass, it minimizes the distance to cluster members and saves energy while receiving data.Also, the CH helps other cluster members because they save energy (the distance decreases) while transmitting to the CH.

2.
For the relocation purpose, an additional solar-powered battery is used only to move CH, and not for processing and communication tasks.In CH-active, only one solar-powered CH (in each cluster) is allowed to move inside this cluster during every round.Solar-powered batteries are used only for relocating the CH in each round for the following two reasons:

•
In some cases, the terrain configuration is harder (e.g., uphill), and nodes demand more energy power, and as a result, we may have an unequal power cost to the WSN nodes.

•
If the solar-powered battery was used additionally for communication tasks, this would neutralize the advantages provided by the CH-active algorithm.If we allow the relocation process itself to drain the original sensor batteries in an unbalanced way, which is caused by different solar power available and different consumption due to terrain configuration, we cannot clearly compare the benefits of our algorithm.Therefore, we assume a (separation) scenario, in which solar-powered battery is used only for relocating the CH in each round, while the battery of the sensor node is used only for communication and processing tasks.

3.
The CH-active algorithm is beneficial, even if we have no solar-powered time periods.In the CH-partially-active algorithm (a modification of CH-active), we examine the situation where CH sensors do not have enough energy (i.e., solar energy is not available) to position themselves in the center of the mass, but they can reach a certain percentage of the distance from their initial position to the center (one part of the path).As we shall see in Section 5, by moving the CH partially to only 25% of the distance towards the center of the masses in a cluster, the lifetime of the WSN is prolonged significantly.To the best of our knowledge, a similar solution has not been proposed.
The CH-active and CH-partially-active relocation algorithms are ideally applied at a WSN application, where changes on the sensing field (data) are rare, while periodical and not intensive reporting is sufficient for the achievement of the application goals.Not intensive reporting means that sensors report to the CH one to more times daily.In such applications, the reporting period (e.g., for radiation measures, pollution reports etc.) often lasts one round.
This article is organized as follows.In Section 2, we discuss the related work on WSNs routing and clustering techniques.In Section 3, we describe the system model in our proposed algorithm.In Section 4 we present our algorithm, while in Section 5 we analyze the algorithm and the simulation results.In Section 6, we conclude this article.

Related Work
Low-energy adaptive clustering hierarchy (LEACH) [16] is a widely referenced routing protocol for WSNs.Many routing protocols in WSNs are improved LEACH versions or LEACH variants [19,20].LEACH is a single-hop self-organizing clustering algorithm, in which the nodes in the network form clusters by self-organization and one of the nodes in each cluster is selected as the CH.All non-CH nodes transmit data to the CHs, which receive and aggregate data before transmitting them to the BS.LEACH minimizes energy consumption in WSNs through cluster formation and data aggregation.In LEACH, communication between BS and CHs is divided into rounds.The role of the CH is done randomly per round.Every round has two states: setup state and steady state.
During the setup state, every sensor node selects a random number between 0 and 1.If this number is less than the threshold T(n), the node becomes a CH.The threshold T(n) is assigned to sensor nodes n and is calculated as follows: where n is the node ID, r is the current round, P is the expected percentage of CH, and G is the set of nodes that are not elected as CHs in the last 1/P rounds.When a node becomes CH, it creates a cluster and defines a TDMA frame for communication with other cluster members.
During the steady state, nodes transmit to the CH.The CH performs the aggregation of the received data and forwards them to the BS.In steady state, CHs allocate time slots to the normal nodes.Each normal node collects sensing data and transmits them to its CH using its designated time slot.After the CH receives all the data packets from its cluster members, it aggregates the data and sends a compressed packet to the BS.After all the data are sent to the BS, the network reverts to the setup state and restarts the cluster formation until the wireless network exhausts all its energy.
There are various WSN applications, where the mobility of sensors is in use, either passive or active.During the passive navigation, under external influences (and not using their own energy) the sensors change clusters inside a round.This complicates the problem of establishing an energy-efficient organization of the sensor network [21].However, there are specific applications, where the sensors move by using their own energy to cover the sensing area dynamically, to replace depleted sensors, or because of the nature of the sensing phenomenon.Therefore, the energy of the sensors of this type becomes an even more critical resource [22].However, some researchers have figured out that sensors, which have the capacity to move with the help of their own energy, could take advantage of the savings in total energy consumption in the network.Ma and Yang in [23] provided a solution of a network that is heterogeneous in terms of the nodes mobility.This network contains a small number of resource-rich specialized CHs.Sensor nodes have limited amount of energy and can only reach nearby nodes within a limited range, while CHs can move to anywhere within the working area.Each CH knows the location and connectivity pattern for all of its sensors.
Banerjee et al. in [24] considered the case where the sensors and the sink are static, and the CHs are mobile and work as relay nodes.The low-energy static sensor nodes sense physical parameters and route the data to the higher energy-rich nodes (called MCHs), which transmit data directly to the BS.The MCHs move within its own cluster to change its neighborhood nodes so as to avoid the fixed set of sensors to continuously forward data to the MCH, which may otherwise result in network partitioning.Thus, a CH can regulate the flow of energy among the sensors in the cluster and, thus it increases the total network lifetime.Three mobile strategies are discussed based on: (i) event, (ii) residual energy and (iii) combination of both (i) and (ii) (i.e., hybrid mobility).In this hybrid strategy, the moving decision is made based on the event and the residual energy.
The LEACH protocol and most of its successors use the radio energy dissipation model.This model calculates the power consumption and attributes energy loss due to channel transmission.The energy consumption on the wireless sensor node depends on the distance of the BS and on the number of transmit and receive operations.The main idea behind many algorithms is to reduce the distances and frequency of communications between the sensor and BS.
The batteries of sensor nodes do not recharge after node deployment.Therefore, we need alternative energy sources, such as solar power.Many proposed solutions [25][26][27] include solar-powered sensors because a solar-powered sensor is more likely to be elected as a CH.The problem with solar power is that this energy source is not permanent.For example, a solar-powered node is elected as CH at the beginning of the round, and after that, it has no energy to carry out its tasks until the end of the round.
From another perspective, WSNs can be studied as bio-inspired systems.Some characteristics of a WSN can be improved, if sensors are organized based on the knowledge of animal "social" behavior [28,29].In order to consider a WSN as a bio-inspired system, it is often useful to observe the behavior of birds in the flock [30][31][32].Ruihua et al. in [33] presented an algorithm that is based on the flock optimization algorithm.Their algorithm takes into account two factors for the CH selection: (i) the minimum distance between the CHs and the cluster members, and (ii) the residual energy of the nodes.
In [34], a WSN using multi-hop routing for communication is considered, and an algorithm, based on Particle Swarm Optimization (PSO), has been implemented for finding the optimal location of the sink.The algorithm presented in [31] suggests a way to establish a minimum distance between CH and its cluster members.This algorithm is based on the migration behavior of a flock of birds in the process of searching for food.
Most of the proposed clustering algorithms overburden the CH during cluster formation.To overcome this problem, many researchers have come up with the idea of fuzzy logic (FL), which is applied in WSN for decision making.These algorithms focus on the efficiency of CH, which could be adaptive, flexible, and intelligent enough to distribute the load among the sensor nodes that can enhance the network lifetime.But unfortunately, most of the algorithms use type-1 FL (T1FL) model.In addition, many clustering algorithms have not considered the expected residual energy, which is the predicated remaining energy for being selected as a CH and running a round.
Lee and Cheng [35] proposed a fuzzy-logic-based clustering approach (namely LEACH-ERE) with an extension to the energy predication to prolong the lifetime of WSNs by evenly distributing the workload.The LEACH-ERE algorithm prolongs the lifetime of the WSN by evenly distributing the workload.It selects the CHs considering expected residual energy of the sensor nodes.LEACH-ERE is more efficient than other distributed algorithms, such as LEACH and CHEF [36] and can be applied to large-scale WSNs.Nayak and Devulapalli [37] proposed an interesting fuzzy logic-based clustering algorithm for WSNs.In their approach, a super-CH (SCH) is elected among the CHs who can only send the information to the mobile BS by choosing suitable fuzzy descriptors, such as remaining battery power, mobility of BS, and centrality of the clusters.A fuzzy inference engine (Mamdani's rule) is used to elect the chance to be the SCH.Their protocol performs better than the LEACH protocol in terms of the first node dies, half node alive, better stability, and better lifetime.In particular, their protocol is more stable and have 20% longer lifetime compared to LEACH.Nayak and Vathasavai [38] proposed a clustering algorithm on the basis of interval type-2 FL model, expecting to handle uncertain level decision better than T1FL model.Based on simulation results, it is concluded that T2FL model provides better scalability, better lifetime compared to T1FL, LEACH single hop, and LEACH multi-hop protocol.
Collotta et al. [39] proposed a fuzzy logic based mechanism that according to the battery level and the ratio of Throughput to Workload defines the sleeping time of sensor devices in an Industrial WSN (IWSN) based on IEEE 802.15.4 protocol.They introduced a Particle Swarm Optimization (PSO) algorithm to obtain the optimal values and parameters of the proposed Fuzzy Logic Controller (FLC), i.e., optimizing the membership functions, by varying their range, to achieve the best results regarding the battery life of sensor nodes.They provided a detailed description of the FLC configuration, a logical analysis of the PSO algorithm for the derivation of best performance conditions values, and simulative assessments, obtained through Matlab simulations.
Finally, Mostafaei et al. [40] addressed the problem of partial coverage in WSNs.They presented PCLA (Partial Coverage with Learning Automata), a novel algorithm that leverages the probabilistic framework of Learning Automata (LA) to find a convenient subset of sensor nodes to ensure partial coverage.We remind that an automaton is a machine designed to automatically follow a predetermined sequence of operations or respond to encoded instructions.LA adapt to changes in the Random Environment and this adaptation is the result of the learning process.Their approach [40] uses the smallest number of sensors at any given time, thus extending WSN lifetime.The PCLA algorithm minimizes the number of sensors to activate for covering a desired portion of the region of interest preserving the connectivity among sensors.In particular, PCLA properly schedules sensors into active or sleep state in order to extend the network lifetime.Precisely, each node runs the PCLA algorithm that first creates a backbone by selecting a number of nodes and leveraging the coverage graph of the network.Then, these nodes use their neighbors to meet the network coverage and connectivity requirements.Simulation results [40] showed how PCLA can select sensors efficiently to satisfy partial coverage area requirements, thus guaranteeing good performance in terms of time complexity, working-node ratio (i.e., the number of nodes to activate), scalability, and WSN lifetime.Moreover, compared to the state of the art, PCLA is able to guarantee better performance.

Network Model
In our framework, the assumptions regarding WSNs are as follows:

•
Data are transmitted rarely, once or a few times daily.

•
The BS is not subject to energy restrictions and has strong communication and computation capabilities.

•
The sensor nodes have enough power to reach the BS.

•
The sensor nodes are energy-constrained and have the same capabilities.

•
Each sensor node can change its transmission power level dynamically in order to adapt to a certain communication distance.

•
A sensor node can switch between run and sleep states under the command of a TDMA order.

•
An additional solar-powered battery is used only to relocate/move CH, and not for processing and communication.

•
The CH has enough time and enough energy in order to move to the optimal location.• CH relocation is done occasionally in order for the CH to achieve an optimal distance from all of the other sensors inside the cluster.

Energy Model
In Figure 2, d is the distance between the transmitting node and the receiving node, while k is the bytes of transmitting data.E elec is the dissipated energy of the transmitting electric circle and the receiving electric circle.These electric circles are equal in this energy model.ε amp is the amplifying power.In the simulation process, we adopted the channel model used in [41].This channel model includes a free-space transmitting model.Therefore, if we transmit k-bit data over a distance d, the energy dissipation in the transmitting parts is: (2)

The CH-Active Algorithm
In this section, we introduce the CH-active algorithm that is based on the selfish herd hypothesis and uses the same concept of round, as that used by LEACH.Each round consists of two states: the setup state and the steady state.In the setup state, we adopted the same function used by LEACH for CH selection.CHs are elected and clusters are formed in this stage.In the steady state, the WSN sends data to the BS.
The steady-state in the CH-active algorithm is quite different from LEACH because it includes solar-powered CH relocations.After all the CHs are chosen, each CH relocates itself to the center of the masses of the cluster.The CH moves to the gravity center of the active nodes.The center of the masses is calculated each time as the center of the live (active) nodes in the formed cluster.This center is roaming slightly inside the cluster in later steps.The center of the mass of each cluster is calculated based on the following equation: where: • K is the number of sensors in the cluster; • ri is the position of each sensor i; • mi is the mass of each sensor i, we assume that all sensor masses are equal; • mtot is the total mass of all sensors in the cluster.
After moving to the center of the masses, the CH collects the data from the cluster members, and relocates itself back to the position it had before relocating to the center of the masses.This is done to avoid the grouping of all the nodes in one-time spot.Then, the CH aggregates data, and sends them to the sink.It is noteworthy that we considered the situation when a CH sensor does not have enough energy to position itself in the center of the mass, but it can reach a certain percentage of the distance from its initial position to the center.In our framework, this modification of the CH-active algorithm is called CH-partially-active algorithm.Algorithm 1 shows the pseudocode for the proposed algorithm(s).In the simulation process, we adopted the channel model used in [41].This channel model includes a free-space transmitting model.Therefore, if we transmit k-bit data over a distance d, the energy dissipation in the transmitting parts is: (2)

The CH-Active Algorithm
In this section, we introduce the CH-active algorithm that is based on the selfish herd hypothesis and uses the same concept of round, as that used by LEACH.Each round consists of two states: the setup state and the steady state.In the setup state, we adopted the same function used by LEACH for CH selection.CHs are elected and clusters are formed in this stage.In the steady state, the WSN sends data to the BS.
The steady-state in the CH-active algorithm is quite different from LEACH because it includes solar-powered CH relocations.After all the CHs are chosen, each CH relocates itself to the center of the masses of the cluster.The CH moves to the gravity center of the active nodes.The center of the masses is calculated each time as the center of the live (active) nodes in the formed cluster.This center is roaming slightly inside the cluster in later steps.The center of the mass of each cluster is calculated based on the following equation: where: • K is the number of sensors in the cluster; • r i is the position of each sensor i; • m i is the mass of each sensor i, we assume that all sensor masses are equal; • m tot is the total mass of all sensors in the cluster.
After moving to the center of the masses, the CH collects the data from the cluster members, and relocates itself back to the position it had before relocating to the center of the masses.This is done to avoid the grouping of all the nodes in one-time spot.Then, the CH aggregates data, and sends them to the sink.It is noteworthy that we considered the situation when a CH sensor does not have enough energy to position itself in the center of the mass, but it can reach a certain percentage of the distance from its initial position to the center.In our framework, this modification of the CH-active algorithm is called CH-partially-active algorithm.Algorithm 1 shows the pseudocode for the proposed algorithm(s).

Simulation Results and Discussion
This section provides a concise and precise description of the experimental results, their interpretation as well as the experimental conclusions that can be drawn.

Simulation Model
To evaluate the performance of the proposed algorithms, we run several simulations that compare LEACH, CH-active, and CH-partially-active.We used MATLAB (R2015a) as the simulation tool.The same set of sensor nodes was used to track network behavior and energy preservation in identical conditions.Simulation saves all of the parameters and sensor states in each simulation step in a five-dimensional matrix.Then, the history data, covering the complete lifetime and every parameter of all sensors, are used to generate precise figures of performance.Table 1 shows the simulation parameters.We randomly placed 100 nodes in two areas.In both areas, the BS is at (0, −100).The data packet size is 2000 bytes and the control signal packet size is 100 bytes.We used the energy model described in the "System model" section.Each node has an initial energy of 2 J.The percentage of the distance that we used in the CH-partially-active algorithm is 25%.
Two important metrics that reflect the performance of our algorithms are: (1) the number of active nodes related to network lifespan (rounds), and (2) total network energy.

Number of Active Nodes
Figure 3 shows the number of active nodes related to rounds.The simulated terrain is 500 m × 500 m wide.The simulation is running until the last node switch off in the CH-active algorithm.The simulation ends when none of the nodes is active anymore (more than 900 rounds in case of the CH-active algorithm).The proposed algorithms showed significant improvement.It can be seen that when the instability period begins, the CH-active algorithm brings an advantage over LEACH in this application.Along with decreasing the number of active nodes, the distance between nodes is increasing, and then moving to the center of active nodes begins to gain a notable advantage.The LEACH algorithm has no more active nodes in the region of 480 rounds.The proposed algorithms have about 40 active nodes at this time.While most batteries are in good condition, both of the proposed algorithms have very similar performances.However, CH-active begins to be more advanced than CH-partially-active, after 40% of the nodes die.It is shown that the rest of the nodes in the following rounds stay active for 10% more rounds, so that the network is alive for a longer period with CH-active than with CH-partially-active.However, the difference in the number of active nodes is not large at any time.This difference does not exceed 10 (in the region of round 500) and in most cases, it is less than 5.
Figure 4 shows the number of active nodes per round on a 1000 m × 1000 m field, with 100 uniformly distributed nodes.The energy assigned to each node at the simulation start is 2 J.Because of their nature, it is expected that CH-active and CH-partially-active algorithms will accomplish better results from the very reconfiguration, when the terrain itself is wider.The optimum exploitation of the proposed algorithms is on a wider terrain, and in a harsh environment with periodical and not intensive reporting.In optimum application, the CH has enough time to move to the gravity center and collect all the data from the appertaining clusters there.After that, CH returns to its initial position and reports to the BS from the initial position.In the meantime, data aggregation is done.Figure 4 shows the number of active nodes per round on a 1000 m × 1000 m field, with 100 uniformly distributed nodes.The energy assigned to each node at the simulation start is 2 J.Because of their nature, it is expected that CH-active and CH-partially-active algorithms will accomplish better results from the very reconfiguration, when the terrain itself is wider.The optimum exploitation of the proposed algorithms is on a wider terrain, and in a harsh environment with periodical and not intensive reporting.In optimum application, the CH has enough time to move to the gravity center and collect all the data from the appertaining clusters there.After that, CH returns to its initial position and reports to the BS from the initial position.In the meantime, data aggregation is done.As it was expected, the normalized gain in a number of rounds is bigger on wider terrain (compare Figures 3 and Figure 4).The LEACH algorithm has no more active nodes around 140 rounds.The proposed algorithms have about 35 active nodes at this time.On a 1000 m × 1000 m terrain, the difference in duration between the CH-active algorithm and LEACH is 250 rounds.As shown in Figure 4, when the number of live nodes is decreased, and/or if the distance between the nodes is bigger, the CH-active algorithm begins to gain an advantage over the CH-partially-active  Figure 4 shows the number of active nodes per round on a 1000 m × 1000 m field, with 100 uniformly distributed nodes.The energy assigned to each node at the simulation start is 2 J.Because of their nature, it is expected that CH-active and CH-partially-active algorithms will accomplish better results from the very reconfiguration, when the terrain itself is wider.The optimum exploitation of the proposed algorithms is on a wider terrain, and in a harsh environment with periodical and not intensive reporting.In optimum application, the CH has enough time to move to the gravity center and collect all the data from the appertaining clusters there.After that, CH returns to its initial position and reports to the BS from the initial position.In the meantime, data aggregation is done.As it was expected, the normalized gain in a number of rounds is bigger on wider terrain (compare Figures 3 and Figure 4).The LEACH algorithm has no more active nodes around 140 rounds.The proposed algorithms have about 35 active nodes at this time.On a 1000 m × 1000 m terrain, the difference in duration between the CH-active algorithm and LEACH is 250 rounds.As shown in Figure 4, when the number of live nodes is decreased, and/or if the distance between the nodes is bigger, the CH-active algorithm begins to gain an advantage over the CH-partially-active As it was expected, the normalized gain in a number of rounds is bigger on wider terrain (compare Figures 3 and 4).The LEACH algorithm has no more active nodes around 140 rounds.The proposed algorithms have about 35 active nodes at this time.On a 1000 m × 1000 m terrain, the difference in duration between the CH-active algorithm and LEACH is 250 rounds.As shown in Figure 4, when the number of live nodes is decreased, and/or if the distance between the nodes is bigger, the CH-active algorithm begins to gain an advantage over the CH-partially-active after 65% of the nodes die.The difference between the proposed algorithms does not exceed 8 (in the region of round 180) and in most cases, it is less than 5.

Energy of the Network
The total network energy is the sum of the energies of all the nodes in each round.Figure 5 shows the total network energy on a 500 m × 500 m terrain, while Figure 6 shows the total network energy on a 1000 m × 1000 m terrain.Using the CH-active algorithm, due to the fact that the sensors are active for a longer period, the total energy of the network does not decrease so quickly as with LEACH.The total network energy for CH-active and CH-partially-active algorithms does not differ greatly.
shows the total network energy on a 500 m × 500 m terrain, while Figure 6 shows the total network energy on a 1000 m × 1000 m terrain.Using the CH-active algorithm, due to the fact that the sensors are active for a longer period, the total energy of the network does not decrease so quickly as with LEACH.The total network energy for CH-active and CH-partially-active algorithms does not differ greatly.Figure 7 depicts the average energy per node on a 500 m × 500 m terrain, while Figure 8 depicts the average energy per node on a 1000 m × 1000 m terrain.The best energy balance in the network is achieved, when the CH-active algorithm is used.Figure 7 shows that with the CH-active algorithm, the nodes have residual energy for more than 400 rounds, after the network is exhausted under energy on a 1000 m × 1000 m terrain.Using the CH-active algorithm, due to the fact that the sensors are active for a longer period, the total energy of the network does not decrease so quickly as with LEACH.The total network energy for CH-active and CH-partially-active algorithms does not differ greatly.Figure 7 depicts the average energy per node on a 500 m × 500 m terrain, while Figure 8 depicts the average energy per node on a 1000 m × 1000 m terrain.The best energy balance in the network is achieved, when the CH-active algorithm is used.Figure 7 shows that with the CH-active algorithm, the nodes have residual energy for more than 400 rounds, after the network is exhausted under Figure 7 depicts the average energy per node on a 500 m × 500 m terrain, while Figure 8 depicts the average energy per node on a 1000 m × 1000 m terrain.The best energy balance in the network is achieved, when the CH-active algorithm is used.Figure 7 shows that with the CH-active algorithm, the nodes have residual energy for more than 400 rounds, after the network is exhausted under LEACH algorithm (500 m × 500 m terrain) and for more than 200 rounds (1000 m × 1000 m).The WSN with the CH-active algorithm is active twice as long as the WSN with LEACH algorithm in the 500 m × 500 m terrain, and it is active for 60% longer in the 1000 m × 1000 m terrain.When the terrain is bigger as in the second case, the sensors consume more energy to communicate with the BS.
LEACH algorithm (500 m × 500 m terrain) and for more than 200 rounds (1000 m × 1000 m).The WSN with the CH-active algorithm is active twice as long as the WSN with LEACH algorithm in the 500 m × 500 m terrain, and it is active for 60% longer in the 1000 m × 1000 m terrain.When the terrain is bigger as in the second case, the sensors consume more energy to communicate with the BS.

Conclusions
In this article, we have proposed the CH-active algorithm that relocates solar-powered CHs in the center of the mass, in order the total energy consumption in WSN to be reduced, and the network lifespan to be extended.Actually, by relocating the CH to the center of the masses, the CH minimizes the distance to the other cluster members and saves energy while receiving data.
In our framework, an additional solar-powered battery is used only to relocate the CHs, and not for processing and communication tasks.The CH-active algorithm uses the idea of CH relocation that is based on the selfish herd hypothesis.Simulation results show that when proper parameters are used, the CH-active algorithm is more stable and superior to LEACH with regard to the extension of WSN lifespan.LEACH algorithm (500 m × 500 m terrain) and for more than 200 rounds (1000 m × 1000 m).The WSN with the CH-active algorithm is active twice as long as the WSN with LEACH algorithm in the 500 m × 500 m terrain, and it is active for 60% longer in the 1000 m × 1000 m terrain.When the terrain is bigger as in the second case, the sensors consume more energy to communicate with the BS.

Conclusions
In this article, we have proposed the CH-active algorithm that relocates solar-powered CHs in the center of the mass, in order the total energy consumption in WSN to be reduced, and the network lifespan to be extended.Actually, by relocating the CH to the center of the masses, the CH minimizes the distance to the other cluster members and saves energy while receiving data.
In our framework, an additional solar-powered battery is used only to relocate the CHs, and not for processing and communication tasks.The CH-active algorithm uses the idea of CH relocation that is based on the selfish herd hypothesis.Simulation results show that when proper parameters are used, the CH-active algorithm is more stable and superior to LEACH with regard to the extension of WSN lifespan.

Conclusions
In this article, we have proposed the CH-active algorithm that relocates solar-powered CHs in the center of the mass, in order the total energy consumption in WSN to be reduced, and the network lifespan to be extended.Actually, by relocating the CH to the center of the masses, the CH minimizes the distance to the other cluster members and saves energy while receiving data.
In our framework, an additional solar-powered battery is used only to relocate the CHs, and not for processing and communication tasks.The CH-active algorithm uses the idea of CH relocation that is based on the selfish herd hypothesis.Simulation results show that when proper parameters are used, the CH-active algorithm is more stable and superior to LEACH with regard to the extension of WSN lifespan.
In this article, we also examined the situation where CH sensors do not have enough energy to position themselves in the center of the mass, but they can reach a certain percentage of the distance from their initial position to the center.This modification of CH-active is called the CH-partially-active algorithm.Our simulations have shown that moving CH to only 25% of the distance to the center of mass, contributes significantly to the lifetime of the WSN.The difference in active nodes in relation to the CH-active algorithm in most cases is less than 5.This result significantly extends the possible scope of the application of the proposed algorithm.
CH-active and CH-partially-active algorithms constitute a new paradigm set for further research in order to invent even better relocation algorithms.In the near future, we will study how relocating other non-CH nodes can impact network performance.Also, the impact of a problematic solar charging on network performance will be considered.
Conclusively, CH-active is unsuitable to be applied at a WSN application, where changes in the sensing field (data) are very frequent.For example, CH-active is unsuitable for a WSN application in an industrial automation context, where changes on the sensing field are very frequent and periodical and intensive reporting is required.CH-active is ideally applied only to "slow" WSN applications, such as daily reporting of the radioactivity and other types of pollution, reporting for weather data, etc.For the CH-active algorithm, the optimum WSN application covers wider sensing fields and in a harsh environment with periodical and not intensive reporting.

Algorithm 1 1 : 2 : 4 : 13 : 17 :
The CH-active and the CH-partially-active algorithms Parameters n: number of nodes on terrain n_active: number of active nodes x,y: dimensions of the field x_sink, y_sink: sink position (x,y) node_energy: energy dedicated to the nodes initial_node_energy: initial energy per node message_length: length of the messages round_number: number of round in progress epoch_number: number of epoch in progress Distribute nodes randomly on the terrain Prepare the (4D) matrix for storage of all node parameters and statuses in all rounds and all epochs 3: While number of active nodes > 0 Start new round 5: If round_number > 20 start a new epoch 6: Filter-out the nodes with no power 7: Choose the CHs from live nodes 8: Mark used CH statuses for chosen CHs in the matrix 9: Choose the CH for each individual sensor node-create clusters 10: Calculate the center of masses of all nodes in each created cluster 11: Case 1: 12: If Method = CH-partially-active Move the CHs partially toward the center of masses of still active nodes of the cluster 14Move the CHs to the very center of masses of still active nodes of the cluster 18: Endif 19: For i = 1 to n 20: If i is not in cluster: Send the sensed data to the sink 21: If i is in cluster: Send the sensed data to the CH 22: Move the CH back to the initial position 23: Aggregate data on the CH 24: Send their data from the CH to the sink 25: Endif 26: End while