## 4 Proposed Algorithm EEWBP
### Network Operation
#### 4.3.1 Cluster Formation Phase  
In the first phase, active nodes and CHs were picked to represent a cluster. The EEWBP sum up assigned weight values according to the criteria as different performance parameters for every operation. EEWBP identifies active nodes and CHs, and then executes data transmission operations using the weighted-sum methodology. The data transmission procedure is executed in the second process. For example, data is sent from CMs to their respective cluster hosts (intra-cluster communication) and from various designated cluster hosts to sink hosts (inter-cluster communication) in each cycle of communications. As part of the EEWBP algorithm, SNs collect information about residual energy and other parameters. In addition to their coordinates, the SNs know the distance between them and the distance to the sink. Based on the Euclidian formula, these distance estimates are made. After each communication cycle, all SNs are used to update their information, considering the amount of battery power that they have left. As a result, each SN broadcasts a new packet of information in its cluster radius, corresponding to the sensor's detecting range. As soon as each node receives the message, it calculates its Sum weight (Sw). Based on the excess energy of the SN, the distance between node and sink, the degree of a SN, and the trust value, Sum weight (Sw) is determined. The procedures required in selecting active nodes and CHs during the first communication round of EEWBP can be seen in Algorithm 1 and Figure 2, and the detailed procedure is mentioned below:  
1. Dismantle SNs to cover the entire required region;
2. Computation of residual energy R\({}_{\text{e}}\) of each node is done in the starting and if it is less than the threshold value, then it is skipped from the current round and can participate only in the next round of communication; \[\text{Residual energy}=\text{initial energy}-\text{current energy}\] (4)
3. Calculation of all the minimum distances between each node to the sink as denoted by Dist(i,j). To calculate distance among every node to CH and between CH to BS, we use a Basic Equation (5) known as three-dimensional Cartesian space, in which two locations have three coordinates each. In order to determine the distance spanning between two points, A(x1, y1, z1) and B(x2, y2, z2), use the formula: \[\text{D}^{2}=(\Delta\text{x})^{2}+(\Delta\text{y})^{2}+(\Delta\text{z})^{2}\] (5)where \(\Delta x=x1-x2\,,\Delta y=y1-y2\,,\Delta z=z1-z2\);
4. Calculation of each sensor node's net weight using a weighted-sum equation (Sw)  
\[\text{Sum weight }(\text{Sw})=\text{Re }\times x1+\text{ Avg }\text{ FS }\times x2+\text{ SND }\times x3+\text{ Nbq }\times x4+\text{TTV} \tag{6}\]  
The values of x1, x2, x3, and x4 are 0.6, 0.3, 0.2, and 0.1 for particular application;
5. Identification of the SN with the highest value of 'Sw' as the active node for a certain region;
6. Each active node inside its sensing network radius broadcasts an updated packet to the rest of the network;
7. Calculation of 'CH wpp' (CH weighted-sum) using the determined 'Sw' of the sensor node and the distance between it and the sink;
8. Nodes with the lowest 'CH wpp' values are picked as candidates for CH for the specified active nodes;
9. Each selected CH broadcasts an updated packet inside the cluster radius;
10. If residual energy of CH is less than 25% then again CH re-selection process is repeated. ```
Start
1:For every SN in network deployed on space;
2:Calculate residual energy \(\text{Re}\) of every node
3:If (\(\text{Re}_{\text{e}}<\text{threshold}\))
4:Skip the node for current round
5:Calculate of all the minimum distances between each node to the sink Dist(i,j). 6:Calculate each sensor node's net weight using a weighted-sum equation including Min Avg flying speed, 'SND(degree of a sensor node), nbd(number of neighbors), and Trust value
7:Highest value of weighted-sum of a SN is denoted as active node
8: Each active node inside its sensing network radius, Transmit an updated packet to the rest of the network.