# Proposed Methodology

- Group Optimal Algorithm Using Cuckoos Search for the Cluster Formation
- Cluster Formation Using Group Cuckoos Algorithm
- Modified Task Selection Algorithm Used to Compute the Optimal Path
- Modified Task Selection Algorithm Using Chemical Reaction Optimization
- Node Selection Algorithm for the Aggregated Node

The proposed system consists of IEM-EDR protocol and FOG implementation for industrial fault detection and correction.

This proposed system consists of different algorithms:

- • First, the group optimal algorithm utilized for forming the clustering that will decrease the energy consumption of nodes.
- • The modified task selection algorithm used to compute the optimal path between industrial environments to data processing centers (monitoring room).
- • Then introduce the node selection algorithm for the aggregated node computation among multiple nodes in the network.
- • And for the proposed network, machine learning algorithm implementations are utilized.

## Group Optimal Algorithm Using Cuckoos Search for the Cluster Formation

**Clustering: **grouping of sensor nodes by connecting the dedicated network is considered as the clustering. In larger WSN the sensor nodes work together; thus, depending upon the operation the clustering can be done. For organizing the cluster the root node is used in each cluster. The network lifetime is enhanced by cluster formation. The data is collected by CH in the cluster. The CH will collect the data from the BS and aggregate afterward forward data to the target node. The parameters used for clustering are listed below:

**Residual Energy: **in the clustering process after completing some rounds the selection of the CH depends on energy that remains in the sensors.

**Initial Energy: **this parameter is used for selecting the CH. It is defined as the nodes’ energy when the algorithm starts.

**Energy Consumption Rate: **the formula for energy consumption is given below:

Where Ej is the initial energy and Eft) represents each node’s residual energy, respectively, and у represents current round.

**Energy Consumption Model: **Energy’s large amount is consumed by the sensor node, and the expression is given by:

At the receiving end, the energy consumption mainly depends on the data size and the receiving energy is described as:

where E, represents the per bit dissipation of energy at the transmitter, E_{r} is defined as the per bit dissipation of energy at receiver, the electronic circuit’s energy consumption in the transmitter and the receiver is given by E_{lec}, E_{da} is the consumption of energy in l-bit aggregation of data, e_{fs} is the coefficient factor of free space, e_{rap }multipath coefficient factor, data packet size is represented by m, d represents the distance among receiver and transmitter, and d_{0} represents threshold distance.

### Cluster Formation Using Group Cuckoos Algorithm

Yang and Deb in 2009 [33] proposed the optimal Cuckoos search algorithm. It is based on some cuckoo species’ obligate brood parasitism who lays their eggs in other species’ host birds’ nests. Furthermore, the maximization problem is solved by utilizing CS, for multi-dimensional space. The fitness value quality is based on objective function value. The three rules in the CS are listed below:

- • At a time a cuckoo lays only one egg and it will dump its egg in a nest chosen randomly.
- • The next generation is calculated by taking the finest nest with the highest quality of eggs.
- • It is considered that there is a fixed host’s nest, the egg laid by a cuckoo is calculated in probability and it is defined as P
_{0}. By this, the worst nests are discovered.

Depending upon different solutions the fitness values are calculated. On addition of levy angle’s product as well as existing solution’s step size, the new solution can be updated toward the optimum point. For the i^{th} cuckoo the new solution is given by X. The expression for the levying is presented below:

Where E_{t} is was taken by a standard normal distribution and for random walks it has unity standard deviation and zero mean or for Levy flights drawn from Levy distribution. The step size is given by a and its value is more than 0 (normally it is considered as 1). ^{* 1 2 3 4 5 6 7 8 9 10 11}

Algorithm 1 Group Cuckoos Algorithm for Clustering Formation Input X; and value of i.

Output Cluster formation

- 1 Objective function is described
- 2 Initialize the population of n host is x
_{s}(i = 1, 2......n) - 3 if (t
f) - 4 Calculate the step size by: Step size = rand * (nest (randperm (n),:) - nesttrand perm (n),)) new_nest = nest + stepsize.*K (6) where К = rand (size (nest)) > p
_{a}. - 5 Select a cuckoo randomly based on the levy flights and also calculate the fitness value

*i* /■' x *w,* | x 100//j where F- frequency, w is the weight and 1 is the message length

- 6 Select nest among n host
- 7 if (fj>fj)
- 8 The worse nest is assigned as P
_{a}and new nest is identified - 9 Maintain the best solution
- 10 Repeat up to the best position is obtained
- 11 End

Return Cluster Formation

## Modified Task Selection Algorithm Used to Compute the Optimal Path

The algorithm’s primary goal is to identify the optimal path between the nodes. The links are formed using the chemical reaction algorithm.

### Modified Task Selection Algorithm Using Chemical Reaction Optimization

The CRO (chemical reaction optimization) depends on swarm intelligence meta-heu- ristics. The molecular structure in the CRO gives the complete solution. It is considered that normally two types of energies are there in molecules, that means, KE (kinetic energy) and PE (potential energy). The PE-based the virtue of its structure or it can be stated as it is a stable one. If the PE is low then there is a stable structure. But in KE the molecules possess energy by their motion virtue. By measuring the potential energy function the quality of a molecule can be calculated. The expression for PE is given by:

Where, f represents potential energy function, an objective function and % indicates the molecule structure.

The change in the molecular structure from *XX'* and it is defined as the *PE _{y} > PE*

_{x}- or it can also be defined as the

*PE*The KE of the molecules defines the capability for escaping from locale optima. The molecules collisions are divided as: inter-molecular collisions and uni-molecular collisions. Furthermore, there are two types of uni-molecular collisions, that are decomposition and on-wall ineffective collisions. The inter-molecular is divided into ineffective collisions and synthesis. The mathematical expression is given by:

_{y}+ KE_{y}> PE_{X}■.**On-wall ineffective collision: **the expression is as:

Where x is the current molecular structure, the changed structure is given by But, there exists no dynamic collision. The resultant molecule structure is similar to that of the original molecules and the expression is given by:

where KE_{LR} represents [0, 1] bounded system parameters, and lost energy amount to environment when hit by a molecule is given by:

A central energy buffer stores the lost energy. Decomposition reaction is encouraged with the help of stored energy.

**Decomposition: **after hitting with the container wall if the molecules split into two or more parts it is known as decomposition. There exists an energetic collision, and structure is difficult to obtain. The condition is given by:

The original molecule’s structure is represented by *у* and resulted structures are represented as x'i and *y.*

The changed structure is given by:

The value is assigned as:

Therefore:

where q indicates the uniformly generated random number from [0, 1] interval. Commonly *PE,; PE*_{zi} and *PE,;* have similar energy. Because of the on-wall unproductive collisions sequence, a molecule’s KE decreases. Therefore, from the central energy, some energy is drawn this is used for the decomposition reaction:

If Eq. (3.4) holds, the change is allowed and we can calculate:

The random uniform numbers are indicated using q_{h} q_{2}, q_{3}, and q_{4} and from the [0, 1] interval random numbers are generated. The updated buffer is:

**Inter-molecular ineffective collision: **this is when after molecular collision, molecules rebound. The on-wall ineffective collision is similar to this. From the central energy buffer no KE is drawn. Here the only energy exchange is there among molecules.

The initial position of the molecules is given by and/_{2}- The obtained structure is taken as *yj* and *y* where *y* and *y' _{2}* are neighborhood structures. The exchange will happen only when the energy conservation condition holds.

It is assigned to a variable and is given by:

Therefore,

Where, *r* repres ents a random uniform number generated in the interval [0, 1].

**Synthesis: **the collision of the molecule occurs and a new molecule or an intermediate molecule is developed. The collision is energetic. From the changed structure, it is very difficult to get the original molecule structure. The condition is given by:

Consider, %, and X2 are original molecules and x' is an obtained molecule. This condition is given by:

**Energy model: **it depends upon the data amount as well as distance. If d (propagation distance) is lower than the d_{0} threshold distance, then d, and energy consumption are proportional. Or else d_{2} and d_{4} are proportional. Each node’s total energy consumption is given by:

where, E_{eU},_{c} represents the dissipated energy per bit when the receiver or transmitter circuit is operating, *e _{fs}* indicate the amplifier energy in the free space,

*z*based on the threshold transmission distance and the transmitter amplifier model. The receiver consumed energy is given by:

_{mp}where, E_{dec} is dependent of various factors like signal spreading, filtering, modulation, and the digital coding.

Algorithm 2 CRO for Compute the Optimal Path

Input T_{t}, the structure of the molecule

Output Optimal path selection

1 Division of Transmitter (T,) into one molecular and two molecular

structures

- 2 Case 1: One molecular structure
- 3 if (Satisfy the decomposition)
- 4 Perform Decomposition operation
- 5 else
- 6 Perform On-wall ineffective collision
- 7 Case 2: Two molecular structures
- 8 if (Satisfy the decomposition)
- 9 Perform Synthesis
- 10 Else
- 11 Perform inter-molecular ineffective collision
- 12 For both case I and case 2, Check for the new minimum PE
- 13 Repeat the process until the optimal solution is obtained
- 12 End

Return Optimal path selection

## Node Selection Algorithm for the Aggregated Node

Node selection is used for the selection of the aggregated node. The algorithm used for selecting the weed optimization algorithm is explained below.

Weed Optimization Algorithm is used for finding the aggregated node. It is based on the agriculture format of the WOA or it is based on the growing characteristics of the weed. Normally the weed plants grow' suddenly and are harmful to gardens, farms, and pastures.

It is used in new conditions and in any environment. Various plant features like growth, production, and seed competition can be numerically emulated by WOA. The weed colonies can be grown with the following characteristics:

- • In each area, spread a limited number of seeds.
- • Depending on the colony quality, the weed is produced from a seed which again produces seeds.
- • Created seeds grow' randomly in the specified area and make new seeds.
- • The process w'ill continue till the maximum amount of plants are grown in a colony.

From the analysis the weeds having lower quality are removed. This will result in the selection of high quality weeds. The step of WOA is given by:

**Assigning the initial population: **the initial population represented as **(P _{inl}). **The generation of initial population is done and it extends randomly in d-dimensional region. The dimension of the plant is taken as d-dimension. The plant in the area is considered as a parameter of decision making. Thus a bunch of various plants will make a colony.

**Reproduction: **as the name indicates, in this section the plants will make seeds for making the colony. The seeds are made by choosing their own quality, colony quality, as well as the produced seeds’ minimum and maximum number. This is indicated using the variable (Nc_S_{max}), (No_S_{min}) and these parameters can be selected by the user. The expression for number of speed is given by:

**Spread of seeds: **The two main processes that take place in this step are the adoption and randomness. In a d-dimensional area, with zero mean and normal distribution the generated seeds are randomly spread. This will give a new scenario in which new plants will grow around the parent plant in d-dimension. The newly formed plants have a variable standard deviation. The standard deviation is given in equation (29). From the equation, it is clear that the initially predetermined values (maximum) to a final predetermined value (minimum).

Algorithm 3

Input Population of plants

Output Aggregated node selection

- 1 Initial population of the weed
- 2 Calculate the fitness value of the initial weed population

F = ^{a} fNU+ Ь fsLA+ ^{c} bisi.

3 Calculate number of seeds

Calculate fitness value for each seeds

- 4 Spread the new seeds
- 5 Calculate the fitness value for new seed
- 6 if(N
_{s}mal) - 7 Remove the seeds with lower fitness value
- 8 else
- 9 Maximum number of iteration is achieved
- 10 End Return Aggregated node selection