Vous êtes sur la page 1sur 13

Introduction to Genetic Algorithm

Index
1. Introduction 2. Applications of GA 3. Comparison of GA and Traditional optimization techniques 4. Steps for implementing GA 5. Future Work 6. References

INTRODUCTION

Genetic algorithms (GAs) are adaptive heuristic search algorithm based on the evolutionary ideas of natural selection and genetics. As such they represent an intelligent exploitation of a random search used to solve optimization problems. Although randomized, GAs are by no means random; instead they exploit historical information to direct the search into the region of better performance within the search space. The basic techniques of the GAs are designed to simulate processes in natural systems necessary for evolution, especially those follow the principles first lay down by Charles Darwin of Survival of the Fittest. Since in nature, competition among individuals for scarce resources results in the fittest individuals dominating over the weaker ones. The GA maintains a population on n chromosomes (solutions) with associated fitness values. Parents are selected to mate, on the basis of their fitness, producing offspring via a reproductive plan. Consequently highly fit solutions are given more opportunities to reproduce, so that offspring inherit characteristics from each parent. As parents mate and produce offspring, room must be made for the new arrivals since the population is kept at a static size. Individuals in the population die and are replaced by the new solutions, eventually creating a new generation once all mating opportunities in the old population have been exhausted. In this way it is hopes that over successive generations better solutions will thrive while the least fit solutions die.

Applications of GA
y Automotive Design: Using Genetic Algorithms to both design composite materials and aerodynamic shapes for race cars and regular means of transportation (including aviation) can return combinations of best materials and best engineering to provide faster, lighter, more fuel efficient and safer vehicles for all the things we use vehicles for. Rather than spending years in laboratories working with polymers, wind tunnels and balsa wood shapes, the processes can be done much quicker and more efficiently by computer modeling using GA searches to return a range of options human designers can then put together however they please.

Engineering Design: Getting the most out of a range of materials to optimize the structural and operational design of buildings, factories, machines, etc. is a rapidly expanding application of GAs. These are being created for such uses as optimizing the design of heat exchangers, robot gripping arms, satellite booms, building trusses, flywheels, turbines, and just about any other computer-assisted engineering design application. There is work to combine GAs optimizing particular aspects of engineering problems to work together, and some of these can not only solve design problems, but also project them forward to analyze weaknesses and possible point failures in the future so these can be avoided.

Biomimetic Invention: Biomimicry or biomimetics is the development of technologies inspired by designs in nature. Since GAs is inspired by the mechanisms of biological evolution, it makes sense that they could be used in the process of invention as well. GAs rely primarily on something called implicit parallelism (like to like), using mutation and selection in secondary roles toward a design solution. GA programmers are working on applications that not only analyze the natural designs

themselves for a return on how they work, but can also combine natural designs to create something entirely new that can have exciting applications.

Encryption and Code Breaking: On the security front, GAs can be used both to create encryption for sensitive data as well as to break those codes. Encrypting data, protecting copyrights and breaking competitors' codes have been important in the computer world ever since there have been computers, so the competition is intense. Every time someone adds more complexity to their encryption algorithms, someone else comes up with a GA that can break the code. It is hoped that one day soon we will have quantum computers that will be able to generate completely indecipherable codes. Of course, by then the 'other guys' will have quantum computers too, so it's a sure bet the spy vs. spy games will go on indefinitely.

Computer Aided Molecular Design: GAs are used to aid in the understanding of protein folding, analyzing the effects of substitutions on those protein functions, and to predict the binding affinities of various designed proteins developed by the pharmaceutical industry for treatment of particular diseases. The same sort of GA optimization and analysis is used for designing industrial chemicals for particular uses, and in both cases GAs can also be useful for predicting possible adverse consequences. This application has and will continue to have great impact on the costs associated with development of new chemicals and drugs. Optimizing Chemical Kinetic Analysis: GAs is proving very useful toward optimizing designs in transportation, aerospace propulsion and electrical generation. By being able to predict ahead of time the chemical kinetics of fuels and the efficiency of engines, more optimal mixtures and designs can be made available quicker to industry and the public. Some computer modeling applications in this area also simulate the effectiveness of lubricants and can pinpoint optimized operational vectors, and may lead to greatly increased efficiency all around well before traditional fuels run out. [2]

Comparison between Traditional Optimization and GA technique


1. In GA, the coding discretizes the search space even if the function is continuous. This means that even discontinuous function can be optimized using GA. But, in most traditional methods, differentiation is to be carried out and this is not possible for discontinuous functions. 2. GAs work with a population of points instead of a single point, as in most traditional methods. 3. Using GAs, multiple optimal solutions can be reached; whereas in traditional methods only a single optimal solution can be obtained. 4. For implementing GAs, no auxiliary information about the function is required. 5. GAs are probabilistic while the traditional one is deterministic. [1]

Steps for implementing GA


To illustrate the working principles of GAs, an unconstrained optimization problem is considered. Let us consider following maximization problem, Maximize f(x) CODING: In order to use GAs to solve the above problem variables Xi's are first coded in some string structures. It is important to mention here that the coding of the variables is not absolutely necessary. Xi (l) Xi Xi (u) , where i=1, 2, 3, 4.N.

Binary-coded strings having 1's and 0's are mostly used. The length of the string is usually determined according to the desired solution accuracy. For example, if four bits are used to code each variable in a two-variable optimization problem, the strings (0000 0000) and (1111 1111) would represent the points (x1l,x2l) T (x1u,x2u )T respectively, because the sub-strings (0000) and (1111) have the minimum and the maximum decoded values. Any other eight bit string can be found to represent a point in the search space according to a fixed mapping rule. Usually, the following linear mapping rule is used:

In the above equation, the variable xi is coded with sub-string si of length . The decoded value of a binary sub-string si is calculated as where si (0,1).

FITNESS: GAs mimic the survival-of-the-fittest principle of nature to make a search process. Therefore, GAs are naturally suitable for solving maximization problems. Maximization problems are usually transformed into maximization problem by suitable transformation. In general, a fitness function F(i) is first derived from the objective function and used in successive

genetic operations. Fitness in biological sense is a quality value which is a measure of the reproductive efficiency of chromosomes. In genetic algorithm, fitness is used to allocate reproductive traits to the individuals in the population and thus act as some measure of goodness to be maximized. This means that individuals with higher fitness value will have higher probability of being selected as candidates for further examination. Fitness Function F(X) =f(x), for maximization problem F(X) =1 / (1+f(x)), for minimization problem

OPERATORS: Reproduction: It is an operator that makes more copies of better strings in a new population. Reproduction is usually the first operator applied on a population. Reproduction selects good strings in a population and forms a mating pool. This is one of the reasons for the reproduction operation to be sometimes known as the selection operator. Thus, in reproduction operation the process of natural selection causes those individuals that encode successful structures to produce copies more frequently. To sustain the generation of a new population, the reproduction of the individuals in the current population is necessary. For better individuals, these should be from the fittest individuals of the previous population. There exist a number of reproduction operators in GA literature, but the essential idea in all of them is that the above average strings are picked from the current population and their multiple copies are inserted in the mating pool in a probabilistic manner. Probability of selection of ith string into the mating pool

Average Fitness,

Roulette Wheel Selection:

The commonly-used reproduction operator is the proportionate reproduction operator where a string is selected for the mating pool with a probability proportional to its fitness.

Step1: Using Fi calculate Pi Step2: Calculate cumulative probability Pi Step3: Generate n random numbers (between 0 and 1) Step4: Copy the string that represents the chosen random numbers in the cumulative probability range into the mating pool. A string with higher fitness will have a larger range in the cumulative probability of getting copied into the mating pool.

Crossover: A crossover operator is used to recombine two strings to get a better string. In crossover operation, recombination process creates different individuals in the successive generations by combining material from two individuals of the previous generation. In reproduction, good strings in a population are probabilistically assigned a larger number of copies and a mating pool is formed. It is important to note that no new strings are formed in the reproduction phase. In the crossover operator, new strings are created by exchanging information among strings of the mating pool. The two strings participating in the crossover operation are known as parent strings and the resulting strings are known as children strings. It is intuitive from this construction that good sub-strings from parent strings can be combined to form a better child string, if an appropriate site is chosen. With a random site, the children strings produced may or may not have a combination of good sub-strings from parent strings, depending on whether or not the crossing site falls in the appropriate place. But this is not a matter of serious concern, because if good strings are created by crossover, there will be more copies of them in the next mating pool generated by crossover. It is clear from this discussion that the effect of cross over may be detrimental or beneficial. Thus, in order to preserve some of the good strings

that are already present in the mating pool, all strings in the mating pool are not used in crossover. When a crossover probability, defined here as pc is used, only 100pc per cent strings in the population are used in the crossover operation and 100(1-pc) per cent of the population remains as they are in the current population. A crossover operator is mainly responsible for the earch of new strings even though mutation operator is also used for this purpose sparingly.

Many crossover operators exist in the GA literature. One site crossover and two site crossover are the most common ones adopted. In most crossover operators, two strings are picked from the mating pool at random and some portion of the strings is exchanged between the strings. Crossover operation is done at string level by randomly selecting two strings for crossover operations. A one site crossover operator is performed by randomly choosing a crossing site along the string and by exchanging all bits on the right side of the crossing site as shown in figure below.

Single Crossover String 1 011 0110

String 1

011 1101

String 2

110 1101

String 2

110 0110

# Before Crossover

#After Crossover

In one site crossover, a crossover site is selected randomly (shown as vertical lines). The portion right of the selected site of these two strings is exchanged to form a new pair of strings. The new strings are thus a combination of the old strings.

Mutation: Mutation adds new information in a random way to the genetic search process and ultimately helps to avoid getting trapped at local optima. It is an operator that introduces diversity in the population whenever the population tends to become homogeneous due to

repeated use of reproduction and crossover operators. Mutation may cause the chromosomes of individuals to be different from those of their parent individuals. Mutation in a way is the process of randomly disturbing genetic information. They operate at the bit level; when the bits are being copied from the current string to the new string, there is probability that each bit may become mutated. This probability is usually a quite small value, called as mutation probability pm. A coin toss mechanism is employed; if random number between zero and one is less than the mutation probability, then the bit is inverted, so that zero becomes one and one becomes zero. This helps in introducing a bit of diversity to the population by scattering the occasional points. This random scattering would result in better optima, or even modify a part of genetic code that will be beneficial in later operations. On the other hand, it might produce a weak individual that will never be selected for further operations. The need for mutation is to create a point in the neighborhood of the current point, thereby achieving a local search around the current solution. The mutation is also used to maintain diversity in the population. For example, the following population having four eight bit strings may be considered: 01101011 00111101 00010110 01111100. It can be noticed that all four strings have a 0 in the left most bit position. If the true optimum Solution requires 1 in that position, and then neither reproduction nor crossover operator described above will be able to create 1 in that position. The inclusion of mutation introduces probability pm of turning 0 into 1. [1,3]

FUTURE WORK
y y y y y Biological Aspects pertaining to the development of Genetic Algorithms in brief. Development of flow diagram for the step by step procedure of Genetic Algorithm. Problem of maximization of an algebraic function within a given range. Case study related to the topic of thermodynamics. Code in Matlab/Excel if feasible.

References
1. B.V.Babu, Process Plant Simulation, Oxford University Press, pp 260-272. 2. http:// brainz.org/15-real-world-applications-genetic-algorithms/, 30/01/2011, 1032 hrs. 3. Tom V. Mathew, Genetic Algorithms, Department of Civil Engineering, IIT-Bombay.

Vous aimerez peut-être aussi