Penalty function methods for constrained optimization with genetic algorithms

Genetic Algorithms are most directly suited to unconstrained optimization. Application of Genetic Algorithms to constrained optimization problems is often a challenging effort. Several methods have been proposed for handling constraints. The most common method in Genetic Algorithms to handle constraints is to use penalty functions. In this paper, we present these penalty-based methods and discuss their strengths and weaknesses.


INTRODUCTION
Genetic Algorithms (GAs) are stochastic optimization methods based on concepts of natural selection and genetics [11,14]. They work with a population of individuals, each representing a possible solution to a given problem. GAs typically work by iteratively generating and evaluating individuals using an evaluation function. The simplest of GAs work according to the scheme shown in Figure 1. 1. Initialize population of individuals (t) 2. Evaluate each individual using evaluation function (t) 3. Repeat until a stopping criterion is satisfied -Select parents from population (t) -Perform crossover on parents creating population (t+1) -Perform mutation on population (t+1) -Evaluate each individual of population (t+1) Figure 1. The Steps of a Typical Genetic Algorithm They have been applied to a wide range of problems in diverse fields such as engineering, mathematics, operations research etc. (for a variety of applications, see [11,29]). Most of the problems in these fields are stated as constrained optimization problems. Since GAs are directly applicable only to unconstrained optimization, it is necessary to use some additional methods that will keep solutions in the feasible region.
During the past few years, several methods were proposed for handling constraints by GAs [6,7,23,25,36]. Most of these methods have serious drawbacks. While some of them may give infeasible solution or require many additional parameters, others are problem-dependent (i.e. specific algorithm has to be designed for each particular problem). The most popular approach in GA community to handle constraints is to use penalty functions that penalize infeasible solutions by reducing their fitness values in proportion to their degrees of constraint violation [30,36]. In this paper, we analyze these penalty-based methods. The rest of this paper is organized as follows. In the second section, a definition of a constrained optimization problem is given. The third section gives constraint handling methods and a classification of them. The fourth section provides an introduction to penalty functions and explains penalty-based methods in more detail. The last section concludes the paper.

CONSTRAINED OPTIMIZATION
A constrained optimization problem is usually written as a nonlinear optimization problem of the following form: is the vector of solutions, F is the feasible region and S is the whole search space. There are q inequality and m-q equality constraints.
) x ( f is usually called the objective function or criterion function. Objective function and constraints could be linear or nonlinear in the problem. Vector x that satisfies all the constraints is a feasible solution of the problem. All of the feasible solutions constitute the feasible region. Inequality constraints that satisfy 0 ) x ( g i = are called active at x . Using these definitions, nonlinear programming problem is to find a point F

CONSTRAINT HANDLING in GAs
There are several approaches proposed in GAs to handle constrained optimization problems. These approaches can be grouped in four major categories [28] Note that there are other classification schemes of constraint handling methods in GAs. As seen above even though many methods to handle constrained optimization problems within GAs have been proposed this paper will concentrate on penalty function methods.

Penalty Functions
Penalty method transforms constrained problem to unconstrained one in two ways. The first way is to use additive form as follows: where ) x ( p presents a penalty term. If no violation occurs, ) x ( p will be zero and positive otherwise. Under this conversion, the overall objective function now is ) x ( eval which serves as an evaluation function in GAs. Second way is to use multiplicative form, For minimization problems, if no violation occurs ) x ( p is one and bigger than one, otherwise. The additive penalty type has received much more attention than the multiplicative type in the GA community. In classical optimization, two types of penalty function are commonly used: interior and exterior penalty functions. In GAs exterior penalty functions are used more than interior penalty functions. The main reason of this, there is no need to start with a feasible solution in exterior penalty functions. Because finding a feasible solution in many GAs problems is a NP-hard itself. The general formulation of an exterior penalty function is [7], indicates the new objective function to be optimized. G i and L j are the functions of ) x ( g i and ) x ( h j constraints respectively, and r i ve c j are penalty parameters. General formulas of G i and L j are, where β and γ are commonly 1 or 2. If the inequality is hold, > or 0 h j ≠ , a big term will be added to ) x ( φ function such that the solution is pushed back towards to the feasible region. The severeness of the penalty depends on the penalty parameters r i and c j . If either the penalty is too large or too small, the problem could be very hard for GAs. A big penalty prevents to search unfeasible region. In this case GA will converge to a feasible solution very quickly even if it is far from the optimal. A pretty small penalty will cause to spend so much time in searching an unfeasible region; thus GA would converge an unfeasible solution [25].

Death Penalty
This simple and popular method just rejects unfeasible solutions from the population: In this case, there will never be any unfeasible solutions in the population. If a feasible search space is convex or a reasonable part of the whole search space, it can be expected that this method can work well [30]. However, when the problem is highly constrained, the algorithm will spend a lot of time to find too few feasible solutions. Also, considering only the points that are in feasible region of the search space prevents to find better solutions.

Static Penalties
In the methods of this group, penalty parameters don't depend on the current generation number and a constant penalty is applied to unfeasible solutions. Homaifar et al. [15] proposed a static penalty approach in which users describe some levels of violation. Steps of the method are as follows: • Generate l levels of violation for each constraint, • Generate penalty coefficient R ij (i=1,...,l ; j=1,…,m) for each level of violation and each constraint. The bigger coefficients are given to the bigger violation levels, • Generate a random population using both feasible and unfeasible individuals, where R ij indicates the penalty coefficient corresponding to j th constraint and i th violation level. m is the number of constraints. Homaifar et al. [15] transformed equality constraints to inequality constraints by 0 ) The disadvantage of this method is the large number of parameters that must be set. In this method, for m constraints it is needed to set m(2l+1) parameters in total. For instance, for m=5 constraints and l=4 levels of violation the total of 45 parameters should be set. Michalewicz [31] shows that the quality of solutions is very sensitive to the values of these parameters. Kuri Morales and Quezada [20] suggested an another static penalty approach. In this method, individuals are evaluated using the following formula: where s is the number of non-violated constraints and m is the total number of constraints. Constraints can be equality or inequality. K is a large positive constant. Kuri Morales and Quezada [20] used this constant as 1x10 9 . There is only one restriction on K. K should guarantee that an unfeasible individual must be graded worse than a feasible individual. This approach uses information about the number of violated constraints, not the amount of constraint violation.

Dynamic Penalties
In the methods of this group, penalty parameters are usually dependent on the current generation number. Jones and Houck [16] suggested following dynamic function to evaluate individuals at each generation t: where C, α and β are constants determined by users. Joines and Houck [16] used C=0.5, α=1 or 2 and β=1 or 2. ) x , ( SVC β is described as This dynamic method increases the penalty as generation grows. The quality of a possible solution is very sensitive to changes of α and β values. There is no explanation about the sensitivity of the method for different values of C. Even Joines and Houck [16] stated that they used good selection of C=0.5 and α=β=2, Michalewicz [31] gave some examples to state that these parameter values cause premature convergence. He also showed that the method converges an unfeasible solution or a solution that is so far from an optimal solution. Kazarlis and Petridis [17] used the following dynamic penalty function, where A=severity factor, m=total number of constraints, Kazarlis and Petridis [17] tried linear, quadratic and cubic forms of V(g) and received the best performance by where G is the total number of generations. This method needs some parameters depending on the problem. It is very hard to determine these parameters. Kazarlis and Petridis [17] did not state why they took A=1000 and B=0 in their work.

Annealing Penalties
There are some methods based on annealing algorithm in this group. Michalewicz and Attia [24] developed a method (GENECOP II) based on the idea of simulated annealing. Steps of this method are as follows: • Separate all constraints into four subsets: linear equations, linear inequalities, nonlinear equations and nonlinear inequalities, • If τ<τ f (freezing point) stop the procedure, otherwise, -Diminish τ, -Use the best solution as a starting point for next generation, -Update A, -Repeat the previous step of the main part.
GENOCOP II distinguishes between linear and nonlinear constraints. In the algorithm only active constraints are under consideration at every iteration. While the temperature τ decrease, selective pressure on unfeasible solutions increases. As an interesting point of the method, there is no diversity of the initial generation that consists of multiple copies of a solution satisfied all linear constraints. At each generation the temperature τ decreases and the best solution found at the previous iteration is used as a starting point of next iteration. The algorithm is terminated at a previously determined freezing point τ f . The method is very sensitive to values of the parameters. There is no specific way how to decide these parameters for any particular problem. Michalewicz In the formula, α(M,T) depends on the parameters M, the measurement of constraint violation, and temperature T, a function of running time of the algorithm. As execution proceeds, T approaches to zero. Carlson Skalak et al.
[5] used the following function for α(M,T): Initial value of penalty parameter is small but increases over time so that unfeasible solutions found from last generations can be eliminated. For T, is used. Here, t indicates the last temperature used at the previous iteration.

Adaptive Penalties
In the methods of this group, penalty parameters are updated for every generation according to information gathered from the population. Hadj-Alouane and Bean [12] evaluated an individual by following formula: Here penalty parameter λ(t) is updated at every generation k: (19) where Case # 1 denotes all of the best individuals in the last k generations are feasible, and Case # 2 denotes they are not feasible. In other words, if all best individuals of last k generations are feasible, penalty term λ(t+1) for generation (t+1) decreases. If they are unfeasible penalty term is increased. Otherwise, i.e. if the best individuals in the last k generations consist of feasible and unfeasible solutions, penalty term does not change. The main problem of this method is how to choose k, β 1 and β 2 . Smith and Tate [35] suggested to evaluate each individual by following formula: (20) where B all is the value of the optimal objective function regardless of constraints, B feas is the value of the optimal objective function satisfying constraints, ) x ( g i is the value of violation for constraint i, k is the severity parameter and NFT (called Near Feasibility Threshold) is the threshold distance from the feasible region F. Unfeasible solutions at this distance are considered to be reasonable since they are very close to the feasible region. Disadvantage of this method is how to choose NFT that is problem dependent Yokota et al. [37] took the multiplication form as the evaluation function. Individuals are evaluated by the following formula: is the value of violation for constraint i . It is defined as follows, For a feasible solution is satisfied so for NFT=b i this approach is a special case of the approach of Smith and Tate [35]. Gen and Cheng [10] improved the approach presented above by giving high penalties for unfeasible solutions. Evaluation function is as follows: In the formula above, ) The purpose of this method is to protect the diversity of the population and to protect the unfeasible solutions, which form the big part of the population in the early generations, from high penalties. Gen and Cheng [10] claims that their approach is independent from the problem. However, this approach is only used in an optimization problem so their claim can be appreciated as suspicious.

Segregated GA
Le Riche et al. [21] developed a segregated GA (sometimes it is called as yet another method) that uses two penalty parameters (say, p 1 and p 2 ) in two different populations. The aim is to overcome the problem of too high and too low penalties (see section 3.1). If a small value is selected for p 1 and a large value for p 2 , a simultaneous convergence from feasible and unfeasible sides can be achieved. The method works as follows: -Generate 2 x pop individuals at random (pop is the population size), -Design two different evaluation functions: Le Riche et al. [21] applied their method to laminated design problem and obtained excellent results. The way of choosing penalties for each of two populations is again the main problem in the method.

Co-evolutionary Penalties
Coello [8] developed a method of co-evolutionary penalties that split the penalty into two values, so that the GA has enough information about the number of constraint violations and the amounts of the violation. Each individual is evaluated by the formula: is the value of the objective function, w 1 and w 2 are two penalty parameters and coef is the sum of the amounts by which the constraints are violated. coef is defined as follows: where initial value of viol is zero and increases by one for each constraint that is violated. This approach introduces the definition of four parameters. If they are not carefully chosen, a lot of evaluation function assessments may be required. Note that only inequality constraints are considered in this method.

CONCLUSIONS
Real-world optimization problems have constraints that must be satisfied by the solution of the problem. A variety of constraint handling methods have been suggested by many researchers Each method has its own advantages and disadvantages. The most popular constraint handling method among users is penalty function methods. In this paper we discussed these methods and gave their weakness and strengths. It is impossible to say one of the methods is the best for every problem. The main problem of the most methods is to set appropriate values of the penalty parameters. Consequently, users have to experiment with different values of penalty parameters.