Abstract
Gravitational search algorithm (GSA) is inspired by swarm behaviors in nature and physical law based on Newtonian gravity and the laws of motion. There are two key parameters including the number of applied agents (Kbest) and gravitational coefficient (G) to control the search progress in the algorithm. In the conventional GSA, the acceleration of the agents is mainly determined by Kbest and G. Kbest and G are calculated by a monotonically decreasing function, which is not a good schedule for solving complex problems. In order to solve the problem and accelerate the convergence of algorithm, an adaptive GSA is proposed, in which Kbest and G calculation method for strengthening exploitation capability are implemented to achieve better optimization results. Extensive experimental results based on benchmark functions are provided to show the effectiveness of the proposed method. The obtained results have been compared with the results of the original GSA, CGSA, and CLPSO. The comparison results have revealed that the proposed method has good performances.
Keywords
Introduction
Today, as optimization problems become more and more complicated, traditional methods cannot deal with many problems in the high-dimensional search space. Hence, heuristic search algorithms have come into being. Heuristic optimization methods are developed based on nature and physical processes. In the past few decades, algorithms inspired by the behaviors of natural phenomena have received a lot of attentions [1–4].
Gravitational search algorithm (GSA) was proposed by Esmat Rashedi in 2009, which is based on the law of gravity [5]. GSA is different from traditional heuristic algorithms which provide a simple solution. It can effectively solve high-dimensional space optimization problems. As a newly optimization algorithm based on the law of gravity and motion, GSA includes the operators of mass, a multi-dimensional search space, calculation of the force applied to the objects and movement under the influence of gravitation. In GSA, mass is considered as the weight of the object, which can be divided into three specifications: active gravitational mass, pass gravitational mass, and inertial mass. According to Newton’s physics laws and the above-mentioned mass, the gravitational force that acts on one particle by another particle is proportional to the product of the active gravitational mass and passive gravitational mass and inversely proportional to the square distance. After applying force, this force combines the inertial mass to produce acceleration.
The combination of gravity and mass is the staple idea of GSA. In GSA, agents are considered as objects with a specific mass while gravity is the medium of interaction between each object in the search space. The position of each agent corresponds to a solution and the performances of agents are measured by their masses, which are determined by using a fitness function. Eventually, a global movement of all objects will appear and tend to be heavier masses, which means the sub-optimum solutions [5].
The parameters of an evolutionary algorithm have a very important influence on adjusting the algorithm to the problem [6]. There are some important parameters in GSA such as the number of effective objects and the gravitational coefficient. These parameters have a great impact on the performance of the algorithm, such as convergence rate, exploration, and exploitation. If the setting of important parameters is not perfect, the algorithm will prematurely converge and fall into the local optimum. Since the search process is randomized and the problems are becoming more and more complicated, it is debatable to use only a linear function that decreases over time and an exponentially decreasing model for G in all iterations [7].
In this paper, in order to strengthen the GSA’s exploitation capabilities, some improvements are applied to the calculation rules of Kbest and G. When the fitness value of the objects is getting better and better, the exploration should be weakened accordingly. The larger the value of Kbest is, the more objects that interact with each other under gravitation are. It will result in more motion of the objects in the search space, which will make the acceleration of the object faster. At the same time, G determines the amount of mutual attraction between each object by their positions, which means that the increase of G can be combined with Kbest to strengthen the exploitation ability of the algorithm during optimization.
In the next section, gravitational search algorithm is reviewed. Section 3 introduces the main improvement directions and results of GSA today. The proposed improved GSA is described in detail in Section 4. In Section 5, the experimental results are presented. Finally, the paper is concluded in Section 6.
Related works
In recent years, many modified versions of GSA have been proposed. The most famous are four types, namely real GSA introduced for real-valued variables, binary GSA which has variables with two values of 0 and 1 [8], discrete GSA [9] possessing variables with discrete values, and mixed GSA [10] containing both continuous and binary variables. To control the exploitation and exploration efficiently, some new GSA operators are designed, including disruption [11], chaotic [12], mutation [13], crossover [14], and so on.
In the basic GSA, parameters mainly consist of the following aspects: masses of objects (M) , number of agents (N) , gravitational constant (G) , distance between agents in search space (R), power between distance (P) and number of sets of force applied (Kbest) .
The values of masses in the basic GSA, including passive mass, active mass, and inertia mass, are set to the same. Sepehr Ebrahimi Mood & et al. suggested that mass calculation should be improved through defining opportune functions named sigma scaling and Boltzmann functions. These functions try to balance the exploration and exploitation and prevent the algorithm from falling into local optimum [15]. Fatemeh Khajooei and Esmat Rashedi proposed a function about the concept of antigravity, which utilizes both positive and negative masses. The algorithm has the ability to explore the search space [16].
The number of agents is generally set in the beginning of algorithm and fixed during operation [17]. The value of N is set according to the requirements of different algorithms. Distance between agents is calculated by the function of the Euclidian distance and power between distances is set to one in all GSA and its variants.
In the most of GSA versions, G and Kbest all follow a rule and decrease as the number of iterations increases [18]. In the basic GSA, G is controlled by an exponential function as Equation (1) [5].
Where G o is the initial value of gravitational constant and α is the damping factor.
Fatemeh and Esmat use a fuzzy rule to control parameters setting of GSA. In their opinions, distance between agents (R) can be rewritten into a new parameter ED calculated as Equation (2), which detects the ability of algorithms in terms of diversity, where R
ave
, R
max
andR
min
stand for average, maximum and minimum distance. Then, another new parameter CM as Equation (3) is introduced to measure the progress of the algorithm, where fitave (t) is average agents’ finesses at time t. The combination of ED and CM can be expressed by fuzzy logic controller to prevent the algorithm from falling into local optimum and early convergence. During the operation of the algorithm, G is increased by these fuzzy rules when the algorithm stops running. At the end of the iteration, G is decreased so that the exploitation capabilities of the algorithm can be enhanced. This is in line with the rules of strengthening exploration ability in the early stage and increasing exploitation capability in the later stage [19].
In the basic GSA, G is considered as a linear decreasing function as Equation (4). E. Rashedi & et al. examine the effect of different values of G0 and kbest . The results of their experiments have shown that the optimal value of G0 is different with different functions and G0 is a parameter determined by the problem. Furthermore, the value of kbest has been experimentally proven to change with time t.
In another study, the authors deem that kbest should be increased to escape trapping local optima when best fitness can’t be improved during iterations. For parameter G, they suggest that a simple exponential decreasing function is unreasonable to solve complicated optimization problems among all iterations. Eight fuzzy rules are adopted to update G and Kbest [7].
In GSA, the objective function of an optimization problem is based on many variables which can be set to m decision variables. Each variable has an upper and lower bound as shown in Equation (5), represented by
Suppose there are now k objects, the position of the ith object is defined as Equation (6):
Then, combine the law of motion to calculate the acceleration of the object i at time t and in the dth direction, which is given as Equation (8):
The gravitational constant G is a function of time as Equation (11) that takes an initial value (G0) and will be reduced with time to control the search accuracy.
The masses of objects are calculated by the fitness function. Supposing that the gravitational mass is numerically equal to the inertia mass, the mass M
i
(t) is acquired by Equations (12)–(15):M
i
M
ii
, i = 1, 2, . . . , k,
In the conventional GSA, the parameters Kbest and G are very influential to the performance of the algorithm. It is not very reasonable to simply calculate Kbest and G by a decreasing function when iterations increase. Therefore, Kbest and G should be adjusted based on the effect of the algorithm’ operation [19].
Number of agents of force applied
The number of effective agents (Kbest) is considered to measure the search progress of GSA. The value of Kbest is greater, which means that there are more objects interacting with each other due to the gravitational force. It causes objects in the search space having more motion, which in turn leads to a lower convergence speed. In the search process of GSA, Kbest should be increased to prevent falling into local optimum, especially when the search process has stalled. Finally, the power of exploitation has been strengthened.
In the basic GSA, Kbest is obtained by a decreasing function as Equation (16).
In this paper, with regards to Kbest, a new coefficient β is defined to adjust the value of Kbest. The specific formula is as Equation (17).
The value of β has a significant effect on increasing or decreasing the ability of exploration and exploitation. Our goal is to achieve better results by changing β through operational feedback. In order to strengthen the exploitation of the algorithm, the following formula is designed to make a decision in the Equation (18).
In the velocity calculation rule, gravitational constant has a huge impact on the movement of the agents in the search space. The ability of exploitation can be enhanced by adjusting the speed of the objects movement. When the fitness value becomes better and better, G should be decreased to strengthen local search capabilities. In the basic GSA, G is obtained purely from the beginning to the end by an exponential function. It is unreasonable and should be changed to solve complex problems. Thus, it is revised as follows:
Pseudocode of IGSA
max_it: maximum number of iterations
F_index: the index of the test function
Min_flag: [min_flag = 1,minimization] and [min_flag = 0,maximization]
(1) Rnorm = 2 (norm in the Euclidian distance);
(2) Generate the initial position of the i th agent
(3)
(4) Checks the search boundaries for agents;
(5) Evaluate the objective function values of agents;
(6)
(7) Select the minimum value in the calculation result;
(8)
(9) Select the maximum value in the calculation result;
(10)
(11) Calculate the values of masses (M) of each agent by Equation (13);
(12) Calculate gravitational constant(G) by Equation (20);
(13) Calculate the value of KM by Equation (19);
(14)
(15) Increase the value of β=β(1 +N (0, 1));
(16) Increase the value of θ = θ (1 - N (0, 1))
(17)
(18) β= 1
(19) θ = 1;
(20) Calculate the number of effective objects (Kbest) by Equation (17);
(21) Calculate acceleration and velocity by Equations (9)–(15);
(22) Update agents’ position;
(23)
Lbest: the best solution(the location of Fbest in search space);
BestChart: the best so far Chart over iterations.
Computational complexity should be discussed. Given the number of agents to be N, the computational complexity for one generation is analyzed as follows. Calculation the values of masses of each agent need O (N) computations. The parameter KM evaluation requires O (N) . Calculation acceleration and velocity need O (N2) computations. Therefore, the total computational complexity for one generation is O (N2).
Experimental results
The performance of the proposed algorithm can be tested by ten standard benchmark functions including some unimodal and some multimodal criterion, which are listed in Table 1. Functions f1 to f7 are unimodal and functions f8 to f12 are multimodal. The former pays more attention to the convergence rate, while the latter pays more attention to the final results.
IGSA is applied to minimize these functions and the results are compared with the basic GSA, chaotic GSA [20], and comprehensive learning particle swarm optimizer [21]. Among these algorithms, number of agents is set to 50 (N = 50). The dimensions of test function are set to 30 and 50 respectively. Maximum iteration is 1000.
The results are averaged over 25 runs and the mean values and variance are presented in Table 2, in which the best values have been highlighted in bold.
12 standard benchmark functions
12 standard benchmark functions
The results of four algorithms
From unimodal function f1 to f5, all results from IGSA are better than the basic GSA, the variance of the 25 runs is smaller and the convergence rate is faster. Among them, the results of functions f1, f2, and f4 have shown that IGSA has better convergence rate and running results as well as smaller variance than CGSA and CLPSO. CGSA has achieved the best results on function f3 when the dimension is 30. Also, the good performance of IGSA could be concluded in Fig. 1. The convergence speed is significantly faster and better results are achieved. The differences between them have shown that IGSA is faster to find global optimal solutions than other algorithms, the result is more stable, and the convergence speed is higher.

Comparison of performance f1–f4 (D=50).
The multimodal functions f8 to f10 are very difficult to optimize because there are many local optimal solutions increasing exponentially as the dimension increases, the capabilities of optimization algorithm has greater impact on final results. It is extra important to avoid falling into local optimum and locate a near-global optimum. In the functions f10, IGSA has achieved better performance than the original GSA, CGSA, and CLPSO. IGSA has better results than GSA and CGSA in f8 and f9. However, the results are worse than the performance of CLPSO. According to the no free lunch theorem, we can’t expect the best performances on all the test functions.
For a thorough comparison, the t test has also been carried out. Table 2 presents the t values on every function of this two-tailed test with a significance level of 0.05 between the proposed algorithm and other algorithms. Rows “+(Better)”, “=(Same)” and “–(Worse)” give the number of functions that the proposed algorithm performs significantly better than, almost the same as, and significantly worse than the compared algorithm, respectively. Row “Score” shows the difference between the number of 1s and the number of – 1s, which is adopted to give an overall comparison between the two algorithms. For instance, comparing the proposed algorithm with GSA, the former significantly outperforms the latter on 12 functions, does the same as the latter on two functions, and does worse on six functions, yielding a “Score” figure of merit of 12-2 = 10, which demonstrates that the proposed algorithm generally outperforms the conventional GSA. Although it performs slightly weaker on some functions, the proposed algorithm in general offers much improved performance than all the above algorithms compared.
In order to further validate the performance of the proposed method, additional experiments have been made. We optimize Kbest separately, optimize G separately, and combine Kbest and G for optimization under same conditions. f1, f2, f4, f8, and f10 are selected to make testing. The comparison results are listed in Table 3.
Comparison result of parameter setting
Comparison result of parameter setting
Among f1, f2, f4, f8, and f10, the results of optimizing Kbest alone are the worst, and are similar to the results of the original GSA. The results of optimizing G alone are much better than the original GSA. However, the combination of Kbest and G has achieved superior performances, which are the best among the three experiments. The experimental results have demonstrated that the optimization of Kbest and G together is very reasonable and effective.
In addition, sensitivity is also tested. Two experiments are implemented. For the first experiment, the parameter β is kept same during the experiment. The parameter θ is set three different values, 1, 1.5 and 2 respectively. For the second experiment, the parameter θis maintained same during the experiment. The parameter β is with three different values, 1, 1.5 and 2 respectively.
The experiment is under same conditions. f1, f2, f4, f8, and f10 are selected to make testing. The comparison results are listed in Tables 4 and 5. From the Tables 4 and 5, it can be found that these two parameters have little influence on the final results when the initial ranges are set between 1 and 2.
Result of sensitive testing with different θ
Result of sensitive testing with different β
Gravitational search algorithm is one of the power metaheuristic algorithms at present. It is based on the law of gravity and mass interactions. In order to achieve better performances, a new idea of controlling the late search process of gravitational search algorithm is proposed, which represents a post-improvement of parameter Kbest and parameter G. The new strategy makes GSA have higher convergence rate and can escape from the local minimum. The purpose of strengthening the exploitation ability of later iterations is also realized. The combination of Kbest and G has achieved better results for global optimization problems. The performance of improved GSA is tested in well-known standard functions. The influences of Kbest and G are also discussed and sensitivity testing is finished. The proposed algorithm has got superior performances in the most unimodal and multimodal functions. The experimental results are compared with other algorithms. These results have demonstrated that IGSA has merit in solving the problems of optimization.
Optimization problems have become more and more complicated. Some of them contain several constraints while some of them have discrete variables. It is more difficulty to optimize these problems. In the coming research, we will improve GSA to solve these problems and use the algorithm to solve real application problems.
Footnotes
Acknowledgments
This research was funded by the China Natural Science Foundation (No. 71974100, No. 41501555), Natural Science Foundation in Jiangsu Province (No. BK20191402), Major Project of Philosophy and Social Science Research in Colleges and Universities in Jiangsu province (2019SJZDA039), Qing Lan project (R2019Q05) and Postgraduate research and innovation plan project (SJKY19_0983) in Jiangsu Province.
