A Constraint-Handling Technique for Genetic Algorithms using a Violation Factor

Over the years, several meta-heuristic algorithms were proposed and are now emerging as common methods for constrained optimization problems. Among them, genetic algorithms (GA's) shine as popular evolutionary algorithms (EA's) in engineering optimization. Most engineering design problems are difficult to resolve with conventional optimization algorithms because they are highly nonlinear and contain constraints. In order to handle these constraints, the most common technique is to apply penalty functions. The major drawback is that they require tuning of parameters, which can be very challenging. In this paper, we present a constraint-handling technique for GA's solely using the violation factor, called VCH (Violation Constraint-Handling) method. Several benchmark problems from the literature are examined. The VCH technique was able to provide a consistent performance and match results from other GA-based techniques.


Introduction
Many optimization problems in engineering are highly nonlinear, containing a mixture of discrete and continuous design variables subject to a series of constraints. Such problems are known as constrained optimization problems or nonlinear programming problems in which traditional calculus-based methods struggle to solve. These numerical optimization methods are highly deterministic and are convenient in finding the global optimum for simple problems by improving the solution in the vicinity of a starting point. However, they have major drawbacks with complex engineering problems i.e.: difficulty in computing the derivatives, sensitivity to the initial conditions and a large memory requirement.
Because of these downsides, over the years, several heuristic and meta-heuristic algorithms were proposed. They are now emerging as popular methods for the solution of complex engineering problems. These algorithms are purely stochastic and consist of approximate methods but on the contrary are derivativefree techniques. Heuristic methods try to find decent solutions that are easily reachable but are not necessarily the best solutions by means of trial and error. Further developments of heuristics are the so-called meta-heuristic algorithms: A higher level of optimization compared to heuristic algorithms. The meta-heuristic techniques include: genetic algorithms (GA, Holland (1975)), simulated annealing (SA, Kirkpatrick and Vecchi (1983)), particle swarm optimization (PSO, Eberhart and Kennedy (1995)), ant colony optimization (ACO, Dorigo et al. (1996)), tabu search (Glover 1977) etc. Among all metaheuristics, genetic algorithms (proposed by Holland (1975)) are one of the most popular evolutionary algorithms (EA's). By mimicking the basic Darwinian mechanism from the famous book "The Origin of Species" (Darwin and Bynum, 2009) defined natural selection of biological systems or the principle of the survival of the fittest. GA's try to evolve the population of chromosomes that are fitter by applying three key evolutionary operators: selection, crossover and mutation. The attempt is to produce a new generation or descendants with a better fitness value than their parents.
Most engineering optimization design problems are difficult to solve using conventional algorithms since they comprise problem-specific constraints (linear, non-linear, equality or inequality). Despite the success of GA in a wide-range of applications, solving constrained optimization problems is no easy task. The most common technique is to apply penalty functions. As a result, the problem is converted from a constrained to an unconstrained optimization problem. The major drawback of these penalty functions is the requirement of a definition and proper tuning of their parameters, which can be challenging and problematic.
Hence, the aim of this paper is to answer one of the most stimulating questions encountered in metaheuristics: constraint-handling in evolutionary algorithms. In this paper, we will use a GA as a numerical tool to propose a constraint-handling technique that eliminates the use of penalty functions. We present a parameter-free constraint-handling technique for GA using the violation factor; hence, the method will be referred to as VCH (Violation Constraint-Handling). This paper is organized as follows: Section 2 contains the most relevant constrainthandling techniques proposed by previous works. Then, the VCH approach is described in Section 3 and validated with the numerical examples in Section 4. Our technique and results are discussed in Section 5 and the conclusion and some paths for future research are provided in Section 6.

Literature Review
Below are the most relevant constraint-handling techniques used in EA's for the purpose of this study. The reader is referred to the following surveys (Coello, 2002;Coello and Carlos, 1999;Dasgupta and Michalewicz, 1997;Gen and Cheng, 1996;Michalewicz, 1995a;1995b;Michalewicz and Schoenauer, 1996;Yeniay, 2005) for further details, explanations and comparison.

Penalty Methods
The penalty methods are the most common approaches for constraint-handling in EA. Penalty functions were initially suggested by (Courant, 1943) and later extended by (Carroll, 1961) and (Fiacco and McCormick, 1966). Generally, the penalty term is determined from the amount of constraint violation of the solution vector. The formulation of the exterior penalty functions can be expressed as: is the new fitness function to be optimized, The determination of the magnitude of the penalty term is a vital concern. The penalty term cannot be too high or else the algorithm will be locked inside the feasible domain and cannot move towards the border with the infeasible area. Too low, the term will be irrelevant in regard to the objective function and the search will remain in the infeasible region. Knowing how to exploit the search space in order to guide the search in the utmost desired direction is still unclear and rather challenging.

Static Penalty
In this group, the penalty factors remain constant during the evolution process and do not vary during each generation. A popular method is to define several levels of violation and attribute to each higher level a greater penalty coefficient A ki . Homaifar et al. (1994) proposed to convert the equality constraints into inequality constraints and evaluate the following: Other researchers (Hoffmeister and Sprave, 1996;Morales and Quezada, 1998) have proposed interesting static penalties, but the main downside in these approaches are the necessity of a high number of parameters. They are difficult to describe and may not always be easy to obtain for real-world applications.

Dynamic Penalty
In this category, the penalty function depends on the generation number and usually the penalty term will increase over each generation. Joines and Houck (1994) evaluate each individuals using the following expressions: and: The cooling parameters α and β are user defined constants, g i and h j are the inequality and equality constraints respectively.
A common dynamic penalty function is based on the notion of simulated annealing (Kirkpatrick and Vecchi, 1983;Michalewicz and Attia, 1994), where the penalty term is updated on every occasion the solution is locked in near a local optimal. Dynamic penalties that learn from the search process are called adaptive penalty functions.
An incorrect choice of the penalty factor may lead to a local feasible solution or an infeasible solution (Back et al., 1997). In regards to the simulated annealing, the solution is extremely sensitive to the cooling parameters. Coello (2000b;1999) proposed to evaluate the following fitness function with only inequality constraints as follows:

Co-Evolution
with w 1 and w 2 two integers considered as penalty factors, Viol is an integer that is incremented for each violated constraint and CV is the sum of all violated constraints expressed as: The idea of this method is to use a population to evolve the solution vector and another to develop the penalty factors w 1 and w 2 . This technique still requires the definition of four parameters and according to the author, they must be empirically determined. A major drawback of this penalty method is that it is very subtle to variations in the parameters in addition of their rigorous definition and high computational cost.

Death Penalty
A major concern in optimization algorithms in general and in EA's in particular is the element of 'infeasible solutions'. The simplest way is to reject the individual-(hence 'death') when at least one constraint is violated. A new point is generated until a feasible solution is found, therefore making this approach a lengthy process with the high risk of stagnating.

Separation of Objectives and Constraints
There are more than a few proposed approaches that separate the amount of constraint violation and the objective function. For instance, Powell and Skolnick (1993) with A a constant to be determined by the user. The main difficulty with Powell and Skolnick (1993) is not the definition of the penalty factor A but rather with the concept of superiority of feasible over infeasible solutions. Deb (2000) uses a similar separation approach and evaluates the individuals using: where, f worst is the worst feasible solution in the population and ( ) i k x include the inequality constraints and the transformed equalities. The constraints are normalized since they are each expressed in different units and to avoid any preference.

Proposed Technique
One of the key complications in using GA for practical engineering optimization applications is the design of the fitness function. When dealing with constrained problems, we must find a mean to estimate the closeness of an infeasible solution to the feasible region. By simply examining the previously proposed constraint-handling techniques, several key points can be derived about the existing methods. Initially, they are diverse, yet require the definition and fine-tuning of at least one parameter.
Apart of being an arduous procedure to define and control the penalty terms, we claim that such methods deviate from the essence of the philosophy of the evolutionary algorithms (i.e., techniques based on the principle of natural selection). Arguably, the most widely used algorithm is the genetic algorithm developed by (Holland, 1975). Despite the success of GA's as optimization techniques in many engineering applications, they are mostly applied on unconstrained problems. Therefore, the main proposal of the authors is to suggest a constraint-handling technique that preserves the notions of the GA. The key motif is to keep the fitness function equivalent to the designer's objective and eliminate any additional penalty functions. The core structure of GA is analogous to the theory of biological evolution mimicking the principle of the survival of the fittest. The proposed constraint-handling technique is directly inspired from the nature of genetic algorithms, since the objective function is preserved during the evolution process. In this study, we will implement the proposed VCH method inside a genetic algorithm due to its advantages: a) Adaptability: Does not oblige the objective function to be continuous or in algebraic form. b) Robustness: Escapes more easily from local optimums because of its population-based nature. c) Equilibrium: Provide a good balance between exploitation and exploration. Do not need specific domain information, but can be further exploited it if provided. d) Flexibility: GA's are simple and relatively easy to implement.
We are interested in the general nonlinear programming problems (NLP); a minimization or maximization of a constrained optimization problem in which we want to: Subject to certain set of constraints: where, x is the solution vector with p variables These constraints can be either linear or non-linear. Most constraint-handling approaches tend to deal with inequality constraints only. Therefore, a customary approach is to transform equality to inequality constraints using the following expression: where ∈ is the tolerance (usually a very small value, user-defined). This is justified by the fact that obtaining sampling points that satisfy the equality exactly is very difficult and hence, some tolerance or allowance is used in practice.
We shall first illustrate the overall procedure of the VCH technique for GA. In the subsequent, we assume the following: • Real-coded GA according to which each chromosome is a string of the form 〈d 1 ,d 2 ,…,d m 〉, where d 1 , d 2 …, d m are real numbers Step 1: Initialization of the population: The design variables are randomly initialized to satisfy the upper and lower constraints as follows: Step 2: Evaluation of the fitness function, normalized constraints and constraint violation: For each individual x , the fitness function ( ) f x is calculated along with the resulting constraints. All the equality constraints are converted into inequalities using (9), hence a total of n+m inequality constraints. These equations are all normalized and therefore become in the form of: Furthermore, the amount of Constraint Violation (C.V) of the normalized constraints G k , (k = 1, …n+m), is determined using: In addition, the number of violation is defined as the percentage of violated constraints for a given solution: .
number of violated constraints N V n m = + (14) Step 3: Sorting of the population: The population is separated into two families; feasible solutions (V 0 ) and unfeasible (V 1 ) consisting of individuals that violate at least one constraint. The first set (V 0 ) is sorted with respect to the fitness value (ascending order, assuming a minimization problem). The second family (V 1 ) is sorted according to the proposed pair-wise comparison rules. In the VCH approach, we adopted a feasibility-based rule, a set of rules to evolve the population at each generation: • If one individual is infeasible and the other is feasible, the winner is the feasible solution • If both individuals are feasible, the winner is the one with the highest fitness value Step 4: Formation of Elites: The sorted families V 0 and V 1 form the new population. The first Nelite individuals are the elites, which are kept intact to the next generation with no alteration. This selection operator, one form of elitism consists of a driving force for self-organization or convergence and is essentially an intensive exploitation.
Step 5: Reproduction by crossover and mutation: A tournament-based technique is used to perform the crossover among the individuals of the population. Whole arithmetic crossover (Michalewicz and Janikow, 1996;Michalewicz and Nazhiyath, 1995;Michalewicz and Schoenauer, 1996) is applied in our algorithm. It is composed of a linear combination of two parent vectors to be crossed (as shown in 15). This genetic operator uses simple static parameter φ (a random number between 0 and 1). Any linear combination of two feasible points in a convex domain will produce another feasible point (Michalewicz, 1992).
The reproduction and crossover operators are programmed to imitate the paradigm of the survival of the fittest. The crossover operator is a recombination of two chromosomes, an operation that ensures an efficient exploitation in the local search within a subspace. Therefore, the offspring are spread over the entire feasible space. The crossover-elitism pair eases the achievement of global optimality. In contrast, the mutation operator is a randomization mechanism for global search and exploration.
Step 6: Stopping criteria: Steps 2-5 are repeated until either the stopping criteria is respected or the maximum number of generation is attained. We implemented a severe stopping criterion on the best solution of each generation; the relative error between the present and the past generation for each design variable must remain less than the user-defined tolerance for at least N amount of generations.
As the population evolves, the proposed VCH process will lead the search to reach feasible regions, much similar to a severe penalty function. Nonetheless, in order to maintain infeasible solutions near the feasible region, at each generation, the infeasible solution with the lowest C.V and best objective function value will be kept in the population for the next generation. As a result, the population will most likely have fewer infeasible solutions located in promising areas of the search space. The VCH approach does not use any penalty function to handle the constraints. Instead, it can be seen to have a mechanism that encourages the solutions close to the feasible region in favorable areas of the design space to remain in the population. This does not add substantial computational cost.
An optimization problem is called a convex programming problem if the objective function and the constraint functions are both convex. Originally, EAs were developed to solve unconstrained problems. Constrained optimization is a computationally challenging task, mainly if the constraint functions are nonlinear and/or nonconvex. A positive feature of the proposed VCH approach is that it does not care about the structure of the constraint functions (linear or nonlinear, convex or nonconvex). An accelerated VCH technique for convex optimization problems is to generate an initial population with only feasible solutions. Thereafter, the reproduction by means of an arithmetic crossover (as per expression 15) will continue to generate feasible solutions (Michalewicz, 1992). Testing for convexity or concavity can be done by evaluating if the Hessian matrix ( ) is positive semi definite (for minimization problems). The accelerated genetic algorithm for the solving of constrained problems in the case of convex design and objective spaces would not require the use of any feasibility-rules. Rather, solutions with high fitness values are preferred since all the individuals of the population are feasible (as described in Fig. 1).

Numerical Examples
In order to validate the proposed constraint handling technique, several examples taken from the literature will be used. These numerical examples are all constrained optimization problems that include linear and nonlinear constraints. These are benchmark optimization problems that have been previously evaluated by other GA-based techniques, which is useful to investigate and demonstrate the quality and usefulness of the proposed VCH approach.
The algorithm is implemented in Matlab (R2013 a Student Version 8.1.1.604) run by a 2.90 GHz Intel® Core™ i7-3520M CPU (4 Duo processor) with 4096 MB of Random Access Memory (RAM). The number of crossover-ed and mutated individuals in the population (100 chromosomes) are 94 and 5 respectively.
That means only one individual is preserved to the following generation based on elitism. The termination criterion is taken as either the reach of the maximum number of generations (set to 500 in all examples) or the achievement of the relative error on the design vector (set to be equal to 10 −6 ). To demonstrate the effectiveness of the proposed VCH, the best, mean, median, worst and fitness evaluations are recorded for 20 independent runs. We are concerned with the efficiency of the technique in terms of CPU time, because we are particularly interested in solving engineering optimization problems, for which the cost of fitness evaluations is generally high. However, it is more convenient to adopt the number of fitness evaluations since it is independent of the implemented hardware. The stopping condition employed in the numerical simulations is identical to the criteria described in step 6.

Himmelblau's Nonlinear Optimization Problem
This problem was originally proposed by (Himmelblau, 1972) and has been widely used as a point of reference for nonlinear constrained optimization problems and several other constraint handling techniques that use penalties. In this formulation, there are five design variables [x 1 , x 2 , x 3 , x 4 , x 5 ], six nonlinear inequality constraints and 10 boundary conditions.
The problem can be stated as follows:

Himmelblau's Nonlinear Problem
The best solution was found to be ( )  Table 2). The worst solution found was ( ) f x = -30800.89145, which is better than 75% of the reviewed methods as per Table 1. The significantly fewer function evaluations reduced the computational cost of the optimization procedure to an average CPU time of 0.52 s/run for 20 independent runs.

Minimization
of the Weight of a Tension/Compression Spring This optimization problem was described by (Arora, 1989) and (Belegundu, 1983) and it consists of minimizing the weight of a tension/compression spring, subject to constraints on minimum deflection, shear stress, surge frequency, outside diameter and on the design variables. The later are the wire diameter d (= x 1 ), the mean coil diameter D (= x 2 ) and the number of active coils N (= x 3 ).
The problem is expressed as follows: ) 5108

Design of a Pressure Vessel
This problem was originally proposed (Sandgren, 1988;1990) for the design of a pressure vessel with minimal overall cost (material, forming and welding). The air storage tank has a working pressure of 2000 psi and a maximum volume of 750 ft 3 . There are four design variables namely; T S ( = x 1 )thickness of the shell, T h ( = x 2 ) thickness of the head, R (= x 3 ) inner radius and L(= x 4 ) length of the cylindrical section of the vessel, not including the head. T S and T h are integer multiples of 0.0625 inch and R and L are continuous.
The following pressure vessel design problem is taken from Kannan and Kramer (1994)

Welded Beam Design Problem
The welded beam problem has been used as a benchmark problem originally proposed by (Rao, 1996).  Coello (2000b;1999) 6293.843232 6308.14965 7.41328537 900000 Table 7. Optimal results for welded beam design problem (NA = Not Available) Design variables The beam is designed for minimum cost subject to constraints on shear stress (τ), bending stress in the beam (σ), buckling load on the bar (P c ) end deflection of the beam (δ) and side constraints. In this problem there are four design variables namely; thickness of the beam h(= x 1 ), length of the welded joint l (= x 2 ), width of the beam t(= x 3 ) and thickness of the beam b (= x 4 ). It is important to note that in this problem, there are several models in the overviewed literature, with different number of constraints and variable definitions. In the present study, the results for the following optimization formulation are presented: where, τ is the shear stress in the weld (it has two components namely primary stress τ′ and secondary stress τ′′), τ max is the allowable shear stress of the weld (= 13600 psi), σ the normal stress in the beam, σ max is the allowable normal stress for the beam material (= 30000 psi), P c the buckling load, P the load (= 6000 lb) and δ the beam end deflection:

Welded Beam Design
The presented algorithm has been tested on this optimization problem and compared with the best solutions by previous methods reported in Table 7. The optimal design vector was found to be: x 1 = 0.20578, x 2 = 3.47294, x 3 = 9.02922, x 4 = 0.20608 with an optimal fitness value ( )

Discussion
In this paper, we have developed a constrainthandling method for GA, free of any penalty parameters using only the violation factor called VCH (as summarized in the flowchart of Fig. 1) that is capable of sorting a population with both feasible and infeasible individuals. In the proposed VCH method, at a given iteration, the individuals of the population are never compared in terms of both objective function value and constraint violation information. Essentially, the main motif is to keep the fitness function equivalent to the designer's objective function and therefore the conversion of the constrained problem into an unconstrained one is no longer required.
Genetic algorithms try to mimic the principle of the survival of the fittest, where newer generations are evolved in attempt to produce descendants with a better 'fitness'. Because at all times the fitness function is equal to the objective function to be minimized, our proposed VCH technique is more conforming with the biological fundamentals of genetic algorithms. A major drawback of many techniques in the literature is that the constraint handling method requires a feasible initial population. For some problems, finding a feasible solution is NP-hard and even impossible for the problems with conflicting constraints. In the VCH approach, it is not required to have a feasible initial population. There are available techniques that ensure feasibility of the population when dealing with linear constraints such as (Yun, 2005) by means of mathematical programming.
Compared to other constraint-handling techniques based on penalty functions, the VCH method was able to provide a consistent performance and demonstrated to be simpler, faster and delivered reliable optimal solutions without any violation of the constraints. As the population evolves, the VCH method will lead the search to reach faster feasible regions. This is revealed in Fig. 2, with the convergence of the average constraint violation of the elites towards zero (no violation) as the population evolves. The VCH method allows the closest solutions to the feasible region in favorable areas of the search space to remain in the population. Specific methods such as the reduced gradient method, cutting plane method and the gradient projection method are appropriate. However, they are only fitting either to problems having convex feasible regions or with few design variables. Furthermore, the overall results suggest that the proposed approach is highly competitive and was even able to contest (some cases improve) the results produced by other methods, some of which are more difficult constraint-handling techniques applied to genetic algorithms. The VCH algorithm was tested on several benchmark examples and demonstrated its ability to solve problems with a large number of constraints.

Conclusion and Future Work
The diversity and popularity of evolutionary algorithms does not imply that there are no problems that need urgent attention. From one point of view, these optimization algorithms are very good at obtaining optimal solutions in a practical time. On the other, they still lack in balance of accuracy, computational efforts, global convergence and the tuning and control of their parameters. Nature has evolved over millions of years, providing a rich source of inspiration for researchers to develop diverse algorithms with different degrees of success and popularity. Such diversity and accomplishment does not signify that we should focus solely on developing more algorithms for the sake of algorithm development, or even worse for the sake of publication. This attitude distracts from the search for solutions for more challenging and truly important problems in optimization and new algorithms may be proposed only if they: • deliver truly novel ideas • demonstrate to be efficient techniques that solve challenging optimization problems (that are not solved by existing methods) • verify to the "3-self" (self-adaptive, self-evolving and self-organizing algorithms) It is vital to state that during the development of this technique, several other versions of the same approach were examined without much success. For example, different reproduction probabilities (crossover and mutation) were tested. The authors avoided a high mutation rate to prevent the method of becoming a random search, but choose to keep it at 0.05 for a more robust global search and exploration. More than a few other crossover techniques were examined but the objective of this paper was not to present a comparative study on their performance but rather present the parameter-free constraint-handling technique using the violation factor. It is still unclear how to achieve optimal balance of exploitation and exploration by proper parameter tuning of the evolutionary operators of GA in general and in the VCH algorithm in particular. The crossover operator ensured an efficient exploitation in the local search within a subspace and can provide good convergence in local subspace. The selection and mutation operators enabled the GA to have a higher ability for exploration. It could be argued that the VCH technique is competent because it does not require any fine-tuning of the GA, which is normally performed by trial and error and is time consuming. Finally, it is worth mentioning that for many of them, it is unclear if the authors implemented a stopping criterion or not. In our study however, a severe criterion was introduced based on the minimum relative error of the design variables. Moreover, the user-defined tolerance has to be respected for a number of generations before the execution is terminated.
The main challenges that still require further examination are: The proof of convergence of some EA, control and tuning of parameters, the solution of large scale applications (e.g., the traveling salesman problem) and finally tackling Nondeterministic Polynomial (NP)hard problems. Solving these issues is becoming more imperative than ever before. Among these matters is the open question of constraint-handling in GA specifically to solve engineering optimization problems. The insights gained by the proposed VCH technique should have an impact on the manner constrained problems are solved.
Lastly, the authors suggest in the upcoming work, further numerical simulations could be investigated for more complex optimization problems. It would be motivating to explore the integration of VCH technique in other EA's such as Particle Swarm Optimization (PSO), ant Colony Optimization (ACO), Bee Colony Optimization (BCO) and Differential Evolution (DE). Parameter tuning of the evolutionary operators in GA is an active area of research and could be examined in future work. Present work is aimed at introducing the proposed constraint-handling technique in a multi objective platform for the optimization of the composite lay-out of wind turbine blades using a genetic algorithm as discussed in (Chehouri et al., 2015).