This action might not be possible to undo. Are you sure you want to continue?

SEMINAR REPORT Submitted by

**PRAVEEN R S Roll No: 27322
**

To The University of Kerala In partial fulfillment of the requirements for the award of the degree Of Bachelor of Technology in Mechanical Stream – Industrial Engineering

**Department Of Mechanical Engineering
**

College of Engineering, Thiruvananthapuram – 16 November, 2010

DEPARTMENT OF MECHANICAL ENGINEERING COLLEGE OF ENGINEERING THIRUVANANTHAPURAM – 16

CERTIFICATE This is to certify that the report entitled “GENETIC ALGORITHMS”, submitted by “Praveen R S, S7 Industrial, Roll No. 27322” to the University of Kerala in partial fulfillment of the requirements for the award of the Degree of Bachelor of Technology in Mechanical stream-Industrial Engineering is a bonafide record of the seminar presented by him.

Sri. V S Unnikrishnan (Asst. Professor)

Dr. Regikumar V (Lecturer)

Sri. M S Subramony (Senior Lecturer)

Prof. Z A Samitha (Senior Staff Advisor)

Prof. E Abdul Rasheed (Head of the Department)

Acknowledgement

I express my gratitude to my guides, Sri. V S Unnikrishnan (Asst. Professor, Department of Mechanical Engineering), Sri. M S Subramony (Lecturer, Department of Mechanical Engineering) and Sri. Rejikumar V (Lecturer, Department of Mechanical Engineering) from College of Engineering, Trivandrum for their expert guidance and advice in presenting the seminar.

I express my sincere thanks to Sri. K Sunilkumar (Lecturer & Staff Advisor, Department of Mechanical Engineering), Prof. Z A Samitha (Professor & Senior Staff Advisor, Department of Mechanical Engineering), Prof. E Abdul Rasheed (Head of Department, Department of Mechanical Engineering), Dr. J Letha (Principal, College of Engineering, Trivandrum) for giving me this opportunity and for their kind cooperation during the course of this work.

I would also wish to record my gratefulness to all my friends and classmates for their help and support in carrying out this work successfully. I also thank the Lord Almighty for the grace, strength and hope to make my endeavour a success.

Praveen R S

Cross over. It has got a wide variety of applications is Operations Research related problems like Transportation problems.Abstract Genetic Algorithm is one among the different Bio-inspired computing algorithms. Spanning tree problem. The feasible solutions from the solution space are evaluated using a fitness function and they are selected for reproduction on the basis of their fitness value. Travelling salesman problem. Scheduling. Reproduction involves cross over and mutation. The iteration process is continued till the required convergence is attained. Genetic Algorithm usually exhibits a reduced chance of converging to local optimum. compared to the previous generation. It applies the Principle of survival of the fittest to find better and better solutions. Selection. The successive generations would have better average fitness value. Mutation . Keywords: Fitness function. etc.

1.3.1 Evolutionary Algorithms Genetic Algorithms 2.1.(iii) Mutation Encoding 3.(vi) Order Crossover 5.3.4 GA Operators Conclusion References 1 2 3 3 5 6 6 7 7 8 8 9 9 10 10 10 11 11 11 12 13 13 14 14 14 14 15 15 16 16 17 18 19 20 20 20 20 21 22 22 23 24 24 24 25 25 26 29 Section 3: Section 4: Section 5: Section 6: Section 7: Section 8: Section 9: Section 10: .1 Problem Statement 8.1.2 Structure of a Single Population Genetic Algorithm 2.(iii) Uniform Crossover 5.(ii) Recombination or Crossover 2.2.(i) Fitness Proportional Selection 4.1.(iii) Stochastic Universal Sampling 4.(v) Partially Matched Crossover 5.1 Recombination Techniques 5.2 Selection Techniques 4.2 Slow Finishing Solution of a Transportation problem using GA 8.(ii) Ranked Selection 4.1.(i) Selection 2.1 Premature Convergence 7.(vi) Tournament Selection Recombination or Crossover 5.2.1 Genetic Algorithms Overview 2.(iii) Uniform Mutation 6.(i) Flip bit Mutation 6.1 Encoding Techniques 3.(ii) Boundary Mutation 6.(ii) Two point Crossover 5.1.3.(vii) Cycle Crossover 5.(iv) Shuffle Crossover 5.2.1.1.2.1.(v) Truncation Selection 4.1.2 Genotypes and Phenotypes 3.1 Fitness Function 4.2 Encoding 8.2.2 Crossover Probability (pc) Mutation 6.1 Mutation Techniques 6.2 Mutation Probability(pm) Convergence 7.(i) One point Crossover 5.3 Random Keys Selection 4.(iv) Roulette Wheel Selection 4.2.3 Prüfer Number 8.3 Genetic Algorithm Operators 2.Table of contents Section 1: Section 2: Introduction 1.

.... Two point Crossover ......... Chromosome Fitness on a Roulette Wheel .......................................................................................................... Flip Bit Mutation............................................................................. 24 11. 25 ....................................................................................................................................................................................................... 20 9... 6 3........................ Stochastic Universal Sampling ...........................................List of Figures 1.................................................... 24 12.................... 12 5.......................... 1 2................................................................................................. One point Crossover .................... Boundary Mutation ............................................................ 15 8........ 20 10................................. 12 4............................................................................................................................... The Placement of Genetic Algorithms in the hierarchy of Knowledge Based Information Systems ............................................................................................................................ Prüfer Number .............................. Uniform Crossover.................. Spanning Tree Representation ........ 14 7................................................................................... A Feasible Solution for the Transportation Problem . Structure of a simple Genetic Algorithm .. 14 6.........................................

Introduction Knowledge-based information systems or Evolutionary computing algorithms are designed to mimic the performance of biological systems. The no free lunch theorem states that no search algorithm is better on all problems. but have not yet been able to solve the really complex problems that their biological counterparts can. The present trend is to combine these fields into a hybrid in order that the drawbacks of one may be offset by the merits of another. Evolutionary computing algorithms are used for search and optimization applications and also include fuzzy logic. Knowledge Based Information Systems Approximate Reasoning Approaches Search/ Optimisation Approaches Probabilistic Models Multivalued & Fuzzy logic Neural Networks Evolutionary Algorithms Evolutionary Strategies Evolutionary Programming Genetic Algorithms Genetic Programming Figure 1: The Placement of Genetic Algorithms in the hierarchy of Knowledge Based Information Systems . All search methods show on average the same performance over all possible problem instances. which provides an approximate reasoning basis for representing uncertain and imprecise knowledge. Neural networks.Page |1 1. fuzzy logic and evolutionary computing have shown capability on many problems.

ultimately arriving at a satisfactory solution to the problem.Random searches simply perform random walks of the problem space. They do not use any knowledge gained from previous results and are inefficient. even though they may exhibit low speed of convergence.These algorithms use random choice to travel through the search space using the knowledge gained from previous results in the search.Evolutionary Algorithms Evolutionary algorithms can be used successfully in many applications requiring the optimization of a certain multi-dimensional function. Downhill simplex search Tabu search which is usually applied to combinatorial optimization problems Evolutionary algorithms exhibit an adaptive behavior that allows them to handle nonlinear. The population of possible solutions evolves from one generation to the next. high dimensional problems without requiring differentiability or explicit knowledge of the problem structure. Randomized Search Techniques . Random Search Algorithms .Page |2 1. and in the way the members are represented within the algorithm. recording the best optimum values found. finds an optimum by following the local gradient of the function (thus. Genetic Algorithms Simulated annealing (SA) which is a stochastic hill-climbing algorithm based on the analogy with the physical process of annealing. These algorithms differ in the way a new population is generated from the present one. Hill climbing.1. in essence. they are also known as gradient methods). They are part of the derivative-free optimization and search methods that comprise. . They also are very robust to time-varying behavior.

Genetic Algorithms 2. The GA will generally include the three fundamental genetic operations of selection. crossover and mutation. GAs suffers from the problem of excessive complexity if used on problems that are too large. a new set of approximations is created by the process of selecting individual potential solutions (individuals) according to their level of fitness in the problem domain and breeding them together using operators borrowed from natural genetics. Genetic algorithms work on populations of individuals rather than single solutions. the algorithm applies the principle of survival of the fittest to find better and better approximations. just as in natural adaptation. These algorithms search or operate on a given population of potential solutions to find those that approach some specification or criteria. These operations are used to modify the chosen solutions and select the most appropriate offspring to pass on to succeeding generations. .Page |3 2. allowing for parallel processing to be performed when finding solutions to the more large and complex problems. At each generation. Genetic Algorithms Overview Genetic Algorithms (GAs) were invented by John Holland in the 1960s and were developed with his students and colleagues at the University of Michigan in the 1970s. They usually exhibit a reduced chance of converging to local minima.1. This process leads to the evolution of populations of individuals that are better suited to their environment than the individuals that they were created from. Holland's original goal was to investigate the mechanisms of adaptation in nature and to develop methods in which these mechanisms could be imported into computer systems. To do this. Genetic algorithms are search methods that employ processes found in natural biological evolution.

At every evolutionary step. which represents the degree of correctness of that particular solution or the quality of solution it represents. Although they do not guarantee convergence to the single best solution to the problem. the individuals in the current population are decoded and evaluated according to a fitness function set for a given problem. The GA using genetic operators. Crossover is performed between two selected individuals by exchanging part of their genomes to form new individuals. where each string represents a different solution to a given problem. Thus. The mutation operator is introduced to prevent premature convergence. the possibility of the GA getting caught in local minima is greatly reduced because the whole space of possible solutions can be simultaneously searched.Page |4 Standard genetic algorithms are implemented where the initial population of individuals is generated at random. GAs converge rapidly to quality solutions. the processing leverage associated with GAs make them efficient search techniques. also known as generation. to finally arrive at a quality solution to the given problem manipulates the strings. The initial population of strings is randomly chosen. Every member of a population has a certain fitness value associated with it. The expected number of times an individual is chosen is approximately proportional to its relative performance in the population. The main advantage of a GA is that it is able to manipulate numerous strings simultaneously by parallel processing. .

The offspring are inserted into the population replacing the parents. that is. Each feasible solution is encoded as a chromosome (string) also called a genotype and each chromosome is given a measure of fitness (fitness factor) via a fitness (evaluation or objective) function. This initial population is then compared against the specifications or criteria and the individuals that are closest to the criteria. In some cases. the first generation is produced. A finite fixed population of chromosomes is maintained. producing a new generation. but to be carried over. A finite fixed population of chromosomes is maintained. it is better not to allow this parent to be discarded when forming a new generation. . Individuals are selected (parents) according to their fitness for the production of offspring. All offspring will be mutated (altering some genes in a chromosome) with a certain probability. The fitness of the offspring is then computed. If the optimization criteria are not met. Mutation ensures the entire state-space will be searched. This cycle is performed until the optimization criteria are reached. The fitness of a chromosome determines its ability to survive and produce offspring.Page |5 2. are then recombined in a way that guides their search to only the most promising areas of the state or search space. where the parent already has a high fitness factor. Parent chromosomes are combined to produce superior offspring chromosomes (crossover) at some crossover point (locus).2 Structure of a Single Population Genetic Algorithm A GA has the ability to create an initial population of feasible solutions (or number of individuals) and randomly initializing them at the beginning of a computation. then the creation of a new generation starts. those with the highest fitness factor. (given enough time) and it is an effective way of leading the population out of a local minima trap. Thus.

pairs of individuals of the current population are selected to mate with each other to form the offspring. (i) Selection This operator selects the chromosome in the population for reproduction.Page |6 Provide Initial Population Does the average fitness suit the requirement? No Yes Best individuals Start Generate population new Selection Solution Found Recombination Mutation Figure 2: Structure of a simple Genetic Algorithm 2.3 Genetic Algorithm Operators A basic genetic algorithm comprises three genetic operators-Selection. but the key idea is to select the better individuals of the population. Crossover and Mutation. the GA uses these operators to calculate successive generations. The more fit the chromosome. 2. the crossover operator is applied to each of these pairs. the higher its probability of being selected for reproduction. After selection of the pairs of parent strings.3. . Thus. which then form the next generation. First. selection is based on the survival-of-the-fittest strategy. Starting from an initial population of strings (representing possible solutions).

In a sense. . (ii) Recombination or Crossover The crossover operator involves the swapping of genetic material (bit-values) between the two parent strings. (iii) Mutation The two individuals (children) resulting from each crossover operation will now be subjected to the mutation operator in the final step to forming the new generation.Page |7 2. 2.3. This operator randomly flips or alters one or more bit values at randomly selected locations in a chromosome. it serves as an insurance policy. which is needed to make sure that the entire solution space is used in the search for the best solution.3. it helps prevent the loss of genetic material. This operator randomly chooses a locus (a bit position along the two chromosomes) and exchanges the sub-sequences before and after that locus between two chromosomes to create two offspring. The mutation operator enhances the ability of the GA to find a near optimal solution to a given problem by maintaining a sufficient level of genetic variety in the population.

Choosing a fixed encoding ahead of time presents a paradox to the potential GA user: for any problem that is hard enough that one would want to use a GA.e. Encoding 3.Page |8 3. most research is currently done by guessing at an appropriate encoding and then trying out a particular version of the GA on it. One appealing idea is to have the encoding itself adapt so that the GA can make better use of it. The representation scheme determines how the problem is structured in the GA and also determines what genetic operators are used [1]. D). one doesn't know enough about the problem ahead of time to come up with the best encoding for the GA.1 Encoding Techniques For any GA a chromosome representation is required to describe each individual in the population of interest. strongly advocates using whatever encoding is the most natural for your problem.. This alphabet could consist of binary digits (0 and 1). B. A. symbols (i. and then devising a GA that can use that encoding [2]. Each individual or chromosome is made up of a sequence of genes from a certain alphabet. The first thing that must be done in any new problem is to generate a code for this problem. In Holland's original design. How is one to decide on the correct encoding for one's problem? Lawrence Davis. the alphabet was limited to binary digits. integers. a researcher with much experience applying GAs to real-world problems. Each element of the string represents a particular feature in the chromosome. Thus. etc. . floating point numbers. C. matrices.

48 4 0. For example. In the random key method. 3) can be coded as 101 011. using a binary coding scheme (5. 3.38 2 0. in which 101 refers to 5 and 011 refers to 3. Search happens in genotypic space. For example: Random key 0.81 5 Nodes that should be early in the tour tend to “evolve” genes closer to 0 and those that should come later tend to evolve genes closer to 1. To decode the chromosome. but selection occurs in phenotypic space. 3) is the phenotype whereas 101 011 is the genotype of the solution. we assign each gene a random number drawn uniformly from [0.06 1 0. we visit the nodes in ascending order of their genes. (5. .42 Decodes as 3 0.Page |9 3.3 Random Keys Random key is a special encoding scheme used in Travelling Salesman Problem to represent the nodes [3]. Standard crossover techniques will generate children that are guaranteed to be feasible. 1).2 Genotypes and Phenotypes The actual value of a solution refers to its phenotype whereas the encoded value refers to its genotype.

through repeated application of some selection function. This function usually selects one or two individuals from the old population. The fitness of that string. provides a measure of performance with respect to a particular set of parameters [4].P a g e | 10 4.2 Selection Techniques Once individuals have had their fitness assessed. . The evaluation of a string representing a set of parameters is independent of the evaluation of any other string. Constraints on the chromosomes can be modeled by penalties in the fitness function or encoded directly in the chromosomes' data structures. however. they may be selected and bred to form the next generation in the evolution cycle. The period in which the individual is evaluated and assigned a fitness value is known as fitness assessment. or objective function. known as its fitness. Good chromosomes (those with the highest fitness function) survive and have offspring. Commonly used selection techniques are as follows. is always defined with respect to other members of the current population. 4. Selection 4. modifies them. while those chromosomes furthest removed or with the lowest fitness function are culled.1 Fitness Function The evaluation function. When individuals are modified to produce new individuals. which indicates how good a solution it is. they are said to be breeding. Selection determines which individuals are chosen for breeding (recombination) and how many offspring each selected individual produces. copies them. The individual (chromosome or string) is first grade. The fitness function transforms that measure of performance into an allocation of reproductive opportunities. and returns the modified copies for addition to the new population.

then the distance between the pointers is 1/n and the position of the first pointer is given by a randomly generated number in the range [0. The individuals are mapped to contiguous segments of a line. The best individual in the population is thus selected with probability .2. 4. Fitnesses may be transformed in some way prior to normalization. such that each individual's segment is equal in size to its fitness exactly as in roulette-wheel selection. Here equally spaced pointers are placed over the line as many as there are individuals to be selected. (i) Fitness Proportional Selection This selection method normalizes all the fitnesses in the population. One of the problems with fitness-proportional selection is that it is based directly on the fitness. Assessed fitnesses are rarely an accurate measure of how “good” an individual really is. (ii) Ranked Selection In this technique. .2. 4. 1/n]. with the first individual being the worst and the last individual being the best. These normalized fitnesses then become the probabilities that their respective individuals will be selected. Each individual is then selected with a probability based on some linear function of its sorted rank. This is usually done by assigning to the individual at rank i a probability of selection. (iii) Stochastic Universal Sampling Stochastic universal sampling provides zero bias and minimum spread. individuals are first sorted according to their fitness values.P a g e | 11 4. the worst individual is selected with the probability . and 1 < c < 2 is the selection bias: higher values of the selective pressure „c‟ cause the system to focus more on selecting only the better individuals.2. ( ) | | where ||P|| is the size of the population P. Consider n the number of individuals to be selected.

A p q B C r D E F Figure 3: Stochastic Universal Sampling 4. C. also called stochastic sampling with replacement. being the most fit individual.P a g e | 12 Consider an example. B. A. E 20% D 14% A 7% B 24% C 35% Figure 4: Chromosome Fitness on a Roulette Wheel Here. the width of each slot represents the relative fitness of a given chromosome. . has the greater probability to be selected. Each slot on the wheel represents a chromosome from the parent generation. The solutions which fall at those points are selected. „r‟ is fixed such that rq = pq. The largest fitness values tend to be the most likely resting-places for the marble. D. E and F are six different solutions arranged in their decreasing order of fitness. since they have larger slots. C. B and D are selected. Then the Roulette wheel is simulated. Consider an example. (iv) Roulette Wheel Selection The simplest selection scheme is roulette-wheel selection. The initial point (here its „p‟) is fixed at random and another point „q‟ is fixed such that it is at a distance of 1/n from p. A. and their lengths are proportional to their fitness values. Here.2.

One form of truncation selection. a pool of n individuals is picked at random from the population. works as follows. Seven is used widely in the genetic programming literature. the more directed this method is at picking highly fit individuals. and is not very selective. fast. then the method selects individuals totally at random. individuals are sorted according to their fitness. In tournament selection. If n = 1. Breeders for large populations/mass selection use it.P a g e | 13 4. m individuals are “selected” from the union of the population and the m parents which had created that population previously. (v) Truncation Selection Compared to the previous selection methods modeling natural selection.l) selection.2. (vi) Tournament Selection This selection mechanism is popular because it is simple. The m best individuals in the population are “selected”. Each individual in this group is then used to produce k new individuals in the next generation. Let the population size l = km where k and m are positive integers. In truncation selection. and is relatively highly selective. Clearly.2. (m + l) selection. truncation selection is an artificial selection method. These are independent choices: an individual may be chosen more than once. (m. Two is the standard number for genetic algorithm literature. Popular values for n include 2 and 7. 4. and has well-understood statistical properties. In a variant form. The next generation is formed from breeding only the best individuals in the population. Then tournament selection selects the individual with the highest fitness in this pool. . the larger the value n.

The locus point is randomly chosen.1. Recombination or Crossover After selection has been carried out recombination can occur.P a g e | 14 5. Figure 6: Two point Crossover . 5. The population is recombined according to the probability of crossover pc. Figure 5: One point Crossover 5. (i) One Point Crossover The traditional GA uses 1-point crossover.1 Recombination Techniques 5. When a population has been entirely replaced by children. Crossovers are (sometimes) deterministic operators that capture the best features of two parents and pass it to a new offspring. The whole process of finding an optimal solution is known as evolving a solution. To exchange a segment from one loop with that from another loop requires the selection of two randomly chosen crossover or cut points. (ii) Two Point Crossover In two-point crossover chromosomes are regarded as loop formed by joining the ends together. the new population is known as the next generation.1. where the two mating chromosomes are each cut once at corresponding points and the selections after the cuts exchanged.

The process is repeated with the parents exchanged to produce the second offspring. Copying the corresponding gene from one or the other parent. the gene is copied from the first parent and where there is a "0" in the mask. the variables in the offspring are unshuffled. This removes positional bias as the variables are randomly reassigned each time crossover is performed. Figure 7: Uniform Crossover 5. Where there is a "1" in the crossover mask.1. contain a mixture of genes from each parent. chosen according to a randomly generated crossover mask creates each gene in the offspring. (iii) Uniform Crossover This form of crossover is different from one-point crossover. But before the variables are exchanged. The number of effective crossing points is not fixed.1. . Offspring therefore. After recombination. (iv) Shuffle Crossover Shuffle crossover is related to uniform crossover. but will average L/2 where L is the chromosome length. A new crossover mask is randomly generated for each pair of parents. A single crossover position (as in single point crossover) is selected. the gene is copied from the second parent as shown in figure 7.P a g e | 15 5. they are randomly shuffled in both parents.

PMX begins by selecting two points -. (v) Partially Matched Crossover (PMX) Partially matched crossover (PMX) arose in an attempt to solve the blind Travelling Salesman Problem (TSP).for its operation. OX would remove the incoming alleles like so (a dash represents a blank allele): Offspring 1: .two and five.|HBA|FG Offspring 2: GF|CDE |--- . fitness is entirely based on the ordering of the cities in a chromosome and as such. (vi) Order Crossover (OX) Order crossover involves the removal of some alleles and the shifting of others. that is. in this case -.. Parent chromosome 1: AB|CDE|FGH Parent chromosome 2: GF|HBA|CDE The PMX algorithm notes that the H allele in Chromosome 2 will replace the C allele in Chromosome 1 so it replaces C with H and H with C for both chromosomes The same process is accomplished for the other two alleles being swapped.1. In the blind TSP. Given the crossover points and parent chromosomes as in the PMX example. B replaced D and D replaces B in both chromosomes A replaces E and E replaces A in both chromosomes And the end result is two offspring with these encodings: Offspring 1: ED|HBA|FGC Offspring 2: GF|CDE|HBA 5.P a g e | 16 5.1. we need to maintain valid permutations during reproduction.

finishing the two offspring.P a g e | 17 Then. filling empty alleles and leaving an opening for the swapped-in section: Offspring 1: BA|---|FGH Offspring 2: DE|---|GFC To finish the process. Another swap occurs: Offspring 1: G-----D Offspring 2: A-----G . (vii) Cycle Crossover (CX) This form of crossover works in an entirely different fashion. 5. Offspring 1: BA|CDE|FGH Offspring 2: DE|HBA|GFC PMX preserves the absolute position of a city allele within chromosomes. OX exchanges the alleles within the crossover boundaries. by swapping a specific set of cities between chromosomes. OX shifts alleles to the left (wrapping around the end of the chromosome if necessary). beginning after the second crossover point. whereas OX preserves the order of cities in the permutation.1. Parent 1: ABCDEFGH Parent 2: GFHBACDE In generating offspring. CX begins with the first cities of the two parent chromosomes: Offspring 1: G------Offspring 2: A------A search of Parent 1 finds the just-introduced G allele in position 7.

CX then fills the remaining empty alleles from corresponding elements of the parents. whole generation is made from exact copies of chromosomes from old population. If crossover probability is 100%. The final offspring look like this: Offspring 1: GECBAFDH Offspring 2: ABHDECGE The inversion operator isn't a form of crossover. If there is a crossover.P a g e | 18 The search-and-swapping process continues until the allele first replaced in Parent 1 -. offspring is exact copy of parents.2 Crossover Probability (pc) Crossover probability (pc) says how often will be crossover performed. However it is good to leave some part of population survive to next generation. Inversion preserves the nature of a permutation while reordering its elements. Crossover is made in the hope that new chromosomes will have good parts of old chromosome and may be the new chromosomes will be better. If it is 0%. . it reverses a sequence of alleles.the A – is found in a swap between chromosomes. then all offspring is made by crossover. If there is no crossover. offspring is made from the parts of parents‟ chromosome. Here are two examples of inversion applied to the test chromosomes: ABC|DEFGH| inverts to ABCHGFED 5.

Mutation can assist by preventing a (small) population prematurely converging onto a local minimum and remaining stuck on this minimum due to a recessive gene that has infected the whole population (genetic drift). Mutation After recombination offspring undergo mutation. As the population converges on a solution. Although it is generally held that crossover is the main force leading to a thorough search of the problem space.P a g e | 19 6. mutations are probabilistic background operators that try to re-introduce needed chromosome features (bit or allele) into populations whose features have been inadvertently lost. The more dimensions one individual has the smaller the mutation probability is required to be. Mutation generally finds better solutions than a crossoveronly regime although crossover gives much faster evolution than a mutation-only population. mutation becomes more productive and crossover less productive. rather the balance among crossover. . gives an insignificant improvement in the search speed. Offspring variables are mutated by the addition of small random values (size of the mutation step). is set to be inversely proportional to the number of bits (variables) "n". in the chromosome (dimensions). with low probability. Varying the mutation rate by increasing it at the beginning of a search and a decreasing it to 1/n at the end as the population converges. It does this by providing a small element of random search in the vicinity of the population when it has largely converged. mutation and selection that is important. Crossover alone cannot prevent the population converging on a local minimum. it is not a choice between crossover and mutation but. A mutation rate m = 1/n produces almost optimal results for a broad class of test functions where the mutation rate is independent of the size of the population. Consequently. The probability of mutating a variable pm.

(i) Flip bit Mutation This technique is generally used in binary coded chromosomes. Figure 8:Flip Bit Mutation 6. which determines which all bit positions should be flipped. The „C‟ can be either changed to A or H. Here. a bit position is selected at random and it is changed to the upper or lower bound of the coding scheme used. . 0 is flipped to 1. Flipping is done where an „1‟ is in the mask and the bit is left as it is. Figure 9: Boundary Mutation 6.(iii)Uniform Mutation This technique is similar to the uniform crossover.1 Mutation Techniques 6. where a „0‟ is in the mask.1.1. Here also.1. (i. or 1 is flipped to 0).P a g e | 20 6. The value of a particular bit chosen at random is flipped. Consider a coding scheme of characters from A to H. there is a mutation mask.e. (ii) Boundary Mutation This is a modification of the flip bit technique.

offspring is taken after crossover without any change.P a g e | 21 6. part of chromosome is changed. If mutation is performed. If mutation probability is 100%.2 Mutation Probability (pm) Mutation probability says how often will be parts of chromosomes mutated. Mutation is made to prevent falling GA into local optimum. because then GA will in fact change to random search. . but it should not occur very often. If there is no mutation. whole chromosome is changed.

the values for each gene for different members of the population are randomly distributed giving a wide spread of individual fitnesses. wider search of the search space to be made. but not optimal. Once the population has reduced its range of fitnesses due to this convergence. Convergence is the progression towards increasing uniformity. 7. The only saving grace is mutation that allows a slower. Convergence With a correctly designed and implemented GA. A gene is said to have converged when 95% of the population share the same value. At the start of a run. The population is said to have converged when all of the genes have converged. As the run progresses some gene values begin to predominate. . chromosomes may tend to dominate the population causing it to converge on a local minimum rather than search for a global minimum. As the population converges the range of fitnesses in the population reduces.1 Premature Convergence A standard problem with GAs is where the genes from a small number of highly fit.P a g e | 22 7. the ability of the GA to continue to search for better solutions is effectively prevented. the population will evolve over successive generations so that the fitness of the best and the average individual in each generation increases towards the global optimum [5]. This reduced range often leads to premature convergence and slow finishing. Crossovers of chromosomes that are almost identical produce offspring chromosomes that are almost identical to their parents.

2 Slow Finishing After many generations. The average fitness will be high and the range of fitness levels quite small. the population would have converged but can't yet find the global maximum. This means that there is very little gradient in the fitness function. However. Ways of doing this are presented in the next section. Because of this slight slope. The effect is to compress the range of fitnesses and prevent any "super-fit" individuals from having the opportunity to take control. this allows premature convergence to occur. 7. nor too small. so that it is neither too large. . because the population is not infinite. The basic idea is to control the number of reproductive opportunities each individual gets. the population slowly edges towards the global maximum rather than going to it quickly.P a g e | 23 The schema theorem states that we should allocate reproductive opportunities to individuals in proportion to their relative fitness. In order to make GAs work effectively on finite populations the selection process of parents must be modified.

2 Encoding Establish arbitrary feasible connections between the sources and destinations. 3. S2 and S3. There are four destinations D1. D2. a4 and 16 respectively. whose supply quantities are 8.1 Problem Statement There are three sources named S1. 19 and 17 respectively. 8.P a g e | 24 8 Solution of a Transportation Problem using Genetic Algorithm 8. D3 and D4 whose demands are 11. Transportation cost from every source to every destination is same. . Solve the transportation problem to find the optimum allocations. Figure 11: Spanning Tree Representation The corresponding Spanning trees are coded into Prüfer number. Figure 10: A Feasible Solution for the Transportation Problem Develop the corresponding Spanning tree notation.

4 GA Operators The Prüfer number representations of all the feasible solutions need to be obtained first.3 Prüfer number Prüfer number is an encoding technique used to encode spanning tree representations [6]. the fitness should be evaluated in inverse scale. The steps to find the Prüfer number for the above spanning tree are shown below. Here. . They can be evaluated using the fitness function.P a g e | 25 8. The fitness for different feasible solutions can be obtained by calculating the allocations for links between different sources and destinations. The solution with least cost must be allotted maximum fitness. Figure 12: Prüfer Number 8. the Prüfer number consists of n-2 digits. from which the total cost can be obtained. If there are „n‟ stations in a Transportation problem (including sources and destinations). It is the sequence of numbers of nodes to which the least valued leaf nodes (dangling nodes) are connected. It can be followed by Crossover and Mutation. Selection process can be followed by Fitness evaluation.

or a satisfactory fitness level has been reached for the population. but typically contains several hundreds or thousands of possible solutions. This heuristic is routinely used to generate useful solutions to optimization and search problems [7]. the fitness of every individual in the population is evaluated. solutions are represented in binary as strings of 0s and 1s. such as inheritance. mutation. In a genetic algorithm. evolves toward better solutions. multiple individuals are stochastically selected from the current population (based on their fitness). Traditionally. which encode candidate solutions (called individuals. Genetic algorithms belong to the larger class of evolutionary algorithms (EA). . the population is generated randomly. In each generation. If the algorithm has terminated due to a maximum number of generations. Traditionally. the algorithm terminates when either a maximum number of generations has been produced. creatures. and crossover. The evolution usually starts from a population of randomly generated individuals and happens in generations. a population of strings (called chromosomes or the genotype of the genome). a satisfactory solution may or may not have been reached. which generate solutions to optimization problems using techniques inspired by natural evolution. the solutions may be "seeded" in areas where optimal solutions are likely to be found. and modified (recombined and possibly randomly mutated) to form a new population. selection. Occasionally. Initially many individual solutions are randomly generated to form an initial population. Commonly. The new population is then used in the next iteration of the algorithm. The population size depends on the nature of the problem. covering the entire range of possible solutions (the search space).P a g e | 26 9 Conclusion The genetic algorithm (GA) is a search heuristic that mimics the process of natural evolution. but other encodings are also possible. or phenotypes) to an optimization problem.

and the process continues until a new population of solutions of appropriate size is generated. Although reproduction methods that are based on the use of two parents are more "biology inspired". These processes ultimately result in the next generation population of chromosomes that is different from the initial generation. where fitter solutions (as measured by a fitness function) are typically more likely to be selected. preventing premature convergence on poor solutions. a new solution is created which typically shares many of the characteristics of its "parents". For each new solution to be produced. New parents are selected for each new child. . some research suggests more than two "parents" are better to be used to reproduce a good quality chromosome. Individual solutions are selected through a fitness-based process. a proportion of the existing population is selected to breed a new generation.P a g e | 27 During each successive generation. as this process may be very time-consuming. The next step is to generate a second generation population of solutions from those selected through genetic operators: crossover (also called recombination). Generally the average fitness will have increased by this procedure for the population. Most functions are stochastic and designed so that a small proportion of less fit solutions are selected. a pair of "parent" solutions is selected for breeding from the pool selected previously. This helps keep the diversity of the population large. since only the best organisms from the first generation are selected for breeding. Certain selection methods rate the fitness of each solution and preferentially select the best solutions. along with a small proportion of less fit solutions. and/or mutation. Popular and well-studied selection methods include roulette wheel selection and tournament selection. By producing a "child" solution using the above methods of crossover and mutation. Other methods rate only a random sample of the population.

Genetic algorithms are often applied as an approach to solve global optimization problems. GAs have also been applied to engineering. and many scheduling software packages are based on GAs.P a g e | 28 This generational process is repeated until a termination condition has been reached. As a general rule of thumb genetic algorithms might be useful in problem domains that have a complex fitness landscape as crossover is designed to move the population away from local optima that a traditional hill climbing algorithm might get stuck in. . Common terminating conditions are: A solution is found that satisfies minimum criteria Fixed number of generations reached Allocated budget (computation time/money) reached The highest ranking solution's fitness is reaching or has reached a plateau such that successive iterations no longer produce better results Manual inspection Combinations of the above Problems which appear to be particularly appropriate for solution by genetic algorithms include timetabling and scheduling problems.

Snyder. July 2003 Genetic Algorithms and Engineering Optimization. editor. Department of Industrial Engineering and Management Sciences.445 .P a g e | 29 References [1] [2] [3] Representations for Genetic and Evolutionary Algorithms. A Genetic Algorithm for the Linear Transportation Problem. Springer 2005 Davis. no.org/wiki/Genetic_algorithm [4] [5] [6] [7] .wikipedia.no.452 http://en. New York: John Wiley. 1991. March/April 1991. IEEE Transactions on systems. man. A A R Townsend. Vignaux and Z. Michalewicz. Mark S. Van Nostrand Reinhold Lawrence V. 2000 G. L. and cybernetics. 2005 Genetic Algorithms-A tutorial. February 25. Handbook of Genetic Algorithms. 21. Mitsuo Gen and Runwei Cheng. Franz Rothlauf. A Random-Key Genetic Algorithm for the Generalized Traveling Salesman Problem.. D.2. pg. A. vol. Daskin.

Sign up to vote on this title

UsefulNot useful- genetic algorithm
- Genetic Algorithms - Principles and Perspectives - A Guide to GA Theory
- Genetic Algorithm Report
- gads_tb
- A Genetic Algorithm Tutorial
- Genetic Algorithms and Engineering Optimization
- Genetic Algorithms
- Genetic Algo
- Genetic Algorithms
- A Field Guide to Genetic Programming
- 0101.Genetic Algorithm
- Genetic algorithm
- Genetic Algorithm Overview
- Genetic algorithm
- Genetic Algorithms in Optimization
- Genetic Algorithms
- Introduction to Genetic Algorithms
- Genetic Algorithms for Composite Laminate Design and Optimization Grant A. E. Soremekun
- Ga Perf Analysis
- genetic
- GA _timetable Problem 2
- IJCSI-9-2-1-368-376
- genetic
- Optimizing With Ga
- GA
- 00560795
- Research Paper
- Msdo 2015 Lecture 7 Ga
- Deeksha GA
- Genetic Algorithms

Are you sure?

This action might not be possible to undo. Are you sure you want to continue?

We've moved you to where you read on your other device.

Get the full title to continue

Get the full title to continue reading from where you left off, or restart the preview.

scribd