# Robust Clustering Routing Method for Wireless Sensor Networks Considering the Locust Search Scheme
## 4 The New Clustering Routing Approach
### Configuration Step  
In its initial stage, network parameters and their architecture need to be defined. This fact is because it is possible to define several network configurations depending on the requirements of the application. The network is mainly defined by the characteristics of its sensor nodes. The WSNs involve a set of nodes that define a topological structure where the information should be collected. Therefore, our protocol considers some network constraints and a determined topology. These assumptions have been taken into account in order to maintain compatibility with other works reported in the literature. Network assumptions:  
1. The network presents one base station \(BS\) a group of cluster heads elements \(\mathbf{CH}\), and a set of sensor nodes \(\mathbf{n}\). 2. The energy in the base station is supplied through an external source, while the power level of each sensor node is bounded. 3. A particular sensor node is considered dead or useless when its energy level is empty. 4. All sensor elements have a homogeneous characteristic. Network topology:  
1. In its initial stage, all nodes are randomly distributed in the area where the information is collected. 2. The position of each node does not change during the network operation. 3. The base station is located in the middle of the sensing section. 4. It is not fixed the number of clusters of the structure. 5. Every generic node (also known as a leaf node) is assigned to its nearest cluster head element. Once the network structure is already defined, the process for the generation of the connections for the whole network is executed. This step is the configuration phase. Under this phase, an initial set of CHs is selected to produce the initial cluster structure. In the selection process of the optimal set of CHs, our proposed scheme adopts the following energy model of consumption. Model of Energy Consumption  
In a general WSNs, the processes that consume most of the energy stored in the system are data reception and transmission. The amount of necessary energy for transmitting or receiving information varies according to the distance \(d\) and the packet size where the information is encoded. Under this perspective, the required energy level for transmitting a packet with \(l\)-bit is expressed by the following formulation. \[E_{TX}(l,d)=\left\{ \begin{array}{ll}lE_{elec}+l\varepsilon_{fs}d^{2},&d\leq d _{th}\\ lE_{elec}+l\varepsilon_{mpd}d^{4},&d>d_{th}\end{array} \right. \tag{10}\]  
where \(E_{TX}\) represents the level of energy consumption to transmit information, \(l\) symbolizes the encoded data size, \(E_{elec}\) corresponds to the dissipation of energy when it is transmitted or received only one bit of data, \(\varepsilon_{fs}\) denotes the energy factor of dissipation in the free space model, \(\varepsilon_{mp}\) refers to the factor of energy dissipation considering a multipath attenuation formulation, and \(d_{th}\) represents a threshold value that defines the maximal transmission distance. It is computed by the following equation. \[d_{th}=\sqrt{\frac{\varepsilon_{fs}}{\varepsilon_{mp}}} \tag{11}\]  
The energy needed for receiving a packet of \(l\)-bit is computed by Equation (10). \[E_{RX}(l)=lE_{elec} \tag{12}\]A general sensor node \(n_{i}\) can only transmit information to the cluster head. Under such conditions, the energy consumption of node \(n_{i}\) can be calculated by the following model:  
\[E(n_{i})=E_{TX}(l,d) \tag{13}\]  
On the other hand, the energy consumption of a cluster head \(CH_{j}\) integrates several elements: the energy consumption when packets are received, the collection of the data information, and the transmission of the collected data to the base station. Therefore, the energy consumption for \(CH_{j}\) is computed by the following expression:  
\[E\big{(}CH_{j}\big{)}=E_{RX}(l)N_{j}+\big{(}N_{j}+1\big{)}IE_{DA}+E_{TX}(l,d) \tag{14}\]  
where \(N_{j}\) denotes the number of nodes that belong to the cluster \(j\). \(E_{DA}\) corresponds to the consumed energy for 1 bit of collected data.