## 5 Experimental Setup and Results
### Simulation Results  
For the purpose of simulation, we developed Algorithm 2 which is as follows:  
```
Step 1: Deployed 100 nodes in a network with the BS at \((50,100)\) and nodes are randomly spread over \((100,100)\)m\({}^{2}\) areas. Step 2: Box plot mechanism was employed to check whether any outlier presents in the data (node) or not. Step 3: Nodes are divided into number of clusters based on hyperparameter values using the K-medoids algorithm. Step 4: The TOPSIS technique was applied to choose CHs from clusters using criteria such as distance from sink, average distance of cluster nodes, reliability of cluster and residual energy. Step 5: Based on the values of \(k_{opt}\), nodes are again divided into \(k_{opt}\) number of clusters. Then, CHs of each cluster were chosen by the TOPSIS approach, and clustering is performed by applying the K-medoids algorithm for the first round of the simulation. Step 6: Applying Algorithm 1 to choose the CHs for the very next rounds until residual energy of all the nodes has not been diminished, and we have counted the number of rounds throughout the complete simulation process. Step 7: Stop. ```  
**Algorithm 2** WSN Lifetime extension Algorithm  
We coded Algorithm 2 in the C++ programming language, and the pictorial representations have been completed using the Python programming language on the basis of the numerical results obtained. After 2600 rounds, the residual energy of all nodes alive has been diminished. Figure 7 illustrates this situation graphically. The dotted line in Figure 7 depicts a similar circumstance in which the residual energy must be diminished if the clustering mechanism is being utilized. From Figure 7, it has been seen that after 2600 cycles, the residual energy is completely diminished. So, our proposed schemes have a greater residual energy which in turn extends the network lifetime more than the LEACH-C and HEED schemes, which are depicted in Figure 8. The red line shows the network lifetime of LEACH-C [35] and the blue line for HEED [47]. HEED (hybrid energy efficiency distributed clustering) protocol is an energy-efficient clustering protocol. Node degree and distance to neighbors are used as secondary parameters, with residual energy as the key parameter. The algorithm employed in this study is designed to extend network lifetime, and residual energy is included as a parameter with equal priority to other parameters. First, a comparison between the proposed approach and HEED was made on the basis of these differences. In comparison to HEED, our suggested algorithm exhibits 32% more network lifetime. The LEACH-C (centralized low  
Figure 8: Number of rounds vs. number of nodes alive using the LEACH-C and HEED algorithms. Figure 7: Number of rounds vs. number of nodes alive. energy adaptive clustering hierarchy) protocol is based on residual energy. When forming a cluster, it takes into account the residual energy of each node as well as the distances between different nodes and eligible cluster heads. In contrast, the cluster in the proposed approach is created using the K-medoids algorithm, and the CHs are chosen using the MCDM approach. The proposed strategy with the novel algorithm exhibits 42% greater network lifetime when the two approaches are compared. The K-medoids algorithm is a very popular optimized clustering algorithm which tries to optimize the problem of inter- and intra-cluster distance for cluster creation. The optimized clustering model of WSN is further studied and tried to solve with the very popular optimization technique. In this study, experimental results were compared with OCABC (optimal clustering artificial bee colony) and PSO (particle swarm optimization) as applied to the clustering optimization problem in WSN. It was discovered that the proposed approach outperformed the two algorithms by 11% and 18% in terms of network lifetime (see Figure 9). Again, the clustering strategy in WSN maximizes the network's lifetime and energy efficiency.