# BioWSN: A Bio-Inspired Method for Optimization of Routing in Wireless Sensor Networks

Authors: Ramin Ahmadi; Gholamhossein Ekbatanifard; Peyman Bayat
Journal: Mathematical Problems in Engineering
 (2022)

---

## Abstract

Wireless sensor networks (WSN) have been recently gaining traction for many applications in monitoring and surveillance systems in the physical world specifically in agriculture, healthcare, and smart cities. Many clustering and routing approaches have been introduced to reduce the consumption of energy in WSNs to increase the lifetime of the network. In this study, we propose an improved version of grey wolf optimizer (GWO), a nature-inspired metaheuristic optimization algorithm, to perform cluster head selection and routing in WSN while maximizing the lifetime of WSN. GWO has a propensity to converge to local optima. To overcome this drawback of the conventional GWO, we introduce a balancing factor between the exploration and exploitation phases of the algorithm in addition to a mapping scheme. Comparative simulation and analysis of the proposed algorithm show significant improvement compared to frequently used and well-known approaches namely LEACH and PSO.


---

## Body

## 1. Introduction

A wireless sensor network (WSN) is a type of network that typically consists of low energy and cheap sensor nodes deployed in fixed or random positions to collect data from the environment and send them to the base station to make proper actions relevant to its application [1, 2]. WSNs have many applications [3] in agricultural monitoring and surveillance [4, 5], defense systems [6], healthcare [7], etc. Each sensor node has the task of sensing, processing, and transmitting data. They also have a battery supply to perform such tasks; however, all tasks are energy consuming. Therefore, preserving the energy in sensor nodes is a critical optimization problem in WSNs.Typically, routing methods in WSNs are categorized into flat routing, hierarchical routing, and multipath routing depending on the application and the size of the network. In flat-based routing, all nodes are identical and have the same functionality. When this type of routing is used in networks with large number of nodes, instead of broadcasting queries to all sensing nodes, the BS only sends them to a specific area in order to save energy. However, in hierarchical-based routing, nodes have different functionalities. In order to reduce energy waste in sensing nodes with various level of residual energies, one set of nodes are chosen to select CHs and another set of nodes are used to establish a path and transmit information. Multipath routing is used in scenarios where the reliability of WSN is more important than the lifetime of network. More than one path is established between source and destination nodes in order to have alternative paths in case there is a failure in a sensing node in the primary path. However, this improved reliability by maintaining multiple paths is achieved at the cost of higher energy consumption and subsequently lower network lifetime.We introduce an energy-aware GWO-based routing protocol to increase the lifetime of WSNs. In addition to the reduction in energy consumption, extending the lifetime of the network has immense importance, which is achieved by implementing efficient clustering and routing protocols [8]. WSN is divided into several groups called clusters. Each cluster has a leader node as cluster head (CH). By moving some of the decisions locally to CHs instead of the base station (BS), energy consumption is reduced [9]. Traditional brute force methods are suitable for small-sized networks, but as the number of sensor nodes grows, so does the complexity and the need to use meta-heuristic optimization algorithms [10].After cluster formation, every CH sends the sensed data to the BS; however, as the network gets larger, sending packets directly from cluster heads to the base station becomes unfeasible. Therefore, relay nodes are selected between CH and the BS to enable the indirect sending of packets [11]. Many meta-heuristic algorithms have been used to solve optimization problems such as Genetic Algorithm (GA) [12], Particle Swarm Optimization (PSO) [13], Firefly Algorithm (FA) [14], and Ant Colony Optimization (ACO) [15]. Grey wolf optimizer (GWO) [16] developed in 2014 has been shown to be promising [17] and provides better performance than PSO and GA. We propose two algorithms based on an improved variation of GWO for clustering and routing. GWO is an efficient algorithm with low complexity inspired by the natural hunting habits of grey wolves. In recent years, GWO has been used to solve many problems such as time series forecasting [18], feature selection [19], and scheduling [20].Improvements are made to the conventional GWO that offers a more balance approach in exploration and exploitation phases of the algorithm, and the new algorithm is used to perform clustering and routing in WSNs. The clustering protocol establishes a trade-off between energy consumption and distance, while the routing protocol also considers the membership number of each CH. Grey wolves are encoded to represent clusters and routes in our algorithm, and multiple objective functions are defined to have a better energy-aware approach to the routing problem in WSN compared to other methods. Multiple performance metrics such as energy depletion, number of alive nodes, and network lifetime are chosen to evaluate the proposed method and compare it to other methods. Overall, reducing energy consumption through our method and subsequently increasing the lifetime networks are the advantages of the proposed method.


### 1.1. Motivation

Routing in WSNs is an NP-hard problem that makes it impossible to solve in polynomial time using deterministic algorithms. However, swarm intelligence algorithms such as GWO can achieve suitable results solving numerous NP-hard problems. In WSN, establishing a path and sending data from source to destination is an energy consuming task that should be minimized to increase the lifetime of any given network. Different approaches focus on different objectives. Some methods focus on optimal CH selection and some focus on optimal path finding and routing. Due to the high computational complexity and waste of energy resources of any brute force approach of clustering and routing, offering a metaheuristic approach to clustering and routing that is energy aware is a challenge that is worth exploring. Improving the conventional GWO algorithm that is prone to converging to local optima and slow convergence speed is another motivation.


### 1.2. Contribution

The approach proposed in this paper can be separated into two parts: (1) clustering using a multiobjective optimization protocol via improving conventional grey wolf optimizer (GWO) to extend the lifetime of individual sensor nodes by defining two objectives: remaining energy and distance. (2) The improved GWO (IGWO) with multiple objectives of remaining energy, distance, and the number of cluster members is used to reduce energy consumption in a wireless sensor network. The improved version of GWO strikes a better balance between exploration and exploitation phases of algorithm compared to the original version.In the following, the rest of the paper is organized as follows: Section2 is an overview of related work. In Section 3, grey wolf optimizer and our proposed improvements are described. WSN and energy model along with our proposed clustering and routing methods are provided in Section 4. Then simulation results and comparative analysis are presented in Section 5. Finally, the conclusion is presented in the last section.


## 1.1. Motivation

Routing in WSNs is an NP-hard problem that makes it impossible to solve in polynomial time using deterministic algorithms. However, swarm intelligence algorithms such as GWO can achieve suitable results solving numerous NP-hard problems. In WSN, establishing a path and sending data from source to destination is an energy consuming task that should be minimized to increase the lifetime of any given network. Different approaches focus on different objectives. Some methods focus on optimal CH selection and some focus on optimal path finding and routing. Due to the high computational complexity and waste of energy resources of any brute force approach of clustering and routing, offering a metaheuristic approach to clustering and routing that is energy aware is a challenge that is worth exploring. Improving the conventional GWO algorithm that is prone to converging to local optima and slow convergence speed is another motivation.


## 1.2. Contribution

The approach proposed in this paper can be separated into two parts: (1) clustering using a multiobjective optimization protocol via improving conventional grey wolf optimizer (GWO) to extend the lifetime of individual sensor nodes by defining two objectives: remaining energy and distance. (2) The improved GWO (IGWO) with multiple objectives of remaining energy, distance, and the number of cluster members is used to reduce energy consumption in a wireless sensor network. The improved version of GWO strikes a better balance between exploration and exploitation phases of algorithm compared to the original version.In the following, the rest of the paper is organized as follows: Section2 is an overview of related work. In Section 3, grey wolf optimizer and our proposed improvements are described. WSN and energy model along with our proposed clustering and routing methods are provided in Section 4. Then simulation results and comparative analysis are presented in Section 5. Finally, the conclusion is presented in the last section.


## 2. Related Work

Various routing algorithms have been proposed in the literature. LEACH is a well-known and popular clustering algorithm. The selection of cluster heads and assigning sensor nodes to them are decided locally. It includes randomized rotation of CHs to evenly distribute the energy consumption over the network. Anzola et al. [21] proposed a clustering method that divides the sensing area into a two-hop hierarchical topology. Their approach is based on the k-d tree algorithm. Morsy et al. [22] have developed a hybrid GA-PSO algorithm to formulate the selection process of cluster heads in wireless sensor networks. Its fitness function consists of intracluster distance, the distance between cluster head and base station, and residual energy of sensor nodes.Huang et al. [23] used the LEACH and fuzzy C-means (FCM) to find the position of cluster heads and the number of clusters. Distance to the base station, residual energy of nodes, and degree of membership are some of the factors considered to extend network lifetime. FCM calculates the membership degree of nodes and prior to clustering, outlier nodes are identified and eliminated and later on added to the closest cluster.Tomar and Shukla [24] have proposed an approach based on gravitational search algorithm (GSA) and fuzzy inference system (FIS). Selection of CHs is carried out by GSA, while assignment of supercluster heads is performed by FIS. Data are sent from ordinary sensor nodes to the SCH through CHs by an efficient path. These paths are discovered based on the number of hops. Energy efficiency and throughput are the parameters chosen to evaluate the performance of the proposed method compared to GECR and PSOCR.By combining ant lion optimizer and whale optimization algorithm, Sureshkumar and Vimala [25] introduced a hybrid method that addresses the challenges of security and energy efficiency in WSN. Initially, CH selection is done by the hybrid algorithm while considering delay and energy. Nodes with lower delay and higher residual energy are suitable candidates for CHs. In the next stage, trust factor that determines the reliability of any given node along with energy of nodes is updated. Finally, by using fitness values such as trust, delay, and energy communication paths is discovered. Computational time of this approach is considerably better than the WOA method, which is a highlight of this study. Different attack scenarios are included in the comparative analysis.In the approach proposed by Razzaq et al. [26], based on the channel status of the receiver and parameters of radio, optimal fixed packet size is considered. Their proposed algorithm produces better results than the traditional K-means. Anand and Pandey [27] proposed a step routing method. Initially, GA is used to optimize cluster head selection, then routing is done by PSO. They also proposed a new method of selecting the optimal cluster head and the relay node. Their simulation results confirm the superiority of PSO-GA compared to LEACH, HCR, and EA-CRP. In [28], the proposed algorithm uses distance to the base station and residual energy as input and coupled with fuzzy logic and calculates the competitive radii.In [29], IACO algorithm that is a modified variant of Ant Colony Optimizer is studied. Shortest path is found between two nodes using IACO and then it is used to establish routing in addition to remaining energy levels of the nodes. Two of the biggest pitfalls of ACO are getting trapped in local optima and slow convergence speed. IACO outperforms ACO and Dijkstra algorithm in terms of transmission delay and overall performance. However, the network used to evaluate the performance is fairly small with only 100 nodes.Shahbaz et al. [30] proposed a multipath routing solution using firefly algorithm for homogenous WSNs that consists of three stages: assigning nodes as CHs, path discovery between nodes, and maintaining established paths. The objective function of the first stage consists of node degree, remaining energy of nodes, and proximity of each node to its neighboring nodes. A fuzzy system is used in the second stage to find paths. The third stage maintains discovered paths and finds a new path in case there is failure in one of the sensing nodes. Results of the proposed method for networks with number of sensor nodes between 100 and 200 are compared to LEACH, TEEN, and EMEER in terms of energy consumption, network lifetime, delay, and loss rate of packets.In [31], a two-level routing method is proposed to improve packed delivery rate by introducing a new type of cluster head called backup cluster head. Initially, based on remaining energy and distance to the BS, cluster heads and backup cluster heads are selected. Then, each cluster is divided into four regions, and transmission of data between source and destination is done either through their CHs or through the most suitable node in their region. Routing protocol is divided into intercluster routing and intracluster routing. Parameters such as network lifetime, packet delivery rate, and delay are used to evaluate this method compared to CFTP, FBCFP, and DFCR.Hajipour and Barati [32] propose EELRP that is a layered routing protocol with emphasis on energy efficiency. In their proposed approach, the network is divided into various circles with the same center but different radii, while each circle is divided into eight equal sections in size. BS is positioned in the center of the circles and an agent is selected for each section. Data transmission is done by sending the data to the agent of each section until it reaches the BS. To increase reliability of the approach, error detection and correction are introduced. Reduction of energy consumption and improvement of lifetime are among metrics to evaluate effectiveness of this method.


## 3. Grey Wolf Optimizer

Inspired by the natural hunting behavior of grey wolves, the grey wolf optimizer has been developed [16]. GWO deems alpha (α), beta (β), delta (δ) wolves to be the leader among the population while guiding the other wolves, omega (ω), closer to the optimal global solution. Alpha, beta, and delta wolves represent the best, second best, and third best solutions. Searching for prey consists of three main stages: surrounding the prey, hunting the prey, and attacking the prey. The surrounding step can be modeled by equations (1) and (2)(1)D⟶=C⟶⋅X⟶p−X⟶t,(2)X⟶t+1=X⟶pt−A⟶⋅D⟶,where X⟶p is the position of the prey, X⟶ represents the position of a grey wolf, t indicates the current iteration, A⟶ and C⟶ are coefficient formulated by equations (3) and (4), andA⟶ and C⟶ are worked out by(3)A⟶=2a⟶⋅r⟶1−a⟶,(4)C⟶=2r⟶2.Random vectorsr⟶1 and r⟶2 take a value between 0 and 1, and a⟶ is linearly decreased from 2 to 0 over time. Grey wolves move to a new random location in the area around the prey using (1) and (2).Three leading wolves carry out the hunting and lead omega wolves. With the assumption that the leading wolves have a better understanding of the position of prey, the hunting process is carried out by the following equations (5)–(11).(5)D⟶α=C⟶1⋅X⟶α−X⟶,(6)D⟶β=C⟶2⋅X⟶β−X⟶,(7)D⟶δ=C⟶3⋅X⟶δ−X⟶,(8)X⟶1=X⟶α−A⟶1⋅D⟶α,(9)X⟶2=X⟶β−A⟶2⋅D⟶β,(10)X⟶3=X⟶δ−A⟶3⋅D⟶δ,(11)X⟶t+1=X⟶1+X⟶2+X⟶33.Distance between leading wolves and prey is calculated by equations (5)–(7), while equations (8)–(10) update the position of alpha, beta, and delta wolves. Equation (11) works out the position of the prey. When A⟶>1 search space is being explored and when A⟶<1 attacking the prey is executed.


### 3.1. Improved Grey Wolf Optimizer (IGWO)

The two main phases of GWO are exploration and exploitation. In the exploration phase, the search space is searched through and probed and in the exploitation phase movement towards the best solution is executed. Grey wolf optimizer like many approximating algorithms occasionally converges to a local optimum. GWO has been developed to initially carry out exploration and then move on to the exploitation phase and close in on the global optimum. To balance these two phases, we have introduced a new control parameter that can change the emphasis on either exploration or exploitation. This will allow the algorithm to reduce the likelihood of falling into local optima traps.In GWO these two phases are managed by the parametera⟶. As mentioned in the discussion of the original GWO, this parameter is linearly decreased. In earlier iterations of the algorithm, there is more focus on exploration, while exploitation becomes more prominent later on. By changing the linearity of a⟶, we can change the capability of exploration and exploitation towards a more balanced approach. Our new control parameter is(12)a⟶t=2−2ttmaxk,where tmax is the total iterations, t is the current iteration, and k is a constant. Here the parameter a⟶ is still decreased from 2 to 0 but in a non-linear manner. Priority is on exploration for values of k above 1. However, for the values between 0 and 1, the exploitation phase is more eminent. A suitable value for k can be found by trial and error.To further improve the algorithm and overcome the reduction in exploitation whenk is more than 1, we introduce a mapping method to conduct a local search around the alpha wolf. If this mapping generated a better result, then the alpha wolf is moved to that new position. The new position is formulated as(13)X⟶n=X⟶α+rU−Lz−0.5,where U and L are the upper and lower boundaries, r is the center, and z is the mapping parameter updated at each iteration:(14)z⟶t+1=4×z⟶t×1−z⟶t.


## 3.1. Improved Grey Wolf Optimizer (IGWO)

The two main phases of GWO are exploration and exploitation. In the exploration phase, the search space is searched through and probed and in the exploitation phase movement towards the best solution is executed. Grey wolf optimizer like many approximating algorithms occasionally converges to a local optimum. GWO has been developed to initially carry out exploration and then move on to the exploitation phase and close in on the global optimum. To balance these two phases, we have introduced a new control parameter that can change the emphasis on either exploration or exploitation. This will allow the algorithm to reduce the likelihood of falling into local optima traps.In GWO these two phases are managed by the parametera⟶. As mentioned in the discussion of the original GWO, this parameter is linearly decreased. In earlier iterations of the algorithm, there is more focus on exploration, while exploitation becomes more prominent later on. By changing the linearity of a⟶, we can change the capability of exploration and exploitation towards a more balanced approach. Our new control parameter is(12)a⟶t=2−2ttmaxk,where tmax is the total iterations, t is the current iteration, and k is a constant. Here the parameter a⟶ is still decreased from 2 to 0 but in a non-linear manner. Priority is on exploration for values of k above 1. However, for the values between 0 and 1, the exploitation phase is more eminent. A suitable value for k can be found by trial and error.To further improve the algorithm and overcome the reduction in exploitation whenk is more than 1, we introduce a mapping method to conduct a local search around the alpha wolf. If this mapping generated a better result, then the alpha wolf is moved to that new position. The new position is formulated as(13)X⟶n=X⟶α+rU−Lz−0.5,where U and L are the upper and lower boundaries, r is the center, and z is the mapping parameter updated at each iteration:(14)z⟶t+1=4×z⟶t×1−z⟶t.


## 4. Wireless Sensor Network and Energy Model

This paper presumes sensor nodes are stationary, nonrechargeable, and randomly positioned [33] in a 250-meter by 250-meter area. This deployment method covers most applications such as habitat monitoring and smart cities. The radio model is derived from the model used in [30]. Communication components are turned on only during transmission to reduce the depletion of batteries in sensor nodes. The discovery of neighboring sensor nodes and their locations happens in the initial step while each sensor node is aware of its own location. If transmission distance is more than the threshold value d0, multipath amplifier εmp is adopted, otherwise, we use the free space amplifier εfs. The amount of energy required to transmit l-bit of data is calculated by(15)Etransmit=l.Eelec+l.εfs.d2,d<d0,l.EE+l.εmp.d4,d≥d0,where Eelec denotes the energy consumed by the transmitter. In the same way, the amount of energy required to receive l-bit of data is calculated by(16)Ereceive=l.Eelec.In the initial phase, sensor nodes send their location and remaining energy to the base station. All sensor nodes are assigned to one cluster head, and the base station is positioned in different locations.


### 4.1. IGWO Algorithm for Cluster Head Formation

Initially, each sensor node forwards a message that contains its unique ID and then upon receiving that message each node in the receiving area of the radio signal updates their table with the neighbor ID. This step is repeated until all neighbor tables of sensor nodes are completed. Then each node forwards its unique ID, list of neighbors, and remaining energy to the base station. Finally, IGWO algorithm finds the optimal cluster heads.


### 4.2. Initialization of Grey Wolves for Clustering

In IGWO, each solution is characterized by a grey wolf. In cluster head formation, a grey wolf represents a set of nodes selected as cluster heads in the network. The number of elements in all grey wolves is the same and equal to the total number of cluster heads. LetSi=x1,x2,…,xD be the ith solution in the population, x represents the node ID of a cluster head, and D represents the number of cluster heads. Figure 1 illustrates an example of a population of five grey wolves in a network with 100 sensor nodes where 10% of nodes are selected as cluster heads.Figure 1
An example of a population initialization.


### 4.3. Clustering Evaluation

To find the best grey wolf with optimal cluster head candidates, we define two objectives: remaining energy and distance. Sensor nodes send data to their assigned cluster head, then the cluster head combines the transmitted data into a single packet. In order to extend network life, a sensor node with higher remaining energy is more suited to be selected as a cluster head than a sensor node with lower remaining energy. So our first objective is to minimize:(17)obj1=∑m=1k1ECHm.Higher distance between sensor nodes and cluster heads leads to quicker energy depletion. Hence, minimizing the distance between sensor nodes and their cluster head results in higher network life. So our second objective is to minimize:(18)obj2=∑i=1NdistanceSNi,CHSNi,where CHSNi is the cluster head assigned to SNi. The fitness value of each clustering solution is the sum of obj1 and obj2. Algorithm 1 represents cluster head selection.Algorithm 1:Clustering.
SNii=1,2,…,n: set of sensor nodesm: number of grey wolvesXii=1,2,…,n: Random generation of grey wolvesSetting initial values ofa⟶, A⟶, and C⟶tmax: total number of iterationsFitness evaluation of each grey wolfX⟶α: the best solutionX⟶β: second best solutionX⟶δ: third best solutionwhilet<tmaxdofor each X⟶i in X⟶doUpdate the position ofX⟶iend forUpdatea⟶, A⟶, and C⟶Evaluate the fitness of all grey wolves using equations (17) and (18)Map a new position forX⟶α and move it there if it is improvedUpdateX⟶α, X⟶β, and X⟶δt=t+1end whilereturnX⟶α as the solution to assign sensor nodes to cluster heads


### 4.4. IGWO Algorithm for Routing

The routing algorithm obtains the best path between each cluster head and the base station. Similar to the clustering process, preserving energy and shortening distances are our objectives. The number of elements in each grey wolf is equal to the number of cluster heads.


### 4.5. Initialization of Grey Wolves for Routing

Initially, positions of grey wolves are randomly assigned between 0 and 1. A population of 5 grey wolves is shown in Figure2. Let Pi=y1,y2,…,yD be the ith solution in the population, y represents the node ID of a cluster head, and D represents the number of cluster heads. The next hop is calculated by(19)Next_hopi=Num_PNHi×yi,where Num_PNHi is the number of potential candidates as the next hop, and yi is the node ID of yth cluster head. Table 1 illustrates the next hop for every cluster head in P1.Figure 2
An example of a population initialization for clustering.Table 1
Process of next hop selection.
Cluster HeadsPNHsNum_PNHy⌈Num_PNH×y⌉Next_hopCH1CH1, CH320.221CH1CH2CH1, CH3, CH430.562CH3CH3CH5, CH6, CH730.542CH6CH4CH3, CH620.131CH3CH5CH7, CH820.552CH8CH6CH7, CH920.331CH7CH7CH8, CH9, CH1030.031CH8CH8CH10, BS20.481CH10CH9CH10, BS20.642BSCH10BS10.251BS


### 4.6. Routing Evaluation

In order to find the best solution (grey wolf) with optimal cluster head candidates, we define three objectives: remaining energy, distance, and the number of cluster members. In the transmission phase, the cluster head selected as the next hop receives and combines data and then transmits it to the base station. Thus, it is more desirable to choose the cluster head with higher energy as the next hop calculated by(20)obj1=1∑i=1nENext_hopi,Routes with the shortest path extend the lifetime of the network. Therefore, the sum of the distance from the cluster head to the next hop and from there to the base station should be minimized. This objective is calculated as(21)obj2=∑i=1ndCH,Next_hop+dNext_hop,BS.Potential cluster heads as the next hop with a high member count are assumed to consume more energy than those with a low member count. Hence, the objective of choosing the next hop with a low member count is expressed by(22)obj3=1∑i=1nCHi.Finally, the summation of these three objectives is the fitness value of the routing solution that should be minimized. Algorithm 2 illustrates the routing process.Algorithm 2:Routing.
CHii=1,2,…,n: set of cluster heads.m: number of grey wolves.Xii=1,2,…,n: Random generation of grey wolves.Setting initial values ofa⟶, A⟶, and C⟶.tmax: total number of iterations.Fitness evaluation of each grey wolf.X⟶α: the best solution.X⟶β: second best solution.X⟶δ: third best solution.whilet<tmaxdofor each X⟶i in X⟶doUpdate the position ofX⟶iend forUpdatea⟶, A⟶, and C⟶Evaluate the fitness of all grey wolves using equations (20)–(22)Map a new position forX⟶α and move it there if it’s improvedUpdateX⟶α, X⟶β, and X⟶δt=t+1end whilereturnX⟶α as the solution for routing.


## 4.1. IGWO Algorithm for Cluster Head Formation

Initially, each sensor node forwards a message that contains its unique ID and then upon receiving that message each node in the receiving area of the radio signal updates their table with the neighbor ID. This step is repeated until all neighbor tables of sensor nodes are completed. Then each node forwards its unique ID, list of neighbors, and remaining energy to the base station. Finally, IGWO algorithm finds the optimal cluster heads.


## 4.2. Initialization of Grey Wolves for Clustering

In IGWO, each solution is characterized by a grey wolf. In cluster head formation, a grey wolf represents a set of nodes selected as cluster heads in the network. The number of elements in all grey wolves is the same and equal to the total number of cluster heads. LetSi=x1,x2,…,xD be the ith solution in the population, x represents the node ID of a cluster head, and D represents the number of cluster heads. Figure 1 illustrates an example of a population of five grey wolves in a network with 100 sensor nodes where 10% of nodes are selected as cluster heads.Figure 1
An example of a population initialization.


## 4.3. Clustering Evaluation

To find the best grey wolf with optimal cluster head candidates, we define two objectives: remaining energy and distance. Sensor nodes send data to their assigned cluster head, then the cluster head combines the transmitted data into a single packet. In order to extend network life, a sensor node with higher remaining energy is more suited to be selected as a cluster head than a sensor node with lower remaining energy. So our first objective is to minimize:(17)obj1=∑m=1k1ECHm.Higher distance between sensor nodes and cluster heads leads to quicker energy depletion. Hence, minimizing the distance between sensor nodes and their cluster head results in higher network life. So our second objective is to minimize:(18)obj2=∑i=1NdistanceSNi,CHSNi,where CHSNi is the cluster head assigned to SNi. The fitness value of each clustering solution is the sum of obj1 and obj2. Algorithm 1 represents cluster head selection.Algorithm 1:Clustering.
SNii=1,2,…,n: set of sensor nodesm: number of grey wolvesXii=1,2,…,n: Random generation of grey wolvesSetting initial values ofa⟶, A⟶, and C⟶tmax: total number of iterationsFitness evaluation of each grey wolfX⟶α: the best solutionX⟶β: second best solutionX⟶δ: third best solutionwhilet<tmaxdofor each X⟶i in X⟶doUpdate the position ofX⟶iend forUpdatea⟶, A⟶, and C⟶Evaluate the fitness of all grey wolves using equations (17) and (18)Map a new position forX⟶α and move it there if it is improvedUpdateX⟶α, X⟶β, and X⟶δt=t+1end whilereturnX⟶α as the solution to assign sensor nodes to cluster heads


## 4.4. IGWO Algorithm for Routing

The routing algorithm obtains the best path between each cluster head and the base station. Similar to the clustering process, preserving energy and shortening distances are our objectives. The number of elements in each grey wolf is equal to the number of cluster heads.


## 4.5. Initialization of Grey Wolves for Routing

Initially, positions of grey wolves are randomly assigned between 0 and 1. A population of 5 grey wolves is shown in Figure2. Let Pi=y1,y2,…,yD be the ith solution in the population, y represents the node ID of a cluster head, and D represents the number of cluster heads. The next hop is calculated by(19)Next_hopi=Num_PNHi×yi,where Num_PNHi is the number of potential candidates as the next hop, and yi is the node ID of yth cluster head. Table 1 illustrates the next hop for every cluster head in P1.Figure 2
An example of a population initialization for clustering.Table 1
Process of next hop selection.
Cluster HeadsPNHsNum_PNHy⌈Num_PNH×y⌉Next_hopCH1CH1, CH320.221CH1CH2CH1, CH3, CH430.562CH3CH3CH5, CH6, CH730.542CH6CH4CH3, CH620.131CH3CH5CH7, CH820.552CH8CH6CH7, CH920.331CH7CH7CH8, CH9, CH1030.031CH8CH8CH10, BS20.481CH10CH9CH10, BS20.642BSCH10BS10.251BS


## 4.6. Routing Evaluation

In order to find the best solution (grey wolf) with optimal cluster head candidates, we define three objectives: remaining energy, distance, and the number of cluster members. In the transmission phase, the cluster head selected as the next hop receives and combines data and then transmits it to the base station. Thus, it is more desirable to choose the cluster head with higher energy as the next hop calculated by(20)obj1=1∑i=1nENext_hopi,Routes with the shortest path extend the lifetime of the network. Therefore, the sum of the distance from the cluster head to the next hop and from there to the base station should be minimized. This objective is calculated as(21)obj2=∑i=1ndCH,Next_hop+dNext_hop,BS.Potential cluster heads as the next hop with a high member count are assumed to consume more energy than those with a low member count. Hence, the objective of choosing the next hop with a low member count is expressed by(22)obj3=1∑i=1nCHi.Finally, the summation of these three objectives is the fitness value of the routing solution that should be minimized. Algorithm 2 illustrates the routing process.Algorithm 2:Routing.
CHii=1,2,…,n: set of cluster heads.m: number of grey wolves.Xii=1,2,…,n: Random generation of grey wolves.Setting initial values ofa⟶, A⟶, and C⟶.tmax: total number of iterations.Fitness evaluation of each grey wolf.X⟶α: the best solution.X⟶β: second best solution.X⟶δ: third best solution.whilet<tmaxdofor each X⟶i in X⟶doUpdate the position ofX⟶iend forUpdatea⟶, A⟶, and C⟶Evaluate the fitness of all grey wolves using equations (20)–(22)Map a new position forX⟶α and move it there if it’s improvedUpdateX⟶α, X⟶β, and X⟶δt=t+1end whilereturnX⟶α as the solution for routing.


## 5. Simulation Results

To evaluate the functionality of the proposed methods, simulations are conducted using OPNET. IGWO and WSN parameters are shown in Table2. Algorithms are evaluated for four different scenarios via positioning the base station at coordinates (125, 125), (250, 250), (125, 0), and (125,300). Obtained results are compared to well-known PSO and LEACH algorithms with default parameters.Table 2
Parameters for WSN and IGWO.
ParametersValueNumber of runs20Sensing area250 m × 250 mNumber of sensor nodes200–600Number of cluster heads20–60Initial energy of sensor nodes2 JPacket size4000 bitsControl message size200 bitsEelec50 nJ/bitEfs10 pJ/bit/m2Emp0.0013 pJ/bit/m4d035 mNumber of grey wolves30Number of iterations250z0.15k2


### 5.1. Energy Depletion

The energy depletion of networks with 400 nodes and 20 cluster heads after 300 rounds averaged over 20 runs is shown in Table3. The performance of the proposed method is superior among all algorithms. From the initial 800 J, IGWO has lost the least amount of energy, while LEACH is the poorest performing algorithm among all of them. Placing the base station at the center of the sensing area yields the best results as expected. Base station placement outside of the sensing area noticeably reduces energy preservation.Table 3
Average energy depletion for different algorithms and various scenarios.
BS (125, 125)BS (250, 250)BS (125, 0)BS (125, 300)PSO242.37365.85312.91414.07LEACH309.46392.96381.68515.21GWO128.50219.75187.72311.90IGWO91.33157.60129.24253.81


### 5.2. Remaining Energy

The energy of sensor nodes is wasted during sending, receiving, and combining packets. Network capability is improved by increasing the remaining energy of nodes. The performance of algorithms for different numbers of sensor nodes (200, 400, 600) and 40 cluster heads are shown in Figures3–5.Figure 3
Results of remaining energy in 200 nodes for LEACH, PSO, GWO, and IGWO. (a) Base station at (125,125), (b) base station at (125,0), (c) base station at (250,250), and (d) base station at (125,300).
(a)(b)(c)(d)Figure 4
Results of remaining energy in 400 nodes for LEACH, PSO, GWO, and IGWO. (a) Base station at (125,125), (b) base station at (125,0), (c) base station at (250,250), and (d) base station at (125,300).
(a)(b)(c)(d)Figure 5
Results of remaining energy in 600 nodes for LEACH, PSO, GWO, and IGWO. (a) Base station at (125,125), (b) base station at (125,0), (c) base station at (250,250), and (d) base station at (125,300).
(a)(b)(c)(d)In Figures3(a)–3(d), it is demonstrated that PSO and LEACH consume energy quicker when the base station is positioned at (125, 0) or (125,300). However, both GWO and IGWO still outperform LEACH and PSO, while IGWO remains the best approach.It is evident from Figures3–5 that in most cases, a lower number of nodes leads to earlier depletion of the total energy. For example, by comparing Figures 4(a) and 5(a), we can see that in the GWO approach when the number of nodes is 400, the system runs out of energy at roughly 2000th round while that happens 200 rounds later when the number of nodes is set to 600.


### 5.3. Number of Alive Nodes

Another metric to compare different algorithms is the number of alive nodes. A node that still contains residual energy is considered to be an alive node. A higher number of alive nodes is a sign of better performing routing protocol. In Figure6, the number of alive nodes for a network with 400 nodes and 60 cluster heads is shown.Figure 6
Number of alive nodes in 400-node network for LEACH, PSO, GWO, and IGWO. (a) Base station at (125,125), (b) base station at (125,0), (c) base station at (250,250), and (d) base station at (125,300).
(a)(b)(c)(d)Figure6 shows that placing the base station at the corner or outside the sensing area significantly reduces performance. However, in those scenarios, IGWO still results in better performance.


### 5.4. Network Lifetime

In this study, we use half nodes death (HND) as network lifetime. Higher network lifetime is a desirable capability in wireless sensor networks. All algorithms are tested with different numbers of nodes (200, 400, 600) and corresponding numbers of cluster heads (20, 40, 60), and the results are depicted in Figure7. The proposed algorithm clearly outperforms other methods. The selection method of picking cluster heads with high remaining energy can explain this superiority in network lifetime.Figure 7
Network lifetime for LEACH, PSO, GEO, and IGWO. (a) Base station at (125,125), (b) base station at (125,0), (c) base station at (250,250), and (d) base station at (125,300).
(a)(b)(c)(d)Increasing the number of sensor nodes and cluster heads slightly reduces the lifetime of the network. The biggest difference in performance between IGWO and LEACH is when the base station is positioned at the center or at the edge.


## 5.1. Energy Depletion

The energy depletion of networks with 400 nodes and 20 cluster heads after 300 rounds averaged over 20 runs is shown in Table3. The performance of the proposed method is superior among all algorithms. From the initial 800 J, IGWO has lost the least amount of energy, while LEACH is the poorest performing algorithm among all of them. Placing the base station at the center of the sensing area yields the best results as expected. Base station placement outside of the sensing area noticeably reduces energy preservation.Table 3
Average energy depletion for different algorithms and various scenarios.
BS (125, 125)BS (250, 250)BS (125, 0)BS (125, 300)PSO242.37365.85312.91414.07LEACH309.46392.96381.68515.21GWO128.50219.75187.72311.90IGWO91.33157.60129.24253.81


## 5.2. Remaining Energy

The energy of sensor nodes is wasted during sending, receiving, and combining packets. Network capability is improved by increasing the remaining energy of nodes. The performance of algorithms for different numbers of sensor nodes (200, 400, 600) and 40 cluster heads are shown in Figures3–5.Figure 3
Results of remaining energy in 200 nodes for LEACH, PSO, GWO, and IGWO. (a) Base station at (125,125), (b) base station at (125,0), (c) base station at (250,250), and (d) base station at (125,300).
(a)(b)(c)(d)Figure 4
Results of remaining energy in 400 nodes for LEACH, PSO, GWO, and IGWO. (a) Base station at (125,125), (b) base station at (125,0), (c) base station at (250,250), and (d) base station at (125,300).
(a)(b)(c)(d)Figure 5
Results of remaining energy in 600 nodes for LEACH, PSO, GWO, and IGWO. (a) Base station at (125,125), (b) base station at (125,0), (c) base station at (250,250), and (d) base station at (125,300).
(a)(b)(c)(d)In Figures3(a)–3(d), it is demonstrated that PSO and LEACH consume energy quicker when the base station is positioned at (125, 0) or (125,300). However, both GWO and IGWO still outperform LEACH and PSO, while IGWO remains the best approach.It is evident from Figures3–5 that in most cases, a lower number of nodes leads to earlier depletion of the total energy. For example, by comparing Figures 4(a) and 5(a), we can see that in the GWO approach when the number of nodes is 400, the system runs out of energy at roughly 2000th round while that happens 200 rounds later when the number of nodes is set to 600.


## 5.3. Number of Alive Nodes

Another metric to compare different algorithms is the number of alive nodes. A node that still contains residual energy is considered to be an alive node. A higher number of alive nodes is a sign of better performing routing protocol. In Figure6, the number of alive nodes for a network with 400 nodes and 60 cluster heads is shown.Figure 6
Number of alive nodes in 400-node network for LEACH, PSO, GWO, and IGWO. (a) Base station at (125,125), (b) base station at (125,0), (c) base station at (250,250), and (d) base station at (125,300).
(a)(b)(c)(d)Figure6 shows that placing the base station at the corner or outside the sensing area significantly reduces performance. However, in those scenarios, IGWO still results in better performance.


## 5.4. Network Lifetime

In this study, we use half nodes death (HND) as network lifetime. Higher network lifetime is a desirable capability in wireless sensor networks. All algorithms are tested with different numbers of nodes (200, 400, 600) and corresponding numbers of cluster heads (20, 40, 60), and the results are depicted in Figure7. The proposed algorithm clearly outperforms other methods. The selection method of picking cluster heads with high remaining energy can explain this superiority in network lifetime.Figure 7
Network lifetime for LEACH, PSO, GEO, and IGWO. (a) Base station at (125,125), (b) base station at (125,0), (c) base station at (250,250), and (d) base station at (125,300).
(a)(b)(c)(d)Increasing the number of sensor nodes and cluster heads slightly reduces the lifetime of the network. The biggest difference in performance between IGWO and LEACH is when the base station is positioned at the center or at the edge.


## 6. Conclusion

In this study, an improved version of GWO is introduced to solve clustering and routing problems in wireless sensor networks. The improvement to the algorithm is mainly on the balance between the exploration and the exploitation phases of the algorithm to fix the convergence problem of the conventional GWO. The performance of the proposed algorithm is tested on WSNs with various numbers of sensor nodes and cluster heads. Remaining energy, number of alive nodes, and network lifetime are the parameters selected for the comparative analysis of algorithms. Obtained results demonstrate that placing the base station at the center of sensing area yields better performance. Obtained results are compared to well-known algorithms such as LEACH and PSO. Overall, IGWO outperforms other methods in both reduction of energy consumption and extension of network lifetime.



---

*Source: 4826388-2022-04-26.xml*