lion5_paper28_gravitationalinteractionsoptimization

Upload: reza-gholami

Post on 05-Apr-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/31/2019 LION5_paper28_GravitationalInteractionsOptimization

    1/12

    Gravitational Interactions Optimization

    Juan J. Flores1, Rodrigo Lopez1, and Julio Barrera2

    1 Universidad Michoacana de San Nicolas de HidalgoDivision de Estudios de Posgrado, Facultad de Ingeniera Electrica

    2 CINVESTAV-IPNDepartamento de Computacion

    Evolutionary Computation GroupAv. IPN No. 2508, Col. San Pedro Zacatenco

    Mexico, D.F. 07360, [email protected],[email protected],[email protected]

    Abstract. Evolutionary computation is inspired by nature in order toformulate metaheuristics capable to optimize several kinds of problems.A family of algorithms has emerged based on this idea; e.g. genetic algo-rithms, evolutionary strategies, particle swarm optimization (PSO), antcolony optimization (ACO), etc. In this paper we show a population-based metaheuristic inspired on the gravitational forces produced by theinteraction of the masses of a set of bodies. We explored the physicsknowledge in order to find useful analogies to design an optimizationmetaheuristic. The proposed algorithm is capable to find the optimaof unimodal and multimodal functions commonly used to benchmarkevolutionary algorithms. We show that the proposed algorithm (Gravi-tational Interactions Optimization - GIO) works and outperforms PSOwith niches in both cases. Our algorithm does not depend on a radiusparameter and does not need to use niches to solve multimodal prob-lems. We compare GIO with other metaheuristics with respect to themean number of evaluations needed to find the optima.

    Keywords: Optimization, gravitational interactions, evolutionary com-putation, metaheuristic

    1 Introduction

    Multimodal optimization problems deal with objective functions that commonlycontain more than one global optima and several local optima. In order to findall the global optima in multimodal problems with classical methods, one typi-

    cally runs a given method several times with different starting points, expectingto find all the global optima. However, these techniques do not guarantee thelocation of all optima. Therefore, this kind of techniques are not the best way toexplore multimodal functions with complex and large search spaces. In the evo-lutionary computation literature exists a variety of metaheuristics challengingthe typical problems of classical optimization. E.g. in particle swarm optimiza-tion with niches the best particle makes a niche with all particles within a radius

  • 7/31/2019 LION5_paper28_GravitationalInteractionsOptimization

    2/12

    2 Juan J. Flores, Rodrigo Lopez, and Julio Barrera

    r, until the niche is full; it then selects the next best no niched particle and itsclosest particles to form the second niche; the process repeats until all particles

    are assigned to a niche. Objective function stretching, introduced by Parsopolous[9], [10] is another algorithm whose strategy is to modify the fitness landscapein order to remove local optima and avoid the premature convergence in PSO.In a minimization problem, a possible local minimum is stretched to overcome alocal maximum allowing to explore other sections of the search space identifyingnew solutions. GSA introduced by Rashedi [11], is a gravitational memory-less(does not include a cognitive component in the model) metaheuristic capable tofind only one global optima in unimodal and multimodal problems with morethan one global optima, where a heavier mass means a better solution and thegravitational constant G is used to adjust the accuracy search.

    The rest of the paper is organized as follows: Section 2 compares GIO withGSA and CSS, two other metaheuristics very similar to our proposal. Section 3reviews Newtons universal gravitation law. Section 4 proposes Gravitational In-teractions Optimization, the main contribution of this paper. Section 5 presentsthe experimental framework and the obtained results. Finally, Section 6 presentsour conclusions.

    2 Review GSA GIO and CSS

    GIO has similarities with other two nature-inspired algorithms: GSA (Gravita-tional Search Algorithm), inspired on gravitational interactions and CSS ChargeSearch System (CSS) inspired on electrostatic dynamics laws. Our work is verysimilar to theirs, but since we have publications from around the same time [1],[3], and have not had any personal communication with their respective authors,

    we can state that this work is independent from the works of CSS and GSA.First GSA and CSS are very similar to GIO, assigning masses and charges

    respectively to bodies, according to the fitness function in the place the body islocated, in order to determine the evolution.

    The gravitational constant G in GSA decreases linearly with time. We thinkthat is not a good idea, since convergence is regularly not linear. In an attemptto increase its exploration capabilities, when GSA is determining the total forceexerted to a body, it weights each component (the force exerted by each otherbody) by a random number. This situation, in the worst case, destroys theunderlying metaphor, i.e. the gravitational interaction.

    Another point is that GSA uses Kbest agents in order to minimize computingtime, although the complexity of the algorithm is not reduced. On the other

    hand, we allow all masses (agents) to interact with each other.The CSS algorithm tries to imitate the electrostatic dynamics in order tooptimize unimodal and multimodal functions, assigning charge to the particlesin a similar way as GSA and GIO assign masses to the bodies. We think that thehigh level of detail of the charges of the particles in CSS is unnecessary, and theparameter a is very large for some functions; the estimation of this parametercould be arbitrary. We think that CSS lost the sense of electromagnetism dynam-

  • 7/31/2019 LION5_paper28_GravitationalInteractionsOptimization

    3/12

    Gravitational Interactions Optimization 3

    ics when they assign binary flags to determine the direction of the attraction ofthe bodies. All charges are positive, and still attract each other, departing from

    the electrostatic metaphor and making it look more like a gravitational one.Another important difference is that both CSS and GSA aim to locate the

    global optimum for multimodal functions, while GIOs main interest is to deter-mine all local and global optima for multimodal functions.

    In our work we explore the properties of gravitational interactions in orderto make a useful metaheuristic to find optima in unimodal and multimodalproblems.

    3 Newtons Law of Universal Gravitation

    The attraction force of two particles is proportional to their masses and inverselyproportional to their distance. The Law of Universal Gravitation was proposed

    by Isaac Newton [8]. This law is stated in Definition 1.

    Definition 1 The force between any two particles having masses m1 and m2,separated by a distance r, is an attraction acting along the line joining the par-ticles and has G magnitude shown in Equation (1).

    F = Gm1m2

    r2(1)

    where G is a universal gravitational constant.

    The forces between two particles with mass are an action-reaction pair. Twoparticles with masses m1 and m2 exert attracting forces F12 and F21 towardseach other whose magnitudes are equal but their directions are opposed.

    The gravitational constant G is an empirical physical constant involved inthe computation of the gravitational attraction between particles with masses,which when determined by the maximum deflection method [12] yields.

    G = 6.673 1011N(m/kg)2 (2)

    The gravitational force is extremely weak compared to other fundamentalforces; e.g. the electromagnetic force is 39 orders of magnitude greater than thegravity force.

    Newtons law of universal gravitation can be written in vectorial notation,which considers both: The force of the masses and the direction of each force.The vectorial notation is shown in Equation (3).

    F12 = G m1m2

    |r12|2r12 (3)

    where F12 is the force exerted by m1 on m2, G is the gravitational constant, m1and m2 are the masses of the particles, |r12| is the euclidean distance betweenparticles m1 and m2, r12 is the unit vector, defined as

    r2r1|r2r1|

    , and r1 and r2 are

    the locations of particles m1 and m2 (see Figure 1).

  • 7/31/2019 LION5_paper28_GravitationalInteractionsOptimization

    4/12

    4 Juan J. Flores, Rodrigo Lopez, and Julio Barrera

    m1 m1 m1

    m2 m2 m2

    F12 F21r21 r12r12

    (a) (b) (c)

    Fig. 1. (a) The force exerted on m2 (by m1), F21, is directed opposite to the dis-placement, r12, of m2 from m1. (b) The force exerted on m1 (by m2), F12, is directedopposite to the displacement, r21, of m1 from m2. (c) F21 = F12, the forces being anaction-reaction pair

    4 Gravitational Interactions Optimization

    In order to find one or more optima there exists a large variety of evolution-ary algorithms, e.g. genetic algorithms (GA) [4], evolutionary strategies (ES)[5], ant colony optimization (ACO) [2], particle swarm optimization (PSO) [6],electrostatic PSO (EPSO) [1], etc. There exist works related to the design ofmetaheuristics that take into account distances in order to determine the clustermembership of the particles, computing and maximizing a ratio for all particlesin the swarm with respect to the particle to be updated, e.g. FER-PSO [7]. Wepropose a Gravitational Interaction Optimization metaheuristic (GIO) capableof solving optimization problems. The motivation of the design of this meta-

    heuristic is to find useful properties and anolgies that can relate optimizationproblems with Newtons gravitational theory. In the approach presented in thispaper, we abduct the interactions exhibited by a set of bodies and use them toguide the search for the global optimum in an optimization problem.

    4.1 Gravitational Interactions for Unimodal Optimization

    GIO is a population-based metaheuristic where a set of bodies are initially dis-persed along the search space with a uniform random distribution. The fitnessof bodies located on the search space are mapped as masses in a Gravitationalfield where the solutions are evolved. Each body stores its current position Band possibly its best position so far Bb, according to the fitness function. Bodies

    are allowed to interact in a synchronous discrete manner for a number of epochs.The body interactions follow Newtons gravitational law and move each body toa new location in such way that the whole population tends to reach the globaloptimum (or multiple local optima for multi-modal problems).

    The fitness function is a mapping that transforms a vector X = (x1, x2, . . . , xn)to a scalar f(X). This mapping associates the fitness value f(X) to each locationX = (x1 xn) of the search space. We assign a body B to every location X

  • 7/31/2019 LION5_paper28_GravitationalInteractionsOptimization

    5/12

    Gravitational Interactions Optimization 5

    in the search space where an individual of the population is found. Body B isassigned a mass, whose magnitude is a function of the fitness of its location.

    Newtons law of universal gravitation describes the attraction forces thatexist between two punctual bodies with masses (described in vectorial form in3). Substituting we obtain Equation (4).

    Fij =M(f(Bi)) M(f(Bj))

    |Bi Bj |2Bij (4)

    where Bi is the position of the ith body and Bj is the jth body that contributesexerting a force on the mass Bi; |Bi Bj| is the euclidean distance and Bij isthe unit vector between bodies Bi and Bj ; f(Bi) is the fitness of body Bi, M isthe mapping function that associates the fitness value f of domain {x : x }to a mass of codomain {y : y (0, 1]} for each position of the body Bi. Thismapping is computed using Equation (5).

    M(f(Bi)) =

    f(Bi) minf(B)

    maxf(B) minf(B)(1 mapMin) + mapMin

    2(5)

    where minf(B) is the minimum fitness value of the positions of the bodies sofar, maxf(B) is the maximum fitness value of the positions so far. mapMinis a constant with a small positive value near zero, such that (1 mapMin)reescales the fitness value f(Bi) to a mass in the interval [mapMin, 1). Theresult is squared to emphasize the best and worst fitnesses.

    One characteristic of the proposed method is the full interaction; i.e eachbody Bi interacts with every other body Bj through their masses. Interactionscontribute to their displacement, according to the resultant force. Equation (6)computes the resultant force exerted on body Bi by the bodies Bj .

    Fi =

    nj=1

    M(f(Bi)) M

    f(Bbj)

    |Bi Bbj |2

    BiBbj (6)

    where Fi is the resultant force of the sum of all vector forces between M(Bi)and M(Bbj), |Bi B

    bj | is the Euclidean distance between the current positions

    of body Bi and the best position so far of the body Bj. In order to avoidnumerical errors we compute the force between masses M(Bi) and M(B

    bj ) only

    if|BiBj| 105 (if the distance is smaller than that, we suppose both bodies

    collided already and are located in the same place; we are assuming punctual

    masses), BiBbj is the unit vector that directs the force. In order to estimate a

    displacement that could enhance the solution of particle Bi, it is neccesary tosolve Equation (4) for Bj . Assuming that we want to find a location of the bodyB with M(f(B)) = 1, B is computed using Equation (7).

    B =

    M(f(Bi))

    |Fi|Fi (7)

  • 7/31/2019 LION5_paper28_GravitationalInteractionsOptimization

    6/12

    6 Juan J. Flores, Rodrigo Lopez, and Julio Barrera

    To update the position of the bodies we use Equations (8) and (9).

    Vt+1 = (V + R C B) (8)

    Bt+1 = B + Vt+1 (9)

    where V is the current velocity of Bi, R is a random real number generated inthe range of [0, 1) and is multiplied by the gravitational interaction coefficientC, in order to expect random exploration distances with mean 1, we setC = 2.01, this displacement is constrained multiplying by a constant with a valueof 0.86, in order to ensure convergence. B is the main displacement computedby Equation (7).

    Using Newtons law F = ma, we can compute velocity and from there dis-placement, as in GSA [11]. Using this scheme though, when bodies are far apart,forces are small, and the resulting displacement is also small; when the methodis converging, bodies are closer to each other, producing larger forces, thereforelarger displacements. This leads to a divergent or at least non-convergent behav-ior. GSA solves this problem by assuming G as a linearly decreasing functionof time. As in classical mechanics, we consider G a constant and use a heuris-tic solution to this problem: where should a body of unitary mass be locatedto produce the same resulting force in Bi? We use that location as Bis newlocation.

    Using this heuristic, when bodies are far apart from each other, forces aresmall, as they would be produced by a unitary mass located far away. Whenthe method is converging and masses are close together, resulting forces arelarger, as produced by a close unitary mass, resulting in small displacements.This heuristic leads to very a convenient convergence scheme, where exploration

    takes place at the beginning and exploitation at end of the process.The complete GIO algorithm is described the Algorithms 1, 2, and 3. Al-

    gorithm 1 computes the the total force exerted by the masses M(f(Bj)) andM(f(Bi)); in order to prevent premature convergence and division by 0, wecompute only those pairs of bodies with a distance greater than . Algorithm2 computes the velocities of the bodies, receives the bodies and computes theresultant force that attracts the mass assigned to Bi. In order to prevent a di-vision by 0 we compute the distance only if |Ftotal| > 0, the new velocity iscomputed by Equation (8), and finally we update the velocity associated to Bi.Algorithm 3 computes the new positions B of each iteration t; this algorithmtakes as parameters the search range, the number of bodies nBodies, and themaximum number of iterations maxIter. The algorithm computes the velocities

    with computeV elocities(bodies) using Algorithm 2, and updates the their posi-tions with updatePosition(), which implements Equation (9), limitPositions()limits the positions of the bodies to the search space defined by the search range;updateFitness() updates the fitness according to the new positions of the bodies;finally, we update the best position so far with updateBb().

    This scheme develops good results for unimodal problems. The performaceresults of the algorithm presented in this section are presented in Section 5.

  • 7/31/2019 LION5_paper28_GravitationalInteractionsOptimization

    7/12

    Gravitational Interactions Optimization 7

    Algorithm 1 computeFtotal(index)

    1: i index2: Ftotal 03: for j 1 to nBodies do4: if distance(Bi, B

    bj ) > then

    5: Ftotal Ftotal + Bbi,jM(f(Bi))M(f(Bbj ))/distance(Bi, B

    bj )

    2

    6: end if7: end for8: return Ftotal

    Algorithm 2 computeVelocities(bodies)

    1: for i 1 to nBodies do2: Ftotal computeF total(i)3: if |Ftotal| > 0 then4: distance

    pM(f(Bi))/|Ftotal|

    5: else6: distance 07: end if8: Vnew (V + R C distance Ftotal)9: updateV elocity(Bi, Vnew)

    10: end for

    11: return Ftotal

    Algorithm 3 GIO(ranges, nBodies,maxIter)

    1: bodies initializeParticles(nBodies, ranges)2: for t 0 to maxIter do3: computeV elocities(bodies)4: limitV elocity()5: updatePosition()

    6: limitPosition()7: updateFitness()8: updateBb()9: end for

  • 7/31/2019 LION5_paper28_GravitationalInteractionsOptimization

    8/12

    8 Juan J. Flores, Rodrigo Lopez, and Julio Barrera

    4.2 Gravitational Interactions for Multimodal Optimization

    In the previous Subsection we showed the basic steps of the gravitational in-teractions metaheuristic. This scheme works well for unimodal problems. Formultimodal problems it is necessary to add a cognitive component analogousto the one used in PSO [6]; the cognitive component is a constant that gives aweight to each bodys memory. The new positions of the bodies are computedin order to find more than one optima with Equations (10) and (11).

    Adding the cognitive component to Equation (8) and using the constrictionfactor (Equation (12)) [6], makes the new Equation (10) capable to find morethan one optimum in multimodal problems. The effect of this component is tomake the local search more robust, restricting the bodies to local search, unlessthe gravitational forces of a cluster of masses overcome the force exerted by itscognitive component.

    Vnew =

    V + C1 R1 (Bb B) + C2 R2 a

    (10)

    Bnew = B + Vnew (11)

    where, analogous to PSO, C1 and C2 are the cognitive and the gravitationalinteraction constants, R1 and R2 are real random numbers variables in the [0, 1)range and is the inertia constraint (Proposed by Clerk [6]). The inertia con-straint is used to avoid the bodies to explore out of the search space computedby Equation (12).

    =2

    |2

    2 4|(12)

    where = C1 + C2 > 4, is an arbitrary value in the range of (0, 1] [6]. Inour algorithm we set C1 = C2 = 2.01. The constriction factor in our algorithmcontributes to convergence through the iterations.

    To make multimodal Gravitational Interactions Algorithm (Algorithms 1, 2,and 3, described in the previous subsection) work for multimodal optimizationproblems, we replace line 8 of Algorithm 2 by Equation 10.

    5 Experiments

    In order to test the performance of the Gravitational Interactions Optimizationalgorithm for unimodal and multimodal functions, we tested both versions withsome functions commonly used to measure the performance of different kinds ofmetaheuristics.

  • 7/31/2019 LION5_paper28_GravitationalInteractionsOptimization

    9/12

    Gravitational Interactions Optimization 9

    Unimodal Test Functions

    U1U1 = [1 + (1 + (x + y + 1)2)(19 14x + 3y2 + 6xy + 3y2)] 2 x, y 2

    [(30 + (2x 3y)

    2

    )(18 32x + 12x

    2

    + 48y 36xy + 27y

    2

    )]U2 U2 = (x + 2y 7)2 + (2x + y 5)2 10 x, y 10

    U3U3 = 1100 (w2 x)2 + (w 1)2 + (y 1)2 + 90 (y2 z)2 +

    10 w ,x ,y,z 1010.1 ((x 1)2 + (z 1)2) + 19.8 (x1) (z 1)

    Multimodal Test Functions

    M1 M1 =

    (y 5.1x2

    42+ 5x

    6)2 + 10(1 1

    8)Cos(x) + 10

    5 x 100 y 15

    M2 M2 = Sin(5x)6 0 x 1M3 M3 = (x2 + y 11)2 (x + y2 7)2 6 x, y 6

    M4 M4 = 4

    (4 2.1x2 + x4

    3)x2 + xy + (4 + 4y2)y2

    1.9 x 1.91.1 x 1.1

    Table 1. Test functions used for our experiments

    5.1 Test Functions

    We show the performance of unimodal and multimodal Gravitational Interac-tions Optimization with 3 unimodal and 4 multimodal functions. The test func-tions used are shown in the Table 1.

    For unimodal optimization we used the functions in Figure 2; U1 is theGoldstein and Price function (Figure 2(a)), U2 is the Booth function (Figure2(b)), and U3 is the 4 variable Colville Function. For multimodal optimization weused the functions in Figure 3; M1 is the Branins RCOS Function with 3 globaloptima (Figure 3(a)), M2 is the 6 global maximum univariable Debs function(Figure 3(b)), M3 is Himmelblaus function with 4 global optima (Figure 3(c)),

    M4 is the Six-Hump cammelback function with 2 global optima and 4 localoptima (Figure 3(d)).

    2

    1

    0

    1

    2

    x

    2

    1

    0

    1

    2

    y

    3 106

    2 106

    1 106

    0

    f

    (a) Goldstein-Price function

    10

    5

    0

    5

    10

    x

    10

    5

    0

    5

    10

    y

    2000

    1000

    0

    f

    (b) Booth function

    Fig. 2. Fitness landscape of two test functions with one optima used to measure theperformance of Unimodal Gravitational Interactions

  • 7/31/2019 LION5_paper28_GravitationalInteractionsOptimization

    10/12

    10 Juan J. Flores, Rodrigo Lopez, and Julio Barrera

    5.2 Results

    5

    0

    5

    10

    x

    0

    5

    10

    15

    y

    300

    200

    100

    0

    (a) Branins RCOS function

    0.2 0.4 0.6 0.8 1.0x

    0.2

    0.4

    0.6

    0.8

    1.0

    y

    (b) Debs function

    5

    0

    5

    x

    5

    0

    5

    y

    2000

    1500

    1000

    500

    0

    f

    (c) Himmelblaus function

    1

    0

    1

    x

    1.0

    0.5

    0.0

    0.5

    1.0

    y

    20

    10

    0

    (d) Six-hump cammelback function

    Fig. 3. Fitness landscape of multimodal test functions used in our experiments

    In our experiments we consider = 1 103 to be an acceptable error todetermine if the solution obtained had reached the optimum. We used 100 bodiesfor a maximum of 1000 iterations, we used as stop condition the inability of allthe bodies to enhance their fitness memory solutions by 1 104, or when thealgorithm found all the optima. Each experiment was repeated 30 times.

    PSO with niches requires two extra parameters: the radius r, and the max-imum number of particles per niche nMax. To solve M1 we set r = 0.5 andnMax = 50, to solve M2 we set r = 0.1 and nMax = 15, to solve M3 we setr = 0.5 and nMax = 30, and M4 with r = 0.5 and nMax = 25.

    The performance of Gravitational Interaction Optimization (GIO) is com-pared with Particle Swarm Optimization with niches (NPSO) in Table 2; thistable includes the mean and the standard deviation of evaluations required tofind all the global optima (column Evaluations) and the percentage of successes(column Success) to finding all the optima.

  • 7/31/2019 LION5_paper28_GravitationalInteractionsOptimization

    11/12

  • 7/31/2019 LION5_paper28_GravitationalInteractionsOptimization

    12/12

    12 Juan J. Flores, Rodrigo Lopez, and Julio Barrera

    the 8th Mexican International Conference on Artificial Intelligence (MICAI 09),pages 622632, Berlin, Heidelberg, 2009. Springer-Verlag.

    2. Alberto Colorni, Marco Dorigo, and Vittorio Maniezzo. Distributed optimizationby ant colonies. In Proceedings of the Parallel Problem Solving from Nature Con-ference. Elsevier Publishing, 1992.

    3. Juan J. Flores, Rodrigo Lopez Faras, and Julio Barrera. Particle swarm optimiza-tion with gravitational interactions for multimodal and unimodal problems. InProceedings of the 9th Mexican International Conference on Artificial Intelligence(MICAI 2010), pages 361370. Springer-Verlag, 2010.

    4. David E. Goldberg. Genetic Algorithms in Search, Optimization, and MachineLearning. Addison-Wesley Professional, 1 edition, January 1989.

    5. Rechenberg Ingo. Evolutionsstrategie 94. PhD thesis, Technische UniversitatBerlin, 1994.

    6. J. Kennedy and R. Eberhart. Swarm Intelligence. Evolutionary Computation.Morgan Kaufmann Publisher, 2001.

    7. Xiaodong Li. A multimodal particle swarm optimizer based on fitness euclidean-

    distance ratio. In Proceedings of the 9th annual conference on Genetic and evo-lutionary computation (GECCO 07), pages 7885, New York, NY, USA, 2007.ACM.

    8. I. Newton. Newtons Principia Mathematica. Fsica. Ediciones Altaya, S.A., 21edition, 1968.

    9. K. E. Parsopoulos, G.D. Magoulas, Uxbridge Ub Ph, M.N. Vrahatis, and V.P.Plagianakos. Stretching technique for obtaining global minimizers through particleswarm optimization. In Proceedings of the Particle Swarm Optimization Workshop,pages 2229, 2001.

    10. K. E. Parsopoulos, V. P. Plagianakos, G. D. Magoulas, and M. N. Vrahatis. Improv-ing the particle swarm optimizer by function stretching. Nonconvex Optimizationand its Applications, 54:445458, 2001.

    11. Esmat Rashedi, Hossein Nezamabadi-pour, and Saeid Saryazdi. Gsa: A gravita-

    tional search algorithm. Information Sciences, 179(13):22322248, 2009.12. Hallyday. Robert, Resnick. David. Physics Part I. Physics. John Wiley and SonsInc, 1966.