## 4 Clustering and Routing Strategy
### Energy Model Configurations  
The energy scheme employed in this research is similar to those planned in the standard LEACH approach. The energy expenses experienced by the analog-digital electronics (ADE) units, power unit, processing unit, and memory unit of sensory nodes are added together to determine the overall cost of sending n-bit data along with a distance, D. The cost of using multiple paths (\(\phi\)) or free space (\(\Psi\)) depends on whether the distance among two communicative nodes is more or less than a distance specified threshold. In addition to those assumptions, a 1 Mb/s data transmission speed with 914 MHz core frequency is considered for the transmitter of regular services in smart city infrastructure. The costs of data reception per n-bit data are estimated as the digital and analog component energy expenses. The energy used by individual network components can be defined as follows.  
CHs energy consumption encompasses the energy required to create the cluster and additional tasks allocated to such a CH position. Primary roles of selected CH include selection announcements, aggregation of sensed data, determination of an alternate route in case of route failure, and relaying of the essential data from mn to BS and vice versa.  
\[\xi=\sum_{R=1}^{n}\left[e_{sel}+e_{adv}+e_{B}+e_{SD}+e_{(T_{x})}^{A}+e_{P}^{A}\right] \tag{1}\]  
\[e_{sel}=\left[(\frac{\eta}{\mathbb{T}})\times(e_{(T_{x}|R_{x})_{dc}}+\hat{d}_ {BS}^{2}.\psi)+((\frac{h(N-1)}{\mathbb{T}})\times\alpha)\right] \tag{2}\]  
\[e_{adv}=e_{(T_{x}|R_{x})_{dc}}\times\eta \tag{3}\]  
\[e_{B}=e_{(T_{x}|R_{x})_{dc}}\times\eta\times N_{mn} \tag{4}\]  
\[e_{SD}=\left[f\times N_{mn}\times\Psi\times e_{(T_{x}|R_{x})_{dc}}\right] \tag{5}\]  
\[e_{T_{x}}^{A}=\left[(\frac{\varphi}{\mathbb{T}})\times(e_{(T_{x}|R_{x})_{dc}} +\hat{d}_{BS}^{2}.\psi)+((\frac{h(N-1)}{\mathbb{T}})\times\alpha)\right] \tag{6}\]  
Similarly, the data perceiving from external environs, transmission, and reception activities are concerned with each mn's roles. Thus, each mn's total energy depends on the energy spent for set-up, receiving, and transmitting required data. Algorithm 1 shows the Distribution and Computations of clustering.  
```
Input: \(M_{d},mn_{i},X\) Output: Ranking, CH selection, and Intra-Cluster Routing \(\forall mn_{i}\)\(BS_{i}\) sends \(B_{sig}\); END \(\forall BS_{i}\) Upon receiving \(Bsig\) from \(BSi\); \(mn_{i}\) sends \(Back_{sig}\); END \(\forall mn_{i}\) Upon receiving \(Back_{sig}\); \(BS_{i}\) computes \(R_{i}\); \(R_{i}=\sum_{(i=1)}^{n}(M_{d}+X)\), where\(M_{d}<\text{meanm}_{i_{\text{T}}x_{i}}[Rad]\{R_{1},R_{2},R_{3},\ldots R_{n}\}e \mathbb{Z}_{i}\) \(\text{END}\ \forall\mathbb{F}^{th}\ frame\) \(While(condition:(T_{\text{T}}(R_{i}||CH_{i}))\) Select CASE (current slot); \(CASE\_1:Slot\_0\) \(R_{i}\&\&CH_{i}\)\(gain\_{i}\); BREAK; \(CASE\_2:(T_{\text{T}}(R_{i}))\) \(ends\_{\
eq}\)\(ptoCH_{i}\); \(IF\)\(gexceedsST\) \(Rif\text{$forwards$\
eq$}\text{$}1-\mathfrak{H}||2-\mathfrak{H}Rn\); \(ENDIF\) BREAK; \(CASE\_3:(T_{\text{T}}(CH_{i}))\) broadcast \(\varphi\) to \(Ri\); BREAK; END CASE; \(Current\_slot\)\(\leftarrow\)\(Next\_slot\); \(END\mathbb{F}^{th-}frame\)
```  
**Algorithm 1** CRS algorithm for Clustering selection and Routing.