1 Introduction

Optimization is the process of finding the optimal solution to a given problem through a series of methods and techniques (Jain et al. 2019). Optimization is an extremely important task to improve system performance, reduce costs and increase competitiveness. It has more complex practical applications in many fields, such as medicine, engineering, business and production (Boussaïd et al. 2013; Devan et al. 2022; Chou et al. 2021). Along with the development and progress of society, the challenges faced by optimization are becoming more and more complex and play a more rapid and reliable role. Traditional optimization algorithms excel in the optimization of single-peaked functions, which usually employ deterministic and gradient-based methods, but most engineering optimization problems exhibit nonlinear characteristics that make them unsolvable by traditional optimization algorithms. Meta-heuristic algorithms, as a new computational method, provide new ways to solve these practical problems (Dokeroglu et al. 2019). Meta-heuristic algorithm is a kind of optimization algorithm based on meta-heuristic knowledge (Kumar and Vohra 2021), its core idea lies in the in-depth analysis and solution of the problem through heuristic methods, it extracts the essential features of the problem by analyzing the meta-features of the problem, so as to design more efficient optimization algorithms. Meta-heuristic algorithms are favored because they maximize the features of the problem, reduce the search pressure and the size of the search space, and use empirical data as the basis for each iteration, they are able to search for the domain of definition and the objective function in a more efficient way, and they can take into account the given constraints, capture the factors that are present in the environment, and improve the solution to the challenges posed by changes in the environment. Meta-heuristic algorithms are more concerned with the practical solvability of the problem and emphasize more on the rapidity and real-time nature of the solved problems. Because of these aforementioned features, many researchers have applied heuristic algorithms in the optimization fields, such as Ant Lion Optimizer (ALO) (Abualigah et al. 2021), Particle Swarm Optimization (PSO) (Gad 2022), Crow Search Algorithm (CSA) (Meraihi et al. 2021), Wild Horse Optimizer (WHO) (Kumar et al. 2023), Artificial Bee Colony (ABC) (Karaboga et al. 2014). Grey Wolf Optimizer (GWO) (Nadimi-Shahraki et al. 2021), Whale Optimization Algorithm (WOA) (Gharehchopogh and Gholizadeh 2019). Coati Optimization Algorithm (COA) (Dehghani et al. 2023). Chimp Optimization Algorithm (ChOA) (Khishe and Mosavi 2020). Bat Algorithm (BA) (Yang and Hossein 2012). Marine Predators Algorithm (MPA) (Faramarzi et al. 2020), Slime Mould Algorithm (SMA) (Gharehchopogh et al. 2023), Harris Hawks Optimization (HHO) (Gharehchopogh 2023), Firefly Algorithm (FA) (Gandomi et al. 2013), Energy Valley Optimizer (EVO) (Azizi et al. 2023), Nutcracker Optimizer Algorithm (NOA) (Abdel-Basset et al. 2023a), Spider Wasp Optimizer (SWO) (Abdel-Basset et al. 2023b), Zebra Optimization Algorithm (ZOA) (Mohapatra and Mohapatra 2023) and African Vultures Optimization Algorithm (AVOA) (Gharehchopogh and Ibrikci 2023) etc.

The Honey Badger Algorithm (HBA), which mainly simulates the dynamic searching behavior of honey badgers in finding honey and digging process, has great potential in various application areas because of its good experimental results and simple structure (Hashim et al. 2022). In order to improve the effectiveness of HBA, scholars continue to explore new optimization methods, and many researchers have already proposed improvements on the HBA. Dong et al. proposed an HBA incorporating the principle of differential evolution so as to enhance its performance. Deng et al. combined \(L{\text{evy}}\) flight strategy as well as operators from GA with HBA to improve the algorithm's optimization seeking ability (Deng 2022). Xiang et al. proposed a multi-strategy improved HBA, which applies the restricted inverse learning mechanism and the starvation search strategy on HBA, and introduces an adaptive weighting factor. Han et al. proposed to introduce reverse learning and chaos mechanisms into HBA (Han and Ghadimi 2022), which was improved to increase the population quality of honey badgers and improve the performance of the original algorithm. Yasear et al. added a reverse learning mechanism to the HBA and used the improved HBA for solving complex problems in power consumption costs. Nassef et al. introduced a hunting search strategy in HBA thereby improving the algorithm's optimization capability (Nassef et al. 2022), ensure a smooth transition of the algorithm from the exploration to the exploitation. Lei et al. proposed a spiral search mechanism to update the exploration phase of the HBA and thus improve its global search capability, introduced the law of quasi-cosines to update the density factor in the original HBA, and proposed a pinhole imaging strategy to improve the population diversity (Lei et al. 2022). Düzenli et al. used Gaussian chaotic mapping to deal with key random variables in HBA and incorporated adversarial learning for solving the PV parameter estimation problem (Düzenli̇ et al. 2022). Dao improved the HBA by using elite reverse learning and multi-directional strategies (Dao et al. 2023) and applied it to the problem of WSN node coverage.

In the field of mathematics, elementary function is a crucial concept, and its wide application value is self-evident. With the continuous development of mathematics, the extension of elementary functions has become an inevitable trend. Common elementary functions include exponential function, logarithmic function, trigonometric function, inverse trigonometric function and constant function. Elementary functions are a kind of mathematical tool widely used in mathematics, physics, economy, life science and other fields. At the same time, the idea of function also plays a vital role in the field of optimization, and many scholars apply elementary functions with different characteristics on different optimization problems. Hao et al. added perturbations generated by six primitive functions to each of the MOA and MOP parameters in the arithmetic optimization algorithm (AOA) and effectively improved the convergence speed of AOA, and improvements were made to three ELD problem cases (Hao et al. 2022). Guo et al. improved the Whale Optimization Algorithm (WOA) based on the exponential models and logarithmic models in the primitive functions, and the improved WOA demonstrated a more efficient performance in solving the water resources prediction model problem (Guo et al. 2020a). Kumar et al. added a perturbation strategy based on hyperbolic growth functions to the Spider Monkey Optimization (SMO) algorithm to improve its perturbation. A spiral is a curve with a special form that can be found in nature or in artificially constructed objects, and is also commonly used as a tool for designing optimization algorithms. In the Moth-Flame Optimization (MFO) algorithm, the flight path of a moth produces a spiral approximation of the flame as it flies (Mirjalili 2015). In Whale Optimization Algorithm (WOA), humpback whales perform hunting behavior with spiral motion. In Bald Eagle Search Algorithm (BES), bald eagle predation is divided into three phases (select, search, and swoop). In the search phase, the bald eagle searches around the current position in an Archimedean spiral (Alsattar et al. 2020). There are various forms of solenoids and their properties are different, so many scholars have applied solenoids to the improvement of algorithms. Sun et al. proposed an improved WOA based on different search paths and perceived disturbances, and experimental comparisons were made to verify the effect of search paths on its performance (Hao et al. 2022). Guo et al. proposed an ALO based on a spiral complex path search model with eight spiral path search strategies to improve population diversity and balance exploration to exploitation (Guo et al. 2020b). Zhang put forward a MRFO algorithm based on a mathematical spiral foraging strategy, which enhances its global search capability while increasing its convergence speed, as well as verifying its efficiency in terms of power system economics (Zhang et al. 2023).

Table 1 compares the use of solenoids in the related references. All of the above studies are based on the expression of spirals in right-angled coordinates, this paper proposes an improved HBA based on the density factors of the elementary function and the mathematical spirals in the polar coordinate system. This algorithm adopts six density factors for the decaying states based on the elementary functions, and on the basis of the density factor with the best comprehensive effect, the mathematical expressions of seven mathematical spirals (Fibonacci spiral, Butterfly curve, Rose spiral, Cycloid, Archimedean spiral, Hypotrochoid, Cardioid) in the polar coordinate system are introduced in terms of polar diameters and angles to replace the foraging strategy of the honey badger digging pattern in HBA, which will in turn improve the algorithm optimization function's accuracy and the algorithm's ability to balance exploration and exploitation. The above improvements are sequentially compared with the original HBA by using 23 benchmark functions. Then the optimization algorithm α4CycρHBA, which has the best performance, is selected to compare its performance with SOA (Dhiman and Kumar 2019), MVO (Sayed et al. 2019), DOA (Singh 2021), CDO (Shehadeh 2023), MFO (Mirjalili 2015), SCA (Abualigah and Diabat 2021), BA, GWO (Kumar et al. 2017) and FFA (Shayanfar and Gharehchopogh 2018). Finally, the optimized design problems of pressure vessel, three-bar truss, cantilever beam and slotted bulkhead are solved to prove its effectiveness. The results of simulation experiments show that the proposed improved HBA based on the density factors with elementary functions and the mathematical spirals in the polar coordinate system has the characteristics of balanced exploration and exploitation, fast convergence and high accuracy, and it can solve the function optimization and engineering optimization problems better. This paper includes the following contents. Section 2 introduces the HBA; Sect. 3 introduces the improved HBA based on the elementary function density factors and the mathematical spirals of the polar coordinate system; Sect. 4 carries out a series of simulation experiments and engineering optimization; Sect. 5 draws relevant conclusions.

Table 1 Comparison of different algorithms by using spirals

2 Fundamentals of honey badger optimization algorithm

The honey badger is a furry mammal found in Africa, West Asia, and South Asia that requires burrows, rock crevices, or other sheltered areas for shelter, and is known as "the world's most fearless animal". The honey badger has a stout body with strong claws that can destroy bee nests, and thick skin and rough hair that can defend against swarms of bees. Despite its love of honey, the honey badger does not have the skills to accurately identify hives. A bird that acts as a honey mentor for honey badgers is able to discover bee nests but is unable to access the honey. Observational experiments in the field revealed that this series of phenomena led to cooperation: the guide bird would bring the honey badger to the hive after discovering it, while the honey badger would use its front paws to open the hive, and ultimately, the guide bird and the honey badger worked together to obtain the honey together. In general, honey badgers are able to use their olfactory system to continuously track the location of their prey. In order to find a hive, the honey badger has to adopt two different strategies. One is to search by smell and the other is to follow a guide bird. In both cases, one is dominated by the digging phase, while the other is dominated by the honey phase. The honey badger switches between these two phases, but each is unique. In digging phase, the honey badger uses its keen sense of smell to pinpoint the location of the hive, and once it is close it quickly searches for the best place to dig. In honey phase, honey badgers use guide birds directly to pinpoint the location of the hive.

2.1 Initialization phase

Honey Badger Algorithm (HBA) is proposed based on the honey badger population. Assuming that N is the population size of honey badgers in the algorithm, D represents the dimension of the problem to be optimized, and X is a population of N individual honey badgers, the matrix X can be represented as follows:

$$X = \left[ \begin{aligned} x_{11} {\text{ x}}_{{{12}}} {\text{ x}}_{{{13}}} \, ...{\text{ x}}_{{{\text{1D}}}} \hfill \\ x_{21} {\text{ x}}_{{{22}}} {\text{ x}}_{{{23}}} \, ...{\text{ x}}_{{{\text{2D}}}} \hfill \\ x_{31} {\text{ x}}_{{{32}}} {\text{ x}}_{{{33}}} \, ...{\text{ x}}_{{{\text{3D}}}} \hfill \\ ... \, ... \, ... \, ... \, ... \hfill \\ x_{n1} {\text{ x}}_{{{\text{n2}}}} {\text{ x}}_{{{\text{n3}}}} \, ...{\text{ x}}_{{{\text{nD}}}} \hfill \\ \end{aligned} \right]$$
(1)

In the quest space, the population initialization of HBA is achieved by randomly generating a number of individuals, is described mathematically as below:

$${\text{x}}_{{\text{i}}} = lb_{i} + r_{1} \times (ub_{i} - lb_{i} )$$
(2)

where xi represents the location information of the honey badger; r1 is a random number uniformly distributed in the range [0,1]; ubi and lbi are the upper and lower bounds of the solved problem space.

2.2 Definition of smell intensity

Honey badgers locate hives and dig for food based on scent, so the scent strength of prey is a very important factor. Scent strength I was not only related to the source strength of the prey, but also showed a close correlation with the distance between the prey and the honey badger, which moved by tracking the intensity of the prey's scent. As the intensity of the prey's scent increases and its distance from the honey badger decreases, the honey badger can locate the prey more accurately and approach the prey faster. The effect of odor intensity I on honey badger behavior is shown in Fig. 1.

Fig. 1
figure 1

Honey badger movements based on prey odor intensity

Following the principle of the inverse square law, the smell intensity I of HBA is defined as below:

$$\begin{array}{l}{I_{\rm{i}}} = {r_2} \times \frac{S}{{4\pi {\rm{d}}_{\rm{i}}^2}}\\S = {({x_i} - {x_{i + 1}})^2}\\{d_i} = {x_{prey}} - {x_i}\end{array}$$
(3)

where S denotes the source intensity (concentration intensity) of the prey, di denotes the distance between both the prey and the honey badger, and r2 is a random number uniformly distributed over the range [0,1]. The optimal individual in the honey badger population is defined as the prey, and xprey denotes the location of the prey.

2.3 Density factor

In HBA, the density factor \({\alpha }\) controls some random factor that varies over time and it is defined as follows:

$$\alpha = C \times \exp \left(\frac{ - t}{{t_{\max } }}\right)$$
(4)

where, \(t\) denotes the current number of iterations, \({t}_{max}\) denotes the maximum number of iterations, and C is a constant value of \(\ge 1\). Set \(C=2\).

At the beginning of the iteration, the density factor is very large, and with the increase of iteration, the density factor tends to decay, thus reducing the randomness with the number of iterations while making the algorithm more stable, which ensures that the HBA can be a smooth transition in the process of the exploration phase to the exploitation phase. The image of the HBA density factor \({\alpha }\) is shown in Fig. 2.

Fig. 2
figure 2

Trend of density factor with number of iterations

2.4 Position update

Based on the two distinct foraging strategies possessed by honey badgers in nature, the location update of the search agent in HBA can be divided into two phases, namely "digging phase" and "honey phase", which have different movement trajectories.

2.4.1 Digging phase

During this phase, the honey badger autonomously searches for hives by smell and destroys them for food. Its trajectory follows the shape of the Cardioid and its position is updated with the following Eq.  (5).

$$x_{new} = x_{prey} + F \times \beta \times I \times x_{prey} + F \times r_{3} \times \alpha \times d_{i} \times |\cos (2\pi r_{4} ) \times [1 - \cos (2\pi r_{5} )]|$$
(5)

where \({x}_{new}\) represents the new position of the honey badger individual and \({x}_{prey}\) represents the optimal position of the prey.\(\upbeta\) indicates the ability of the individual honey badger to acquire food and is a constant value greater than 1, which is set as \(6\). \({d}_{i}\), I and \({\alpha }\) are determined by Eq.  (2) and Eq.  (4), \({r}_{3}\), \({r}_{4}\) and \({r}_{5}\) are three different uniformly distributed random numbers, and the search direction of the honey badger is changed by using the flag F. The expression of F is defined as:

$$F = \left\{ \begin{array}{l}1{\text{ if }}{{\text{r}}_6} \le 0.5\\ - 1{\text{ else}}\end{array} \right.$$
(6)

where \({{\text{r}}}_{6}\) is a random number between [0,1].

During the digging phase of honey badger foraging, factors that influence the search path of the honey badger include the smell intensity I of the globally optimal prey \({x}_{prey}\), the distance between the honey badger and the prey \({d}_{i}\), and the density factor \({\alpha }\). At the same time, the search direction flag F may also influence the search path, with honey badgers redirecting their digging appropriately when better quality prey is present.

2.4.2 Honey phase

In this phase, the honey badger needs to follow the lead of the honey guiding bird to find the hive for food. When a guiding bird finds a hive, it calls out the honey badger to follow it, which then uses its strong claws to break through the hive, and the two work together for mutual benefit to obtain food. Equation  (7) describes the location update strategy for the honey phase.

$$x_{new} = x_{prey} + F \cdot r_{7} \cdot \alpha \cdot d_{i}$$
(7)

where \({x}_{new}\) represents the new position of the honey badger individual and \({x}_{prey}\) represents the optimal position of the prey. F is determined by Eq. (6), \(\alpha\) is determined by Eq. (4), \({d}_{i}\) is determined by Eq.  (2), and \({r}_{7}\) is a random number between 0 and 1.

In the honey phase, the honey badger's search path is influenced by the global optimal prey \({x}_{prey}\), the distance between the honey badger and the prey \({d}_{i}\), and the density factor \({\alpha }\). Meanwhile, due to the perturbing effect of the search direction flag F, the honey badger will explore near the global optimal position \({x}_{prey}\). The following description shows the operation flowchart of HBA.

Step 1: Initialize the parameters such as population size, number of iterations, \(\beta\) and C, etc. Individual fitness values were evaluated using an objective function to save the optimal position as the prey position;

Step 2: Update the density factor and calculate the smell intensity I.

Step 3: Depending on the value of the random rate r to decide to execute the corresponding search strategy, Eq. (5) or Eq. (7) is executed to update the location of the honey badger individual.

Step 4: Calculate the fitness value by using the objective function and update the global optimal solution.

Step 5: Repeat Step 2~4 to calculate the optimal position and optimal fitness value when the stopping condition is satisfied.

3 Improved honey badger algorithm

3.1 Improved HBA based on elementary functional density factors

Honey badger's foraging behavior in nature can be summarized in two distinct phases: digging phase and honey phase, but no matter which foraging phase, the search path of honey badgers is heavily dependent on the density factor \({\alpha }\). Therefore, choosing the appropriate density factor can maintain the balance between the global and local search capabilities of the algorithm, thus improving its search efficiency and accuracy. The mathematical description of the density factor \({\alpha }\) in the original HBA is shown in Eq.  (4), and the graph of its change with the number of iterations is shown in Fig. 2. According to Fig. 2, it can be seen that the density factor does not converge to 0 at the end of the iteration, this will lead to algorithms that are prone to local optimal solutions. In order to overcome this negative situation and to improve the searching ability of HBA, this paper designs six elementary function based density factors to improve HBA, which include linear function based density factor \({\alpha }_{1}\), cubic function based density factor \({\alpha }_{2}\), cubic root function based density factor \({\alpha }_{3}\), logarithmic function based density factor \({\alpha }_{4}\), cosine function based density factor \({\alpha }_{5}\) and sinusoidal function based density factor \({\alpha }_{6}\). The mathematical expressions for these six elementary function density factors are shown in Eqs. (8)- (13), and their visualization graphs are shown in Fig. 3. According to the images presented by the six elementary function-based density factors in Fig. 3, it can be seen that the improved density factors show a gradual decay from 2 to 0 with the increase in the number of iterations, and this trend significantly improves the capability of the HBA. It can be visualized through Fig. 3 that the density factor \({\alpha }_{4}\) designed based on the logarithmic function converges significantly faster at the beginning and the end of the iteration, with higher convergence accuracy as well as faster convergence, compared to the other five elementary function density factors.

$$\alpha_{1} = C \times \left(1 - \frac{t}{{t_{\max } }}\right)$$
(8)
$$\alpha_{2} = - \left(C \times \frac{t}{{t{}_{\max }}}\right) - 1^{3} + 1$$
(9)
$$\alpha_{3} = - {}^{3}\sqrt {C \times \frac{t}{{t_{\max } }} - 1} + 1$$
(10)
$$\alpha_{4} = \frac{{\log \left(\frac{t}{{t_{\max } }}\right)}}{{\log \left(\frac{1}{C}\right)}} \times \frac{2}{9}$$
(11)
$$\alpha_{5} = C \times \cos \left(\frac{\pi }{2} \times \frac{t}{{t_{\max } }}\right)$$
(12)
$$\alpha_{6} = C \times \sin \left(\frac{ - \pi }{2} \times \frac{t}{{t_{\max } }}\right) + 2$$
(13)
Fig. 3
figure 3

Six elementary function density factors

3.2 Improved HBA based on mathematical spirals in polar coordinate system

3.2.1 Mathematical spirals

In this paper, seven mathematical spirals are used to replace the foraging strategy of the honey badger digging phase in the HBA by applying the mathematical expressions of the polar diameters and polar angles in their polar coordinate systems. These 7 types of mathematical spirals are Fibonacci spiral, Butterfly curve, Rose spiral, Cycloid, Archimedean spiral, Hypotrochoid and Cardioid. The search area covered by each type of spirals is unique, which leads to variations in the optimization effect of the algorithm, further highlighting the excellence of the improved HBA. The definitions of the seven mathematical spirals and the parametric equations of the right-angled coordinate system are as follows, and the images of the seven spirals are shown in Fig. 4.

Fig. 4
figure 4

Two-dimensional images of mathematical spirals

(1) Fibonacci spiral. The Fibonacci spiral (Fib) also known as the golden spiral, is a logarithmic spiral with a unique spiral structure. The rate of change of curvature at each point of the Fibonacci spiral is equal, consisting of n 1/4 circles of radius size in a golden ratio. However, the curvature is discontinuous at the point where each 1/4 circle meets, which means that the curvature of the entire spiral is not continuous.

$$\left\{ \begin{aligned} x = a \times e^{(k\theta )} \times \cos (\theta ) \hfill \\ y = a \times e^{(k\theta )} \times {\text{sin}}(\theta ) \hfill \\ \end{aligned} \right.$$
(14)

(2) Butterfly Curve. Butterfly curve (But) is a very beautiful algebraic curve on the plane, by changing the variable θ in the Eq.  (15) you can get different shapes and directions of the butterfly curves.

$$\left\{ \begin{aligned} x = \sin (\theta ) \times (e^{\cos (\theta )} - 2 \times \cos (4\theta ) - \sin^{5} \left(\frac{\theta }{12})\right) \hfill \\ y = \cos (\theta ) \times \left(e^{\cos (\theta )} - 2 \times \cos (4\theta ) - \sin^{5}\left(\frac{\theta }{12}\right)\right) \hfill \\ \end{aligned} \right.$$
(15)

(3) Rose spiral. The geometry of the Rose spiral (Ros) depends on the values of the parameters of the Eq.  (16). The length of the leaves is controlled by parameter \(a\), and the number of leaves, leaves size and the length of the period are controlled by parameter \(n\).

$$\left\{ \begin{aligned} x = a \times \sin (n\theta ) \times \cos (\theta ) \hfill \\ y = a \times \sin (n\theta ) \times \sin (\theta ) \hfill \\ \end{aligned} \right.$$
(16)

(4) Cycloid. Cycloid (Cyc) is the trajectory formed by a fixed point on the circumference of a circle when the circle rolls on a fixed straight line, and can also be called a circular roll line or spinning wheel line.

$$\left\{ \begin{aligned} x = r \times (\theta - \sin (\theta )) \hfill \\ y = r \times (1 - \cos (\theta )) \hfill \\ \end{aligned} \right.$$
(17)

(5) Archimedean spiral. Archimedean spiral (Arc) is a trace formed when a point is detached from a fixed point at uniform speed and rotates around the fixed point at a fixed angular velocity, hence the name isochronous spiral.

$$\left\{ \begin{aligned} x = a + b \times \theta \times \cos (\theta ) \hfill \\ y = a + b \times \theta \times \sin (\theta ) \hfill \\ \end{aligned} \right.$$
(18)

(6) Hypotrochoid. The trajectory formed by a point on a circle of radius b that rolls along the inside of a fixed circle of radius a is known as Hypotrochoid (Hyp), and the distance from this point to the center of the circle that rolls internally is c.

$$\left\{ \begin{aligned} x = (a - b) \times \cos (\theta ) + c \times \cos \left(\frac{(a - b)}{b} \times \theta \right) \hfill \\ y = (a - b) \times \sin (\theta ) - c \times \sin \left(\frac{(a - b)}{b} \times \theta \right) \hfill \\ \end{aligned} \right.$$
(19)

(7) Cardioid: Cardioid (Car), also known as the heart-shaped line, is a kind of pendulum line, also a kind of ark line. It is the orbit formed when a fixed point on a circle rolls around the circumference of another circle that is tangent to it and of the same radius, and is so called because it is shaped like a heart.

$$\left\{ \begin{aligned} x = a \times \cos (\theta ) \times (1 - \cos (\theta )) \hfill \\ y = a \times \sin (\theta ) \times (1 - \cos (\theta )) \hfill \\ \end{aligned} \right.$$
(20)

3.2.2 Improved HBA based on mathematical spirals in polar coordinate system

In the original HBA, the trajectory of the honey badger in the digging phase is the parametric equation corresponding to the x-axis in the Cardioid in right-angle coordinates, and the density factor \({\alpha }\) and the flag F for changing the search direction are multiplied with the Cardioid, and the trajectory image corresponding to the two is shown in Fig. 5. According to Fig. 5, as the number of iterations progressively increases, the honey badger population performs a motion similar to the shape of the Cardioid, whose range is between \([\mathrm{0,2}]\). When multiplied in front of the heart line by the attenuated density factor \({\alpha }\) and the flag F that changes the search direction, it ranges from [-4,4]. In this paper, the different spiral threads are multiplied by the corresponding coefficients, which in turn ensures the uniformity of the range of motion. From Fig. 5 (b), it can be seen that the image of the Cardioid does not converge to 0 after multiplying the density factor \({\alpha }\) and changing the sign F of the search direction, which is due to the fact that the density factor in the original HBA does not converge to 0 (see Fig. 3). Therefore, the density factors used in this paper in replacing the Cardioid in the original HBA with a different spiral is the logarithmic function design based density factor \({\alpha }_{4}\) proposed above with the best synthesized results.

Fig. 5
figure 5

Images of Cardioid trajectory

3.3 (1) Mathematical spirals based on polar diameter \({\varvec{\uprho}}\) in polar coordinate system

Calculations for replacing the original HBA Cardioid based on the polar diameter \(\uprho\) in the polar coordinate system for Fibonacci spiral, Butterfly curve, Rose spiral, Cycloid, Archimedean spiral, Hypotrochoid, and Cardioid are shown in Table 2, where \(l=0.05\uppi \bullet {\text{t}}\). Two-dimensional images of different spirals with different polar diameter \(\uprho\) are shown in Fig. 6, and two-dimensional images of spirals multiplied by a density factor \({\alpha }_{4}\) and a sign F that changes the search direction are illustrated by Fig. 7.

Table 2 Formulas for 7 improved methods
Fig. 6
figure 6

Two-dimensional images of different spirals polar diameters \({\varvec{\uprho}}\)

Fig. 7
figure 7

Different spirals polar diameters \({\varvec{\uprho}}\)*\({{\varvec{\upalpha}}}_{4}\)*F

3.4 8) Mathematical spirals based on polar angle \({\varvec{\uptheta}}\) in polar coordinate system

Calculations for replacing the original HBA Cardioid based on the polar angle \(\uptheta\) in the polar coordinate system for Fibonacci spiral, Butterfly curve, Rose spiral, Cycloid, Archimedean spiral, Hypotrochoid, and Cardioid are shown in Table 3, where \(l=0.05\uppi \bullet {\text{t}}\). Two-dimensional images of different spirals with different polar angle \(\uptheta\) are shown in Fig. 8, and two-dimensional images of spirals multiplied by a density factor \({\alpha }_{4}\) and a sign F that changes the search direction are illustrated by Fig. 9.

Table 3 Formulas for 7 improved methods
Fig. 8
figure 8

Two-dimensional images of different spirals polar angle \({\varvec{\uptheta}}\)

Fig. 9
figure 9

Different spirals polar angle \({\varvec{\uptheta}}\)*\({{\varvec{\upalpha}}}_{4}\)*F

The algorithm flowchart of the improved HBA based on the density factors with the elementary function and the mathematical spirals in the polar coordinate system is shown in Fig. 10.

Fig. 10
figure 10

Flowchart of the improved HBA based on elementary function density factors and mathematical spirals in polar coordinate system

3.5 Complexity of the improved algorithm

Theoretically, HBA is considered as a global optimization algorithm during the exploration and exploitation phase. The computational complexity depends on three processes: initialization, fitness evaluation and algorithm update. The overall complexity of the original HBA consists of the objective function defined in the position update, which has a computational complexity of \(Ot_{\max } \times N \times D)\). The computational complexity is related to the size of the population N, the maximum number of iterations T, and the dimension D of the problem. The complexity of an algorithm is generally calculated based on the number of executions of statements. The improved algorithm α4CycρHBA proposed in this paper only changes the density factor and the foraging path of the honey badger individuals, and does not change the number of executions of the original HBA, so the overall complexity of the improved algorithm α4CycρHBA, which includes the position updating formulas defined in Table 1 and Table 2, is \(Ot_{\max } \times N \times D)\).

4 Simulation experiment and result analysis

4.1 Function optimization

Twenty-three benchmark test functions were selected, in which the test functions were categorized into three types: single-peak test functions, multi-peak test functions, and fixed-dimensional multi-peak test functions. The optimization results of these three kinds of test functions are used to demonstrate the superiority of the improved HBA in all aspects. In order to achieve the fairness of the test experiment, the maximum number of iterations of the HBA and the improved HBA based on the density factors of the elementary function and the mathematical spirals of the polar coordinate system were set to 500, and the number of honey badger populations was set to 50. To ensure the authenticity and fairness of the experiments, each group of experiments was chosen to run independently 30 times. Finally, its optimization performance is verified by using four real engineering optimization problems.

4.1.1 Test functions

To demonstrate the superiority of the improved algorithm, 23 test functions were selected, all of which are the minimized problems. The test functions include three types: single-peak test functions F1 ~ F7, multi-peak test functions F8 ~ F13, and fixed-dimensional multi-peak test functions F14 ~ F23. The dimensionality of both the single-front and multiple-front test functions is 30 dimensions, the dimensionality of F14 and F16 ~ 18 is 2 dimensions, the dimensionality of F15 and F21 ~ 23 is 4 dimensions, the dimensionality of F19 is 3 dimensions, and the dimensionality of F20 is 6 dimensions.

4.1.2 Function optimization for improved HBA based on elementary function density factors

In order to demonstrate the superiority of the improved HBA based on the elementary function density factors compared to the original HBA, 23 test functions were selected. The maximum number of iterations for each algorithm was set to 500. To ensure the reliability of the experimental results, each algorithm was experimented with 30 times and the optimal solutions from the results of these 30 runs were recorded. In order to facilitate the comparison of the performance of the algorithms and the analysis of the results, mathematical statistics of the experimental results were carried out, and Table 4 shows the statistics of the optimum, mean and standard deviation of the runs of the improved HBA as well as the original HBA. The average comparative convergence curves of the improved HBA and the original HBA for 30 runs is shown in Fig. 11.

Table 4 Performance comparison results for function optimization
Fig. 11
figure 11figure 11

Convergence curves for function optimization of the improved HBA based on the density factors with the elementary function

Based on the results of the optimal values obtained from 23 test functions shown in Table 4, the following conclusions can be drawn:The optimal value obtained by α2-HBA is the smallest in F5, the optimal value obtained by α4-HBA is the smallest in F1 ~ F4 and F7,the optimal value obtained by α5-HBA is the smallest in F8, and the optimal values obtained by α1-HBA, α2-HBA, α3-HBA, α4-HBA, α5-HBA and α6-HBA are the smallest in F9 ~ F11 and F14 ~ F23. Based on the results of the average values obtained from the 23 test functions in Table 4, the following conclusions can be drawn: The average value obtained by α2-HBA is the smallest in F14 and F18, the average value obtained by α3-HBA is the smallest in F10, F18 and F19, the average value obtained by α4-HBA is the smallest in F1 ~ F4, F7, F10, F15, F21 and F22, the average value obtained by α5-HBA is the smallest in F6, F8, F10, F13, F18 and F20, the average value obtained by α6-HBA is the smallest in F10, F18 and F21. The average values obtained by α1-HBA, α2-HBA, α3-HBA, α4-HBA, α5-HBA and α6-HBA are the smallest in F9, F11, F16 and F17. Based on the standard deviation results obtained from the 23 test functions in Table 4, the following conclusions can be drawn. The standard deviation obtained by α1-HBA is the smallest in F1 and F5, the standard deviation obtained by α2-HBA is the smallest in F1, F7 and F14, the standard deviation obtained by α3-HBA is the smallest in F10, the standard deviation obtained by α4-HBA is the smallest in F1 ~ F4, F8, F10, F15, F16, F19, F21 and F22, the standard deviation obtained by α5-HBA is the smallest in F6, F10, F13, F18 and F20, the standard deviation obtained by α6-HBA is the smallest in F1, F3, F10 and F21, the standard deviation obtained by α1-HBA, α2-HBA, α3-HBA, α4-HBA, α5-HBA and α6-HBA are the smallest in F9, F11 and F17.

By analyzing the convergence curves of different optimization strategies in the simulation graphs and comparing the data in the table, the following conclusions can be drawn. The proposed six improved algorithms have better optimization performance than the HBA for most of the test functions, which in turn verifies that the proposed improvement scheme is effective. The improved density factor based on the elementary function is not only capable of high-speed optimization search, but also more accurate in the optimization search process. Among them, the α4-HBA optimization algorithm outperforms the original HBA and other schemes for improving the density factor in terms of convergence speed, optimal value, mean and standard deviation. This shows that the proposed α4-HBA optimization algorithm based on the logarithmic function is the most effective, so α4-HBA is chosen for further algorithmic improvement in the following.

4.1.3 Improved HBA for solving test functions based on mathematical spirals with polar diameter \({\varvec{\uprho}}\) in polar coordinate system

In order to demonstrate the more superior performance of the improved HBA based on the mathematical spiral of the polar coordinate system polar diameter \(\uprho\) compared to the original algorithm, 23 test functions were selected. The maximum number of iterations for each algorithm was set to 500. To ensure the reliability of the experimental results, each algorithm was experimented with 30 times and the optimal solutions from the results of these 30 runs were recorded. In this paper, the mathematical statistics of the experimental results are carried out for subsequent comparison and analysis, and the statistics of the optimal value, mean and standard deviation of the runs of the improved algorithm as well as the original algorithm are shown in Table 5. Figure 12 shows the trend of the average convergence curve of the improved HBA based on the mathematical spiral of the polar coordinate system polar diameter \(\uprho\) compared with the original HBA after 30 runs.

Table 5 Performance comparison results for function optimization
Fig. 12
figure 12figure 12

Convergence curves for function optimization of the improved HBA based on the mathematical spirals of polar diameter \({\varvec{\uprho}}\) in the polar coordinate system

Based on the results of the optimal values obtained from the 23 test functions in Table 5, the following conclusions can be drawn:The optimal value obtained by α4FibρHBA is the smallest in F9 ~ F11 and F15, the optimal value obtained by α4ButρHBA is the smallest in F9 ~ F11 and F15, the optimal value obtained by α4RosρHBA is the smallest in F8, F9 ~ F11 and F15, the optimal value obtained by α4CycρHBA is the smallest in F1 ~ 4, F7, F9 ~ F11 and F15, the optimal value obtained by α4ArcρHBA is the smallest in F9 ~ F11 and F15, the optimal value obtained by α4CarρHBA is the smallest in F9 ~ F11 and F15, and the optimal values obtained by α4FibρHBA, α4ButρHBA, α4RosρHBA, α4CycρHBA, α4ArcρHBA, α4HypρHBA and α4CarρHBA are the smallest in F14, F16 ~ F23. Based on the results of the average values obtained from the 23 test functions in Table 5, the following conclusions can be drawn. The average values obtained by α4FibρHBA, α4ButρHBA, and α4RosρHBA are the smallest in F9 ~ F11 and F16 ~ F18, the average value obtained by α4CycρHBA is the smallest in F1 ~ 4, F7, F9 ~ F11, F15 ~ F17 and F19 ~ F23, the average value obtained by α4ArcρHBA is the smallest in F9 ~ F11, F16 and F17, the average value obtained by α4HypρHBA is the smallest in 16 and F17, and the average value obtained by α4CarρHBA is the smallest in F9 ~ F11, F16, F17 and F19. Based on the standard deviation results obtained from the 23 test functions in Table 5, the following conclusions can be drawn. The standard deviation obtained by α4FibρHBA is the smallest in F1, F3, F5, F9 ~ F11 and F17, the standard deviation obtained by α4ButρHBA is the smallest in F1, F3, F9 ~ F11, F17 and F18, the standard deviation obtained by α4RosρHBA is the smallest in F1, F3, F9 ~ F11 and F17,the standard deviation obtained by α4CycρHBA is the smallest in F1 ~ F4, F7, F9 ~ F11, F15 ~ F17 and F19 ~ F23, the standard deviation obtained by α4ArcρHBA is the smallest in F9 ~ F11 and F17, the standard deviation obtained by α4HypρHBA is the smallest in F8 and F17, and the standard deviation obtained by α4CarρHBA is the smallest in F1, F3, F9 ~ F11, F17 and F19.

By analyzing the convergence curves of different optimization strategies in the simulation graphs and comparing the data in the table. the following conclusions can be drawn. The mathematical spirals based on the polar coordinate system polar diameter \(\uprho\) of the improved HBA outperforms the original HBA for most of the test functions, and it has a strong advantage in terms of searching performance. The data and image information generated from the experiments clearly show that the improved algorithm based on α4HypρHBA is ineffective and has a large gap compared to the other optimization strategies, so it is not recommended to use this optimization strategy. Among them, α4CycρHBA optimization algorithm outperforms the original algorithm and other improved schemes in terms of convergence speed, optimal value, mean and standard deviation. Thus the α4CycρHBA optimization algorithm is the most effective, showing its obvious superiority and better search capability.

4.1.4 Improved HBA for solving test functions based on mathematical spirals with polar angle \({\varvec{\uptheta}}\) in polar coordinate system

In order to demonstrate the advantages of the improved HBA based on mathematical spirals of polar angle \(\uptheta\) in polar coordinate system compared to the original HBA, 23 test functions were selected. The maximum number of iterations for each algorithm was set to 500. To ensure the reliability of the experimental results, each algorithm was experimented with 30 times and the optimal solutions from the results of these 30 runs were recorded. Mathematical statistics of the experimental results were performed to better assess their reliability. Table 6 shows the statistics of the optimum, mean and standard deviation of the runs of the improved HBA as well as the original HBA. Figure 13 represents the trend in the average convergence curves of the improved HBA with mathematical spirals based on the polar angle \(\uptheta\) in the polar coordinate system compared to the original HBA after 30 runs.

Table 6 Performance comparison results for function optimization
Fig. 13
figure 13figure 13

Convergence curves for function optimization of the improved HBA based on the mathematical spirals of polar angle \({\varvec{\uptheta}}\) in the polar coordinate system

Based on the results of the optimal values obtained from the 23 test functions in Table 6, the following conclusions can be drawn: The optimal value obtained by α4FibθHBA is the smallest in F7, F9 ~ F11 and F14 ~ F23,the optimal values obtained by α4ButθHBA, α4RosθHBA and α4ArcθHBA are the smallest in F9 ~ F11 and F14 ~ F23, the optimal value obtained by α4CycθHBA is the smallest in F1 ~ 4, F9 ~ F11 and F14 ~ F23, the optimal value obtained by α4HypθHBA is the smallest in F14 ~ F23, and the he optimal value obtained by α4CarθHBA is the smallest in F8, F9 ~ F11 and F14 ~ F23. Based on the results of the average values obtained from the 23 test functions in Table 6, the following conclusions can be drawn: The average value obtained by α4FibθHBA is the smallest in F9 ~ F11, F16 ~ F18 and F20, the average value obtained by α4ButθHBA is the smallest in F9 ~ F11, F16, F17 and F23, the average value obtained by α4RosθHBA is the smallest in F9 ~ F11, F16 ~ F19 and F22, the average value obtained by α4CycθHBA is the smallest in F1 ~ 4, F7, F9 ~ F11 and F15 ~ F19, the average value obtained by α4ArcθHBA is the smallest in F9 ~ F11, F16 ~ F19 and F21, the average value obtained by α4HypθHBA is the smallest in F14, F16 and F17, and the average value obtained by α4CarθHBA is the smallest in F9 ~ F11 and F16 ~ F21. Based on the standard deviation results obtained from the 23 test functions in Table 6, the following conclusions can be drawn: The standard deviation obtained by α4FibθHBA is the smallest in F1, F3, F9 ~ F11 and F17, the standard deviation obtained by α4ButθHBA is the smallest in F1, F3, F9 ~ F11, F17 and F23,the standard deviation obtained by α4RosθHBA is the smallest in F1, F3, F7, F9 ~ F11, F14 and F17,the standard deviation obtained by α4CycθHBA is the smallest in F1 ~ F5, F9 ~ F11 and F15 ~ F19, the standard deviation obtained by α4ArcθHBA is the smallest in F1, F3, F8 ~ F11 and F17, the standard deviation obtained by α4HypθHBA is the smallest in F17 and F22, and the standard deviation obtained by α4CarθHBA is the smallest in F1, F3, F9 ~ F11, F17 and F21.

By analyzing the convergence curves of different optimization strategies in the simulation graphs and comparing the data in the table the following conclusions can be drawn. The improved HBA based on the mathematical spirals in the polar coordinate system with polar angle \(\uptheta\) outperforms the original HBA for most of the test functions, and has a strong edge in search performance. From the data and images, it is obvious that the improvement of the HBA based on the α4HypθHBA scheme is not effective, and the gap with other optimization algorithms is large, so it is not recommended. Among them, the α4CycρHBA outperforms the original HBA and other improved schemes in terms of convergence speed, optimal value, mean and standard deviation. Thus the α4CycθHBA is the most effective, showing its obvious superiority and better search ability.

4.1.5 Performance comparison of α4CycρHBA with other algorithms

Based on the experimental data above, it can be determined that α4CycρHBA has the best optimization performance among all the improved schemes. In order to better prove that the optimization algorithm α4CycρHBA has superiority and feasibility, it is compared with nine algorithms, namely, SOA, MVO, DOA, CDO, MFO, SCA, BA, GWO and FFA. In order to improve the experiment accuracy and avoid the randomness interference on the experimental data, the maximum number of iterations was set to 500 and each algorithm was run 30 times. The average comparative convergence curves of the improved algorithm α4CycρHBA and the other optimized algorithms for 30 runs is shown in Fig. 14. Table 7 lists the statistics of the optimal values, mean and standard deviation of the improved algorithm α4CycρHBA and the other algorithms.

Fig. 14
figure 14figure 14

Convergence curves of function optimization under different algorithms

Table 7 Performance comparison results of function optimization under different algorithms

Based on the analysis of the optimal value data in Table 7, it can be concluded that the optimal value obtained by the improved algorithm α4CycρHBA is the smallest in F7, F9 ~ F11 and F14 ~ F23, the optimal value obtained by SOA is the smallest in F14, F16 and F18, the optimal value obtained by MVO is the smallest in F13, F14, F16 ~ F20, F22 and F23, the optimal value obtained by DOA is the smallest in F1 ~ F4, F9 ~ F11 and F14 ~ F23, the optimal value obtained by CDO is the smallest in F9, F11, F16 and F18, the optimal value obtained by MFO is the smallest in F14 and F16 ~ F23, the optimal value obtained by SCA is the smallest in F14, F16 and F18, the optimal value obtained by BA is the smallest in F8 and F16, the optimal value obtained by GWO is the smallest in F5, F9, F11, F12 and F14 ~ F20, and the optimal value obtained by FFA is the smallest in F6, F14 and F16 ~ F23. Based on the analysis of the mean data in Table 7, it can be concluded that the mean value obtained by the improved algorithm α4CycρHBA is the smallest in F1 ~ F4, F9 ~ F11, F16, F17 and F19, the mean value obtained by SOA is the smallest in F16 and F18, the mean value obtained by MVO is the smallest in F13, F14 and F16 ~ F19, the mean value obtained by DOA is the smallest in F9, F11 and F16 ~ F18, the mean value obtained by CDO is the smallest in F5, F7 and F15, the mean value obtained by MFO is the smallest in F8 and F16 ~ F19, the mean value obtained by SCA is the smallest in F16 and F18, the mean value obtained by GWO is the smallest in F12 and F16 ~ F18, and the mean value obtained by FFA is the smallest in F6, F14 and F16 ~ F23. Based on the analysis of the standard deviation data in Table 7, it can be concluded that the standard deviation obtained by the improved algorithm α4CycρHBA is the smallest in F1 ~ F4, F9 ~ F11, F16, F17 and F19, the standard deviation obtained by DOA is the smallest in F5, F9, F11 and F17, the standard deviation obtained by CDO is the smallest in F6, F7, F10, F13 and F15, the standard deviation obtained by MFO is the smallest in F17,the standard deviation obtained by SCA is the smallest in F8, the standard deviation obtained by GWO is the smallest in F12, and the standard deviation obtained by FFA is the smallest in F14, F18, F20 ~ F23.

By organizing and analyzing the simulation diagrams and experimental data, the following conclusions can be drawn. The α4CycρHBA optimization algorithm has a strong advantage in search performance, and it is better than several other algorithms in many aspects such as convergence speed, optimal value, mean and standard deviation, which shows that the α4CycρHBA optimization algorithm is the most effective, demonstrating a very obvious superiority and a better search ability, and proving that the proposed improvement of HBA algorithm based on the logarithmic function and the polar diameter coordinates is feasible.

4.2 Engineering optimization design

To further validate the applicability of the algorithms proposed in this paper in real life, four engineering design issues are solved using the improved algorithm α4CycρHBA. All four problems are derived from the summary of mathematical models in the real production process, all of which have a single objective function and constraints with multiple inequalities. For the fairness, credibility and better analysis of the experimental results, each engineering problem was run 30 times, and then α4CycρHBA was analyzed in comparison with other algorithms.

4.2.1 Pressure vessel problem

With the continuous improvement of China's industrial level, the demand for pressure vessels is also increasing, so the quality of pressure vessels put forward higher requirements. In view of the complex manufacturing process and potential hazards of pressure vessels, optimizing their design has become a crucial task. The design objective of a pressure vessel is to minimize its total cost \(f(X)\), including but not limited to the cost of materials, forming and welding, while meeting the production requirements. The following objective function and corresponding constraints are set for the optimal pressure vessel design problem.

Objective function:

$$f\left( X \right) = 0.6224X_{1} X_{3} X_{4} + 1.7781X_{2} X_{3}^{2} + 3.1661X_{1}^{2} X_{4} + 19.84X_{1}^{2} X_{3}$$

Restrictive condition:

$$g_{1} \left( X \right) = 0.0193X_{3} - X_{1} \le 0$$

\(g_{2} \left( X \right) = 0.00954X_{3} - X_{2} \le 0\)

$$g_{3} \left( X \right) = 1296000 - \pi X_{3}^{2} X_{4} - 4/3\pi X_{3}^{3} \le 0$$

\(g_{4} \left( X \right) = X_{4} - 240 \le 0\)

where \(X_{1}\) denotes the wall thickness of the cylinder head of the pressure vessel and takes the value in the range of 0.0625 ≤ X1,\(X_{2}\) denotes the wall thickness of the cylinder of the pressure vessel and takes the value in the range of X2 ≤ 6.1875, where \(X_{1}\) and \(X_{2}\) are uniformly varying discrete variables with an interval of 0.0625 between them,\(X_{3}\) and \(X_{4}\) are two variables for which continuity exists, denoting the radius of the cylinder and cylinder head and the length of the cylinder, respectively, and the mathematical model developed for the pressure vessel design problem is presented in Fig. 15.

Fig. 15
figure 15

Model of pressure vessel design problem

The convergence plot of the α4CycρHBA optimization algorithm with the other algorithms on the problem of optimizing the pressure vessel design is shown in Fig. 16, demonstrating their performance and effectiveness in the optimization process. The statistical results of the experimental data for the optimization of the problem are presented in Table 8. Thirty experiments were conducted for each of these algorithms, and the maximum number of iterations was 1000 for all of them. According to the convergence diagram and Table 8, it can be seen that the improved algorithm α4CycρHBA shows obvious superiority in terms of mean value, optimal value and standard deviation, etc. Moreover, in solving the pressure vessel design problem, the optimization algorithm α4CycρHBA shows excellent comprehensive performance, surpassing the other optimization algorithms, which proves its significant practical application value.

Fig. 16
figure 16

Convergence curves of α4CycρHBA with other algorithms for optimizing pressure vessel design problem

Table 8 Data comparison of α4CycρHBA with other algorithms for optimizing pressure vessel design problem

4.2.2 Three-bar truss design problem

The design objective of the three-bar truss is to minimize its volume by adjusting its cross-sectional area. The objective function and constraints of the problem are described as follows.

Objective function:

$$f\left( X \right) = \left( {2\sqrt 2 X_{1} + X_{2} } \right) \cdot l$$

Restrictive condition:

$$g_{1} \left( X \right) = \frac{{\sqrt 2 X_{1} + X_{2} }}{{\sqrt 2 X_{1} + 2X_{1} X_{2} }}P - \sigma \le 0$$
$$g_{2} \left( X \right) = \frac{{X_{2} }}{{\sqrt 2 X_{1} + 2X_{1} X_{2} }}P - \sigma \le 0$$
$$g_{3} \left( X \right) = \frac{1}{{\sqrt 2 X_{2} + X_{1} }}P - \sigma \le 0$$

where variable \(X_{1}\) represents the cross-sectional area of bar 1, which takes the value of \(0 \le X_{1} \le 1\), and variable \(X_{2}\) represents the cross-sectional area of bar 2, which takes the value of \(0 \le X_{2} \le 1\). The other parameters are defined below:\(l = 100\) cm, \(P = 2\;{\text{KN/cm}}^{2}\), \(\sigma = 2\;{\text{KN/cm}}^{2}\).

The mathematical model developed for this problem is presented in Fig. 17. Figure 18 represents the convergence curves of the α4CycρHBA with the original HBA and other algorithms for optimizing the three-bar truss design problem. Table 9 demonstrates the experimental results of the optimal solution of the optimized three-bar truss design problem. The maximum number of iterations is 1000 generations.

Fig. 17
figure 17

Model of three-bar truss design problem

Fig. 18
figure 18

Convergence curves of α4CycρHBA with the original HBA and other algorithms for optimizing the three-bar truss design problem

Table 9 Data comparison of α4CycρHBA with the original HBA and other algorithms for optimizing the three-bar truss design problem

To avoid randomness, each algorithm was subjected to 30 experiments respectively, the optimum, mean and standard deviation of the 30 experiments are recorded in Table 9 and the best experimental data obtained from the experiments are bolded. The experimental results show that α4CycρHBA, HBA and DOA achieve the optimal values in the optimal cost, and the improved algorithm α4CycρHBA is obviously better than the original HBA and other algorithms in both the mean value and the standard deviation,the convergence plots of the combined experiments clearly show that α4CycρHBA has a significant advantage in solving the three-bar truss design problem.

4.2.3 Cantilever beam design problem

The design problem of cantilever beams involves in the design of structural engineering and requires weight optimization of its square section. The cantilever beam is rigidly supported at one end and vertical forces act on the free nodes of the cantilever. The objective function as well as the constraints of the cantilever beam design problem are as follows:

Objective function:

$$f(X) = 0.0624 \times (X_{1} + X_{2} + X_{3} + X_{4} + X_{5} )$$

Restrictive condition:

$$g(X) = \frac{61}{{X_{1}^{3} }} + \frac{37}{{X_{2}^{3} }} + \frac{19}{{X_{3}^{3} }} + \frac{7}{{X_{4}^{3} }} + \frac{1}{{X_{5}^{3} }} - 1 \le 0$$

where, \(0.01 \le X_{i} \le 100,i = 1,2,3,4,5\). The mathematical model developed for this problem is presented in Fig. 19.

Fig. 19
figure 19

Model of cantilever beam design problem

Figure 20 presents the convergence plot of the α4CycρHBA optimization algorithm with the other algorithms on the cantilever beam design problem, demonstrating the results achieved in their optimization process. The statistical results of the experimental data for optimizing this design problem are presented in Table 10. For each algorithm the maximum number of iterations was 1000 and 30 experiments were performed. According to the experimental results, the improved algorithm α4CycρHBA shows obvious superiority in all aspects.

Fig. 20
figure 20

Convergence curves of α4CycρHBA with other algorithms for optimizing the cantilever beam design problem

Table 10 Data comparison of α4CycρHBA with other algorithms for optimizing cantilever beam design problems

4.2.4 Slotted bulkhead design problem

The design problem of slotted bulkheads is a difficult problem in the pursuit of weight minimization, and its core objective is to seek the optimal solution for the weight of slotted bulkheads by solving the extreme values of the objective function. In engineering practice, multiple constraints often need to be satisfied at the same time, so it is important to study this optimization model. The objective function and a series of constraints for this design issue are summarized as follows.

Objective function:

$$f(X) = \frac{{5.885X_{4} (X_{1} + X_{3} )}}{{X_{1} + \sqrt {|X_{3}^{2} - X_{2}^{2} |} }}$$

Restrictive condition:

$$g_{1} (X) = - X_{4} X_{2} \left( {0.4X_{1} + \frac{{X_{3} }}{6}} \right) + 8.94\left( {X_{1} + \sqrt {\left| {X_{3}^{2} - X_{2}^{2} } \right|} } \right) \le 0$$
$$g_{2} (X) = - X_{4} X_{2}^{2} \left( {0.2X_{1} + \frac{{X_{3} }}{12}} \right) + 2.2\left( {8.94\left( {X_{1} + \sqrt {\left| {X_{3}^{2} - X_{2}^{2} } \right|} } \right)} \right)^{4/3} \le 0$$
$$\begin{aligned} g_{3} (X) = - X_{4} + 0.0156X_{1} + 0.15 \le 0 \hfill \\ g_{4} (X) = - X_{4} + 0.0156X_{3} + 0.15 \le 0 \hfill \\ g_{5} (X) = - X_{4} + 0.15 \le 0 \hfill \\ g_{6} (X) = - X_{3} + X_{2} \le 0 \hfill \\ \end{aligned}$$

where, X1 denotes width, whose range is \(0 \le X_{1} \le 100\); X2 denotes depth, whose range is \(0 \le X_{2} \le 100\); X3 denotes length, whose range is \(0 \le X_{3} \le 100\) ; X4 denotes plate thickness, whose range is \(0 \le X_{4} \le 5 .\)

The mathematical model of the slotted bulkhead design problem is shown in Fig. 21. Figure 22 represents the convergence curves of the α4CycρHBA with other algorithms for optimizing the slotted bulkhead design problem. Table 11 shows the statistical results of the experimental data for the optimum solution to this problem. The maximum number of iterations is 1000 generations and to avoid randomness each algorithm was subjected to 30 experiments respectively. The experimental results show that the improved algorithm α4CycρHBA is outstanding in terms of optimal value, mean value and standard deviation, and the convergence diagram of the comprehensive experiments clearly shows that α4CycρHBA has a significant advantage over other algorithms in solving the slotted bulkhead design problem. It accurately illustrates that the improved algorithm α4CycρHBA has strong practical applicability in the slotted bulkhead design problem.

Fig. 21
figure 21

Model of slotted bulkhead design problem

Fig. 22
figure 22

Convergence curves of α4CycρHBA with other algorithms for optimizing the slotted bulkhead design problem

Table 11 Data comparison of α4CycρHBA with other algorithms for optimizing the slotted bulkhead design problem

5 Conclusions and future works

Aiming at the problems of the HBA algorithm in terms of convergence accuracy, solution speed and global optimization search ability, an improved HBA based on the density factors of the elementary functions and the mathematical spirals of the polar coordinate system is proposed. By comparing the optimization effects of the 23 test functions, it can be found that the improved algorithm α4CycρHBA is able to better balance the global and local searching abilities while avoiding falling into local optimum, which significantly improves the overall optimization performance of HBA. To further validate the optimization capability of the α4CycρHBA, nine optimization algorithms, including α4CycρHBA with SOA, MOV, DOA, CDO, MFO, SCA, BA, GWO and FFA, were used to optimize the test functions. The following conclusions can be drawn from the analysis of the overall convergence curves of the simulation plots as well as the experimental data obtained. In the vast majority of the test functions, α4CycρHBA achieves the best experimental results among the optimized functions.α4CycρHBA shows the best optimization solution that is more efficient and superior than the other algorithms in solving the four engineering design problems of pressure vessel, three-bar truss, cantilever beam, and slotted bulkhead.

In the work done, the improved algorithm uses the expression of the polar diameter and polar angle of a spiral in a polar coordinate system to replace the foraging strategy of the original HBA, and the seven spirals used are all simpler. In the future work, we will continue to try to apply two-dimensional or higher-dimensional spirals into the foraging strategy so as to further enhance its stability. In this paper, only the function optimization and simple engineering optimization problems with the improved HBA are solved, and it will be applied to practical applications in the future research, such as image segmentation, job-shop scheduling, pattern recognition and fault diagnosis, and other fields.