An Efficient Improved Harris Hawks Optimizer and Its Application to Form Deviation-Zone Evaluation

Evaluation of the deviation zone based on discrete measured points is crucial for quality control in manufacturing and metrology. However, deviation-zone evaluation is a highly nonlinear problem that is difficult to solve using traditional numerical optimization methods. Swarm intelligence has many advantages in solving this problem: it produces gradient-free, high-quality solutions and is characterized by its ease of implementation. Therefore, this study applies an improved Harris hawks algorithm (HHO) to tackle the problem. The average fitness is applied to replace the random operator in the exploration phase to solve the problem of conflicting exploration strategies due to randomness. In addition, the salp swarm algorithm (SSA) with a nonlinear inertia weight is embedded into the HHO, such that the superior explorative ability of SSA can fill the gap in the exploration of HHO. Finally, the optimal solution is greedily selected between SSA-based individuals and HHO-based individuals. The effectiveness of the proposed improved HHO optimizer is checked through a comparison with other swarm intelligence methods in typical benchmark problems. Moreover, the experimental results of form deviation-zone evaluation on primitive geometries show that the improved method can accurately solve various form deviations, providing an effective general solution for primitive geometries in the manufacturing and metrology fields.


Introduction
Primitive geometries are widely used in aerospace, shipbuilding, and medicine. The form deviation of primitive geometries affects part mating. Part mating is critical in manufacturing and metrology quality control, affecting assembly, service life, wear resistance, and motion. Therefore, the development of computational algorithms to improve the efficiency and reliability of the production processes for manufactured parts has been a challenging research task during the last three decades. The rapid acquisition of discrete point clouds from surfaces has become possible with the development of coordinate measuring machines (CMMs) and low-cost 3D acquisition techniques. Therefore, inspecting manufactured parts by coordinate metrology on a discrete point cloud is an effective method for assessing the degree of satisfaction with design requirements.
Typically, the measured points should be compared to the ideal geometry to determine whether the part is to be accepted or rejected [1]. Robust algorithms can quickly determine a substitute geometry in point clouds, but the reliability and efficiency of the algorithms are affected by the inherent uncertainty of the equipment used. Uncertainty may arise either from systematic errors [2] or data noise [3]. Hence, numerous coordinate metrology tasks focus on eliminating the uncertainty associated with data acquisition, which is referred to as point measurement planning (PMP) [4]. Since the measurement time is proportional to the number of points, PMP research focuses on the size and location of the measurement process to achieve a more precise representation of the measured geometries using fewer points [5]. The sampling strategy design is a solution for contact measurements. Sampling strategies in the literature can be divided into three main categories: uniform, random, and stratified sampling [6]. Noncontact measurements provide more surface information [7], but at the same time, the increased density leads to computational instability and cost. Gohari et al. [8] introduced a data-mining algorithm that analyzes the trend of errors for the acquired points, which guarantees a reliable evaluation of geometric and form deviations.
The second computational task, which is also the main focus of this research work, is substitute geometry estimation (SGE). The objective of SGE is to obtain the ideal geometry parameters for the measured points or to locate the ideal geometry for the measured points via different types of fitting criteria, such as least-squares fitting, total least-squares fitting, min-max fitting, and minimum-zone fitting. In the former, fitting occurs directly on the point cloud, and the latter aligns the point cloud with the design model. The least-squares method is widely used in surface error estimation owing to its high evaluation efficiency. However, it does not strictly adhere to the minimum zone specified by ISO [9] and can only provide approximate results, which may lead to misjudgment of the workpiece and economic losses. The minimum-zone method is often used as the basis for arbitration among various evaluation methods since it is more consistent with the standard definition of physical fittings [10]. Nevertheless, minimum-zone deviation is a highly nonlinear problem, and multivariate optimization algorithms are required to provide satisfactory substitute geometries.
There have been many studies that have applied numerical optimization methods to the evaluation of form errors, including simplex search [11,12], semidefinite programming [13], linear approximation [14], iterative reweighted [15], Chebyshev approximation [16], and steepest descent [17]. In the case of higher nonlinearity, it is challenging for these algorithms to obtain the global solution, since several local solutions may exist. Increasing the number of sample points also reduces the chance of obtaining the global minima in the employed optimization process [18]. Based on this, many researchers have developed new data-fitting methods to solve the above problems.
The representation of surfaces by convex hulls is common in computational geometry techniques, and many researchers have applied it to form error evaluations [19,20]. In addition to the convex-hull technique, Liu et al. [21] constructed the minimum-zone roundness intersection structure and evaluation model using the crossing relationship of chords. In a subsequent study [22], the method was expanded to cylindricity evaluation. In addition, based on computational geometry techniques, Alhadi et al. [23] presented an improved algorithm for the minimum zone of roundness error evaluation using an alternating exchange method. A minimum-zone fitting function was created to enhance the roundness error evaluation. Zhuo et al. [24] introduced the definition of the crossing sector structure based on the minimum-zone criterion and transformed it into an angular relationship of control points, making it easy to identify the MZC. For straightness error, Li et al. [25] proposed a simple bidirectional algorithm based on a four-point model for the calculation of the minimum-zone straightness error from planar coordinate data. Four points are used to construct the upper and lower reference lines which can select candidate points effectively by comparing the slope of the upper and lower reference lines. It is worth noting that computational geometry techniques suffer from the inherent problem of poor solution accuracy. Therefore, combining the initial solution and region search algorithm to search the parameter space greedily is a new research direction. Ye et al. [26] proposed a new neighborhood-based adaptive iterative search strategy. The results of the proposed method provide more accurate values than conventional techniques. Huang et al. [27] presented an asymptotic search method according to which roundness is solved iteratively using the intersecting chord to avoid trapping in the local solution. Liu et al. [28] proposed and developed a novel cylindricity evaluation method. The framework and information flow of the algorithm has been documented, together with the description of the six-point subset, the replacement strategy, and the terminal condition. However, the greedy search approach does not guarantee a global solution and is often inefficient when data increase. There is still a demand for a comprehensive and stable method.
In recent studies, researchers have successively adopted swarm intelligence (SI) to resolve these issues. Some well-known SI methods and many improved optimization algorithms have been effectively used to determine substitute geometries according to various criteria. Du [29] and Pathak [30] applied particle swarm algorithms (PSO) to evaluate form error. Zhang et al. [31] applied an ant-colony algorithm (ACO) to straightness, but it easily fell into local optimal solutions, so Luo et al. [32] applied an improved artificial bee-colony (ABC) algorithm to straightness error evaluation; however, there was still a lack of accuracy. Based on this, Luo [33] proposed to use an improved differential evolution algorithm (DE) for straightness evaluation. For roundness, Wen et al. [34] proposed the use of a genetic algorithm (GA) for the evaluation of the minimum-zone circle, but the genetic algorithm requires the adjustment of numerous parameters. Recently, Li et al. [35] proposed an improved bat algorithm (BA) to achieve accurate evaluation of minimum-zone roundness. In addition, the application of a genetic algorithm [10] and an improved cuckoo search (CS) [36] algorithm to flatness has been studied. These advanced optimization algorithms have their own advantages and disadvantages. Genetic algorithms can be applied to various complex optimization problems in reality but need to adjust various operators, such as crossover, mutation, and selection. The particle swarm optimization algorithm still needs to adjust the inertia weights for different problems to avoid falling into a local optimum. The CS algorithm, based on the foraging behavior of cuckoos, can obtain high-quality solutions, but the convergence speed is slow.
Harris hawks optimization (HHO) [37] has received extensive attention from the research community. The construction of HHO mimics the foraging behavior of Harris hawks in nature. HHO is designed with two phases of exploration and four phases of exploitation. The results of testing for benchmark functions and several engineering optimization problems confirm that HHO outperforms many well-known SI approaches, such as PSO, GWO, CS, DE, and WOA. Notably, HHO expresses a highly exploitative ability in later stages. SSA [38] is also a well-established swarm intelligence technique based on the salp chain, which simulates the foraging patterns in oceans. Due to its simplicity and superiority, it has been widely used in unconstrained and constrained optimization problems.
In this paper, an improved HHO algorithm (IHHO) is proposed for solving the form deviation-zone evaluation problem. The IHHO focuses on two areas of improvement: exploration strategy selection and exploration capabilities. The latter was mainly inspired by [39]. Furthermore, the search area of the primitive geometries is analyzed to speed up the convergence.
The rest of the paper is organized as follows: Section 2 presents the modeling of the objective function and the determination of the search area of the primitive geometries. An overview of the optimizer is also described. The specific structure of the proposed optimizer is presented in Section 3. Section 4 describes a group of experiments and analyses of the global benchmark problem. Section 5 verifies the practicality of the proposed optimizer in dealing with the form deviation-zone evaluation problem. Finally, conclusions are drawn in Section 6.

Form Deviation-Zone Evaluation Model
The minimum zone is the basic principle of assessing the form error and is the final basis for arbitration in the event of a dispute. To obtain a reliable form deviation zone, it is necessary to establish an optimization objective function according to the minimumzone criterion based on the distance function of each primitive geometry. Assuming that P i (x i , y i , z i ) is a discrete measurement point acquired from the surface, f (P i , U) denotes The objective function satisfying the minimum-zone criterion is: The deviation-zone evaluation process solves Equation (2) by continuously optimizing the fitting parameter, U, to minimize the objective function. Obviously, diverse geometries have different expressions and distance functions, and the number of parameters to be optimized varies. In the following, these surfaces will be individually discussed.

Roundness
The circle is one of the most common features of industrial annular workpiece parts. Expression equations and distance functions for circles and other geometries are given in Appendix A. Although the distance function is related to the circle center, (a, b), and the radius, R, the radius cancels out while subtracting the maximum and minimum distances. Therefore, the variables to be optimized are the circle center coordinates, which is a twodimensional optimization problem. We determine the center and roundness error by the least-squares method, as shown in Figure 1, and the search area of the proposed optimization algorithm is shown in Figure 2a.
denotes the distance function from the point to the ideal surface, where U denotes the fitted parameter; then: The objective function satisfying the minimum-zone criterion is: The deviation-zone evaluation process solves Equation (2) by continuously optimizing the fitting parameter, U, to minimize the objective function. Obviously, diverse geometries have different expressions and distance functions, and the number of parameters to be optimized varies. In the following, these surfaces will be individually discussed.

Roundness
The circle is one of the most common features of industrial annular workpiece parts. Expression equations and distance functions for circles and other geometries are given in Appendix A. Although the distance function is related to the circle center, ( ) , a b , and the radius, R, the radius cancels out while subtracting the maximum and minimum distances. Therefore, the variables to be optimized are the circle center coordinates, which is a twodimensional optimization problem. We determine the center and roundness error by the least-squares method, as shown in Figure 1, and the search area of the proposed optimization algorithm is shown in Figure 2a.   denotes the distance function from the point to the ideal surface, where U denot fitted parameter; then: The objective function satisfying the minimum-zone criterion is: The deviation-zone evaluation process solves Equation (2) by continuously op ing the fitting parameter, U, to minimize the objective function. Obviously, diverse g etries have different expressions and distance functions, and the number of parame be optimized varies. In the following, these surfaces will be individually discussed.

Roundness
The circle is one of the most common features of industrial annular workpiece Expression equations and distance functions for circles and other geometries are gi Appendix A. Although the distance function is related to the circle center, ( ) , a b , an radius, R, the radius cancels out while subtracting the maximum and minimum dist Therefore, the variables to be optimized are the circle center coordinates, which is a dimensional optimization problem. We determine the center and roundness error b least-squares method, as shown in Figure 1, and the search area of the proposed o zation algorithm is shown in Figure 2a.

Straightness
A spatial line has six parameters: three for position, (x 0 , y 0 , z 0 ) , and three for direction, (a, b, c). According to error theory, the arithmetic mean of the measurement sequence is the closest to its actual value, so the arithmetic mean of the line is used as the spatial line position. Typically, the minimum-zone line is around the least-squares line. Consequently, the initial linear direction vector is obtained by least squares, as shown in Figure 1. However, the direction of the spatial line is arbitrary, and it is often difficult to average over all directions when determining the search area by the least-squares parameters. With this in mind, we align the line to the Z-axis by the Rodrigues rotation matrix, T, to reduce the optimization dimension and determine the appropriate search area. The transformation process is as follows: where θ denotes the angle between the line and the Z-axis, satisfying the following equation: The search space of the position parameter can then be centered on the projection point of the centroid in the XY-plane. The search space of the direction parameter can be centered on the Z-axis. Then, the line expression can be simplified as: Through the above process, the straightness evaluation becomes a four-dimensional optimization problem, and the search area is shown in Figure 1b

Cylindricity
Many parts designed in machines have a cylindrical geometry. Compared to roundness, cylindricity takes into account both axial and radial directions. The distance function of a cylinder is f (P i , x 0 , y 0 , z 0 , a, b, c) (given in Appendix A), including the axis position, (x 0 , y 0 , z 0 ), the axis direction, (a, b, c), and the cylindrical radius, R. Similar to the circle, R can be disregarded in deviation-zone evaluation. Therefore, cylindricity evaluation is essentially the determination of the position and direction of the cylindrical axis. It is a sixdimensional optimization problem similar to the spatial line. Thus, the dimension-reduced method of spatial lines can also be used for cylindricity.
First, normal estimation [40] is performed for the cylindrical surface's point cloud. The obtained unit normal is regarded as a new set of point clouds. Subsequently, the normal estimation is continued on the normal point cloud to obtain the initial axis direction, n(a, b, c), of the cylinder. As with straightness, by aligning the initial axis to the Z-axis via Equations (3)-(5), the control variables can be reduced from six to four, and the search area can be equally distributed in each direction. The process is also demonstrated in Figures 1 and 2b.

Flatness
The distance function of the plane is f (P i , a, b, c, d), where d is related to the plane position. Since the deviation zone is a relative distance, the parameter d has no effect, and the process is a three-dimensional optimization problem. We estimate the plane normal, n(a, b, c), using the least-squares method, and then the algorithm's search area is determined by applying the Rodrigues rotation matrix, as shown in Figures 1 and 2c.

Overview of HHO
HHO is a population-based optimization algorithm that mimics the cooperative behavior of Harris hawks chasing prey (in most cases, rabbits) in nature. In the absence of prey, the hawks will randomly change position until the prey is found. When a rabbit is detected, the hawks will choose different strategies for besiegement, depending on the dynamic nature of the environment and the prey's escape pattern. A switching tactic involves the best hawk (the leader) swooping at the prey and disappearing and the chase being continued by one of the party members. By means of this tactic, the detected rabbit is chased to exhaustion, resulting in a successful hunt. A total of six stages of HHO are plotted in Figure 3, and the specific HHO steps and mathematical model are described in the following subsection. HHO is a population-based optimization algorithm that mimics the cooperative behavior of Harris hawks chasing prey (in most cases, rabbits) in nature. In the absence of prey, the hawks will randomly change position until the prey is found. When a rabbit is detected, the hawks will choose different strategies for besiegement, depending on the dynamic nature of the environment and the prey's escape pattern. A switching tactic involves the best hawk (the leader) swooping at the prey and disappearing and the chase being continued by one of the party members. By means of this tactic, the detected rabbit is chased to exhaustion, resulting in a successful hunt. A total of six stages of HHO are plotted in Figure 3, and the specific HHO steps and mathematical model are described in the following subsection.

Exploration Phase
In this phase, Harris hawks will choose two strategies to move with equal probability: one is to move based on the positions of other family members; the other is to perch on random tall trees. The process is modeled as follows: where ( 1) represent the position vectors of the search agent in the t + 1 and t iterations, respectively, and each dimension represents a control variable; is the average position vector of the current search agents, which is calculated using the following equation: where N denotes the total number of hawks and ( ) i X t indicates the location of each hawk in iteration t.

Transition from Exploration to Exploitation
The prey's energy decreases over time during escape. HHO can transition from exploration to exploitation and choose different exploitation strategies based on the prey's escape energy. The prey's escape energy is modeled as a time-varying stochastic parameter as follows:

Exploration Phase
In this phase, Harris hawks will choose two strategies to move with equal probability: one is to move based on the positions of other family members; the other is to perch on random tall trees. The process is modeled as follows: where X(t + 1) and X(t) represent the position vectors of the search agent in the t + 1 and t iterations, respectively, and each dimension represents a control variable; q, r 1 , r 2 , r 3 , r 4 are random variables inside (0, 1), which are updated in each iteration; X rand (t) is the position vector of a random individual; X prey (t) denotes the rabbit's position vector, which is the best agent; LB and UB are the lower and upper bounds of the control variables; and X ave (t) is the average position vector of the current search agents, which is calculated using the following equation: where N denotes the total number of hawks and X i (t) indicates the location of each hawk in iteration t.

Transition from Exploration to Exploitation
The prey's energy decreases over time during escape. HHO can transition from exploration to exploitation and choose different exploitation strategies based on the prey's escape energy. The prey's escape energy is modeled as a time-varying stochastic parameter as follows: where E indicates the remaining energy of the rabbit in the escape process, T denotes the maximum number of iterations, and E 0 is the initial state of its energy generated randomly inside the interval (−1, 1) in each iteration. Thus, if |E| ≥ 1, this means that the rabbit has enough energy to escape, so the HHO will perform diverse exploration operations, and if |E| < 1, the rabbit is weak, so the algorithm will try to exploit the neighborhood of the solutions.

Exploitation Phase
For this phase, according to the escape behaviors of the prey and the chasing strategies of Harris hawks, four possible strategies are proposed for HHO to model the attacking stage. Let r be the chance that the prey escapes successfully (r < 0.5) or escapes unsuccessfully (r ≥ 0.5).

Soft Besiegement
When r ≥ 0.5 and E ≥ 0.5, the prey still has enough energy to escape dangerous situations. At this time, the hawks will perform a soft besiegement to continuously exhaust the rabbit's energy and prevent it from making random misleading jumps by encircling it softly. If the jump strength of a rabbit is denoted as J = 2(1 − r 5 ), where r 5 is a random number inside (0, 1), this behavior can be modeled according to the following rules: where ∆X(t) is the difference between the prey's position vector and the current location in iteration t.

Hard Besiegement
When r ≥ 0.5 and E < 0.5, the intended prey exhausts the energy, and the hawks finally perform the surprise pounce. In this situation, the current position is updated using Equation (12):

Soft Besiegement with Progressive Rapid Dives
When r < 0.5, the prey has a chance to escape successfully, and the hawks will adopt the chasing strategies of soft besiegement and hard besiegement, but their doing so is more intelligent than in the previous case. By utilizing the concept of Levy flight (LF), the real zigzag deceptive motions of prey are mimicked and the hawks will progressively adjust their location and directions through rapid dives. When the prey has sufficient energy (E ≥ 0.5), the process is expressed as follows: where D is the dimension of the problem, S is a random vector of size 1 × D, and LF is the Levy flight function, which is modeled as follows: where u and v are random numbers in the range (0, 1).

Hard Besiegement with Progressive Rapid Dives
Similarly, when E < 0.5, the prey does not have enough energy to escape, and the rapid dive strategy with LF is modeled as follows:

Overview of SSA
In the foraging behavior of the salp swarm, the group is divided into two parts, the leader and the followers. The first individual is considered the leader, and the other individuals form the main body of the chain and are called the followers. Newtonian mechanical analysis is used to model the leader's and the followers' movements separately. The leader position vector is updated using the following equation: T denotes the position vector of the target agent or the current best solution, c 2 and c 3 are the adaptive tuning parameters between (0, 1), and X 1,j are the position vectors of the leader in the jth dimension. c 1 is an important factor in controlling exploration and exploitation and is calculated by means of the following equation: The follower's update formula is expressed as: As the leader moves, the fluctuation of the leader's position change is transmitted to each follower step by step with the salp chain. The leader continuously explores the space around the moving food source, F. This significantly enhances the exploration ability of SSA and enables the salp chain to catch up with the moving food source and finally complete the foraging behavior.

The Proposed Optimizer
To solve the problem of HHO easily falling into a local optimum and having slow convergence, this paper proposes an improved HHO optimization algorithm. The IHHO focuses on two areas of improvement: exploration strategy selection and exploration capabilities. The following is a specific description of the improved HHO algorithm, and the pseudocode is given in Algorithm 1.

Exploration Based on Average Fitness
In optimization techniques, random operators are often used to determine the update strategy of the search agent due to their random nature. However, in HHO, strategy selection based on random operators may conflict with the actual situation. In detail, when the hawk is very near to the prey ( f (X i ) > f (X prey )), it incorrectly moves to a random location due to a better perching chance (q ≥ 0.5), but the correct strategy is to perch with other family members. When the hawk is far from the prey incorrectly perches with other family members due to a lower perching chance (q < 0.5), but the correct strategy is to move to a random high tree to perch suddenly. Therefore, we replace the random operator, q, of HHO in the exploration phase with the average fitness to solve the conflict problem when choosing between two strategies. Let us define the average fitness, f ave , of the search agents' locations as: Then, Equation (7) becomes the following equation: where f (X i ) denotes the fitness value of the individual agent and N is the number of agents.
Find the best agent to be the leader and use the rest as followers C. Update the leader and followers using Equation (20) and Equation (26) D. If the SSA individual is better, replace the corresponding HHO individual and update the fitness value E. Calculate the average fitness, f ave , using Equation (23) F. Label the best prey location as X prey G. For i = 1, 2, . . . N (each hawk) a. Update the escaping energy E by Equation (9) b. If (|E| ≥ 1) → Randomly choose one hawk location as X rand from the search space → Calculate the mean position vector X ave using Equation (8) → Update the new location using Equation (24) Elseif (|E| < 1) → Generate a random escaping chance of prey r in the range [0, 1] If (r ≥ 0.5 and |E| ≥ 0.5) Update the new location using Equation (10) Elseif (r ≥ 0.5 and |E| < 0.5) Update the new location using Equation (12) Elseif (r < 0.5 and |E| ≥ 0.5) Update the new location using Equation (13) Elseif (r < 0.5 and |E| < 0.5) Update the new location using Equation (17)

Nonlinear Inertia Weight
Note that the values of the inertia weights affect the algorithm's efficiency. Larger inertia weights enhance the global search capability of the algorithm, and, conversely, smaller inertia weights enhance the local search capability. To solve the problem of low convergence accuracy and slow convergence of the traditional SSA algorithm, a nonlinear inertia weight is introduced in the update formula of the follower salp to evaluate the degree of interindividual influence, with values nonlinearly transformed between 0.9 and 0.4. The proposed nonlinear inertia weights are as follows: (25) where w init is the initial inertia weight, w end is the inertia weight for the maximum number of iterations, and k and u are control coefficients that regulate the range of w. After sufficient experiments, taking w init = 0.98, w end = 0.4, k = 0.21, and u = 11.2. the new follower update rule is: The addition of a nonlinear inertia weight enhances the global search ability in the early stage compared to the previous averaging strategy with a fixed weight of 0.5. It enhances the local search ability of the algorithm in the later stage and balances the exploration and exploitation of the SSA.

Hybrid SSA
Combining algorithms has become a trend in optimization research in recent years. The superior explorative ability of SSA can fill the gap in the exploration of conventional HHO. Therefore, this paper embeds the SSA with a nonlinear inertia weight into HHO to improve the diversity of hawks while retaining its inherent excellent convergence and exploitation capabilities.
Specifically, before updating the search agent through the HHO mechanism, the space around the current best agent is explored with SSA to determine whether a better agent exists, and, if so, the position of the HHO individual is updated to the SSA individual. Otherwise, it remains unchanged. Subsequently, the individual with the smallest objective function value is selected as the prey's position vector, X prey , in X HHO , X SSA .

Benchmark Functions and Compared Algorithms
In this section, the proposed improved HHO algorithm (IHHO) is investigated using a set of 23 diverse classical benchmark functions from [37]. The benchmark functions can be divided into three categories: unimodal (of which there are seven), multimodal with varied dimensions (of which there are six), and multimodal with fixed dimensions (of which there are ten). The unimodal sets have a globally unique solution suitable for revealing the optimizer's exploitation capabilities, whereas the multimodal sets have multiple optima that disclose the explorative capability and local optimum avoidance potentials of the proposed optimizer. The mathematical descriptions of the benchmark functions are shown in Tables 1-3.
To investigate the performance of IHHO, in addition to comparison with traditional HHO, other well-recognized swarm intelligence methods, such as PSO [41], GA [42], DE [43], TLBO [44], ABC [45], CS [46], WOA [47], and SSA [38], were also compared. The quantitative analysis included the average value and standard deviation (std. dev.), and the qualitative analysis included the prey position, search history, trajectory, diversity history, average fitness history, boxplot and convergence curves. Furthermore, the nonparametric statistical results of the Wilcoxon signed-rank test and Friedman test were introduced to detect the substantial differences between optimizers. The significance level was set at 0.05. The Wilcoxon signed-rank test categorized the IHHO calculations as significantly better (+), equal (=), or significantly worse (−) by p-values. Further statistical comparisons were made by applying the Friedman test for average ranking performance (expressed as ARV).

Experimental Setup
In this study, the following control variables were adopted: the maximum number of iterations equaled 500 iterations, and the number of search agents equaled 30. The dimension of the function was set to 30 if it was a non-fixed problem. The parameter settings used for various optimization algorithms are reported in Table 4. Every method applied 30 independent runs to avoid the effect of randomness in MATLAB2016a using a Windows 10 64-bit Intel (R) Core (TM) i7-11800 h@2.30 GHz with 16 GB. Table 4. Parameter setting of various optimization algorithms.
The average fitness is a measure of the collaborative behavior of the hawk. Th age fitness in Figures 4 and 5 decreases with iterations, which indicates that all update to a better position with an increasing number of generations.   The diversity history reveals the transition between the exploration and exploitat of search agents. In this paper, diversity is calculated by the Euclidean distance betw N hawks. If the ith agent of the D-dimensional problem is represented , then at a specific iteration t, the diversity is calculated as: As can be seen from the diversity history diagrams in Figures 4 and 5, there is m diversity in the initial stage than in the later stage of the optimization algorithm. T IHHO algorithm performs more exploration in the initial stage, while in the later stage performs more exploitation. Moreover, the curve tends to zero as the iterations proce revealing that the proposed algorithm strikes a good balance between exploration a exploitation.

Comparison with Conventional Swarm-Based Algorithms
In this section, the statistical results of the conventional swarm-based algorithm a the proposed IHHO for 23 benchmark problems are presented in Table 5. The results pose the statistical outcomes in terms of average values and standard deviations. T number of dimensions for all problems was 30, except for the fixed-dimensional mu modal problems f14-f23. The best values are in bold in Table 5, while their statistical sig icance can be observed in Table 6. In addition, Figures 6 and 7 demonstrate the boxpl and convergence curves for unimodal functions (f1, f4), multimodal benchmark functi The diversity history reveals the transition between the exploration and exploitation of search agents. In this paper, diversity is calculated by the Euclidean distance between N hawks. If the ith agent of the D-dimensional problem is represented as X i = (x i,1 , x i,2 , . . . , x i,D ), then at a specific iteration t, the diversity is calculated as: As can be seen from the diversity history diagrams in Figures 4 and 5, there is more diversity in the initial stage than in the later stage of the optimization algorithm. The IHHO algorithm performs more exploration in the initial stage, while in the later stages it performs more exploitation. Moreover, the curve tends to zero as the iterations proceed, revealing that the proposed algorithm strikes a good balance between exploration and exploitation.

Comparison with Conventional Swarm-Based Algorithms
In this section, the statistical results of the conventional swarm-based algorithm and the proposed IHHO for 23 benchmark problems are presented in Table 5. The results expose the statistical outcomes in terms of average values and standard deviations. The number of dimensions for all problems was 30, except for the fixed-dimensional multimodal problems f 14 -f 23 . The best values are in bold in Table 5, while their statistical significance can be observed in Table 6. In addition, Figures 6 and 7       From the statistical results listed in Table 5, the proposed IHHO algorithm had a significant advantage over the other algorithms in terms of average values and standard deviations. For most functions, IHHO was able to find the best solutions, even the optimal ones, except for f6, f8, and f20. For f6, the performance of IHHO was worse than that of PSO and SSA but far better than that of traditional HHO algorithms. For f8, the results were From the statistical results listed in Table 5, the proposed IHHO algorithm had a significant advantage over the other algorithms in terms of average values and standard deviations. For most functions, IHHO was able to find the best solutions, even the optimal ones, except for f 6 , f 8 , and f 20 . For f 6 , the performance of IHHO was worse than that of PSO and SSA but far better than that of traditional HHO algorithms. For f 8 , the results were better than those of the other nine algorithms and slightly inferior to those of the HHO algorithm, while, for f 20 , IHHO also generated the best solution. From the perspective of standard deviations, the standard deviations of IHHO were the lowest for 15 functions, even though the standard deviations for f 9 , f 10 , and f 11 were 0. Although the standard deviations of IHHO were poorer than those of DE, CS, and TLBO for f 16 -f 19 when the same average values were obtained, it outperformed the other algorithms. Meanwhile, IHHO came next in performance to the first method for f 14 . Therefore, IHHO can achieve satisfactory solutions with guaranteed accuracy and stability.
According to the p-values of the Wilcoxon rank-sum tests for analyzing the significant differences of the paired algorithms in Table 6, the performance of IHHO had significant positive differences compared to the other algorithms with respect to the test results for the 23 benchmark functions, except for DE, CS, and TLBO. Although the statistical results for IHHO were significantly worse than those for DE, CS, and TLBO for f 16 -f 19 , the main reason was the difference in the standard deviations. As analyzed before, IHHO was superior to the rest of the methods with respect to standard deviation, so it can still be considered that IHHO can obtain high-quality solutions. Additionally, from the overall significant statistical results of the Wilcoxon rank-sum tests for all functions, the worst case IHHO produced 17 significantly better, 1 equal, and 5 significantly worse results (TLBO), and in the best case IHHO overwhelmingly succeeded for all benchmark functions (GA). From the statistical results of the Friedman test, the best ARV of 1.61 was obtained for IHHO, which is also consistent with the Wilcoxon rank-sum test results; IHHO was far superior to TLBO in second place with a ranked value of 4.04. Therefore, it can be concluded that the IHHO algorithm is an improvement on the HHO algorithm with considerable advantages over the other nine competitive swarm-based algorithms.
The boxplot diagrams of the classical test functions are shown in Figure 6. As can be seen from the boxplots, IHHO consistently outperformed or equaled the other optimization algorithms, while HHO underperformed for the non-scalable function f 23 . In addition, the TLBO algorithm also showed strong consistency. On average, IHHO showed results comparable to those of other optimization algorithms using the boxplot representation.
The convergence curves for six classical benchmark functions are presented in Figure 7. Based on the observation, IHHO ranked first for f 1 , f 7 , f 10 , and f 12 and performed the same as TLBO for f 23 . For the test function f 14 , IHHO ranked second with TLBO and WOAworse than CS, DE, and ABC, but better than the other algorithms. Regarding the overall performance of IHHO for 23 benchmark problems, which are combinations of unimodal and multimodal problems designed to test exploration and exploitation capabilities, it can be stated that IHHO can be used for function optimization.

Discussion
In this section, the effectiveness of the improved HHO algorithm is verified by 23 benchmark functions. It is important to note that all the experiments were executed under the same conditions. First, a qualitative analysis of the IHHO algorithm was performed. By analyzing the eight benchmark functions in five aspects, namely, search history, prey position, trajectory, average fitness value, and diversity, it was demonstrated that the IHHO algorithm can balance exploration and exploitation, thus avoiding falling into local solutions and finding the optimal value. Hence, IHHO can perform the optimization search for complex nonlinear optimization problems. Second, to comprehensively assess the advantages of the proposed algorithm, the IHHO algorithm was compared with several swarm-based methods in six aspects: average values, standard deviations, Wilcoxon ranksum tests, Friedman tests, boxplot diagrams, and convergence curves. The comparative outcomes of all cases revealed that the developed IHHO optimizer, which fuses the average fitness exploration strategy and the nonlinear inertia weight SSA algorithm, obtained better overall performance and converged faster than the alternatives. Accordingly, the proposed optimizer significantly enhances the optimization capability compared to several other classical optimization algorithms. This is because the SSA mechanism makes the search agents better diversified while taking full advantage of the excellent intensification capability of the original HHO algorithms. Although other variants of HHO embedded within the SSA mechanism are available, the exploration strategy based on the average fitness value and the introduction of nonlinear inertia weights described in this paper is innovative and further enhances the coordination of intensification and diversification, with excellent results. However, similar to other swarm-based optimizers, there are also some limitations to the proposed optimizer. First of all, it may expend more time on optimization because of the addition of the SSA exploration mechanism. Second, the range of nonlinear inertia weights may need to be adjusted in some cases. Therefore, there is a need to harmonize efficiency and accuracy when solving problems with real-time requirements.

The Application of IHHO in Form Deviation-Zone Evaluation
Traditional form deviation-zone evaluation suffers from the problems of difficulty in generating solutions, poor generality, and lack of solution accuracy, while other metaheuristic intelligent optimization algorithms have a wide variety of algorithms, each containing many variants, and each having its own advantages and disadvantages. Therefore, the goal of this study was to find an algorithm with strong global optimization capability, less parameter adjustment, and high accuracy for error evaluation.
It has been shown that the HHO algorithm has fewer parameters, is simple in principle, is more exploratory and adaptable in global optimization, and outperforms many well-known intelligent optimization methods, such as PSO, GWO, CS, DE, and WOA. Therefore, its application to form deviation-zone evaluation satisfies the requirement of fewer parameter adjustments and has some advantages over other methods in terms of optimization capability and optimization accuracy. Although there are still problems of early convergence, poor optimization accuracy, and weak global search capability, they have been improved by various measures.

Comparison of Data in the Literature
To evaluate the availability of IHHO in form deviation-zone evaluation, we benchmarked the proposed IHHO by reference to data in the literature. The flowchart of IHHO applied to solve the deviation-zone evaluation problem is shown in Figure 8. The population size was set to 30, the maximum number of iterations was 500, and the optimization dimension and search area for the corresponding problem were shown in Section 2.1. The algorithm was run 30 times independently using MATLAB2016a software, and the average result was taken as the corresponding form error. Table 7 shows the evaluation results of the algorithms reported in the literature and those obtained by IHHO. The results list the number of points, reported minimum-zone errors, IHHO evaluation minimum-zone errors, least-squares evaluation errors, and relative differences. In addition, the convergence curves of three randomly selected experiments are shown in Figure 9 to visualize the working process of the IHHO algorithm for deviation-zone evaluation.
From Table 7, the average evaluation results for the IHHO algorithm in the four types of deviation zones are more accurate or equal to the reported MZs in the literature, except for example 2 of flatness, and significantly improved compared to the least-squares method. In particular, the straightness evaluation error of example 2 improved by 25.65% compared to the reported results. As can be seen from the convergence diagram in Figure 9, the optimal solution was found with only 50 iterations on the dataset, except for the roundness error evaluation, which reached convergence in approximately 150 iterations. The trends were essentially the same for the three randomly selected experiments. Therefore, it can be tentatively concluded that the proposed IHHO optimization algorithm works well in deviation-zone evaluation and can meet the needs of high-precision evaluation in engineering.
of the algorithms reported in the literature and those obtained by IHHO. The res the number of points, reported minimum-zone errors, IHHO evaluation minimu errors, least-squares evaluation errors, and relative differences. In addition, the gence curves of three randomly selected experiments are shown in Figure 9 to v the working process of the IHHO algorithm for deviation-zone evaluation. Evaluate the fitness value by Eq. (2) Calculate the mean position vector using Eq. (8) Find the best agent Update leader by SSA mechanism using Eq.
Update follower with nonlinear inertia weights by Eq. (25) and (26) Obtain the optimal fitness value.
Update the escape energy E by Eq. (9) 1 Calculate the average fitness by Eq. (23) Perform exploration by Eq. (7) Generate the random escaping chance of the prey r in range    Table 7, the average evaluation results for the IHHO algorithm in the four types of deviation zones are more accurate or equal to the reported MZs in the literature, except for example 2 of flatness, and significantly improved compared to the least-squares method. In particular, the straightness evaluation error of example 2 improved by 25.65% compared to the reported results. As can be seen from the convergence diagram in Figure  9, the optimal solution was found with only 50 iterations on the dataset, except for the roundness error evaluation, which reached convergence in approximately 150 iterations. The trends were essentially the same for the three randomly selected experiments. Therefore, it can be tentatively concluded that the proposed IHHO optimization algorithm works well in deviation-zone evaluation and can meet the needs of high-precision evaluation in engineering.

Engineering Applications
To further validate the advantages of the IHHO algorithm applied to deviation-zone evaluation, the surface of a seamless steel tube was measured by a hexagon image-probe hybrid measuring device, MSOC-03-2C. With the probe system, eight sets of section data and corresponding center coordinates were collected to assess the cylindricity and axis straightness of the seamless steel tube. With the vision system, the coordinates of the cross-section of the steel tube hole were collected, filtered, and downsampled for roundness evaluation. Furthermore, the measuring surface of a 10 mm gauge block was collected with a probe for flatness evaluation. The experimental equipment and objects are shown in Figure 10.
Based on the deviation-zone model developed in Section 2.1, the above acquisition data were evaluated using the IHHO, HHO, SSA, SSA&HHO [34], and least-squares methods. To thoroughly verify the convergence property of the algorithm, the maximum number of iterations T = 500 and N = 30. The experiments were repeated 30 times for each data group to remove accidental errors. The results are summarized in Table 8. The boxplots and average convergence curves for the different algorithms relative to the number of iterations are plotted in Figures 11 and 12. The error maps of the gauge block surface and the seamless tube surface are shown in Figure 13.
As shown in Table 8, in the cylindricity evaluation, the error was 0.1013 mm, which is much higher than that of the other algorithms. For straightness, the SSA&HHO and IHHO algorithms were more effective, while SSA and HHO were poor. HHO performed the worst in the roundness evaluation, while the rest of the algorithms performed similarly. In the flatness evaluation, all algorithms achieved the same results. According to the boxplot diagram in Figure 11, the IHHO fluctuations were lower than those of the other methods in 30 independent runs, while the rest of the algorithms showed performance differences when evaluating different form errors.
hybrid measuring device, MSOC-03-2C. With the probe system, eight sets of section data and corresponding center coordinates were collected to assess the cylindricity and axis straightness of the seamless steel tube. With the vision system, the coordinates of the crosssection of the steel tube hole were collected, filtered, and downsampled for roundness evaluation. Furthermore, the measuring surface of a 10 mm gauge block was collected with a probe for flatness evaluation. The experimental equipment and objects are shown in Figure 10. Based on the deviation-zone model developed in Section 2.1, the above acquisition data were evaluated using the IHHO, HHO, SSA, SSA&HHO [34], and least-squares methods. To thoroughly verify the convergence property of the algorithm, the maximum number of iterations T = 500 and N = 30. The experiments were repeated 30 times for each data group to remove accidental errors. The results are summarized in Table 8. The boxplots and average convergence curves for the different algorithms relative to the number of iterations are plotted in Figures 11 and 12. The error maps of the gauge block surface and the seamless tube surface are shown in Figure 13.   Cylindrical axis Figure 11. Boxplots of the evaluation results for the seamless steel pipe and gauge block data of different algorithms. Figure 11. Boxplots of the evaluation results for the seamless steel pipe and gauge block data of different algorithms. As shown in Table 8, in the cylindricity evaluation, the error was 0.1013 mm, which is much higher than that of the other algorithms. For straightness, the SSA&HHO and IHHO algorithms were more effective, while SSA and HHO were poor. HHO performed the worst in the roundness evaluation, while the rest of the algorithms performed similarly. In the flatness evaluation, all algorithms achieved the same results. According to the

Conclusions
This paper proposes an improved Harris hawks optimization algorithm based on the average fitness exploration strategy and nonlinear inertia weights (SSA). The idea of using average fitness in the exploration phase provided us with a solution to the strategy selection conflict caused by randomness. Furthermore, the introduction of nonlinear inertia weights further enhanced the global search capability of the SSA algorithm, enabling it to give full play to its advantages when embedded in HHO and compensating for the shortcomings of the HHO exploration phase. Although the computational complexity of the IHHO algorithm was slightly higher than that of the HHO algorithm, the convergence of the IHHO algorithm was faster than HHO in terms of the number of iterations and function evaluation results. The IHHO algorithm was thoroughly compared with the well-established optimization algorithms, and the results showed that the IHHO algorithm outperformed the other optimization algorithms. With respect to the engineering problem, the IHHO algorithm was compared with other algorithms using data reported in the literature and collected data to verify its effectiveness and superiority in determining form errors. The results show that IHHO is applicable to the deviation-zone evaluation problem and can give accurate and reliable form error evaluation results. However, this paper does not deal with free surfaces without a specific functional expression. Therefore, in future studies, a promising direction would be to evaluate the deviation zone based on the CAD model and the collected discrete points.