Implementation of Harris Hawks Optimization (HHO) Algorithm to Solve Engineering Problems

Recently, optimization techniques have become very important and popular in different engineering applications. In this paper we demonstrate how Harris Hawks Optimization (HHO) algorithm can be used to solve certain optimization problems in engineering. In the second part, biological fundamentals, as well as method explanation are given. Afterwards, the HHO algorithm and its’ applicability is explained in detail. The pseudo code for this algorithm was written using MATLAB R2019a software suite. Harris Hawks Optimization (HHO) algorithm was used for optimization of engineering problems, such as: speed reducer optimization, pressure vessel optimization, cantilever beam optimization and tension/compression spring optimization. The statistical results and comparisons show that the HHO algorithm provides very promising and competitive results compared to others metaheuristic algorithms.


INTRODUCTION
In the past two decades, a set of very efficient methods emerged, with application in solving hard practical optimization problems. These methods are called metaheuristic algorithms, and are often inspired by natural phenomena, since they mimic nature's tried and tested methods. Another name for this class of algorithms is nature-inspired or biological metaheuristic algorithms.
A surge in popularity of these algorithms draws attention of both engineering professionals and industry. One of the reasons for this is that algorithms of this class are adaptable and efficient. Albeit simple in design, they are very successful in solving very complex optimization problems. Metaheuristic algorithms constitute an important part of contemporary global optimization algorithms, artificial intelligence, and informatics in general.
Many metaheuristic algorithms carry a trait that they reach convergence towards a global optimum for the problem after a fairly small number of iterations. Since these problems are complex in nature, determi-ning the global optimum analytically is impossible.
In this case, an algorithm's value for solving a parti-cular problem lies in comparing it to existing solu-tions found in literature.
In this paper the Harris hawks' algorithm, one of the biological metaheuristic algorithms created by Heidari [1], will be demonstrated. After the algorithm was published in 2019, it drew researchers' attention, and it was implemented and improved in many areas of expertise In the paper that introduces Harris Hawk Optimization algorithm, by Heidari et al. [1], a benchmark set of problems was used to show validity of algorithm use. This benchmark set covers three main groups of benchmark landscapes: unimodal (UM), multimodal (MM), and composition (CM In paper by Houssein et al. [2], a hybrid meta-heuristic algorithm called CHHO-CS is introduced, and it combines Harris Hawks Optimizer (HHO) with two operators: cuckoo search (CS) and chaotic maps. This algorithm is used as a part of the pipeline which optimizes drug design and discovery in chemo-informatics. The role of CS is to control the main position vectors of the HHO algorithm to maintain the balance between exploitation and exploration phases, while the chaotic maps are used to update the control energy parameters to avoid falling into local optimum and premature convergence. This algorithm is then used to optimize parameters for Support Vector Machines. The extensive experimental and statistical analyses exhibit that the suggested CHHO-CS method accomplished much-preferred trade-off solutions over the competitor algorithms including the HHO, CS, particle swarm optimization, moth-flame optimization, grey wolf optimizer, Salp swarm algorithm, and sinecosine algorithm surfaced in the literature.
In paper by Khalifeh et al. [3], HHO was used to optimize the water distribution network of Homashahr, a city in Iran, with the goal of minimizing the cost of such network. The solution that was yielded by the algorithm was compared to the current cost of the network, and the algorithm did optimize that cost.
In paper by Du et al. [4], Multi-objective Harris Hawks Optimization (MOHHO for short) was used as a part of the pipeline that tries to predict air pollution using time series. MOHHO was in this case used to optimize the parameters of Elaboration likelihood mo-del (ELM for short), which is used to perform time series prediction. In this paper, four multiobjective functions were used for optimization, while the Inverted Generational Distance (IGD for short) was used as a performance metric. By comparing the resu-lts obtained by using MOHHO with those obtained by MOGOA (Multi-Objective Grasshopper Optimiza-ti-on Algorithm), MOPSO (Multi-Objective Particle Swarm Optimization) and MSSA (Multiobjective Salp Swarm Algorithm), it was concluded that MOHHO has shown best results for 3 out of 4 multi-objective functions.
In this paper, the Harris hawks' algorithm is used to solve the following engineering problems.
The first problem to be solved is speed reducer optimization, having the goal of minimizing reducer weight in accordance with bending stress constraints of gear teeth, surface stresses, transverse deflections of shafts and stresses in shafts. This problem was first analyzed and solved by Coello using GA [5].
The second problem is pressure vessel optimization. The goal of this problem is to minimize material, welding and shaping costs. This problem was first suggested by Sandgren [6].
The third engineering problem is cantilever beam optmization, where minimal weight that fulfills the constraints is sought after. Gandomi has solved this problem using the Cuckoo Search Algorithm (CSA) [7].
The fourth problem to be solved is spring opmization, first formulated by Arora [8], with the goal of minimizing spring weight in accordance to constraints on minimum deflection, shear stress, surge frequency, limits of the other diameter and other design varible.

HARISS HAWKS ALGORITHM
The Harris' hawk (Parabuteo unicinctus) is a well-known bird of prey that survives in somewhat steady groups found in southern half of Arizona, USA. Based on Louis Lefebvre's research on avian "IQ", this type of bird is one of the most intelligent species of birds found in nature. The key feature of Harris hawk's behavior is that they hunt in groups, which are able to efficiently trace, encircle, flush out, and attack the prey. The main tactic of Harris' hawks to capture a prey is "surprise pounce", which is also known as "seven kills" strategy. This interesting hunting strategy is comprised of several hawks attacking the prey simultaneously from different locations. The hunt may be rapidly completed in one dive, or it may take multiple quick dives during several minutes. The main idea of this tactic is to confuse and drive the prey to exhaustion, increasing its vulnerability. Figure 1 shows the behavior of a Harris hawk during hunting. This algorithm consists of exploration phase, transition to exploitation phase, and exploitation phase.
In the exploration phase, the hawks perch randomly on some locations, waiting to detect the prey (designated as "rabbit"), which is the current best solution, based on two strategies, each of which having equal chance q to be selected. q is a random variable having the value between 0 and 1, used for a coin toss in this phase of the algorithm. If this variable' s value is less than 0.5, the first strategy is applied. Otherwise, the second strategy is applied. The two fore mentioned strategies are: Based on escaping energy of the prey, this algorithm switches between exploration and exploit-ation phases. This energy is modeled as: (2) where E indicates the escaping energy of the prey, T is the maximum number of iterations, and 0 E is the initial state of its energy. When 1 E  , this algorithm is in exploration phase, while for 1 E  , the algorithm is in exploitation phase.
In the exploitation phase, the hawks perform the surprise pounce described earlier, by attacking the intended prey. What can happen in this phase is that the prey has enough energy to escape the dive, meaning that the hawks will have to perform several dives on it. This is modeled by the variable r, and the prey has equal chances for escaping and not escaping the dive. Whatever the prey does, the hawks will perform a hard (   besiege.
In the case of soft besiege, when 0.5 r  and 0.5 E  , the prey tries to escape the hawks, yet unsuccessfully. This is modeled by the following equ-ations: is the difference between the position vector of the rabbit and the current position is the random jump strength of the rabbit while trying to run away, and r5 is a random variable inside (0,1).
In order to simulate the motion of the rabbit, the value J changes randomly in each iteration.
In the case of hard besiege, when 0.5 r  and , 0.5 E  the rabbit does not have enough energy to escape, and the hawks move in for the attack. The positions in this case are updated using the following equation: , the rabbit has enough energy to escape the attack, while the hawks perform a soft besiege. In order to model the movement of the escaping rabbit, the levy flight concept is used in this algorithm. In order to per-form a soft besiege, the hawks decide their next move based on equation: This result is then compared to the previous dive, to see if this dive will be good or not. If the dive is worse, the hawks perform random rapid dives when approaching the rabbit, based on the following equation: where D is the dimension of problem and S is a random vector by size 1xD and LF is the levy flight function, which is calculated using the follo- The constants , u  are random values inside (0,1), while  is the default constant set to 1.5. Based on previous discussion, the final strategy for updating hawk position is given by: In the case of hard besiege with progressive rapid dives, when 0.5 E  i 0.5 r  ,the rabbit does not have enough energy to escape, and the hard besiege is performed by the hawks. This time, the hawks try to decrease the distance to their average location with the escaping prey. This is modeled by the following equations: Where Y and Z are given by the following equations:

EXPERIMENTAL ENGINEERING EXAMPLES FOR OPTIMIZATION
In this section, for each of the optimization problems we describe the basis of the problem, goal function, algorithm parameters, as well as conditions that are to be met. Every step of this process was done using the MATLAB R2019a software suite.

Optimization of the speed reducer
The goal of speed reducer optimization is minimizing the reducer weight whilst fulfilling all the defined constraints.
In Figure 2 a schematic view of speed reducer is shown.

Figure 2 -Schematic view of the speed reducer with
variable parameters Project variables for the speed reducer problem are: the width between the shafts (x1), the module of the teeth (x2), the number of teeth in the pinion (x3), the length of the first shaft between the bearings (x4), the length of the second shaft between the bearings (x5), the diameter of the first shaft (x6) and the diameter of the second shaft (x7).

Optimization of the pressure vessel
Second problem is optimization of a pressure vessel (figure 3), which consists of reducing costs of material, montage and welding costs.

Optimization of the cantilever beam
In this part, we will be solving the popular structural design problem of a cantilever beam (Figure 4). The goal is to minimize the weight of the cantilever beam.

Figure 4 -Schematic view of the speed cantilever
beam with variable parameters As seen in Figure 4, the cantilever beam consists of five hollow, box shaped bearings with a square shaped frame. Project variables are lengths of the five squares which make up the cantilever beam.
The goal function is defined by the equation: Goal function to be minimized is defined as: Whilst the conditions to be met are:

RESULTS AND DISCUSSION
In this section, the results obtained by using HHO algorithm on previously defined engineering pro-blems is given. Results of the Harris hawks' algorithm (HHO) will be compared to results obtained by the modified ant colony algorithm (MACA), grasshopper optimization algorithm (GOA), water cycle algorithm (WCA), Ant Lion Optimization (ALO), and Method of Moving Asymptotes (MMA), depending of solutions found in literature.
A detailed display of the results obtained by HHO and a comparison with several results obtained by other methods, for the problem of speed reducer, are shown in Table 1.
In the case of this problem, HHO has given better results than those found in literature.
For the pressure vessel problem, the expected value for the goal function is 5885.3327, with the results shown in Table 2. As in the case of the speed reducer problem, the HHO algorithm gave better results than those found in literature. For the cantilever beam design problem, the results shown in Table 3, along with the results obta-ined by ALO, MMA and GOA methods. In this case, the HHO gives the same result as the MMA algorithm, while ALO and GOA gave better results.
Experimental research was performed for the helical spring problem, and the results of HHO algorithm, along with the results for MACA, GOA, and WCA algorithms, are given in Table 4. The expected value for the goal function in this case is 0.012665. In the case of helical spring optimization, HHO gives the same result as WCA, while MACA and GOA giving a slightly worse result.

CONCLUSION
Contemporary optimization entails applying modern optimization methods, particularly in the area of modern engineering, where in solving optimization problems often means solving nonlinear goal functions with a large number of constraints and variables. In order to solve optimization problems, one ne-eds to go through several steps.
Firstly, problem para-meters are to be identified. Secondly, the constraints for problem parameters need be acknowledged. Thirdly, optimization problem goals must be resea-rched and considered thoroughly. Lastly, based on the identified parameters, constraints, and goal functions, a convenient optimization method must be chosen. This paper describes using Harris hawks' optimization algorithm in order to solve a few engineering problems with a constant number of variables. For this algorithm, 50 search agents and 1000 iterations were chosen as input parameters.
During the course of the research, it has been noted that increasing sea-rch agent and iteration count did not yield better so-lutions. Therefore, this combination of input para-meters was chosen, since it gives minimal execution time.
In the case of speed reducer and pressure vessel optimization, the Harris hawks' algorithm gives better results than other methods found in literature. The results for the other two optimization problems, namely the cantilever beam and helical spring problem, were shown to be near optimal.
This paper focuses on application of optimization algorithms on engineering problems. In this field of study, further research is always necessary, due to its applicability and possibility for the improvement of the optimization results.

ACKNOWLEDGEMENT
This work was supported by the Serbian Ministry of Education, Science and Technological Development through Mathematical Institute of the Serbian Academy of Sciences and Arts.