## 3 Materials and Methods
### Hybrid K-Medoids with IABC-Based CH-Selection Algorithm
### Harris Hawk's Optimization Algorithm (HHO)

HHO is a new nature-inspired algorithm. The HHO was inspired by the hunting behavior of [PERSON]'s hawk. These birds perch in the air, spot prey from afar, and then pounce on it in a coordinated attack. The perching behavior of hawks is modeled as the scouting phase in HHO, while their foraging behavior is modeled as the exploiting phase. The mathematical model of the HHO algorithm is presented in this section. In HHO, a candidate solution is referred to as a hawk, (x), while the best solution is referred to as the prey (\(x_{prey}\)) [37]. ### Exploration Phase

Optimization methods require a thorough search of the problem landscape to find the best widely available solution. The metaheuristic algorithm begins the search in the exploration phase to find the best position between hills and valleys in the search space. At this point, an exhaustive search is conducted in the most remote locations. HHO begins by randomly placing N search agents (hawks) at a random location, x_n^0, i = {1, 2,..., N}, across the search space, using Equation (9):

\[x_{n}^{0}=lb_{n}+r_{1}\times(ub_{n}-lb_{n}),r_{1}=rand(), \tag{9}\]

After the population is initialized, the exploration phase continues until the escaping energy of prey \(\mid\)E\(\mid\)\(\geq\) 1, is reached, at which point the value of E is calculated as (10):

\[\text{E}=2E_{0}\bigg{(}1-\frac{t}{N}\bigg{)},\ t=\{1,2,\ldots,N\}, \tag{10}\]

E\({}_{0}\) and N are the prey's initial energy and the maximum number of iterations, respectively. This phenomenon is governed by a random variable, q, which is calculated as follows (11)-(13):

\[x_{new}=\left\{ \begin{aligned} x_{rand}-r_{2}\left|x_{rand}-2r_{2}x_ {n}\right|q\geq 0.5\\ \big{(}x_{prey}-x_{m}\big{)}-r_{3}[lb_{n}+r_{4}(ub_{n}-lb_{n})] \ q<0.5\end{aligned} \right. \tag{11}\]

\[r_{2}=rand(),\ r_{3}=rand(),\ r_{4}=rand(),\ r_{5}=rand(), \tag{12}\]

\[x_{m}=\frac{1}{N}\sum_{n=1}^{N}x_{n} \tag{13}\]where \(x_{m}\), \(x_{new}\) and \(x_{rand}\) are the dimension-wise average of the population, the new position, and a randomly selection position, respectively. ### Exploitation Phase

The convergence of many candidate solutions to previously identified promising locations in the search space is called exploitation. This phase is activated after a few iterations to explore the problem landscape. Once a potential neighborhood has been identified through the collective experience of the search agents, strategies are developed to make candidate solutions gradually adopt information from the best unique global solution. It is important to note, however, that approaching local regions too early can result in premature convergence, which leads to suboptimal solutions. To address this issue, HHO employs various exploitation strategies aimed at various eagle-hunting situations. A system that chooses precise and effective data-transmission routes using an algorithm inspired by nature and a new probabilistic decision-rule function is proposed. A CL-IoT protocol is suggested (QoS) to balance CH energy usage and latency. By considering the exploitation and exploration phases, the suggested optimization algorithm chooses CHs. The remaining energy, distance, and SN link quality are just a few variables in choosing a CH. We should create energy-consumption graphs for the different clusters in the performance-analysis section. ## 4 Results and Discussion

### Simulation-Parameter Setup

The MATLAB 2018 platform was used to implement the CL-HHO algorithm. Nodes in a WSN are organized based on system-domain standard transmissions. The simulation parameter setup is shown in Table 2. The proposed method's outcomes are compared with existing algorithms, including HEED, EECRP, GWO, CL-ALO, and the proposed CL-HHO strategy [38]. ### Evaluation of Clustering and Routing

CH receives data from SNs in the surrounding environment. Figures 4 and 5 depict data transmission from the source node to CH.