# An Optimized Hierarchical Cluster Formation Approach for Management of Smart Cities
## 3 Proposed Approach
### Proposed Protocol (ICSI Description)
\[\text{CEC}=E_{T_{elelSN}}+E_{delay} \tag{11}\]  
where (\(E_{delay}\)) represents the energy consumed by the sender node due to all factors that affect the communication between the CH and the SN. The key component of ICSI is the fitness function, which acts to optimize all factors that concurrently affect the energy consumption during the process of CH selection. SNs receive many invitations from various CHs; therefore, they need to decide which invitation to respond to. For all received IMs, the first competition is accomplished based on the ability of the current node (CN) to complete the round with the specified CH. This competition seeks to determine the accepted CHs of each SN. According to the 1 st competition, the residual energy is higher than the CEC, the elected CH is selected as an accepted CH of the SN, and the SN is remarked as a candidate member of the CH. Equation (12) evaluates the residual energy of the current node compared to the required CEC. The value of f1 (Equation (13)) introduces the first evaluation of the cost to reach the CH. This step attempts to establish the set of accepted CHs for each SN and the set of accepted SNs for each CH (that can complete their round communication). A zero value of f1 means that the SN cannot complete its round with the specified CH and that this CH is not acceptable for that SN. \[REval=\frac{RE_{CN}}{CEC_{CH_{l}}} \tag{12}\]  
Figure 1: Flowchart of ICSI. \[f1=\left\{ \begin{array}{ll}0&if&REval<1\\ REval&\text{otherwise}\end{array} \right. \tag{13}\]  
The second competition is then performed to weight each accepted CH for each SN according to the cost of the density factor using Equation (14), where (MCSize) is the maximum cluster size that is calculated by Equation (10). In the second competition, the accepted CH is weighted for each node according to the density factor of the CH. The density around the CH affects the traffic load, which can affect the residual energy of the SN that reaches the CH. The value of \(f2\) decreases the chance of a dense CH and raises its weight in the next differentiation:  
\[f2=\frac{\text{MCSize}}{CCM} \tag{14}\]  
Then, the third competition process for each CH is implemented to evaluate the NPF of each candidate member using the competitive weight of each candidate SN according to Equation (15):  
\[W_{i}=\left\{ \begin{array}{ll}0&if&i=0\\ x+w_{i-1}&if&i=n\\ (x+w_{i-1})/2&Otherwise\end{array} \right. \tag{15}\]  
where n is the number of accepted SNs and x is calculated using Equation (16). The summation of w is (\(\sum_{i=1}^{i=n}W_{i}=1\)). \[x=1/n \tag{16}\]  
The objective of the fitness function of ICSI is determined using Equation (17), which is derived from the third competition process; it can concurrently optimize the variants affecting the network life. \[F_{i}=f1*f2*W_{i} \tag{17}\]  
The improved cluster formation process is described in Algorithm 1 as follows:  
``` Inputs: CHs[], SNs[], power and physical properties(RE, EV, Edelay, etc. ), Output: Optimal cluster members list Step 1: Begin Initialize Step 2: network parameters. CHs[] matrix from the elected CHs SNs[] matrix from remaining nodes Step 3: Foreach SNi Step 4: initialize the first accepted CHs[] with zero length Step 5: Foreach CHj in Get all accepted CH in CHs[] using first competition \"Equation (13)\" Remove unaccepted CHs Step 7: Weight CHj-density using second competition \"Equation (14)\" Remove unaccepted CHs Step 8: evaluate the NIF of SNi using third competition \"Equation (16)\" endfor Step 10: Update fitness function using \"Equation (17)\" Crossover and mutation and selection Step 12: Add SNi to next highest CH using \"Equation (17)\" loop until full size Step 14: endfor Step 15: EndA better solution means that an SN with a residual energy that is higher than the CEC to lower the dense CH is allowed to join its cluster. Many factors influence the network life. The fitness function of ICSI concurrently optimizes these factors.