You can edit almost every page by Creating an account and confirming your email.

Gradient-based repair differential evolution

From EverybodyWiki Bios & Wiki



File:Funcionamiendo del algoritmo G-DEmi.gif
G-DEmi applied to mixed-integer nonlinear programming problems shows its capacity to efficiently explore the discontinuous feasible regions (red lines).

The Algorithm G-Demi, an acronym for Gradient-based Differential Evolution for Mixed-Integer Nonlinear Programming, is a variant of the differential evolution designed to solve mixed-integer nonlinear programming problems (MINLP).[1] The presence of both continuous and discrete variables, along with constraints, leads to discontinuous feasible regions of varying sizes in the search space. Traditional evolutionary algorithms face difficulties with these problems due to their insensitivity in handling constraints, leading to the generation of many infeasible solutions. G-DEmi addresses this limitation by integrating a gradient-based repair method within the differential evolution framework. The aim of the repair method is to fix promising infeasible solutions in different subproblems using the gradient information of the constraint set.

G-DEmi

G-DEmi continuously improves a population of candidate solutions through an iterative cycle of generation, evaluation, and selection of trial vectors. In each iteration, new vectors are generated by combining existing solutions. They are evaluated based on their performance and repaired as necessary to satisfy the constraints.

Initial Population

The initial population ๐g is generated by taking random values. For the real variables, random real values are generated, and for the integer variables, random integer values are generated, corresponding to the solution vector [๐ฑ,๐ฒ]. Subsequently, the objective function f(๐ฑg) and the degree of constraint violation G(๐ฑg) are evaluated.

Mutation and Crossover

For each target vector ๐ฑg,i, a trial vector ๐ฎg,i is generated using mutation and binomial crossover (rand/1/bin). The integer variables in ๐ฎg,i are rounded before evaluating the vector in the objective function and constraints.

Evaluation and Selection

The trial vector is compared with its corresponding target vector, and the better one is selected according to the following feasibility rules:[2]

  1. Between two infeasible solutions, the one with lower constraint violation is preferred.
  2. If one solution is infeasible and the other one is feasible, the feasible solution is preferred.
  3. Between two feasible solutions, the one with better objective function value is preferred.

However, if the trial vector fails to improve its target but still has a lower objective function value (f(๐ฎg,i)<f(๐ฑg,i)), and no other vector of the same subproblem has been repaired in the current generation(๐ฒg,iuโˆ‰๐˜), this trial vector is repaired.

Reparation and Improvement

The better solution between the repaired vector and its target vector is passed to the population of the next generation ๐g+1. Through these steps, G-DEmi generates a new population in each generation.

The following pseudocode illustrates the algorithm:

   algorithm G-DEmi Framework
   input: NP, CR, F, kmax, Tmin, Evalmax
   output: The best solution so far
   initialize the population Pg
   evaluate f(xg) and G(xg) for each individual in Pg
   Evalโ†1
   gโ†1
   while Eval<Evalmax do
       Yโ†โˆ…
       for each individual xg,i in Pg do
           generate a trial vector ug,i
           round the integer variables in ug,i
           evaluate f(ug,i) and G(ug,i)
           if ug,i is better than xg,i then
               store ug,i into Pg+1
           elseif f(ug,i)<f(xg,i) and yg,iuโˆ‰Y then
               repair ug,i 
               evaluate f(ug,i) and G(ug,i)
               if ug,i is better than xg,i then
                   store ug,i into Pg+1
               end if
               Y=Yโˆชyg,iu
           end if
           update Eval
       end for
       gโ†g+1
   end while

Gradient-based Repair Method

File:Reparaciรณn en evoluciรณn diferencial.png
Solution Repair in G-DEmi

The gradient-based repair method is a crucial component of G-DEmi, designed to address infeasibility in trial vectors generated by differential evolution operators. This method focuses on independently exploring subproblems defined by integer variables. Specifically, to repair a vector with mixed variables [๐ฑ,๐ฒ], only the real variables ๐ฑ are modified while the integer variables ๐ฒ remain fixed.

The method repairs only those trial vectors ๐ฎ that satisfy two conditions: (i) they lost the tournament against their target vectors but have a better objective function value, and (ii) they belong to a subproblem ๐ฒ where no solution has been repaired in the current generation. These two conditions aim to promote the repair of trial vectors with higher potential and ensure that each subproblem is explored independently, avoiding the repair of similar solutions multiple times.

Definition of Constraint Violation

The constraint violation ๐•(๐ฑ) is defined as a vector that contains the violation degree for each inequality g and equality h constraint in a given problem, for a particular solution vector ๐ฑ. Parameters n and m denote the number of inequality and equality constraints, respectively, and ฯต specifies the tolerance for equality constraints. The sign function sgn(h) preserves the sign of the equality violation.

๐•(๐ฑ)=[max⁡(g1(๐ฑ),0)โ‹ฎmax⁡(gn(๐ฑ),0)sgn(h1)โ‹…max⁡(|h1(๐ฑ)|โˆ’ฯต,0)โ‹ฎsgn(hm)โ‹…max⁡(|hm(๐ฑ)|โˆ’ฯต,0)]

The Gradient Matrix of Constraints

The gradient matrix of these constraints with respect to the N components of ๐ฑ, denoted as โˆ‡๐•(๐ฑ), is defined as:

โˆ‡๐•(๐ฑ)=[โˆ‚g1(๐ฑ)โˆ‚x1โˆ‚g1(๐ฑ)โˆ‚x2โ‹ฏโˆ‚g1(๐ฑ)โˆ‚xNโ‹ฎโ‹ฎโ‹ฎโˆ‚gn(๐ฑ)โˆ‚x1โˆ‚gn(๐ฑ)โˆ‚x2โ‹ฏโˆ‚gn(๐ฑ)โˆ‚xNโˆ‚h1(๐ฑ)โˆ‚x1โˆ‚h1(๐ฑ)โˆ‚x2โ‹ฏโˆ‚h1(๐ฑ)โˆ‚xNโ‹ฎโ‹ฎโ‹ฎโˆ‚hm(๐ฑ)โˆ‚x1โˆ‚hm(๐ฑ)โˆ‚x2โ‹ฏโˆ‚hm(๐ฑ)โˆ‚xN]

Finite Difference Approximation

The forward finite difference approximation provides an estimate of these derivatives, defined as:

โˆ‡๐•(๐ฑ)i,jโ‰ˆfi(๐ฑ+ฮ”xโ‹…๐žj)โˆ’fi(๐ฑ)ฮ”x

where ฮ”x represents the step size and ๐žj is a unitary vector of the same dimension as ๐ฑ, with a value of 1 for the j component and 0 for the rest.

Repair Procedure

This repair method aims to transform ๐ฑ into a feasible solution, which involves adjusting the elements of the vector ๐•(๐ฑ) to zero. Iteratively, a repaired vector ๐ฑk+1 can be obtained using Newton-Raphson's method through the following equation, which represents a linear approximation of ๐•(๐ฑk) in the direction of the origin:

๐ฑk+1=๐ฑkโˆ’โˆ‡๐•(๐ฑk)โˆ’1๐•(๐ฑk)

However, it is common that the number of variables differs from the number of constraints. In this case, the โˆ‡๐•(๐ฑk) matrix is non-invertible and the Moore-Penrose pseudoinverse must be used

๐ฑk+1=๐ฑkโˆ’โˆ‡๐•(๐ฑk)+๐•(๐ฑk)

Where โˆ‡๐•(๐ฑk)+ represents the pseudoinverse matrix of the gradient matrix โˆ‡๐•(๐ฑk). A computationally efficient way of finding โˆ‡๐•(๐ฑk)+ is by employing singular value decomposition.

Mixed Variables Repair

A mixed trial vector ๐ฎ=[๐ฑuk,๐ฒu]T is defined, where only the ๐ฑuk component is updated during the iterative repair process. As a result, the constraint violation degree vector and the gradient matrix can be defined as:

๐•(๐ฎ)=๐•(๐ฑuk,๐ฒu)

โˆ‡๐•(๐ฎ)=โˆ‚๐•(๐ฑuk,๐ฒu)โˆ‚๐ฑuk

The repair method follows these steps:

  Algorithm: Gradient-based repair method
  Input: ๐ฎ,kmax,Tmin
  Output: ๐ฎ
  Initialize k=1.
  While none of the stopping criteria is fulfilled:
    Calculate ๐•(๐ฑku,๐ฒu) 
    Calculate โˆ‡๐•(๐ฑku,๐ฒu) 
    Remove zero elements of ๐•(๐ฑku,๐ฒu) and their corresponding values in โˆ‡๐•(๐ฑku,๐ฒu).
    Calculate the pseudoinverse โˆ‡๐•(๐ฑku,๐ฒu)+.
    Calculate ๐ฑk+1u
    Update ๐ฑukโ†๐ฑuk+1.
    Update ๐ฎ=[๐ฑku,๐ฒu]T.
    Increment kโ†k+1.
  End While
  Stopping criteria:
  kโ‰ฅkmax: Maximum number of iterations reached.
  ๐•=0: All elements of ๐• are equal to zero.
  Tuโ‰คTmin: Maximum absolute difference between ๐ฑuk+1 and ๐ฑuk is equal to or lower than Tmin.

Example of Mixed Variables Repair

This repair procedure can be illustrated by the following example. Consider a scenario with one inequality constraint and one equality constraint, as shown below:

g1(๐ฑ,y)=x12+x22+y2โˆ’12โ‰ค0

h1(๐ฑ,y)=x1+x2+yโˆ’5.5=0

Suppose ๐ฎ=[2 1 1]T and an equality tolerance ฯต=1ร—10โˆ’04. In the first iteration (where k=1), ๐ฑ1u=[2 1]T and ๐ฒu=1. Therefore, the vectors ๐•(๐ฑ1u,๐ฒu) and โˆ‡๐•(๐ฑ1u,๐ฒu) are computed as follows:๐•(๐ฑ1u,๐ฒu)=[max⁡(โˆ’6,0)โˆ’max⁡(1.5โˆ’ฯต,0)]=[0โˆ’1.4999]โˆ‡๐•(๐ฑ1u,๐ฒu)=[โˆ‚g1(๐ฑ1u,๐ฒu)โˆ‚x1โˆ‚g1(๐ฑ1u,๐ฒu)โˆ‚x2โˆ‚h1(๐ฑ1u,๐ฒu)โˆ‚x1โˆ‚h1(๐ฑ1u,๐ฒu)โˆ‚x2]=[4211]As you can see, only h1(๐ฑ1u, ๐ฒu) was violated. Therefore, the element of g1(๐ฑ1u, ๐ฒu) needs to be removed from ๐•(๐ฑ1u, ๐ฒu) along with its corresponding values in โˆ‡๐•(๐ฑ1u, ๐ฒu). This leads to ๐•(๐ฑ1u, ๐ฒu)=โˆ’1.4999. Then, โˆ‡๐•(๐ฑ1u, ๐ฒu) and its pseudoinverse โˆ‡๐•(๐ฑ1u, ๐ฒu)+ are computed as follows:โˆ‡๐•(๐ฑ1u,๐ฒu)=[11]โ‡’โˆ‡๐•(๐ฑ1u,๐ฒu)+=[0.50.5]Subsequently, the vector ๐ฑ2u is obtained as follows:๐ฑ2u=[21]โˆ’[0.50.5][โˆ’1.4999]=[2.751.75]The updated vector ๐•(๐ฑ2u,๐ฒu) results in:๐•(๐ฑ2u,๐ฒu)=[max⁡(โˆ’0.3750,0)max⁡(0โˆ’ฯต,0)]=[00]As you can see, the values of (๐ฑ2u,๐ฒu) satisfy all the constraints. Therefore, the trial vector has been successfully repaired, and its new values are ๐ฎ=[2.75 1.75 1]T.

References

  1. โ†‘ Molina-Pรฉrez, Daniel; Portilla-Flores, Edgar Alfredo; Mezura-Montes, Efrรฉn; Vega-Alvarado, Eduardo; Calva-Yaรฑez, Marรญa Bรกrbara (2024-05-31). "Efficiently handling constraints in mixed-integer nonlinear programming problems using gradient-based repair differential evolution". PeerJ Computer Science. 10: e2095. doi:10.7717/peerj-cs.2095. ISSN 2376-5992. PMC 11157599 Check |pmc= value (help). PMID 38855217 Check |pmid= value (help).
  2. โ†‘ Deb, Kalyanmoy (2000-06-09). "An efficient constraint handling method for genetic algorithms". Computer Methods in Applied Mechanics and Engineering. 186 (2): 311โ€“338. Bibcode:2000CMAME.186..311D. doi:10.1016/S0045-7825(99)00389-8. ISSN 0045-7825. Retrieved 2024-06-12.


This article "Gradient-based repair differential evolution" is from Wikipedia. The list of its authors can be seen in its historical and/or the page Edithistory:Gradient-based repair differential evolution. Articles copied from Draft Namespace on Wikipedia could be seen on the Draft Namespace of Wikipedia and not main one.