You are on page 1of 21

Optimization Techniques

Genetic Algorithms (GA)
and
Particle Swarm
Optimization (PSO)

The Genetic Algorithms
(GA)
• Modeled and developed by John Holland at
University of Michigan in 1975

• Direct random search algorithm based
mechanics of biological evolution

• Basically, GA borrows the idea and developing
mechanism from genetic evolution and natural
selection

effective techniques for optimization applications • Widely-used today in.) • Provide efficient.The Genetic Algorithm (cont. scientific and engineering areas .

Genetic Algorithm • Based on Darwinian Paradigm Reproduction Competition Survive Selection • Intrinsically a robust search and optimization mechanism .

Conceptual Algorithm .

parents are selected to reproduce offspring for a new generation • Fitter individuals have more chance to reproduce • New generation has same size as old generation • Offspring has combination of properties of two parents • If well designed. population will converge to optimal solution . Genetic Algorithm • Inspired by natural evolution • Population of individuals • Individual is feasible solution to problem • Each individual is characterized by a Fitness function • Higher fitness is better solution • Based on their fitness.

Use new generated population for a further run of the algorithm 5. Place new offspring in the new population 4. and return the best solution in current population 6. Create a new population using following steps a. Generate random population of n chromosomes (suitable solutions for the problem) 2. Select two parent chromosomes from a population according to their fitness b. Evaluate the fitness of each chromosome x in the population 3. . Go to step 2. With a crossover probability cross over the parents to form new offspring c. stop. d. Outline of Basic Genetic Algorithm 1. With a mutation probability mutate new offspring at each position in chromosome. If the end condition is satisfied.

Mutation . Phases of Genetic Algorithm 1. Evaluation 3. Crossover c. Genetic operation (objective is the generation of new population from the existing population with the examination of fitness values of chromosomes and application of genetic operators) a. Initialization 2. Reproduction b.

e. initial search points) • Population size and string length need to be judiciously selected • Eg:- . Initialization • Generation of initial population of chromosomes( i.

. Evaluation • Link between genetic algorithm and problem • “Fitness function” is defined • Suitability of each of the chromosome (solutions) is determined.

Mutation . Genetic operation • Objective is the generation of new population from the existing population with the examination of fitness values of chromosomes and application of genetic operators a.Crossover c.Reproduction b.

Reproduction • Operator where by an old chromosome is copied into a mating pool according to its fitness value to produce offspring • Highly fit chromosomes receive more copies in the next generation f (i ) • selection Individual i will have a  f (i) i • Roulette wheel probability to be chosen • Tournament Area is 1 2 Proportional n to fitness value 3 4 .

 Single point crossover  Two point crossover (Multi point crossover)  Uniform crossover . Crossover • Here the gene information of two selected parents is utilized in certain fashion to generate two children who bear some of the useful characteristics of parents and expected to be more fit than parents • Responsible for the global search property of GA. • Various techniques that are used for performing this crossover.

Single Point Crossover • Randomly one position in the chromosomes is chosen • Child 1 is head of chromosome of parent 1 with tail of chromosome of parent 2 • Child 2Randomly is head of position chosen 2 with tail of 1 Parents: 1010001110 0011010010 Offspring: 0101010010 0011001110 .

Chld1=Par2 and Chld2=Par1) . Chld1=Par1 and Chld2=Par2) (if mask=1. Multi Point Crossover • Mask is generated randomly • Cross over is made entire length of string Parent1: 1 1 0 0 1 0 1 1 Parent2: 0 1 0 0 0 1 0 0 Mask: 0 0 1 0 1 1 0 1 Offspring1: 1 1 0 0 0 1 1 0 Offspring2: 0 1 0 0 1 0 0 1 (if mask=0.

Chld1=Par2 and Chld2=Par1) . Uniform Crossover • Mask is generated randomly for each crossover • Cross over is made entire length of string Parent1: 1 1 0 0 1 0 1 1 Parent2: 0 1 0 0 0 1 0 0 Mask: 0 0 1 0 1 1 0 1 Offspring1: 1 1 0 0 0 1 1 0 Offspring2: 0 1 0 0 1 0 0 1 (if mask=0. Chld1=Par1 and Chld2=Par2) (if mask=1.

Mutation • It is random alteration of a bit value at a particular bit position in the chromosome to maintain the population diversity • Eg:.001 to 0. . • Generally mutation probability will be in the range of 0.Mutation site: 4 (say) Original String: 1011001 String after mutation: 1 0 1 0 0 0 1 • Mutation Probability (Pm).01.

Economic Dispatch Problem Using GA • Encoded parameter is the normalized system incremental cost d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 • The decoding of λnm 12 nm    d i  2  i  i 1 • The actual system incremental cost .e = λmin + λnm(λmax – λmin) • Fitness Function 1 FIT    1 k   PD n where  P P i 1 i D  Ploss . λf.

Repeat the procedure from step no. Read generator data. B-coefficients. Algorithm 1.e incremental cost 5. Decode the chromosomes and calculate the actual system λ f. Generate initial population of chromosome 3. 5 until chromosome count>population size .e value and enforce Pi limits. P limits. Calculate the fitness value of the chromosome 8. Calculate transmission losses using B-coefficient equation 7. 2. Set the iteration and chromosome count 4. 6. Calculate the generation output of all the units for each chromosome from its λf. power demand and GA parameters.

Perform crossover on selected parents and generate new child chromosomes. If iteration count <max. 16.Calculate the total fuel cost and Print the result . else print “problem not converged in maximum number of iterations” 17.Copy the Pe % chromosomes of old population to new population starting from the best ones from the top 12.Add all the generated child chromosomes to new population 14. iteration. go to 17 11.) 9. repeat it to get required number of chromosomes 13.Replace old population with new population. if yes. go for next iteration .Increment iteration count.Check if the error is less than ε. Algorithm (cont.Perform mutation on all chromosomes 15. Sort the chromosomes and all their related data in the descending order of fitness 10.

Thank U Genetic Algorithms 21 .