## 4 Proposed Clustering Technique in Wireless Sensor Networks (WSNs)
### Cluster Formation and Cluster Head Selection  
Clustering enhances routing in WSNs by improving energy efficiency, facilitating data aggregation, and supporting the development of efficient routing protocols tailored for hierarchical network structures [1; 8]. This routing technique models the food search method by honey bees, where SNs find the optimal distance to a CH. CHs also use optimal distance to communicate and route data packets to the sink node or base station through another CH. In this regard, the forward and backward passes are performed iteratively to locate a CH with the optimal distance. The following subsections describe the cluster formation and bit error determination stages. During this process, the energy model and Bit Error Rate (BER) determination are considered in cluster formation and CH selection at every given time. These are described as follows:* _Energy model_ The study adopts the energy model by [10] to determine the energy requirement for a sensor or CH to send _n-bit_ of a data packet over a distance \(d\). Hence, the transmission energy is defined in Equation (13) as: \[E_{tx}(n,d)=E_{xtelec}(m)+E_{txampt}(n,d)\] (13) where \(E_{xtelec}(m)\) represents the energy consumed for electronic transmission and \(E_{txampt}(n,d)\) is the energy consumed for amplification during transmission. Hence, the energy consumption \(f(x)\) is expressed in Equation (14) as: \[f(x)=\left\{ \begin{aligned} & n\times E_{dec}+\left(n\times E_{fs} \times d^{2}\right),\ d<d_{0}\\ & n\times E_{dec}+\left(n\times E_{amp}\times d^{4}\right),\ d \geq d_{0}\end{aligned} \right.\] (14) where \(f(x)\) is the energy consumption for sending a message over a certain distance in the network. Where \(E_{dec}\) represents the energy consumed for the electronic transmission, \(E_{fs}\) represents the energy required for signal amplification, d is the distance over which the message is being transmitted and \(E_{amp}\) represents the energy consumed for signal amplification. Furthermore, the energy consumed for receiving the message from a sender is computed in Equation (15) as: \[E_{rx}(n)=n\times E_{dec}\] (15) The residual energy (\(E_{res}\)) of a sensor node is calculated using Equation (16): \[E_{res}=E_{in}-E_{tx}(n,d)+E_{rx}(n)\] (16) where, \(E_{in}\) is the initial energy of the sensor node, \(E_{tx}(n,d)\) is the transmission energy calculated earlier, and \(E_{rx}(n)\) is the energy consumed for receiving the message. The study utilized the Euclidean distance formula to compute the distance \(d\) between SN and CH and between CHs and the sink node or the base station (BS). The Euclidean distance formula is a fundamental concept in mathematics that calculates the straight-line distance between two points in Euclidean space [23; 24]. In a two-dimensional space (such as a Cartesian plane), the Euclidean distance \(d\) between two points \((x_{1},y_{1})\) and \((x_{2},y_{2})\) is expressed in Equation (17): \[d=\sqrt{\left(x_{2}-x_{1}\right)^{2}+\left(y_{2}-y_{1}\right)^{2}}\] (17)  
1. Bit Error Rate (BER) Determination The Bit Error Rate (BER) is a measure of the percentage or fraction of bits in a data stream that has been corrupted during transmission [25; 26]. It represents the ratio of the number of erroneous bits received to the total number of bits transmitted over a specific period, which is expressed in Equation (18). \[BER=\frac{B_{tner}}{B_{tnt}}\] (18) where \(B_{tnt}\) represents the total number of bits transmitted and \(B_{tner}\) is the total number of erroneous bits received. A lower BER value indicates a higher level of data accuracy and reliability in the communication system. For instance, a sensor of BER of 0.01 means that 1 out of every 100 bits transmitted is received in error. BER is crucial in assessing the quality of communication channels, especially in scenarios where noise, interference, or channel impairments can introduce errors in the transmitted data.