BEST CLUSTER HEAD SELECTION AND ROUTE OPTIMIZATION FOR CLUSTER BASED SENSOR NETWORK USING (M-PSO) AND GA ALGORITHMS

Clustering plays a vital role in extending the lifespan and optimized direction of a wireless sensor network by integrating sensor nodes through clusters and choosing cluster heads (CHs) and non-cluster heads (NCHs). Cluster head aggregated data and non-cluster heads forward to the base station (BS). In this paper, we have introduced a new Dynamic Multipath Routing Protocol (DMPRP) for selections of cluster heads (CHs) and non-cluster heads (NCHs), which is ideally selected using M-PSO algorithm. After calculating the probabilities, the best selection of cluster heads has taken, and results have used to find the optimized shortest path using the Genetic Algorithm (GA). The GA algorithm uses an objective function consisting of a network to determine the optimal path.

from NCM to CH; CH to BS. It can be done with a GA, which is a global technique of optimization [4] on basis of the Natural Selection process [5] [6]. GA tends to optimize many elements in designing network routes. Optimization is suitable for Data Network routing and high performance. Thus, optimization can simplify the routing problem [7]. Certain limitations of cluster quality, energy bandwidth, and average inter-cluster distance are defined throughout this paper, analyzing the reliability of the genetic string. We are, therefore, developing a routing strategy that has premised on the GA. A chromosome represents the nodes of such a path, and it may vary in length.

TRADITIONAL ROUTING PROTOCOLS
A LEACH "Low Energy Adaptive Clustering Hierarchy" is a well-known clustering protocol. LEACH's significant involvement is the implementation of a hierarchy based clustering concept for balancing traffic load among the sensor nodes of the network. The operation of the LEACH protocol has divided into several rounds. Some nodes play roles as Cluster Head node to balance the node's energy consumption and some nodes work as a forwarder. The main pitfall of LEACH was the random selection of Cluster Head nodes which could show an unequal distribution of sensor nodes and reason for the imbalance power consumption among the cluster in the network.
The LEACH protocol mainly focus on single-hop propagation allows the cluster head die sooner due to faster consumption of energy. There were many changes to the LEACH deficiencies [8].
Cognitive LEACH (Cog-LEACH) [9] improved the problem of LEACH to render the distribution of Cluster-head more sensible. It mainly focused difficulty of unbalance power reeducation. Authors Latiwesh et al. addressed a Cog-LEACH-C that is Centralized Cognitive LEACH [10]. in this protocol, next to sidle channels, for cluster heads selection the remaining energy of sensor nodes is also used as an attribute to manage the power load of nodes. But it had not well for scalable systems (networks), for sending data from source to destination it used single-hop routing transmission.
Arumugam et al. [11] introduced a new concept of EE-LEACH protocol. It proposed optimum clusters creation and efficient data aggregation method, that reduce energy consumption and but increased the complexity of the network due to combining of multiple technologies.
In the Grid-based protocols [12], partitions the network scenario into various rectangles where every rectangle area has an odd number of grids, and in every row the sensor nodes build a cluster. This methodology significantly decreases the amount of energy exploitation and increases the lifespan of the network. Although the number of grids for each rectangle is incoherent, excessive forwarding between all the layers is taking place. There is a situation where the upper layer nodes expired, and data cannot be transmitted by the lower layer nodes, which means a lot of energy consumption. Some protocols such as "Energy-Efficient and Balanced-Cluster-based Data-Aggregation" (EEBCDA) and for solving the hotspot problem effectively proposed EEBCDA multi-hop [13]. EEBCDA multi-hop is the enhancement of EEBCDA protocol.
Try to manage the network's energy consumption of network, the authors introduce EEMRP [14] grid-based clustering algorithm and proposed node for Communication-Management (CM), which distributed multi hop data communication and share the workload to Cluster head (CH) nodes.

SWARM INTELLIGENCE BASED ROUTING PROTOCOLS
The essential concept of Swarm Intelligence (SI) is self-organization and self-association, which offer the best solution for optimizing in multiple technology areas such as localization or position of nodes, routing data packet efficient ways, cluster formation, cluster head selection, and many more. Ari et al. [15] introduced an Artificial Bee Colony search features protocol for clusterbased energy-efficient routing known as ABC-SD. It used to construct the cluster which consumes less power. On the other hand, the protocol methodology utilizes a distributed technique to select CHs, and fixing the threshold power is utilized for selections CHs. When all of the cluster's energy is under the energy threshold, cluster heads may not be choosing.
Yalçın et al. [16] introduced 2 methodologies based on bacterial Interaction; know Cluster Head selection, and a cognitive-routing algorithm for power and communication boundaries. Simulation results measured from the program Matlab programming with version 2016b (Math Works, Natick, USA). It would appear that the statics is more robust in actual Wireless Sensor Network scenarios, and appropriate.
Karaboga et al. [17] has suggested a routing protocol for clustering system, focused on an ABC "Artificial-Bee-Colony" algorithm to maximize the lifespan of the network. The algorithm uses a Quality-of-Service (QoS) system to reduce the lags between the clusters receiving communication signals. This protocol did not, however, recognize the distribution of the cluster heads, those results in uneven energy consumption.
Rao et al. [18] suggested an "Energy-Efficient Cluster-Head Selection Algorithm" (PSO-ECHS) depending on Particle Swarm Optimization that takes into account several parameters like intracluster-distance, base station-distance and remaining-energy of sensor nodes to choose Cluster Head nodes. Some nodes distance more from Cluster Head nodes die before time once the Cluster Head node chosen by the nodes has more remaining energy but is more distance from such nodes, due to various factors getting careful at the same time.
Kuila et al. [19] have used a Particle Swarm Optimization-based clustering-algorithm to improve the WSN life period. In this technique, the cluster formation has depended upon two things, first the average cluster distance and seconds the gateway's life. Getting fitness values of every particle in the system is computed by using the method called fitness-function, and this fitness value is used to condition the quality of the system. A particle with an enhanced value for fitness functions provides a improved structure of the network.
Latiff et al. [20] introduced clustering technique (energy aware) for WSN using the PSO technique, which established an actual value function to decrease the intra-cluster distance and minimize the energy reduction of a network. While cluster-heads forwarded data to the Base Station (BS), at the time of the routing.
Singh et al. [21] suggested an approach to PSO for the generation of energy aware clusters by optimal cluster head chosen. The Particle Swarm Optimization ultimately lowers the outlay of optimum placement for both the cluster-head nodes in such a cluster. The Particle Swarm Optimization based technique has been introduced within clusters instead of the BS, making it a semi-distributed Particle Swarm Optimization (PSO-SD) method. Nevertheless, the protocol does not take into account the distance between nodes and the BS that may lead to excess energy usage by the CHs for transmitting data to the BS.
The other popular clustering protocol presented in [22] is "Hybrid Energy-Efficient Distributed Clustering" (HEED) The CHs are chosen periodically as per the residual energy of a hybrid node and the cost of intra-cluster data interaction. This cluster head re-selection process reduces the network's connectivity costs and can eliminate the case that there is more than one CH nearby. Besides, the multi-hop communication model is implemented in HEED so that cluster heads in the network collectively transfer data to Base Station by multi-hop means.

OBJECTIVES IDENTIFIED AND PROPOSED:
1. We designed an efficient dynamic multipath cluster optimization model for cluster-based sensor networks, saving energy consumption, and improving the network lifetime for best cluster head selection. 2. The best cluster head selection has done using the M-PSO algorithm based on the probability calculated using ECR.
3. The results of the M-PSO selection of cluster heads have used to find the optimized shortest path using the Genetic Algorithm. 4. The rest of the paper contains section III is the designed network and energy model. Section IV is the proposed mechanism in which the best cluster head selection has done using the M-PSO algorithm. Section V is all about the genetic algorithm, the results of best cluster selection using M-PSO is given to Genetic-Algorithm to find the optimized shortest-path. Section VI is the conclusion.

NETWORK MODEL AND ENERGY MODEL
The proposed protocol in this paper is to have a proper organization of Cluster Heads and improved scalable for various scale network scenarios and enhance the energy efficiency for wireless sensor networks in an optimal way. We mostly focus on the clustering process, an algorithm for the selection of Cluster Head nodes, and the routing-algorithm to maintain the power utilization and enlarge the lifespan of the network. Following network assumptions are found in our proposed Dynamic Multipath Routing Protocol:  The sensor nodes are all homogeneous.  When deployed to the field, all nodes are stationary.  A single base station has placed.  All nodes have the transmitting data and Use source routing. Routing involves route discovery and route maintenance in this protocol.  The source node will start a route discovery process, with route request and route reply (RREP) messages in this phase.  Only the destination node can respond to the sender node with a route reply (RREP) message.  It has used to shorten nodes between sender and destination.  Provide multiple data paths for reaching the destination, resulting in load balancing, low latency, and better network performance.  In case of failure of any route, the multiple routing protocols also provide an alternate path.

ENERGY MODEL
Primarily energy usage of sensor nodes classified at the transmission, the energy amplification, and the receiving operations the electronic of radio sensors. Never underestimate a very important parameter that is the distance between the receiver node and the transmitter node. According to the propagation distance, the system chooses a free-space or multipath fading communication channel, If the propagation distance is less than the threshold distance t0. The energy consumption is directly proportional to d 2 ; else it is proportional to d 4 . The maximum energy used to send an l-bit packet starting the transmitter to its receiver over a distance d link has determined by First Equation: E con (l, d) = For sending one-bit data of sensor node usage Econ energy and system use two types of the energy model amplifier coefficients first free-space and second multipath fading denoted Efs and Emp respectively. The threshold distance t0 calculate by Second Equation: t 0 = While Efs and Emp are both amplifiers parameters. When d < t0, the Efs is the amplifier parameter used for the free-space energy model usage by the sensor nodes when d < t0 and d > t0, the sensor nodes use the multipath fading energy model amplifier parameter that is Emp. In the paper, the maximum transmission distance of the sensor nodes not more than t0, which guarantees that nodes in the clusters are inside the transmission range of the proposed Dynamic Multipath Clustering System base on the uneven dynamic modified-PSO (M-PSO).

CLUSTER CREATION AND FORMATION
Cluster-based architectures make more efficient use of resources, and cluster creation includes cluster members (CM), cluster heads, and non-cluster heads. A structured head node manages this grouping of nodes known as CH, which manages the cluster, collects data from cluster members, and sends data to the base station. A Cluster Head is chosen by weight that may correlate to the capacity of a node to conduct additional responsibilities such as near BS, no. of neighbors. It can calculate by considering factors like node residual energy with parameters cluster member (ID), Neighbor node (neighbor ID, cluster head IP), and neighbor cluster (NCH-IP, cluster gateway-IP). Based on the Base Station site, we calculated the distance through BS to other node numbers, using distance values, and determined the neighboring list. To determine the k-optimal clusters in mathematical representation, we consider the multi-object function of a network.
Following the method k-means, the query is known Expectation-Maximization.
The E-step assigns data points to the cluster nearest to them.
The multi-objective function of it is: Where wik =1 belongs to cluster k, for data point x i ; and again that, wik =0. μk is also the centroid of a cluster of x i . It's a two-part minimization issue. Concerning wik, we first reduce J and treat μk set. Then we decrease J concerning μk, and fix wik. Practically speaking, we first distinguish J w.r.t. wik, and keep informed cluster assignments (E-step). After the cluster assignments from the previous step (M-step), we then separate J w.r.t. μk and recalculate the centroid. In certain words, apply the data point x i to the nearest cluster determined by the total amount of its space from the centroid of a cluster is being squared.

CLUSTER HEAD (CH) SELECTION
Cluster head selection mainly contains the following parameters Cluster-head (CH) (cluster member IP), Neighbor node (neighbor node IP, cluster head IP), and Neighbor cluster (NCH IP, cluster gateway IP). Cluster selection of dynamic multipath routing protocol performs few computational works to measure the energy consumption ratio (ECR) for each selection of the cl uster heads: DMPRP calculates their residual energy transmission ratio (RETR) after calculating the ECR: Where toBS is the distance of CLN from BS If we add ECR equation, the RETR will be

RETR (m) = -----------------------------(9)
When ECR and RETR determine for the current round, DMPRP calculates the combined value of the ECR and RETR nodes over a specific duration of the instance. Because the rate of energy consumption is power p= E r / T, the Riemann sum is used by the total power degenerate over time. This ECR may determine as an approximation overtime period of an instance (Einstance).

E instance -ECR = -----------------------(10)
Where Einstance-ECR is exclusively E.C.R. The energy consumption incorporated over a period of time Likewise, DMPRP calculates the previous instance RETR to the above equations; thus, BS selects a set of appropriate nodes with the lowest energy consumption and optimum residual energy. Also, the distance factor plays a role in choosing a CLN as a CH node for the node in the central region. The pseudo-code for the selection of DMPRP CHs shown below. Such following work-steps reflect the procedure of section CHs indicated by the algorithm.

OVERVIEW OF MODIFIED PARTICLE SWARM OPTIMIZATION FOR PACKET SCHEDULING
Based on the node fitness, the route selection takes place. We proposed an algorithm called modified particle swarm optimization (M-PSO) for packet scheduling, which creates a dynamic multipath routing protocol to organize an optimized route selection. Prior to introducing the projected algorithm, we delineate the modified PSO (M-PSO). Initially, PSO chooses an appropriate number of nodes with a set of node fitness and distance placed in the N-dimensional space, the fitness and distance of each node is updated based on eqn (12) and (13).
Where represents nodes fitness and represent node distance PSO derives the optimal dynamic multipath routing for packet scheduling into three different scopes to classify the node route optimal solution.
The PSO summarizes the optimal results as cluster head best Cluster member best represents the best point among some neighboring nodes, and is a Noncluster head that best presents the best point among the non-clustering nodes bests.
Positions of Cluster head best, cluster member best, and non-cluster head represent as The next node fitness and distance of the nodes are updated as follows Where i= {1, 2, and j= {1, 2... Np}. Np Represents the number of nodes, w,-001 2 is random parameters specified within the range of < 0 to 1 > after many repetitions; the nodes will get the optimal solution in the search space.

FLOW OF CLUSTER SELECTION USING M-PSO ALGORITHM
Initially, cluster creation and formation are done using a dynamic multipath routing protocol (DMPRP). After the formation of clusters, we need to select the best cluster head selections, which aggregate the data to the base station, and the base station computes the best selection based on the probability. The probability of energy consumption ratio calculates for CHs and NCHs using M-PSO algorithm from Equation (7). Suppose a randomly generated cluster head is less than the threshold valve; select as CHs if not select as NCHs. Based on the best probability and fitness valve, the base station (BS) selects the cluster selection using the M-PSO Algorithm. If the fitness function is less than the CHs and NCHs selections, select the respective best selection. Repeat the process until the best selection scheduling done.

Fig. 4.1 Flow Diagram of Cluster Selection using PSO
Based on the cluster heads' selection, which is being calculated from the M-PSO algorithm, the results is taken to find the optimized shortest path by using GA.

GENETIC ALGORITHM (GA)
The fundamental thought of GAs for evolution reflects the ideals that Charles Darwin laid down above all. GA is a speculative search-algorithm about the natural selection principle. The genetic cross over greatly enhances the algorithm's ability to meet and generally find the optimal outcome. Holland also had another objective; first of all, to enhance the knowledge of the natural selection process; furthermore, to create an artificial structure with similar functionality to the natural system [5]. Optimization is the best way to get the right solution from the specified parameters. For optimization, the Objective function is defined. It does not mean having the Best outcome to get optimization. It implies having the best quality, which most accurately meets the criteria. GAs is perfect for all those who need optimization.

GA Operations
The GA's effectiveness depends on the employ of its operators, which constitutes the GA way of action. Operations with the GA are [5][6]: 1. Selection: The chromosomes are selected as of either the population in the selection phase according to their Objective Function significance. The Objective Function is the supreme node to select the continued existence of a chromosome. The chromosome by way of a more excellent fitness value is more likely to contribute its one or more offspring over the next generation.

Crossover:
It is characteristic of other methods of optimization. The crossing of the chosen parent occurs on both the base of a particular crossing over a given mechanism; 1point crossover or 2-point crossover. New off-springs create after fusion of parents.

Mutation: Mutation performs a secondary role in decision making in a genetic algorithm.
The Mutation is required as there may sometimes be any loss of potential genetic information during the reproduction and crossover processes. [7]. The Mutation is generally done by turning bit at a rate of Mutation. The primary aim is to bring about diversity in the population.

Representation of String
The actual chromosome is represented across the population through a number sequence. Each number means its nodes whilst the string represents a network path. The length of the chromosome is variable, none set. Then, the more nodes across the chromosome, the more hops the data transfer will be. Alternatively, they reflect large amounts of the population, the chromosome with the same node of origin and destination as described. From that population count, random sampling is carried out. The remaining chromosomal ones are not taken into consideration.

Population Initialization:
Population is randomized 30 times for n chromosomes and selected as 33 percent. superior to the already present chromosomes. 5. Then ' stop ' if the stop situation is happened to meet, and the best solution within the current population is returned.

FLOW OF CLUSTER SELECTION USING RESULTS OF M-PSO WITH GA
Initially, the population is selected arbitrarily based on the random selection, and the best-fitted selection of the CHs AND NCHS are selected, which are generated from the results of the M-PSO algorithm. The best fitness values of the chromosomes are selected to cross over the offspring. After crossover the operation, a new offspring will produce, and the next mutation operation is performed. While performing mutation operation, Case 1 is we need to trace the missing and repeating nodes to sort out the data. Case 2 is if no missing and repeating nodes are present, then we need to select any random numbers and swap. Case 3: We need to check that the chromosome's length is less than no need to perform Mutation. Else case 4: We need to see the length of the chromosome greater then flipped it with the missing node. Loop's iteration is known "Generation." The first repetition (Generation 0) of the population is processed on arbitrarily selected individuals. After getting the end condition, the best promising result is selected as per the excellence of the path.

EVALUATING THE FITNESS VALUE OF A MUTATED OFF-SPRING'S:
The fitness values are measured for both mutated offspring. The mutated offspring substitute chromosomes of the worst fitness value than that of the offspring. Worst chromosomes are considered as discarded. Population size is constant. First, the fitness function verifies the accessibility of a bandwidth. Unless the desired bandwidth is not accessible, then the path is not careful for the Optimum-path. Alternatively, else it calculates the delay-factor and the number of path hops. The sustainability for each route is determined using the Objective Functions below.
Let represents a fitness function of cluster quality, and an average of intra-cluster distance and represent a function of energy efficiency. For the minimization of and functions, an optimal selection of CHs must be made. The 2-objective functions are normalized between the range 0 and 1, such that the linear combination of are minimized in an efficient manner. The fitness function for the proposed modified PSO (M-PSO) based scheme is derived from using . The linear programming formulation for the optimal selection of CHs is as follows: We consider the following parameters:  Existing energy  Average inter-cluster distance  Cluster quality Derivation of the fitness function

Cluster Quality for C.H.s and N.C.H.s (C.Q.):
The aim is to enhance the quality of the clusters (CQ) between the CHs and NCHs and their cluster members to maximize the energy consumption ratio (ECR). Provided Signal Strength Indicator (RSSI), it tests the energy level provided by RF client. CC2420 transceiver from an access point or router is for calculating the receiver's low power and low voltage. Several kinds of research have proved that RSSI is a precise and simple parameter for estimating the route's quality. It is possible to estimate the route link quality between cluster member n I and local CH j as -----------(23) /*for cluster head */ ------(30) /*for Non cluster head */ The Route link quality is inversely proportional to the RQ. Value, therefore, in order to enhance the cluster quality, the needs to be minimized. /*for cluster head */ The Route link quality is inversely proportional to the RQ. Value, therefore, in order to enhance the cluster quality, the needs to be minimized.
Average ICD: Average ICD (intra-cluster distance) represented by , is the average of distances of all nodes from the selected CHs and can be estimated as -----(25)/*for cluster head */ ------(32)/*for Non cluster head */ Throughout intra-cluster communication, all nodes consume energy in sending data to their CHs and therefore need to be decreased to sort the energy consumption ratio (ECR). Thus, if a node is located close to all other nodes, it is selected as CH.
Average cluster quality (CQ) and average inter-cluster distance (ICD) for an optimal CH range need to be reduced for all CHs. So our first objective role is as follows. For the optimum selection of CHs, the total energy of all CHs must be maximized, i.e., the reciprocal need must be minimized. Also, a node's residual energy may be an essential selection criterion for CHs, since the node with more battery capacity is more capable of data aggregation and cluster management. In addition, the energy absorbed is distributed equally between all the SNs. So our second objective function is as follows.
In the proposed strategy, the two objective functions defined above are not in profound conflict. Therefore it is prudent to reduce the linear combination of both of these objective functions instead of reducing them individually. It gives a unique optimal solution; therefore, we use the fitness function described below.
-----(29)/*for cluster head */ ----(36)/*for Non cluster head */ Minimizing the fitness value is our primary objective as lower fitness value results in better particle position, thereby leading to the optimal selection of CHs.

Experimental model and PERFORMANCE EVALUATION
In order to determine the efficiency of our proposed model Dynamic

Performance Metrics
In this experiment, we considered these following parameters, energy consumed, routing overhead, end-to-end delay, communication delay, and packet delivery ratio to determine the performance of proposed DMPRP by comparing with NEST and EC-PSO approaches.

Results
In our first experiment, we vary the number of nodes as 50, 100, 150 and 200. Some of the metrics are as follows, which are used for understanding the performance of the routing approach and for comparing it with nest-sites selection process-based approach NEST [23] and (EC-PSO) stand for Energy Centers Searching using PSO [24]. We considered two different scenarios, number of nodes and number of rounds:   The above results demonstrate the performance of proposed protocol DMPRP, NEST, and EC-PSO for the different number of nodes. Based on the results, the more number of Cluster Heads was taking place to distribute data from non-cluster members' zone to the nearest cluster head. The energy-consumption of the overall system varied concerning the number of nodes. The Fig  6.1, and 6.6 Defined the number of packets was successfully distributed to the base station, based on the results the packet delivery ratio was decreased with respective of the number of nodes and number of rounds. Based on figure 6.6, the overall delivery ratio varied with respect to the number of rounds. According to the overhead results presented in Fig 6.2 and 6.7, the Overhead is increased with the respective number of nodes and rounds. When more number of nodes distributed the data, the more routing was processed, which impacts more on control packets. As per Fig 6.3 and 6.8, the energy-consumption increased with the respective number of sensors, and the cluster head formed connectivity of non-cluster and cluster members. Based on the energy rate level, the cluster head occupied extra energy, and the proposed model optimizes the communication by minimizing the routing packets for the number of rounds. Fig. 6.4 and 6.9 Present the end-to-end delay performance comparison of DMPRP, NEST, and EC-PRO based on the results, the proposed protocol DMPRP end to end delay rate is increased due to the more number of participants and more number of cluster heads, which impact on the packet delay, the overall performance of DMPRP is 12% less compared to the NEST and EC-PSO. In throughput scenario, the fig 6.5 and 6.10 shown the throughput variation with respective of the number of nodes and number of rounds, based on the derived results, the throughput rate was slightly down, while comparing to the NEST and EC-PSO the throughput rate was increased with respective of the number of packets was passed on over the network.

CONCLUSION
Here in the paper, we proposed a Dynamic Multi-path Routing Protocol (DMPRP) based on a modified (M-PSO) particle swarm optimization algorithm for best cluster head selection. The concept is to segment the network field topology into a number of groups (clusters) predicated on node organization to get a more efficient energy-consumption ratio (ECR) to balance the load and improve performance by selecting the cluster head (CH). We further need to optimize a route path from NCH to CH based on the selected cluster head. The results are used to find the optimized shortest path using the Genetic Algorithm.