1 Introduction

Optimization problem runs through all aspects of human activity. Optimization idea is invariably demonstrated from the division of labor in primitive hunting, to the intensive cultivation in agricultural production, and to job scheduling in industrial production [1]. Early optimization mainly relied on empirical analysis. With the improvement in the knowledge level, people began to resort to more accurate mathematical methods to describe and solve optimization problems [2]. Since the twentieth century, new means for optimization has been available thanks to rapid development of electronic computer technology and artificial intelligence technology, enabling people to effectively deal with many complex optimization problems that could not be solved in the past, thus greatly promoting social progress and development [3].

During research on optimization problems, researchers are often inspired by nature [4]. For example, in the evolution of species, genes not adapted to the environment are gradually eliminated, while those adapted to the environment are more likely to be retained to further enhance the competitiveness of species through the optimization of combinations. Inspired by this, Holland proposed genetic algorithms (GA) [5] to solve optimization problems. In the cooling process of metal, each molecule evolves to the lowest energy state possible, making sequence of all molecules changed from disorderly to orderly. Inspired by this, Kirkpatrick et al. [6] proposed simulated annealing algorithm (SA). Based on colony cooperative foraging behavior, Dorigo et al. [7] proposed an ant colony optimization (ACO) algorithm. By simulating the flight patterns of birds, Kennedy and Eberhart [8] proposed a particle swarm optimization (PSO) algorithm. By simulating the self-organizing pattern of bee colonies, Karaboge proposed artificial bee colony (ABC) algorithm [9]. In addition, there are such optimization algorithms as differential evolution (DE) [10], teaching–learning-based optimization (TLBO) [11], invasive weed optimization (IWO) [12] and fireworks algorithm (FWA) [13], bat algorithm (BA) [14] and bacterial foraging optimization (BFO) algorithm [15].

Inspired by the seed transmission mode of garden balsam, the author proposed a new optimization algorithm—garden balsam optimization algorithm. Garden balsam is an annual herbaceous flower with English name “Touch me not” and “Don’t touch me” in American language because its fruit will crack at slight touch and eject seeds. The fruit of garden balsam known as capsule scatters the seeds around the parent through its own mechanical force of cracking at maturity. Garden balsam growing in good growth environment has robust plant, full capsules and forceful cracking, capable of producing more seeds and spreading them to a wider range [16]. This is how garden balsam optimization (GBO) algorithm comes into being. The algorithm though with relatively simple mechanism has been proved to effectively converge to obtain the optimal solution.

The remainder of this paper is organized as follows. Section 2 describes and summarizes the natural reproduction process of garden balsam. Section 3 describes GBO algorithm and its features. Section 4 describes the experimental research on the proposed algorithm and compares it with other meta-heuristic algorithms. Section 5 discusses the statistical analysis of the comparison results. Finally, Sect. 6 sums up the conclusions of this paper.

2 Garden balsam’s natural reproduction process

During the long-term interaction between plants and the environment, seeds and fruits develop a series of mechanisms suitable for transmission. The seed transmission mode and process constitute an important content of evolutionary ecology. Common transmission factors include air, water, animals and self-spread [17], where self-spread means mechanical ejection force is produced to eject seeds after fruit of certain plants matures, dries and cracks. These fruits are found in dehiscent type of dried fruits. Studies have found that second transmission is often a case in seeds relying on self-spread. Garden balsam in this paper belongs to self-spread types.

Whole plant of garden balsam, an annual herb of sapindales, balsam family and Impatiens L., is divided into six parts of roots, stems, leaves, flowers, fruits and seeds. Because its flower head, wings, tail and feet all look like phoenix shape, it is also known as Buttercup. Garden balsam has varied flower colors including pink, red, purple, pinkish purple. By smashing its petals or leaves, wrapping it around nails with leaves, the nail can be died with bright-colored red; thus, it is very popular with girls. The plant, capsule and self-spread of henbane are shown in Fig. 1.

Fig. 1
figure 1

a Plant, b capsule and c self-spread

Garden balsam fruit in oval shape is developed from the pistil, which includes a few to more than twenty seeds according to growth state and pollination. According to fruit classification knowledge in botany, the fruit of garden balsam is capsule whose most important feature is that the fruit is formed by two or more carpellate pistils, it cracks in diverse ways, and the fruit is cracked into five circinate carpels which eject seeds by mechanical force for self-spread reproduction [18].

Studies have shown aril to be the key structure for the seed transmission by elasticity. The aril mainly consists of vesicular cells which undergoes serious dehydration and contraction during maturation. The unbalanced contraction between cells produces torsion which gradually accumulates with the maturation. When the critical point is exceeded, the vesicles split and roll over the seed tip, obliquely projecting the seeds in the form of bounce. The relationship diagram between seed quality and ejection shows that, for a farther ejection distance, the seed mass is larger, and the relationship is more obvious in case of dry weight than fresh weight. The seed density distribution increases first and then decreases with the enlarging transmission distance.

The steps in the dispersion process of garden balsam population can be summarized as follows:

  1. 1.

    Population initialization: A few seeds are randomly scattered in a specific area, taking root and producing the first-generation population;

  2. 2.

    Progeny reproduction: Each individual plant in the first-generation population will demonstrate different growth conditions due to the different natural conditions in the growth area. The more robust plants will yield more fruits and then generate more seeds.

  3. 3.

    Mechanical transmission: According to the transmission properties of garden balsam, the seeds will be ejected by mechanical transmission to the surrounding areas of the parent after the fruit matures. The plants in good growth state will have full fruit, more powerful ejection force, and the seeds will be ejected farther.

  4. 4.

    Second transmission: In the real world, individual seeds will be randomly transmitted to other places by the influence of natural forces such as animals, running water and wind to increase the population diversity.

  5. 5.

    Elimination through competition: There is a maximum limit for population size within a specific region. When the population reaches its maximum, individuals with poor fitness will be eliminated in competition within the population.

3 Garden balsam optimization algorithm

The garden balsam optimization algorithm establishes the corresponding mathematical model by simulating the propagation and expansion behavior of garden balsam. A parallel explosive search manner is then formed by introducing random factors and selection strategies, which then develops into a global search method for solving optimal solution to complex optimization problem.

From Fig. 2, it can be seen that the algorithm iterates from the beginning and adopts mechanical propagator, second propagator, mapping rule and selection strategy in turn until the termination condition is satisfied; that is, accuracy requirement of the problem is satisfied or the maximum number of iterations is reached.

Fig. 2
figure 2

Framework of garden balsam optimization algorithm

3.1 Initialize a population

Determine the initial population number \( N_{\text{init}} \) and the maximum population size \( N_{ \hbox{max} } \), the maximum number of iterations \( {\text{iter}}_{ \hbox{max} } \), the number of problem dimensions \( D \), the upper limit \( S_{ \hbox{max} } \) and lower limit \( {\text{S}}_{ \hbox{min} } \) for the possible seed number, nonlinear index \( n \), zoom factor \( F \), initial value \( A_{\text{init}} \) of seed diffusion amplitude, seed number \( N_{\sec } \) in second transmission and search space range. The initial population is obtained via uniform distribution to ensure diversity of the initial population of GBO algorithm. The initial population generated by this method can be randomly distributed in the entire search space.

3.2 Mechanical transmission

Seeds can grow into individual plants. Plants in good growth environment (with better fitness function) have robust rhizomes, have full capsules and produce more seeds. The mechanical force is stronger when the capsule cracks at seed maturity, and the seed ejection distance is larger. Meanwhile, consideration should also be given to the balance between early global exploration capabilities and later local exploitation capabilities.

The number of seeds produced by an individual (garden balsam plant) in the reproductive process concerns the individual’s fitness value. A better fitness value means more produced seeds. For minimization, let individuals with minimum fitness values reproduce as many offspring as possible, while individuals with the greatest fitness value reproduce as few offspring as possible. That is, let number of seeds produced by an individual with minimum fitness value be \( S_{ \hbox{max} } \) and number of seeds produced by an individual with the maximum fitness value be \( S_{ \hbox{min} } \), while the number of seeds produced by an individual between the minimum fitness value and the maximum fitness value follows a linear relationship of downward rounding with the fitness value.

The number of seeds produced by individual \( {\text{X}}_{\text{i}} : \)

$$ S_{i} = \frac{{f_{\hbox{max} } - f\left( {X_{i} } \right)}}{{f_{\hbox{max} } - f_{\hbox{min} } }} \times \left( {S_{\hbox{max} } - S_{\hbox{min} } } \right) + S_{\hbox{min} } $$
(1)

where \( S_{i} \) denotes the number of seeds produced by the i-th plant; \( f\left( {X_{i} } \right) \) denotes the fitness value of the i-th plant, \( f_{ \hbox{max} } \) is the maximum fitness value in the current population, \( f_{ \hbox{min} } \) is the minimum fitness value in the current population; \( S_{ \hbox{max} } \) means the maximum number of seeds produced by garden balsam, \( S_{ \hbox{min} } \) means the minimum number of seeds produced by garden balsam.

The calculation expression of the seed diffusion range is as follows:

$$ A_{i} = \left( {\frac{{{\text{iter}}_{\hbox{max} } - {\text{iter}} + 1}}{{{\text{iter}}_{\hbox{max} } }}} \right)^{n} \times \frac{{f_{\hbox{max} } - f\left( {X_{i} } \right) + 1}}{{f_{\hbox{max} } - f_{\hbox{min} } }} \times A_{\text{init}} $$
(2)

where \( {\text{iter}} \) is the current number of evolutionary iterations, \( {\text{iter}}_{ \hbox{max} } \) is the maximum number of evolutionary iterations; \( f\left( {X_{i} } \right) \), \( f_{ \hbox{max} } \) and \( f_{ \hbox{min} } \) have the same meaning as in formula (1); n is a nonlinear harmonic factor, usually set to n = 3 [19]. From formula (2), it can be seen that the seed diffusion range is initially large and later smaller; seeds produced by well-adapted plants have a larger diffusion range, and smaller vice versa. This mechanism effectively guarantees the early exploration capability and later exploitation ability of the algorithm.

In the process of seed transmission, different displacement distances for different dimensions enable better seed diversity. The seed mechanical transmission mode in garden balsam optimization algorithm is shown in Algorithm 1.

figure a

where \( {\text{U}}\left( {0,1} \right) \) represents a random number uniformly distributed in the interval [0,1] and \( {\text{round}}() \) represents a rounding operation.

3.3 Second propagator

In the natural world, individual seeds are affected by natural factors such as wind, water flow and animal transport after mechanical diffusion, and then, second transmission occurs, a process that can effectively increase population diversity. The second transmission mechanism introduced by garden balsam optimization algorithm makes it possible that seeds are not only be sown in the vicinity of the plants, but also be spread farther away, thus improving the ability of the algorithm to explore the solution space. The process of second transmission is as follows: \( N_{ \sec } \) seeds are randomly selected and subject to mutation operations. Differential mutation is adopted here to produce mutation seeds.

Differential mutation is a mutation to improve performance of garden balsam optimization algorithm using difference information between individuals. By differential mutation method, variant individuals can be improved, population diversity can be enhanced, and the population can be prevented from falling into a local optimal solution. Its manifestation is as follows:

$$ x_{i1}^{k} = x_{B}^{k} + F\left( {x_{i2}^{k} - x_{i3}^{k} } \right) $$
(3)

where \( x_{i1}^{k} \) is the position of the target individual in the \( {\text{k}} \)-dimension, \( x_{B}^{k} \) is the position of the best individual of the current population in the k dimension and F is the zoom factor used to zoom the difference vector, which is generally set to 0–2; \( x_{i2}^{k} \quad {\text{and}}\quad x_{i3}^{k} \) are the positions of two dissimilar individuals in the k dimension. The second transmission algorithm in garden balsam optimization algorithm is shown in Algorithm 2.

figure b

3.4 Competitive exclusion rules

As the number of iterations of the algorithm continues to increase, when the sum of the population and the resulting progeny population reaches the preset maximum population size \( N_{ \hbox{max} } \), the algorithm performs a competitive exclusion operation. The rule is to rank all individuals in the current population according to the fitness value, retain individuals with good fitness values (elite solutions), randomly select the remaining individuals and eliminate excess individuals. The number of elite solutions is calculated according to formula (4) and rounded up to an integer. The population size remains unchanged at \( N_{ \hbox{max} } \) hereafter. That is, the algorithm first seizes suitable field by individual’s rapid reproduction and then retains the more competitive individuals in the relatively stable environment to continue searching for space. The number of elite solutions has gradually increased with the evolution of iterations. That is, taking early global exploration into account, the later local exploitation capability can be guaranteed.

This mechanism gives opportunity for individuals with low fitness value to reproduce. Their offspring with better fitness values can survive. This method of first making plants rapidly reproduces and grows to adapt to the environment; then, retaining some more competitive individuals in a relatively stable environment for further environmental exploration can be also regarded as a simulation of r and k selections of organisms [20]. Nbest indicates the number of elite solutions.

$$ N_{\text{best}} = \frac{\text{iter}}{{{\text{iter}}_{\hbox{max} } }}N_{\hbox{max} } $$
(4)

3.5 Cross-border mapping rules

In the process of transmission, seeds may fall outside the scope of feasible areas. Such kind of seeds is meaningless, and they must be pulled back to the feasible area according to certain rules. The garden balsam optimization algorithm handles this situation using random mapping rule. That is, the out-of-bounds seeds are mapped using formula (5), which guarantees that all individuals remain in the feasible space.

$$ x_{i}^{k'} = x_{\text{LB}}^{k} + U\left( {0,1} \right)\left( {x_{\text{UB}}^{k} - x_{\text{LB}}^{k} } \right) $$
(5)

where \( x_{\text{UB}}^{k} \) denotes the upper boundary of \( k \) dimension, \( x_{\text{LB}}^{k} \) denotes the lower boundary of \( k \) dimension and \( U\left( {0,1} \right) \) is the same as in Algorithm 3.

figure c

3.6 Discussion

Exploration and exploitation are two important features of population-based (or population) optimization algorithms. In optimization algorithm, exploration indicates global search capacity by investigating different unknown regions, while exploitation indicates local search capability by locally searching the optimal point. Therefore, if a population-based algorithm can achieve balance between exploration and exploitation of search space, then the algorithm is considered as effective. An inherent weakness of most population-based stochastic algorithms is premature convergence, while premature convergence and stagnation are important considerations in designing natural algorithms.

Population diversity is the key to the performance of population optimization algorithms. It can ensure that the algorithm jumps out of the local extreme points and converges to the global optimal point. Greater population diversity means wider individual distribution in the algorithm and higher possibility of finding the optimal solution without significantly affecting convergence ability of the algorithm. The diversity of garden balsam optimization algorithm is mainly reflected in the following three aspects.

  1. 1.

    Diversity of seed number and ejection distance

    Under the action of the ejection propagator, different parents produce different numbers of seeds according to their own fitness values, and the ejection distance also differs. For parents with good fitness values, more seeds are produced and ejected further. For those with poor fitness values, fewer seeds are produced and ejected for a smaller distance. Hence, the diversity of seed number and ejection distance is guaranteed.

  2. 2.

    Variety of transmission modes

    To simulate the second transmission mechanism in the natural world, the garden balsam optimization algorithm is designed with a second propagator, and a specific number of seeds are randomly selected for differential mutation operations to enable secondary displacements of these seed positions. The second propagator has nothing to do with the parent fitness value, but concerns its own coordinate value. Second propagator is essentially different from mechanical propagator, which guarantees transmission diversity.

  3. 3.

    Diversity of selection mode

When the population size reaches the upper limit, the algorithm initiates an elitist random selection strategy, in which the number of elite solutions gradually increases with the evolutionary iterations. This guarantees the global exploration in the early iteration and also ensures local exploitation capabilities in the later period.

4 Experimental investigation

Experimental comparison was made between garden balsam optimization algorithm and mature optimization algorithms including PSO, DE, ABC, BBO, DE, TLBO to verify the algorithm’s usability and performance in terms of function optimization. The constrained optimization test set given in CEC 2006 was used in the experiment, which contained 24 constrained optimization functions. Detailed mathematical formulas and characteristics of each function are given in the literature [21]. These functions concerning continuous, unbiased constrained optimization problems have varying degrees of complexity and multimodality, each with different numbers of variables and data ranges.

The comparative algorithm selected in the experiment has been previously used by different people in attempts to solve various constrained optimization problems [25,26,27,28,29,30,31,32,33,34,35,36,37]. The results show good effect of these algorithms on constrained optimization problem. In addition, it was found in the literature survey that the algorithm under consideration was successfully applied in a variety of engineering applications, with expected results achieved.

4.1 Experimental setting

The proposed garden balsam optimization algorithm was compared with PSO, BBO, DE, ABC and TLBO under the same experimental platform. The function was evaluated for 240,000 times, and each was run 100 times [22,23,24]. The parameters of each algorithm in the experiment are shown in Table 1. In addition, “static penalty” method is applied to all competitive algorithms as constraint handling technology to maintain the consistency of the technology. The computational code for individual algorithms has been provided by developers of these algorithms.

Table 1 Parameter values of each algorithm

4.2 Results and discussion

Targeting at the 24 constrained optimization functions in the test set, the best, worst and mean solutions are independently run by the six algorithms involved in the comparison experiment for 100 times as shown in Table 2. The data of the comparative algorithm are taken from the literature [22,23,24].

Table 2 Comparative results of test functions obtained by different algorithms

The convergence speed of meta-heuristic algorithm is an important standard for evaluating its performance. So far, GBO algorithm convergence performance has been compared with the other five algorithms on four functions (G1, G3, G8 and G24). The test functions selected show different objective function characteristics (that is, G1 is a quadratic type, G3 is a polynomial, G8 is nonlinear, and G24 is linear). The convergence curve is shown in Fig. 3. It can be seen from the figure that GBO algorithm has better convergence performance than other algorithms.

Fig. 3
figure 3

Convergence of each algorithm on four functions

Table 2 shows in the last column the result of 100 independent runs of garden balsam optimization algorithm on the G01–G24 benchmark function. Each run is evaluated for 240,000 times, and the “worst,” “best” and “mean” operation results are compared with five other mature algorithms. The optimal solution was found in garden balsam optimization algorithm on 16 benchmark functions. Failure to find the optimal solution on the remaining eight benchmark functions also occurred in the other five functions. The balsam optimization algorithm outperforms the rest of the comparative algorithms in mean (M) on 15 test functions.

The success rate of the six algorithms in 100 independent runs on G01–G24 benchmark function is shown in Table 3. In the eight test functions (i.e., G02, G10, G13, G14, G19, G20, G22 and G23), all algorithms achieved a success rate of 0. In other test functions, the GBO algorithm is equal or superior to the other five algorithms.

Table 3 Success rate of various algorithms for test functions

Table 4 shows the “mean number” of function evaluation needed for the six algorithms to achieve a global optimum in 100 independent runs on G01–G24 reference functions (except G02, G10, G13, G13, G14, G19, G20, G22 and G23 functions). It can also be seen that relatively superior results are obtained in garden balsam optimization algorithm on all benchmark functions except G01 and G12. Garden balsam optimization algorithm also has good function evaluation standard deviation in evaluation of most functions.

Table 4 Mean number of function evaluations required to reach global optimum value by comparative algorithms for G01–G24 over 100 independent runs

5 Statistical tests

It can be seen from the results in Tables 2, 3 and 4 that garden balsam optimization algorithm outperforms other competitive algorithms in performance. However, Friedman rank test and Holm–Sidak test are necessary to prove the significance of the proposed algorithm.

Table 5 shows Friedman rank tests in which the “best” and “mean” solutions are obtained on G01–G24 function (G22 function is excluded as no algorithm succeeds on G22 function). Therefore, it can be easily seen from Friedman rank test results in the table that the proposed garden balsam optimization algorithm ranks the first with regard to the “best” and “mean” solutions for all the considered test functions. Table 6 shows the Friedman rank test result of obtained solution “success rate.” Since there was no difference in comparative algorithm between the 10 benchmark functions, only 14 samples were involved in the test, and the proposed garden balsam optimization algorithm ranked the first in the test result.

Table 5 Friedman rank test for the “best” and “mean” solutions obtained for G01–G24 functions
Table 6 Friedman rank test for the “success rate” of the solutions obtained for G01–G24 functions

The Friedman rank test can demonstrate the significant difference between different algorithms in performance when the same problem is handled. It is used to rank algorithms according to the result data in the form of order, but cannot specify any statistical difference in the results. Holm–Sidak test as a post hoc test method can be used to determine statistical differences between algorithms. Table 7 shows the Holm–Sidak test results in which the “best” and “mean” solutions are obtained on G01–G24 function. The p values obtained by all the algorithms from Holm–Sidak test show the statistical difference between the proposed garden balsam optimization algorithm and other algorithms.

Table 7 Holm–Sidak test for the “best” and the “mean” solutions obtained for G01–G24 functions

6 Conclusion

This paper introduces a new numerical random search algorithm that simulates natural behavior—garden balsam optimization algorithm. The process and characteristics of natural transmission of garden balsam are described in detail. The simulation process involves the design of garden balsam optimization algorithm, including mechanical propagator, second propagator, competitive selection strategy and cross-border mapping rule. At the same time, the algorithm’s steps, pseudo-codes and flow charts are given. The characteristics of garden balsam optimization algorithm and the effect of each factor on the algorithm performance are analyzed. Meanwhile, comparative experiment is made. Seen from the experimental results, GBO has a good performance in the aspects of optimal solution, mean solution, success rate and convergence speed. Finally, statistical analysis is made for the experimental work. Seen from the statistical test results of Friedman rank test and Holm–Sidak test, GBO is superior to other natural optimization algorithms in terms of constrained optimization problem.