# Energy-Efficient LoRa Routing for Smart Grids
## 3 Proposed IoT-Based Communication in Smart Grid Environment
### Clustering  
In this phase, the sensor nodes \(\aleph\) are grouped into clusters using the cumulative-distribution-based low-energy adaptive clustering hierarchy (Cum_LEACH) algorithm. This clustering algorithm helps to improve the lifetime and efficiency of the network, which performs the energy load distribution equally among all the nodes of a cluster with two significant stages, namely setup and steady-state. In the first phase, the formation of the clusters and the electing of the CHs are performed, and then, the data transfer to the BS occurs in the second phase. The LEACH algorithm uses a randomised polling approach to select the CHs to ascertain the energy consumptionamong the network nodes. As the CH selection is random, the LEACH protocol does not ensure uniformity in CH placement throughout the network. There is, thus, the possibility that the CHs will be concentrated in certain areas and may not be present in some other areas. Therefore, a cumulative distribution approach for selecting the CH is proposed. 1. Cum_LEACH cluster head selection: CHs are responsible for collecting the data from all the nodes of their own clusters and transmitting the information to the BS. This reduces the number of transmissions to the BS and ensures a balanced energy utilisation of all nodes and a more extended network lifetime. Each node participating in the CH selection process is assigned a random value \(\ell\) between 0 and 1. The probability of a node being selected as a CH is defined using a uniform probability \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Symbol** & **Definition** & **Symbol** & **Definition** \\ \hline \(\aleph\) & Set of sensor nodes & \(\aleph_{i}\) & \(i\)th sensor node \\ \(\ell\) & Random number & \(\Omega_{ddf}\) & CDF \\ \(\alpha\) & Probability & \(r_{cu}\) & Current round is modelled \\ \(\lambda(i)\) & Threshold & \(g\aleph_{i}\) & Nodes do not \\  & & & contribute as CHs \\ \(\aleph_{CH(i)}\) & Number of CHs & \(Fn(\bullet)\) & Fitness function \\  & selected & & \\ \((h_{\min},h_{\max})\) & Minimum and & \(y_{i1},y_{i2}\) & Learning parameters \\ \(z_{m}\) and \(e_{m}\) & Exploration and & & \\  & exploitation & \(g_{b}\) & Global best solution \\ \(d\) & The current iteration & \(\phi(\bullet)\) & Quadratic kernel \\  & Individual’s best & \(e_{m(d)}\) & Current exploration \\  & solution & & values \\ \(e_{m(d+1)}\) & Position & \(\psi_{i}\) & Routing paths \\  & Individual’s best & \(e_{m(d)}\) & Current exploration \\ \(p_{b}\) & solution & & values \\ \(\gamma\) & Random number & \({}^{ml}\psi_{(bst)},{}^{fm}\psi_{(bst)}\) & Best-adapted male \\  & (between 0 and 1) & & and female \\ \(\tau\) & The transition & \(\zeta\) & Inverse probability \\  & parameter & & \\ \(\zeta^{\prime}_{(p,d)}\) & Regeneration & \(v_{q}\in(0,1)\) & Random parameter \\  & probability & & (between 0 and 1) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Notations and definitions. distribution function. This is calculated using the cumulative distribution function given in Equation (2). \[\Omega_{cdf(\ell)}=\alpha(x\leq\ell) \tag{2}\]  
where \(\Omega_{cdf}\) is the cumulative distribution function, \(\alpha\) is the probability, and \(x\) is the random variable indicating the nodes. In the CH selection phase, each node must calculate the probability threshold value using Equation (3). The node elects itself to become the CH when the cumulative probability function is smaller than the threshold. \[\lambda(i)=\frac{c}{1-c(r_{cu})\text{ mod }\left(\frac{1}{c}\right)},\quad i\in^{g} \aleph_{i} \tag{3}\]  
where \({}^{g}\aleph_{i}\) is the set of nodes that do not participate as CHs in the former rounds and \(r_{cu}\) is the current round. If the \(i\)th node is not selected as a CH in the last (\(1/c\)) rounds, then \(i\in\leavevmode\
obreak\ ^{g}\aleph_{i}\), as shown in Equation (3); the threshold correlates not only with \(c\), but also with the remainder from dividing round \(r\) by \([1/c]\).