Function Optimization and Parameter Performance Analysis Based on Gravitation Search Algorithm

The gravitational search algorithm (GSA) is a kind of swarm intelligence optimization algorithm based on the law of gravitation. The parameter initialization of all swarm intelligence optimization algorithms has an important influence on the global optimization ability. Seen from the basic principle of GSA, the convergence rate of GSA is determined by the gravitational constant and the acceleration of the particles. The optimization performances on six typical test functions are verified by the simulation experiments. The simulation results show that the convergence speed of the GSA algorithm is relatively sensitive to the setting of the algorithm parameters, and the GSA parameter can be used flexibly to improve the algorithm’s convergence velocity and improve the accuracy of the solutions.


Introduction
The function optimization problem is to find the optimal solution of the objective function by the iterative [1].In general, the search objective is to optimize the function of the objective function, which is usually described by the continuous, discrete, linear, nonlinear, concave and convex of the function.For constrained optimization problems, one can adopt the specific operators to make the solutions always feasible, or use the penalty function to transform the solutions into the unconstrained problems.So, the unconstrained optimization problems are the research focus here.There has been considerable attention paid to employing metaheuristic algorithms inspired from natural processes and/or events in order to solve function optimization problems.The swarm intelligent optimization algorithm [2] is a random search algorithm simulating the evolution of biological populations.It can solve complex global optimization problems through the cooperation and competition among individuals.The representative swarm intelligence optimization algorithms include Ant Colony Optimization (ACO) algorithm [3], Genetic Algorithm (GA) [4], Particle Swarm Optimization (PSO) algorithm [5], Artificial Bee Colony (ABC) algorithm [6], etc.
However, not all met heuristic algorithms are bio-inspired, because their sources of inspiration often come from physics and chemistry.For the algorithms that are not bio-inspired, most have been developed by mimicking certain physical and/or chemical laws, including electrical charges, gravity, river systems, etc.The typical physics and chemistry inspired met heuristic algorithms include Big Bang-big Crunch optimization algorithm [7], Black hole algorithm [8], Central force optimization algorithm [9], Charged system search algorithm [10], Electro-magnetism optimization algorithm [11], Galaxy-based search algorithm [12], Harmony search algorithm [13], Intelligent water drop algorithm [14], River formation dynamics algorithm [15], Self-propelled particles algorithm [16], Spiral optimization algorithm [17], Water cycle algorithm [18], etc.
The gravitational search algorithm (GSA) was introduced by E. Rashedi et al. in 2009 [19].It was constructed based on the law of gravity and the notion of mass interactions.The GSA algorithm uses the theory of Newtonian physics and its searcher agents are the collection of masses.A multi-objective gravitational search algorithm (MOGSA) technique was proposed to be applied in hybrid laminates to achieve minimum weight and cost [20].A fuzzy gravitational search algorithm was proposed for a pattern recognition application, which in addition provided a comparison with the original gravitational approach [21].The grouping GSA (GGSA) adapted the structure of GSA for solving the data clustering problem [22].Combining the advantages of the gravitational search algorithm (GSA) and gauss pseudo spectral method (GPM), an improved GSA (IGSA) is presented to enhance the convergence speed and the global search ability [23].A novel modified hybrid Particle Swarm Optimization (PSO) and GSA based on fuzzy logic (FL) was proposed to control the ability to search for the global optimum and increase the performance of the hybrid PSO-GSA [24].A binary quantum-inspired gravitational search algorithm (BQIGSA) was proposed by using the principles of QC together with the main structure of GSA to present a robust optimization tool to solve binary encoded problems [25].Another binary version of hybrid PSOGSA called BPSOGSA was proposed to solve many kinds of optimization problems [26].A new gravitational search algorithm was proposed to solve the unit commitment (UC) problem, which is the integrated binary gravitational search algorithm (BGSA) with the Lambda-iteration method [27].
In conclusion, GSA has been successfully applied in many global optimization problems, such as, multi-objective optimization of synthesis gas production [28], the forecasting of turbine heat rate [29], dynamic constrained optimization with offspring repair [30], fuzzy control system [31], grey nonlinear constrained programming problem [32], reactive power dispatch of power systems [33], minimum ratio traveling salesman problem [34], parameter identification of AVR system [35], strategic bidding [36], etc.In this paper, the research on the function optimization problem is solved based on the gravitation search algorithm (GSA).Then the parameter performance comparison and analysis are carried out through the simulation experiments in order to verify its superiority.The paper is organized as follows.In Section 2, the gravitational search algorithm is introduced.The simulation experiments and results analysis are introduced in details in Section 3. Finally, the conclusion illustrates the last part.

Physics Foundation of GSA
The law of universal gravitation is one of the four basic forces in nature.It is one of the fundamental forces in nature.The gravitational force is proportional to the product of the mass, and is inversely proportional to the square of the distance.The gravitational force between two objects is calculated by: where, F is the gravitational force between two objects, G is the gravitational constant, M 1 and M 2 are the masses of the objects 1 and 2 respectively, R is the distance between these two objects.According to the international unit system, the unit of F is Newton (N), the unit of M 1 and M 2 is kg, the unit of R is m, and the constant G is approximately equal to 6.67 ˆ10 ´11 N ¨m2 {kg 2 .The acceleration of the particle a is related to its mass M and of the gravitational force F, which is calculated by the following equation.
According to the Equations ( 1) and ( 2), all of the particles in the world are affected by gravity.The closer the distance between two particles, the greater the gravitational force.Its basic principle is shown in Figure 1, where the mass of the particles is represented by the image size.Particle M 1 is influenced by the gravity of the other three particles to produce the resultant force F. Such an algorithm will converge to the optimal solution, and the gravitational force will not be affected by the environment, so the gravity has a strong local value.
Algorithms 2016, 9, 0003 3 According to the Equations ( 1) and ( 2), all of the particles in the world are affected by gravity.The closer the distance between two particles, the greater the gravitational force.Its basic principle is shown in Figure 1, where the mass of the particles is represented by the image size.Particle 1 M is influenced by the gravity of the other three particles to produce the resultant force F .Such an algorithm will converge to the optimal solution, and the gravitational force will not be affected by the environment, so the gravity has a strong local value.The gravitational search algorithm should make the moving particle in space into an object with a certain mass.These objects are attracted through gravitational interaction between each other, and each particle in the space will be attracted by the mutual attraction of particles to produce accelerations.Each particle is attracted by the other particles and moves in the direction of the force.The particles with small mass move to the particles with great mass, so the optimal solution is obtained by using the large particles.The gravitation search algorithm can realize the information transmission through the interaction between particles.

Basic Principles of Gravitation Search Algorithm
Because there is no need to consider the environmental impact, the position of a particle is initialized as i X .Then in the case of the gravitational interaction between the particles, the gravitational and inertial forces are calculated.This involves continuously updating the location of the objects and obtaining the optimal value based on the above mentioned algorithm.The basic principal of gravitational search algorithm is described as follows in detail.
x x x x of N objects, and then the positions of N objects are brought into the function, where the position of the i th object are defined as follows.

Calculate the Inertia Mass
Each particle with certain mass has inertia.The greater the mass, the greater the inertia.The inertia mass of the particles is related to the self-adaptation degree according to its position.So the inertia mass can be calculated according to the self-adaptation degree.The bigger the inertial mass, the greater the attraction.This point means that the optimal solution can be obtained.At the moment The gravitational search algorithm should make the moving particle in space into an object with a certain mass.These objects are attracted through gravitational interaction between each other, and each particle in the space will be attracted by the mutual attraction of particles to produce accelerations.Each particle is attracted by the other particles and moves in the direction of the force.The particles with small mass move to the particles with great mass, so the optimal solution is obtained by using the large particles.The gravitation search algorithm can realize the information transmission through the interaction between particles.

Basic Principles of Gravitation Search Algorithm
Because there is no need to consider the environmental impact, the position of a particle is initialized as X i .Then in the case of the gravitational interaction between the particles, the gravitational and inertial forces are calculated.This involves continuously updating the location of the objects and obtaining the optimal value based on the above mentioned algorithm.The basic principal of gravitational search algorithm is described as follows in detail.

Initialize the Locations
Firstly, randomly generate the positions x 1 i , x 2 i , ..., x k i , ...x d i of N objects, and then the positions of N objects are brought into the function, where the position of the ith object are defined as follows.

Calculate the Inertia Mass
Each particle with certain mass has inertia.The greater the mass, the greater the inertia.The inertia mass of the particles is related to the self-adaptation degree according to its position.So the inertia mass can be calculated according to the self-adaptation degree.The bigger the inertial mass, the greater the attraction.This point means that the optimal solution can be obtained.At the moment t, the mass of the particle X i is represented as M i ptq.Mass M i ptq can be calculated by the followed equation.
where i " 1, 2, ¨¨¨, N, f itpiq is the fitness value of the object i, bestptq is the optimal solution and worstptq is the worst solution.The calculation equation of bestptq and worstptq are described as follows.

Calculate Gravitational Force
At the moment t, the calculation formula for the gravitational force of object j to object i described as follows.
where, ε is a very small constant, M ai ptq is the inertial mass of the object itself, M pi ptq is the inertial mass of an object i. G ptq is the universal gravitational constant at the moment t, which is determined by the age of the universe.The greater the age of the universe, the smaller G ptq.The inner relationship is described as follows.
Gptq " G 0 ¨e´αt{T (12) where G 0 is the universal gravitational constant of the universe at the initial time t 0 , generally it is set as 100.α is 20, T is the maximum number of iterations and R ij ptq represented the Euclidean distance between object i and object j.
In GSA, the sum F k i ptq of the forces acting on the X i in the K-th dimension is equal to the sum of all the forces acting on this object: where rank j is the random number in the range r0, 1s, F k ij ptq is the gravity of the j-th object acting on the i the object in the k-th dimension space.According to Newton's Second Law, the acceleration of the i-th particle in the k-th dimension at the moment t is defined as follows:

Change the Positions
In each iteration, the object position can be changed by calculating the acceleration, which is calculated by the following equations.
x k i pt `1q " x k i ptq `vk i pt `1q (17)

Algorithm Flowchart
The detailed flowchart of the algorithm is shown in Figure 2, and the optimization procedure is described as follows.

Change the Positions
In each iteration, the object position can be changed by calculating the acceleration, which is calculated by the following equations.

Algorithm Flowchart
The detailed flowchart of the algorithm is shown in Figure 2, and the optimization procedure is described as follows.Step 1: Initialize the positions and accelerations of all particles, the number of iterations and the parameters of the GSA; Step 2: According to the Equation ( 12), calculate the fitness value of each particle and update the gravity constant; Step 3: According to the Equations ( 5)- (7), calculate the quality of the particles based on the obtained fitness values and the acceleration of each particle according to the Equations ( 8) and (15); Step 4: Calculate the velocity of each particle and update the position of the particle according to the Equation (17); Step 5: If the termination condition is not satisfied, turn to Step 2, otherwise output the optimal solution.

Analysis of Gravitational Search Algorithm
In GSA, the update of the particle positions is aroused by the acceleration caused by the gravitational force of the particles.The value of gravity determines the size of the particle's Step 1: Initialize the positions and accelerations of all particles, the number of iterations and the parameters of the GSA; Step 2: According to the Equation ( 12), calculate the fitness value of each particle and update the gravity constant; Step 3: According to the Equations ( 5)- (7), calculate the quality of the particles based on the obtained fitness values and the acceleration of each particle according to the Equations ( 8) and (15); Step 4: Calculate the velocity of each particle and update the position of the particle according to the Equation (17); Step 5: If the termination condition is not satisfied, turn to Step 2, otherwise output the optimal solution.

Analysis of Gravitational Search Algorithm
In GSA, the update of the particle positions is aroused by the acceleration caused by the gravitational force of the particles.The value of gravity determines the size of the particle's acceleration, so the acceleration can be regarded as the search step of the particle position update.Its size determines the convergence rate of the gravitational search algorithm.In the acceleration calculation, the number of particles N and gravity play an important role, and the mass and gravity of the particles are determined the variety of G.The particle with different mass and gravity has different convergence rate.So it is very important to choose the number of particles and the gravity of the universal gravitation search algorithm.
The parameter initialization for all swarm intelligence optimization algorithms has important influence on the performance of the algorithms and the optimization ability.GSA has two main steps: one is to calculate the attraction of other particles for their selves and the corresponding acceleration calculated through gravitational, and another is to update the position of the particles according to the calculated acceleration.As shown in Formula ( 11)-( 17), the convergence rate of GSA is determined by the value of Gravitational constant G 0 to determine the size of the particle acceleration, and parameters α to determine the pace of change.In this section, the effect and influence of parameters G 0 and α will be analyzed in detail.

Test Functions
Six typical functions shown in Table 1 are selected and carried out simulation experiments for the optimal solution under the condition of GSA changeable parameters.There is only one extreme point for f 1 " f 2 , which is mainly used to investigate the convergence of the algorithm and to test the accuracy of the algorithm.There are many extreme points for f 3 " f 6 , the difference are in that f 5 " f 6 has lower dimension 2 and 4 respectively, while f 1 " f 4 are high dimension with 30.

Simulation Results and Corresponding Analysis
The GSA parameters are initialized as follows: max iterations max_it = 1000, objects N = 100.When the simulation experiments are carried out for the parameters G 0 , α = 20.In order to reduce the influence of random disturbance, the independent operation 50 times is carried out for each test function.The optimum values and average values of GSA under different G 0 are shown in Table 2.The simulation curves for six test functions are shown in Figure 3a-f.Seen from the above simulation results, when G 0 is 150, whether the optimal value or average value, the functions ( f 1 , f 2 , f 4 ) all have achieved the best results.When G 0 are 100 and 50, the optimization effect decreased successively.When G 0 is 10, the functions ( f 3 , f 5 , f 6 ) have the best convergence performance.However, the most obvious performance of convergence curves appears in the function f 3 and the curves of optimization effect in function f 1 and f 4 is worst.The parameter selection of different simulation curve fluctuates greatly in f 4 , where the simulation curves of the difference maximum when G 0 is 10 compared with other values.By analyzing the convergence curves of each function, the convergence rate of the low dimensional function was higher than the high dimensional function.Seen from the overall trends, as the growth of the value G 0 , the precision of solution obtained in the related function optimization is not growth, but it is affected by the optimal solution of distribution from the solution space of a different function.Moreover, it is also related to the size of the solution space.
In view of the different values of the parameter α, the maximum or the minimum impact on the performance of function optimization are all varying.Considering the running time, the parameter G 0 is 100 and the other parameters remain unchanged.The simulation experiments and the corresponding analysis for α are shown in Table 3.The simulation curves of six test functions are shown in Figure 4a-f.G is 10 compared with other values.By analyzing the convergence curves of each function, the convergence rate of the low dimensional function was higher than the high dimensional function.Seen from the overall trends, as the growth of the value 0 G , the precision of solution obtained in the related function optimization is not growth, but it is affected by the optimal solution of distribution from the solution space of a different function.Moreover, it is also related to the size of the solution space.
In view of the different values of the parameter α , the maximum or the minimum impact on the performance of function optimization are all varying.Considering the running time, the parameter 0 G is 100 and the other parameters remain unchanged.The simulation experiments and the corresponding analysis for α are shown in Table 3.The simulation curves of six test functions are shown in Figure 4a-f.Seen from the above simulation results, there are most times to obtain the optimal solution when the α value is 15, followed by 10.In addition to function f have converged to the optimal value.As the α increases, the convergence effect showed a decreasing trend and the convergence curves of the other three functions appear to show gradient optimization conditions.When α is 35, the functions 2 f , 3 f have the fastest convergence speed and reach the local optimal value early, but not the global optimal value.Overall, for different functions, the smaller α , the better the convergence performance.Compared to the slow convergence velocity, the functions with low dimension converge at a steeper point on the curve.Seen from the above simulation results, there are most times to obtain the optimal solution when the α value is 15, followed by 10.In addition to function f 1 , f 4 has a greater difference among the optimal solutions.The optimal solutions of other functions are close.The running time of low dimensional functions is less than the high dimensional functions.Comparing the shortest running times, the function f 6 is only a half of function f 1 , which shows that low dimensional function has better convergence performance.Seen from the points in convergence curves, when α is 10, the most obvious optimization performances of f 1 , f 4 , f 6 have converged to the optimal value.As the α increases, the convergence effect showed a decreasing trend and the convergence curves of the other three functions appear to show gradient optimization conditions.When α is 35, the functions f 2 , f 3 have the fastest convergence speed and reach the local optimal value early, but not the global optimal value.Overall, for different functions, the smaller α, the better the convergence performance.Compared to the slow convergence velocity, the functions with low dimension converge at a steeper point on the curve.

Conclusions
Based on the basic principle of the gravitational search algorithm (GSA), the algorithm flowchart is described in detail.The optimization performance is verified by simulation experiments on six test functions.G 0 as a role of step in the particle position growth, through the simulation analysis of functions, when G 0 is 100, the algorithm is relatively inclined to be in a more stable state, which makes the optimal results more stable.The parameter α played a key role in control algorithm convergence rate.When the parameter value is small, the convergence speed of the algorithm is relatively slow.Under the same number of iterations, the conditions need for an optimal solution are worse; thus, a higher number of iterations is needed to obtain the optimal solution.However, the high value will easily cause the algorithm convergence speed to be too fast and become caught into the local solution, which will reduce the accuracy of the solution.As a result, the value 15 is appropriate.The simulation results show that the convergence speed of the algorithm is relatively sensitive to the setting of the algorithm parameters, and the GSA parameters can be used to improve the algorithm's convergence velocity and improve the accuracy of the solutions.

Table 2 .
The simulation result of different number of G 0 .

Table 3 .
The simulation result of different α.

Table 3 .
The simulation result of different α .