Introduction

Optimization techniques that can produce solid performance in high-dimensional and multimodal functions have been of great interest to researchers. It is known that the classic search methods usually get stuck in local minima and do not behave well when faced with a high number of dimensions, such as particle swarm optimization (PSO), ant colony optimization (ACO), genetic algorithm (GA), among others [1,2,3,4].

Swarm intelligence originated from the study of colonies, swarms or flocks of social organisms and the study of the behavior of individuals in this type of groupings impelled the design of very efficient metaheuristic optimization algorithms [5, 6]. For example, the study of the flocks of birds helped the design of the particle swarm optimization algorithm and the study of the colonies of different groupings of organism gave origin to the bee colony algorithm and the ant colony optimization, among other existing optimization algorithms that base their performance on the behavior of groupings of organisms [7,8,9,10,11].

Fuzzy logic and fuzzy sets were initially proposed by Zadeh [12]. Based on these concepts, fuzzy systems are built with if–then rules constructed through knowledge and heuristics that are based on human knowledge [13].

In fuzzy sets, each element can belong to a set with a degree of certainty, and fuzzy logic allows us to reason with inaccurate or uncertain facts to infer from them new facts with a degree of certainty associated with each particular event. This allows us to model the facts as they occur in real life [14].

Galactic swarm optimization proposed by Muthiah-Nakarajan and Noel has shown to behave well when facing multimodal problems as well with a high number of dimensions, since it presents multiple cycles of exploration and exploitation, and this increases the chances of obtaining better solutions and not getting stuck in local minima [1, 2].

Galactic swarm optimization is based on the movement of stars and galaxies in the universe as well as their attractive influence, and the initial population is divided into subpopulations where each solution is attracted towards the best solutions within each subpopulation thus achieving a better exploration of the possible solutions giving rise to the possibility of solving more complex optimization problems [2].

Galactic swarm optimization (GSO) is described in its original form to appreciate which are the necessary equations to perform its operation and determine the parameters that we can adapt to achieve a better behavior of the galactic swarm optimization. The study of galactic swarm optimization performance is made to show the efficacy of the GSO algorithm to solve optimization problems, taking the original GSO as a basis for the modification of the galactic swarm optimization with dynamic adjustment of parameters. Normally to use the adaptation of parameters during execution of metaheuristic algorithms helps to obtain better results than when using fixed parameters [15,16,17].

The main contribution of this work is the use of fuzzy logic and fuzzy systems to help the galactic swarm optimization to automatically make the adjustment of the parameters without the need for the user to manually move the values of the parameters of the algorithm. In addition, it was used for the optimization of the fuzzy controller of the case study of the water tank control, expecting to obtain a better controller than the one used by traditional control methods.

In this approach, two different fuzzy systems were used to perform the dynamic adjustment of the c3 and c4 parameters of galactic swarm optimization. The first fuzzy system has one input variable and two output variables. The second fuzzy system has two input variables and two output variables. For both fuzzy systems the output variables are the c3 and c4 parameters, this with the idea of obtaining better results than those obtained when using fixed parameters. In the case of the study of the water tank controller, the fuzzy controller optimization is performed, dynamically adjusting the parameters of the membership functions to obtain different and varied fuzzy controllers that can improve the results obtained with the original controller.

The paper is organized as follows: in “Basic Concepts”, a brief description of the concepts of metaheuristic algorithms, fuzzy logic and fuzzy sets is presented. In “Galactic Swarm Optimization”, the galactic swarm optimization is described where we can observe the steps and necessary equations to carry out its operation. In “Fuzzy Approach in Galactic Swarm Optimization”, we can find the proposed fuzzy approach to perform the parameter adaptation in galactic swarm optimization. In “Mathematical Functions and the Benchmark Water Tank Problem for Testing the Galactic Swarm Optimization”, we can find the mathematical functions and the benchmark water tank problem used to test the proposed method. “Experiments and Comparison of Results” shows the results obtained from the execution of the galactic swarm optimization and the fuzzy approach to fuzzy galactic swarm optimization (FGSO), in addition to a statistical test to be able to confirm that significant improvements were obtained and finally “Conclusions” describes the conclusions.

Basic Concepts

Metaheuristic Algorithms

Metaheuristic algorithms are usually classified into three classes: evolutionary, based on physical laws and swarm intelligence. Evolutionary algorithms are inspired by the concept of evolution as it occurs in nature [18, 19], and one of the most popular evolutionary algorithms is the genetic algorithm [20] that emulates the concept of evolution according to the theory of Darwin, which has been used in a large number of applications in the areas of engineering, and industry, among others.

Physical-based algorithms try to imitate physical laws such as the gravitational force and the electromagnetic force, and some of these algorithms are the gravitational search algorithm, big bang–big crunch among others. In these algorithms, the agents communicate and move in the space search according to the rules of physics [21, 22].

Swarm intelligence algorithms imitate the social behavior of herds, swarms, and groups of animals in nature, in these algorithms the search agents move and communicate using the social behavior of some type of animal species [20, 23]. The most popular swarm intelligence algorithm is the PSO [24] algorithm that is inspired by the behavior of a flock of birds.

Fuzzy Logic and Fuzzy Sets

Fuzzy logic is a branch of artificial intelligence that allows a system to analyze information from the real world on a scale of values between the false and the true. It supports vague concepts and allows the construction of heuristics capable of interpreting information difficult to define [15, 25].

Fuzzy logic has the virtue of better adapting to the real world and can even understand and function with every day or vague expressions such as “it is very hot”, “is very high” among some others. The key is that their adaptation to natural language is based on quality quantifiers to make our inferences. For every fuzzy set, there is a membership function associated with each of its elements that indicates to what extent the element forms part of that fuzzy set [26].

A fuzzy set is a generalization of the classical sets, the main difference lies in that in the theory of classical sets an element may or may not belong to a set and in the theory of fuzzy sets an element may belong to more than one set with different membership degrees. One of the qualities of a fuzzy set is the handling of ambiguous information [25, 26].

The application of fuzzy logic is to imitate human reasoning in computer programming, where traditional computing can only manipulate strictly dual values, as true or false, yes or no, etc. In fuzzy logic, mathematical models are used to represent subjective notions, such as “high, low” or “cold, hot” for specific values that can be manipulated by computers. This paradigm has a special variable value with respect to time, since control systems or of other types may need feedback in a specific space of time since they may need previous data to perform an average evaluation of the situation in an earlier period of time [12].

Fuzzy logic is based on heuristic rules of if (antecedent) then (consequent) form to represent knowledge that is imprecise and inaccurate in nature. This is achieved using linguistic variables that have the ability to express and work with observations and measures of uncertainty in addition to describing uncertain conditions. Linguistic variables facilitate the extraction and storage of knowledge in a simple way. In addition to providing a gradual transition of states [13].

Galactic Swarm Optimization

Galactic swarm optimization, proposed by Muthiah-Nakarajan and Noel, has shown to behave well when facing multimodal problems and with a high number of dimensions, since it presents multiple cycles of exploration and exploitation, which increases the chances of obtaining better solutions and not getting stuck in local minima [1].

The way stars are attracted into a galaxy and a galaxy within a group of galaxies is emulated in galactic swarm optimization according to two levels of grouping. First, the population is divided into subpopulations, in level 1 all the subpopulations are attracted towards the best solution according to the particle swarm optimization (PSO) algorithm. In level 2 each subpopulation will be represented by the best solution found in each subpopulation treating the best solutions as a super swarm, and they will move according to the PSO algorithm. In this way, all individuals will be attracted towards the global best solution [1, 2].

PSO is a swarm intelligence metaheuristic that is based on the behavior of birds in nature, where each particle or individual has a position and a velocity with which it moves through the search space [27, 28]. In the real world the particles have an amount of inertia that maintains them in the direction in which they moved in the same way they have an acceleration or change of velocity that depends mainly on two characteristics [29, 30]:

  1. 1.

    Each particle is attracted to the best local position it has found also known as local best.

  2. 2.

    Each particle is attracted towards the best global position found in a set of particles or neighbourhood known as the global best.

In Fig. 1 we can find the factors that influence the movement of the particles.

Fig. 1
figure 1

Approximation of the particle position

The force with which the particles are moving in each of these directions can be adjusted by the cognitive component c1 and the social component c2 so that when the particles move away from the best positions the attraction force is greater [31, 32].

In Fig. 2 we observe how a set of randomly initialized particles perform their movement in which different factors influence how to update their position and velocity. This figure illustrates how the particles will move in particular space for a given problem.

Fig. 2
figure 2

Movement of the particles in PSO

In galactic swarm optimization, a set X represents a swarm that is formed of elements \( X_{j}^{(i)} \) that consist of M partitions denominated subswarms Xi all of size N. All the elements of the swarm are initialized randomly in the search space \( [X_{{\rm max} } , X_{{\rm min} } ]^{D} \), where D represents the number of dimensions of the search space [2].

Level 1

The intention of having several swarms exploring at the same time is to lead to a better exploration of possible solutions, since each subswarm independently explores in the search space. The GSO algorithm begins the iterations by computing the position and velocity of the particles using the equations presented below [1, 2]:

$$ v_{j}^{(i)} \leftarrow W_{1} v^{(i)} + c_{1} r_{1} \left( {p_{j}^{(i)} - x_{j}^{(i)} } \right) + c_{2} r_{2} \left( {g^{(i)} - x_{j}^{(i)} } \right) $$
(1)
$$ x_{j}^{(i)} \leftarrow x_{j}^{(i)} + v_{j}^{(i)} . $$
(2)

Where the current velocity is v(i), \( p_{j}^{(i)} \) is the personal best of particle \( x_{j}^{(i)} \), \( g^{(i)} \) is the global best solution of subswarm Xi, c1 and c2 are constants that indicate the direction towards the best local and global solutions, weight of inertia is W1, r1 and r2 are calculated by the following expressions [1]:

$$ W_{1} = 1 - \frac{K}{{I_{1} + 1}}, $$
(3)
$$ r_{1} = \cup \;( - \;1,\; 1). $$
(4)

The current iteration is K ranging from 0 to I1, and r1 is used to obtain random numbers chosen from the range of − 1 to 1.

Level 2

In this level of grouping, the global best solutions are of great importance since they participate in the formation of the superclusters, we have a superswarm Y that is formed of the best solutions found in each subpopulation or subswarm Xi.

$$ Y^{(i)} = g^{(i)} . $$
(5)

Similar to level 1, in this level the position and velocity of the particles are also computed taking as a basis the PSO algorithm [33], the equations show some slight modifications unlike those used in level 1, as shown below [2]:

$$ v^{(i)} \leftarrow W_{2} v^{(i)} + c_{3} r_{3} \left( {p^{(i)} - y^{(i)} } \right) + c_{4} r_{4} \left( {g - y^{(i)} } \right), $$
(6)
$$ y^{(i)} \leftarrow y^{(i)} + v^{(i)} . $$
(7)

In this level p(i) represents the personal best, g is the global best solution, c3 and c4 are the acceleration constants. W2, r3 and r4 are calculated with equations similar to those shown in level 1.

In the superswarm, we use the best solutions of each of the sub swarms and thus exploit the already calculated information. The individuals in the superswarm are more dispersed in comparison with the individuals of the subswarms, reason why an independent exploration is not realized since it focuses on exploiting the solutions found by the subswarms. In galactic swarm optimization, feedback is avoided to help retain the diversity in the solutions and the global search capability.

In the GSO algorithm the movement of the subswarms in level 1 consists mainly in a phase of exploration and in level 2 it is a phase of exploitation, in this way the algorithm alternates between the exploration and the exploitation [1, 2]. The operation of the galactic swarm optimization can be summarized in the pseudocode presented below.

Pseudocode GSO

figure a

Fuzzy Approach in Galactic Swarm Optimization

Fuzzy logic and fuzzy sets were initially proposed by Zadeh [8]. In this case, fuzzy systems are constructed based on if–then rules representing the knowledge and heuristics that are based on human knowledge [12, 17].

In fuzzy sets, each element can be part of a set with a degree of certainty, and fuzzy logic allows us to reason with inaccurate or uncertain facts to infer from them new facts with a degree of certainty associated with each particular event. This allows us to model the facts as they occur in real life [13, 14].

According to the literature [7, 29] the recommended values for the c3 cognitive component and c4 social component are in the range of 0.5–2.5. On the other hand, it is suggested that the dynamic adjustment of the parameters during the execution can produce better results. It has been observed that measures such as the iteration and diversity of the swarm should be taken into consideration for the execution of the algorithm, since it has been demonstrated in other studies [15, 29] that the use of these measures helps to control the parameters of the metaheuristic algorithms during the execution.

The optimal values of the parameters in a fuzzy system help the algorithms to find better solutions, and the objective of our proposal is to dynamically find these values with an adaptation of the parameters utilizing fuzzy logic as a means to achieve this and in this way get better performance of galactic swarm optimization (GSO). The general idea of the proposed approach is illustrated in Fig. 3.

Fig. 3
figure 3

Proposed FGSO

After performing different tests a decision was made about using the c3 and c4 parameters from Eqs. (6) and (7) presented in “Basic Concepts”, since they are of great importance for finding the position and velocity of the particles in the second level of the galactic swarm optimization, and therefore, they become the fuzzy parameters that are dynamically adapted. In GSO the c3 parameter is the cognitive component that measures the performance of the particle with respect to its previous positions; its objective is that the particles are attracted towards the best positions, in the same way that the individuals return to situations or places where they were previously better. The social component is c4 that measures the performance of the particle in relation to a group of particles, the importance of the social component c3 lies in that each particle is grouped into the best position found in a neighborhood or in its search space [8, 33].

The main difference of using the dynamic adjustment of parameters with respect to using fixed parameters is that the selected parameters used as fuzzy parameters are modified as the iterations are being performed in galactic swarm optimization, and this way in each iteration we are dynamically changing the values of the parameters with the idea of finding better solutions.

In this work, everything previously mentioned has been taken into account for the design of fuzzy systems that dynamically adapt the c3 and c4 parameters during the execution of galactic swarm optimization. In this case, these parameters are fuzzy values that are defined as shown in expressions (8) and (9) [17]:

$$ C_{3} = \frac{{\mathop \sum \nolimits_{i = 1}^{{r_{{c_{3} }} }} \mu_{i}^{{C_{3} }} \left( {C_{3i} } \right)}}{{\mathop \sum \nolimits_{i = 1}^{{r_{{c_{3} }} }} \mu_{i}^{{C_{3} }} }}, $$
(8)

where \( r_{{c_{3} }} \) is the total number of rules for the fuzzy system, the output result for rule i is represented by \( C_{3i} \) and \( \mu_{i}^{{C_{3} }} \) is the membership function associated to rule i

$$ C_{4} = \frac{{\mathop \sum \nolimits_{i = 1}^{{r_{{c_{4} }} }} \mu_{i}^{{C_{4} }} \left( {C_{4i} } \right)}}{{\mathop \sum \nolimits_{i = 1}^{{r_{{c_{4} }} }} \mu_{i}^{{C_{4} }} }}, $$
(9)

where \( r_{{c_{4} }} \) is the total number of rules for the fuzzy system, the output result for rule i is represented by \( C_{4i} \) and \( \mu_{i}^{{C_{4} }} \) is the membership function associated to rule i.

The design of the FGSO1 fuzzy system was based on our previous work [2] since it was our first proposal of the dynamic adjustment of parameters using fuzzy logic in galactic swarm optimization. Given that a good behavior was observed in relation to mathematical functions, the decision was made to propose a variant of the FGSO1 fuzzy system, therefore, the FGSO2 fuzzy system is proposed in which diversity has been added as an input variable expecting to obtain significant improvements.

The fuzzy system design is illustrated in Figs. 4 and 5, the fuzzy systems are of Mamdani type, where in the first fuzzy system the iteration is used as an input variable and as outputs we have the c3 and c4 parameters. In the second fuzzy system, we used the iteration and the diversity as input variables and c3 and c4 as output variables.

Fig. 4
figure 4

Fuzzy system FGSO1

Fig. 5
figure 5

Fuzzy system FGSO2

The input variables are divided into three triangular membership functions labeled as “low”, “medium” and “high” in a range from 0 to 1 for both fuzzy systems as can be noticed in Figs. 6 and 7. A triangular membership function is represented by three parameters a, b, and c as shown below [8]:

Fig. 6
figure 6

Input iteration

Fig. 7
figure 7

Input diversity

$$\begin{aligned} {\text{triangle}}\; \left( {x;\;a,\; b,\; c} \right) = \left\{ {\begin{array}{ll} 0, &\quad x \le a \\ \frac{x - a}{b - a} &\quad a \le x \le b \\ \frac{c - x}{c - b} &\quad b \le x \le c \\ 0, &\quad c \le x \\ \end{array} } \right.. \end{aligned} $$
(10)

In this case, the parameters a, b and c with a < b and b < c are the coordinates of the three corners of the triangular membership function.

For the first fuzzy system, the output variables are granulated into three triangular functions of the same type as “low”, “medium” and “high” with a range of 0–3 as shown in Figs. 8 and 9, and for the second fuzzy system the output variables are granulated into five triangular membership functions “low”, “medium low”, “medium”, “medium high”, and “high” in a range from 0 to 3 as shown in Figs. 10 and 11, respectively.

Fig. 8
figure 8

Output c3 of FGSO1

Fig. 9
figure 9

Output c4 of FGSO1

Fig. 10
figure 10

Output c3 of FGSO2

Fig. 11
figure 11

Output c4 of FGSO2

The iteration is normalized to obtain a percentage of the current iteration for the total number of iterations, the diversity represents the mean of the Euclidean distance between all the particles and the best particle found, in other words, it measures the degree of dispersion of the particles, and the expressions used to obtain the iteration and the diversity are presented below [15, 30]:

$$ {\text{Iteration}} = \frac{\text{Current Iteration}}{\text{Total of Iterations}}, $$
(11)
$$ {\text{Diversity }}\;(S(t)) = \frac{1}{n} \mathop \sum \limits_{i = 1}^{n} \sqrt {\mathop \sum \limits_{j = 1}^{D} \left( {x_{ij} (t)} \right)^{2} - \left( {\bar{x}_{j} (x)} \right)^{2} } , $$
(12)

where the population of the GSO is represented by S, the size of the population is n, D is the number of dimensions in which the population moves, xij is the solution i in the dimension j and \( \bar{x}_{j} \) is the best solution found in dimension j [30].

In Figs. 12 and 13 we can find an example of the behavior of the c3 and c4 parameters as the iterations are executed, in addition, in Fig. 14 we illustrate the diversity that exists between the individuals of galactic swarm optimization and how it varies as the iterations pass.

Fig. 12
figure 12

Behavior of the c3 parameter

Fig. 13
figure 13

Behavior of the c4 parameter

Fig. 14
figure 14

Behavior of the diversity parameter

The rules of the FGSO1 fuzzy system were designed with the idea that c3 is increasing and c4 is decreasing in this way aiming at achieving that when the algorithm is in the initial iterations it can explore and when it is in the last iterations it can exploit [2, 13].

Rules of the FGSO1 fuzzy system:

  1. 1.

    If (Iteration is Low) then (c3 is Low) and (c4 is High)

  2. 2.

    If (Iteration is Medium) then (c3 is Medium) and (c4 is Medium)

  3. 3.

    If (Iteration is High) then (c3 is High) and (c4 is Low)

Taking into account the diversity as input variable used in the second fuzzy system along with the iteration input variable, the FGSO2 fuzzy system rules are designed in such a way that when the diversity is low, the particles are too close together then we need to explore and when we have a high diversity we need to exploit. The idea of the rule design is very similar to those used in the FGSO1 fuzzy system, since when we are in the initial iterations we need to explore and when we are in the final stage of the execution of the algorithm then we need to exploit [29].

Rules of the FGSO2 fuzzy system:

  1. 1.

    If (Iteration is Low) and (Diversity is Low) then (c3 is Low) (c4 is High)

  2. 2.

    If (Iteration is Low) and (Diversity is Medium) then (c3 is MediumLow) (c4 is MediumHigh)

  3. 3.

    If (Iteration is Low) and (Diversity is High) then (c3 is Medium) (c4 is High)

  4. 4.

    If (Iteration is Medium) and (Diversity is Low) then (c3 is MediumLow) (c4 is MediumHigh)

  5. 5.

    If (Iteration is Medium) and (Diversity is Medium) then (c3 is Medium) (c4 is Medium)

  6. 6.

    If (Iteration is Medium) and (Diversity is High) then (c3 is MediumHigh) (c4 is MediumLow)

  7. 7.

    If (Iteration is High) and (Diversity is Low) then (c3 is MediumHigh) (c4 is MediumLow)

  8. 8.

    If (Iteration is High) and (Diversity is Medium) then (c3 is MediumHigh) (c4 is Medium)

  9. 9.

    If (Iteration is High) and (Diversity is High) then (c3 is High) (c4 is Low)

Mathematical Functions and the Benchmark Water Tank Problem for Testing the Galactic Swarm Optimization

Water Tank Controller Problem

Most optimization problems in the real world require a lot of computational cost for the evaluation of their possible solutions, and given the limitations of computational or time resources, specialized optimization algorithms are usually required in industrial applications. In the last years, several methods of computational optimization have been proposed to deal with problems where too much computational cost is required and with these methods good results have been obtained [2, 15].

To test the proposed fuzzy approach of the fuzzy galactic swarm optimization with parameter adaptation we use a set of 20 mathematical functions found in [19, 20], where their mathematical representation is presented as well as their search space and their global minimum. We also tested the proposed method with the problem of the water controller, which is described in more detail below. The main idea of our proposed method is to search for the minimum of the benchmark mathematical functions, as well as the best fuzzy controller for the plant of the water tank [34, 35]. In Table 1 we can find the mathematical functions used to test the proposed approach and the original GSO algorithm.

Table 1 Benchmark mathematical functions

In Table 1 we can find the set of mathematical functions used to measure the performance of the GSO algorithm and the proposed fuzzy GSO approach, in addition to the range of the search space and its global minimum.

Water Tank Controller Problem

The fuzzy controller for the benchmark water tank problem refers to controlling the water level in a tank, therefore, it is necessary to know the water level in the tank and with this be able to establish the opening of the valve. To evaluate the opening of the valve in an accurate way, we rely on fuzzy logic, which we implement as a fuzzy controller for the water level and how quickly it is introduced to maintain the water level in the tank.

The filling of the water tank is represented by a differential equation for the water level of the tank, H, as shown below, and Fig. 15 shows a representation of the water tank model [34]:

$$ \frac{\text{d}}{{{\text{d}}t}}{\text{Vol}} = A\frac{{{\text{d}}H}}{{{\text{d}}t}} = bV - a\sqrt H , $$
(13)

where the variable H is the level of the water in the tank, Vol is the volume of water contained in the tank and V is the voltage that is applied to the pump.

Fig. 15
figure 15

Water tank model

Parameter A is the cross-sectional area of the tank, b is a constant associated with the flow of water to the tank and a is a constant associated to the outflow of the tank [35].

Fuzzy System for the Fuzzy Controller of the Water Tank Problem

The fuzzy system of the water tank controller is of the Mamdani type and composed of two input variables and one output variable [35]: the first input variable is Level, which is composed of three Gaussian membership functions labeled High, Okay and Low. The second input variable is Rate, which has three Gaussian membership functions labeled Negative, None, and Positive.

The output is Valve (Tank Fill Valve), which is composed of five triangular membership functions labeled as Close_fast, Close_slow, No_change, Open_slow, and Open_fast.

In Fig. 16 we can find the fuzzy system of the fuzzy controller for the water tank, where the input and output variables are displayed graphically.

Fig. 16
figure 16

Fuzzy system for the tank

The rules of the fuzzy system of the water tank help maintain control of the opening of the valve and thus the water level in the tank.

Rules for the fuzzy system of the water tank controller:

  1. 1.

    If (level is okay) then (valve is no_change)

  2. 2.

    If (level is low) then (valve is open_fast)

  3. 3.

    If (level is high) then (valve is close_fast)

  4. 4.

    If (level is okay) and (rate is positive) then (valve is close_slow)

  5. 5.

    If (level is okay) and (rate is negative) then (valve is open_slow)

Experiments and Comparison of Results

To test and compare the proposed method with the original GSO algorithm, we used 20 benchmark mathematical functions and the fuzzy controller for the water tank controller presented in “Fuzzy Approach in Galactic Swarm Optimization”. In this work, each metaheuristic algorithm is tested with 30 independently performed tests to obtain greater confidence on the obtained results in the simulations.

The c3 and c4 parameters are fixed for the results obtained with the original GSO algorithm and in our proposal c3 and c4 are dynamically adjusted using fuzzy systems to perform the adaptation of the parameters.

The results presented in Tables 3, 4 and 5 are separated by the number of dimensions ranging from 10, 30 and 50 dimensions. The parameters used during the simulations are presented below in Table 2, so that a fair comparison for the tests is performed with the same parameters.

Table 2 Parameters for the simulations

The nomenclature used in the tables is summarized below:

GSO: is the original galactic swarm optimization.

FGSO1: is the first proposed fuzzy system with iteration as the input variable and c3 and c4 as the output variables.

FGSO2: is the second proposed fuzzy system with iteration and diversity as the input variables and c3 and c4 as the output variables.

In Table 3 we can find the averages for each of the 20 mathematical functions used to measure the performance of GSO and FGSO after 30 runs for 10 dimensions.

Table 3 Experimental results with GSO and FGSO for ten dimensions

In Table 3 we can find the averages for each of the 20 mathematical functions used to measure the performance of GSO and FGSO after 30 runs for 10 dimensions. Where it is observed that the original galactic swarm optimization has better performance than the proposed FGSO1 approach in functions f5, f6, f7 and f8, and the FGSO1 approach manages to improve the performance in Rosenbrock, Baele and Dixon-price functions. The FGSO2 approach shows improvements in Rosenbrock, Baele, Dixon-price and f8 functions, but lowers the performance in functions f5, f6, f7, f12 and f13, and in the remaining functions the proposed approach manages to reach the global minimum for each of the functions.

In Table 4 we can find the averages for each of the 20 mathematical functions used to measure the performance of GSO and FGSO after 30 runs for 30 dimensions. Where it is observed that the original galactic swarm optimization has better performance than the proposed FGSO1 approach in functions f5, f6, f7 and f8, and the FGSO1 approach manages to improve the performance in Rosenbrock, Baele and Dixon-price functions. The FGSO2 approach shows improvements in Rosenbrock, Baele, Dixon-price and f8 functions, but lowers the performance in functions f5, f6, f7, f12 and f13, and in the remaining functions the proposed approach manages to reach the global minimum for each of the functions.

Table 4 Experimental results with GSO and FGSO for 30 dimensions

In Table 5 we can find the averages for each of the 20 mathematical functions used to measure the performance of GSO and FGSO after 30 runs for 50 dimensions. In this case, it is observed that the original galactic swarm optimization has better performance than the proposed FGSO1 approach in functions f7 and f8, and the FGSO1 approach manages to improve the performance in Rosenbrock, Baele and Dixon-price functions. The FGSO2 approach shows improvements in Rosenbrock, Baele, Dixon-price and f8 functions, but lowers the performance in functions f7, f12 and f13, and in the remaining functions the proposed approach manages to reach the global minimum for each of the functions.

Table 5 Experimental results with GSO and FGSO for 50 dimensions

To clearly observe the behavior of our proposal and be able to test it, a toolbox was designed to run functions f1–f13 presented in “Mathematical Functions and the Benchmark Water Tank Problem for Testing the Galactic Swarm Optimization”, and below the link to access the FGSO toolbox is provided https://www.dropbox.com/s/z3epfnx857wrtro/FGSO.rar?dl=0.

The results obtained after performing the parameter optimization of the membership functions of the fuzzy controller for the water tank were performed by dynamically adapting the c3 and c4 parameters of the GSO algorithm, as well as with the original GSO algorithm.

In this case, the expression to calculate the fitness value of each particle is replaced by the expression to calculate the mean squared error (MSE) and thus in this way measure the efficiency of the fuzzy controller obtained by galactic swarm optimization, and the expression of the mean squared error (MSE) is the following [35, 36]:

$$ {\text{MSE}} = \frac{1}{n}\mathop \sum \limits_{i = 1}^{n} \left( {X_{i} - Y_{i} } \right)^{2} , $$
(14)

where MSE is the sum of squared errors, that is, the difference between the estimator and what is being estimated, Xi represents the reference value and Yi represents the value produced by the system.

The parameters used for the tests performed with the fuzzy controller of the water tank problem are the following (Table 6).

Table 6 Configuration parameters for GSO and FGSO applied to the water tank problem

In Table 7 we can find the best, worst, average and standard deviation of the fuzzy controller of the water tank used to measure the performance of the GSO algorithm and the proposed FGSO after 30 runs.

Table 7 Experimental results for GSO and FGSO applied to the water tank problem

For this case study, the proposed approach manages to obtain improvements with respect to the original GSO algorithm. In Fig. 17, we can find the best simulation of the fuzzy controller obtained by the proposed fuzzy galactic swarm optimization (FGSO), where the red line represents the reference data, and the blue line represents the data obtained by the fuzzy controller developed to follow the reference.

Fig. 17
figure 17

Best simulation of fuzzy controller for water tank problem

After analyzing the results of the fuzzy controller of the water tank problem, we decided to perform a statistical test between the fuzzy galactic swarm optimization (FGSO) and the galactic swarm optimization to obtain more evidence of the improvements obtained with the proposed method. The statistical test used for the comparison is the z test [3, 34] with the following characteristics:

  • \( \mu_{1} = {\text{Mean }}\;{\text{of }}\;{\text{fuzzy}}\; {\text{galactic }}\;{\text{swarm}}\; {\text{optimization }}\;({\text{FGSO}}) \).

  • \( \mu_{2} = {\text{Mean }}\;{\text{of}}\;{\text{galactic}}\; {\text{swarm }}\;{\text{optimization}} \;({\text{GSO}}). \)

  • \( H_{0} = \mu_{1} \ge \mu_{2} . \)

  • \( H_{a} = \mu_{1} < \mu_{2} \; ({\text{claim}}). \)

  • Claim: the average of the FGSO is lower than the average of the GSO (claim).

  • Confidence level = 95%.

  • \( \propto\, = 0.05. \)

Table 8 shows the averages, standard deviations and the value of the statistical z test for fuzzy galactic swarm optimization (FGSO) and galactic swarm optimization (GSO) applied to the fuzzy controller of the water tank problem.

Table 8 Results of z test for FGSO and GSO for the water tank problem

The statistical z test for the fuzzy controller of the water tank problem was performed with a confidence level of 95%, alpha 0.05, where Ha states that the average of the FGSO is lower than the average of the GSO. Ho states that the average of the FGSO is greater than or equal to the average of the GSO, with a critical value of − 1.645. The resulting value confirms that there is sufficient evidence to reject Ho, therefore, Ha is accepted, indicating that the average of the fuzzy galactic swarm optimization is lower than the average of the galactic swarm optimization.

Statistical Comparison of Fuzzy Galactic Swarm Optimization and the Modified Grey Wolf Optimizer

The fuzzy galactic swarm optimization (FGSO) and modified grey wolf optimizer are compared with 7 benchmark functions with 30, 64 and 128 dimensions, the results obtained by the fuzzy galactic swarm optimization and modified grey wolf optimizer are presented in different tables according to the number of dimensions.

With the intention that the statistical comparison was as fair as possible, we aimed at having a similar number of evaluations between fuzzy galactic swarm optimization (FGSO) and the modified GWO. To obtain the number of evaluations of FGSO, first, the number of evaluations of the first level is obtained by multiplying the number of subpopulations, the size of the population and the number of iterations of the first level in the following way (M × N × I1). In the second level, the number of subpopulations is multiplied by the number of iterations of the second level (M × I2), then the number of evaluations of the first level and those of the second level are added, and finally, it is multiplied by the number of predefined epochs [1].

The parameters of fuzzy galactic swarm optimization and the modified grey wolf optimizer are given in Table 9.

Table 9 Parameters of FGSO and the modified GWO

A statistical test was performed between the fuzzy galactic swarm optimization and modified grey wolf optimizer. The statistical test that was used is the z test [3] with the following characteristics:

  • \( \mu_{1} = {\text{Mean }}\;{\text{of }}\;{\text{the}}\; {\text{fuzzy }}\;{\text{galactic}}\;{\text{swarm }}\;{\text{optimization}}\;({\text{FGSO}}) \)

  • \( \mu_{2} = {\text{Mean }}\;{\text{of }}\;{\text{the }}\;{\text{Modified }}\;{\text{Grey }}\;{\text{Wolf }}\;{\text{Optimizer}}. \)

  • \( H_{0} = \mu_{1} \ge \mu_{2} . \)

  • \( H_{a} = \mu_{1} < \mu_{2} \; ({\text{claim}}). \)

  • Claim: the average of the FGSO is lower than the average of the modified grey wolf optimizer (claim).

  • Confidence level = 95%.

  • \( \propto\, = 0.05. \)

  • Critical value \( Z_{0} = - \;1.645. \)

Table 10 shows the averages, standard deviations and the values of the statistical z test for the Sphere, Rosenbrock, Quartic, Schwefel, Rastrigin, Ackley and Griewank functions for 30 dimensions.

Table 10 Results of the z test for FGSO and modified GWO with 30 dimensions

In Table 11 we can find the averages, standard deviations and the values of the statistical z test for the Sphere, Rosenbrock, Quartic, Schwefel, Rastrigin, Ackley and Griewank functions for 64 dimensions.

Table 11 Results of the z test for FGSO and modified GWO with 64 dimensions

In Table 12 we can find the averages, standard deviations and the values of the statistical z test for the Sphere, Rosenbrock, Quartic, Schwefel, Rastrigin, Ackley and Griewank functions for 128 dimensions.

Table 12 Results of the z test for FGSO and modified GWO with 128 dimensions

A statistical z test is applied, with a confidence level of 95%, an alpha value of 0.05, where Ha states that the average of the FGSO is lower than the average modified grey wolf optimizer and Ho states that the average of FGSO is greater than or equal to the average modified grey wolf optimizer, with a critical value of − 1.645. The results support that for the Sphere, Rosenbrock, Quartic, Schwefel, Rastrigin, Ackley and Griewank functions there is sufficient evidence to reject Ho, therefore, Ha is accepted, stating that the average of FGSO is lower than the average of the modified grey wolf optimizer according to the results shown in Table 10 for experiments with 30 dimensions.

In applying the statistical z test, with a confidence level of 95%, an alpha value of 0.05, where Ha states that the average of the FGSO is lower than the average modified grey wolf optimizer and Ho states that the average of FGSO is greater than or equal to the average modified grey wolf optimizer, with a critical value of − 1.645. The results support that for the Sphere, Rosenbrock, Quartic, Schwefel, Rastrigin, Ackley and Griewank functions there is sufficient evidence to reject Ho, therefore, Ha is accepted, stating that the average of FGSO is lower than the average of the modified grey wolf optimizer according to the results shown in Table 11 for experiments with 64 dimensions.

Once the statistical z test was performed, with a confidence level of 95%, an alpha value of 0.05, where Ha states that the average of the FGSO is lower than the average of the modified grey wolf optimizer and Ho states that the average of FGSO is greater than or equal to the average modified grey wolf optimizer, with a critical value of -1.645. The results support that for the Sphere, Rosenbrock, Quartic, Rastrigin, Ackley and Griewank functions there is sufficient evidence to reject Ho, therefore, Ha is accepted, stating that the average of FGSO is lower than the average of the modified grey wolf optimizer according to the results shown in Table 12 for experiments with 128 dimensions.

Conclusions

The galactic swarm optimization has been shown to behave well in the face of multimodal problems and with a high number of dimensions, since it presents several cycles of exploration and exploitation, which increases the chances of obtaining better solutions and not getting stuck in local minima.

This work proposes a modification to the galactic swarm optimization, which consists of dynamically adjusting the parameters using fuzzy logic. In this case, the adjustment of the parameters was tested with two different fuzzy systems, which were validated with a set of 20 mathematical functions. Another case was also considered with a fuzzy controller and was also tested to observe how our proposed method behaves for parameter optimization of the membership functions of the fuzzy controller of the water tank. We statistically compared the proposed approach with the modified grey wolf optimizer where fuzzy logic was also used to adjust the parameters, and this comparison was made to measure the performance of our proposal versus other metaheuristics that exists in the literature.

We can conclude that the adjustment of the parameters using fuzzy logic in galactic swarm optimization applied to mathematical functions is a good option since competitive results were obtained. It was observed that in some mathematical functions where the original algorithm does not perform well, the proposed approach obtains significant improvements. It is also observed that as the number of dimensions increases the galactic swarm optimization continues to present competitive results, in the case of the study of the fuzzy controller of the water tank, it has been possible to gradually improve the results using our proposed method to optimize the fuzzy controller. All supported by the results shown in the tables in “Experiments and Comparison of Results”.

Galactic swarm optimization is a metaheuristic of recent creation, therefore, it is proposed as future work of the following tasks to study more thoroughly its operation and thus to obtain a better performance of galactic swarm optimization.

  • Consider type-2 fuzzy systems for the adaptation of the parameters in GSO.

  • Optimize the rules of the fuzzy systems.

  • Apply GSO with fuzzy logic for control problems (elevators, washing machines, etc.).

  • Apply GSO with fuzzy logic for image processing.

  • Apply GSO with fuzzy logic for medical diagnosis.

  • Apply GSO with fuzzy logic for systems automation.

  • Adapt the GSO algorithm for use with other metaheuristics.