Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Genetic algorithm raktim

3,804 views

Published on

Genetic Algorithm A short Overview

Published in: Technology
  • Be the first to comment

Genetic algorithm raktim

  1. 1. GENETIC ALGORITHMNAME: RAKTIM HALDARROLL :11EC63R12DEPT : RF & MicrowaveIIT Kharagpur
  2. 2. OVERVIEW• Introduction• History and Motivation• Natural Evolution Process• Optimization and Genetic Algorithm(GA)• Basics of Genetics• Simulation of Natural Evolution: GA• Mathematical Examples• GA using MATLAB• GA Applications in Electromagnetism & Other fields• Comparison between different Optimization Tools• Advantages and Disadvantages, Remedies
  3. 3. INTRODUCTION• Each species try to adapt and acclimatized itself with the gradually changing environment on the earth.• The knowledge that each species gains is encoded in its chromosomes automatically, which undergoes transformations when reproduction occurs.• Over a period of time, these changes to the chromosomes give rise to more fit species that are more likely to survive, and so have a greater chance of passing their improved characteristics on to future generations.• Otherwise the species may extinct.• Genetic Algorithm is search Heuristic that mimics the process of natural evolution and helps us to find out the fittest solution of a problem exactly the same way simulating selection, crossover, mutation etc.• Often its used in optimization and search problems.
  4. 4. History• 1859:Natural selection, genetic inheritance and evolution was first described by Charles Darwin• 1954:Computer simulations of evolution started as early as in 1954 with the work of Nils Aall Barricelli at the Institute of Advanced Study, Princeton.• 1957:Fraser developed first Genetic Algorithm.• 1960:John Holland developed GA on his own way.• 1966:The idea of ‘Evolutionary computation’, as a part of artificial intelligence first introduced by Lawrence J. Fogel.• 1970-75:Genetic Algorithm is Developed by John Holland and his students, University of Michigan (1970’s) almost in the form today we are using it. Thus called the father of ‘GA’.• 1980 -90: GA and Swarm Intelligence Method became very Popular method of computation.
  5. 5. Motivation & NecessityMOTIVATION:Nature is the motivation. Nature automatically finds out the best, fittest individual from a species those who are likely to survive more easily than others. Exactly the same way we can find out the best solutions among a no of solutions by using GA from a given search space for a specific problem.NECESSITY:Often we need a search or an optimization process which-1) Can deal with complex multidimensional discontinuous problem..2) Is easy and efficient to find global maxima or minima.3) Faster.4) Can be implemented by computer.5) Can be used in Huge search space defined for those variables.GA satisfies the following criterias.
  6. 6. Evolution• In 1859 Darwin gave a theory in his ‘On the origin o Species by Means of Natural Selection’.• Individuals less suited to the environment are less likely to survive and less likely to reproduce; individuals more suited to the environment are more likely to survive and more likely to reproduce and leave their inheritable traits to future generations ( called Survival of the fittest), which produces the process of natural selection.• This slowly effected process results in populations changing to adapt to their environments, and ultimately, these variations accumulate over time to form new species called ‘EVOLUTION’.
  7. 7. What is ‘OPTIMIZATION’?• Optimization is an effort to find the best solutions for a given problem (often Multi-dimensional) from a no of alternative solutions in a search space.• Sometimes we need to maximize or minimize some function say maximizing the profit or minimizing the cost, path length etc which depends upon various parameters.• Mathematical Example:• say, f=f( x1, x2, x3 …xn), We want to find maximum value of ‘f’ and for that the values of x1,x2 …xn and suppose if x1 increases upto some value ‘f’ also increases and if for x2 decreases ‘f’ decreases and also values of x1,x2,x3…xn effect each other so to find the maxima basically we need a ‘TRADE-OFF ‘ between the values of variables that’s called optimization.
  8. 8. Mathematical Examples:
  9. 9. A Practical Example : Microstrip Antenna Design• Design W,L and x of a Microstrip Antenna with Minimum Return Loss (R)• Operation frequency fo, εr and h is given
  10. 10. Different Important Optimization Techniques
  11. 11. BASICS OF GENETICS
  12. 12. Cell Structure and Chromosome
  13. 13. Cell-Nucleus-Chromosome-DNA-Gene
  14. 14. Gene:• DNA: Deoxyribonucleic Acid• Basically Pentose Sugar+ +Base(A/T/G/C)=Nucleotide• DNA is a polymer of the Nucleotide Blocks called De-oxyribonucleic Acid.• A small part of DNA (sometimes RNA)can synthesis a particular protein which determines a few characteristics of an individual.• Thus ‘GENE’ is called the molecular unit of heredity of a living organism.
  15. 15. Reproduction and Evolution (example: HUMAN)
  16. 16. SIMULATION OF GENETIC ALGORITHM
  17. 17. NATURE TO COMPUTER MAPPING NATURE COMPUTER1.INDIVIDUAL 1. Solution to a problem2.POPULATION 2. A no of trial solution 3. The Quality of Solution3.FITNESS 4. Encoding for a Solution4.CHROMOSOME 5. Part of encoding of a solution5.GENE that can interchange with others6.CROSSOVER 6. Search Operators7.MUTATION 7. Search Operators help to avoid local optimas8.NATURAL SELECTION 8. Reuse of Good solutions 9. Iteration9.GENERATION
  18. 18. Simulation continued• Evolution takes place taking account of each and every member of a species. Thus when we are going to search a solution in a solution space of a given problem, each solution will be an individual.• A no of all solutions in an iteration no ‘I’ will be the total population and each iteration is similar to a generation.• In any generation children or off-springs are made due to reproduction of parents from previous generation.• Cross-over and mutation are taken place while reproduction occurs.• In this generation again natural selection select two parents for reproduction and create off-springs of the next generation and so on until the selection procedure ends.• This method continues until solution criteria is satisfied.
  19. 19. FLOW CHART OF GENETIC ALGORITHM
  20. 20. GA Algorithm Steps:Step1:Start with a randomly generated population of n chromosomesStep2:Calculate the fitness f(x) of each chromosome x in the population.Step3:Repeat the following steps until n offspring have been created, 3.1 Selection: Roulette-wheel selection operation. (Or, any) 3.2 Crossover: With Cross-over probability p_cross-over. 3.3 Mutation: With Mutation Probability p_mutation.Step4:Replace the current population with the new population.Step5:Repeat steps 2-4 until the objectives solution is found.
  21. 21. Mathematical Example: How to Code GA?• Lets us assume first we want to find minima of f(x),an one dimensional function within domain of xϵ[x1,x2];• First we need to code the solution for Chromosome.• We can use any code preferably Binary Coding.For example: for domain of x from 0 to 7 we can use where step size is 1.
  22. 22. Generalization of binary coding L• Resolution or step size or accuracy level~ 2• L is the no of bits present in the coding. L• Hence Step size=Δ=(X2-X1)/(2 -1);• Code=X1+n*Δ. 2
  23. 23. Initial population & Selection• First an initial population is created taking N no of individuals preferably 30-100 and depends on problem type.• Then Fitness Value of each individual is calculated.• FITNESS FUNCTION: Is defined as such a function for which as solution approaches it also becomes maximum.• So Fitness for ‘i’ th individual is Fi.• Probability of selection : Where N=no of individual in a population• Now from the individuals, 2-parents parents are selected by simulating ‘NATURAL SELECTION’ for creating off-spring.• For simple GA generally Population size remains same• Some selection processes are:1. Fitness Proportionate or Roulette-Wheel selection2. Tournament Selection etc.
  24. 24. Roulette-Wheel Selection• Here we stochastically select from one generation to create the basis of the next generation. The requirement is that the fittest individuals have a greater chance of survival than weaker ones.• In MATLAB rand() creates a random no between 0 to 1.• If its between 0 to .31 1st one , if its between .31 to .36(=.31+.05) then 2nd one will be selected in this example.
  25. 25. Crossover• one-point crossover parent A 1 1 0 1 0 offspring A 11011 parent B 1 0 0 0 1 offspring B 10000• two-point crossover parent A 11010 offspring A 11 00 0 parent B offspring B 10001 10 01 1
  26. 26. Crossover continued..• Except those 2 important types of cross-overs sometimes these are also used:1. Uniform Crossover.2. Arithmetic Crossover.3. Heuristic Crossover.4. Multipoint Crossover.
  27. 27. Mutation• Helps to maintain diversity in population.• Providing new genetic materials it helps to find out global maxima rather than local maxima.1. Flip-Bit:2. Uniform.3. Non-Uniform.4. Boundary.5. Gaussian.Etc.
  28. 28. Case Study: Program with MATLAB• Case Study 1: Function with 1 variable : where xϵ[2,17] ,need to find out the maxima in that domain of x: GA: Fmin=1.7991 @ x~4.3Solution: 4.5Lets take accuracy level = 1/1024 4so bit required=10 3.5Fmin=1.7791 F(x)At x=4.3 (almost) 3 2.5 2 1.5 2 4 6 8 10 12 14 16 18 x
  29. 29. Solution by GA
  30. 30. Continued..
  31. 31. Continued..
  32. 32. How to do program for multiple variable?• Let F=F(X1,X2,X3……Xn) and need to find out Fmax or Fmin where domain is defined.• What we need to do first find the code for each x1,x2,x3… Xn then concatenate them to find out the chromosome or solution in (x1,x2,…Xn) form .• Rest Will be same.
  33. 33. MATLAB:GA TOOL>>optimumtool(‘ga’)
  34. 34. Continued..
  35. 35. Continued..
  36. 36. Continued..
  37. 37. GA by Matlab tool continued..
  38. 38. OBSERVATION: Typical Practical Values for best performance:• Population Size: 20-100 Depends Upon problem also.• Cross-Over Probability: 0.6-0.9 Optimal value~0.7 .• Mutation Probability: As low as possible, 0.1-0.01 etc.• Generation: Typically 50 to 100 yields good result.Here Roulette-wheeler selection is taken all over the experiment.
  39. 39. Do Aliens Exist?• According to Erich Von Daniken, A famous writer Evolution does not take place as it is, not only by ‘nature’ but creatures from other Universe who mutated to create developed genes.• Solution of a mathematical problem by GA supports ‘Evolution’.• But if we add mutation with p_mutation as high as 0.6 to 0.8 the result sometimes drastically fall and sometimes it is surprisingly better.• What you must to know, when and where you need to mutate to develop a gene otherwise poor solution(Extinction), Haphazard solution(cancerous growth) can result.• Does this prove that the history of mankind is not exactly what we think it is???
  40. 40. Application of GA in Electromagnetism1. RCS reduction: Broad-band multi-layer electromagnetic Absorber.2. Low side-lobe levels in thinned and non-uniform arrays.3. Shaped Beam-array.4. Broad-band Patch Antenna Design.5. Natural Resonance Extraction Etc.
  41. 41. Application in Other fields Domain Application Types Control gas pipeline, pole balancing, missile evasion, pursuit Design semiconductor layout, aircraft design, keyboard configuration, communication networks, using travelling salesman problem. Scheduling manufacturing, facility scheduling, resource allocation Robotics trajectory planning Machine Learning designing neural networks, improving classification algorithms, classifier systems Signal Processing filter design Game Playing poker, checkers, prisoner’s dilemma Combinatorial Optimization set covering, travelling salesman, routing, bin packing, graph colouring and partitioning Civil Engineering Design any construction or path with stortage distant, Lowest Cost , lowest Weight and highest Profit ….Etc.
  42. 42. Comparison of 2 popular optimization processesGenetic Algorithm(GA) Particle Swarm Optimization(PSO)1. Weak solutions also give 1. Generally Knowledge of the Best contribution to find the actual particles contribute to find the solution. solution.2. Coding for chromosome 2. No coding as such. required. 3. Change of velocity and3. Crossover , mutation happen. direction.4. Hard to implement. 4. Very easy to implement.5. Faster. 5. Slower.6. Gives better results. 6. Give good results but not like GA.
  43. 43. Disadvantages1. Take more space to calculate fitness every-time.2. Often in practical situation if mutation probability is high it fails to give good solution and again takes larger space.3. Tendency to converge towards local optima if mutation is not proper.4. Cant operate efficiently on a dynamic set of data and when it was already tense to converge towards a solution for previous situation.5. Not always superior to other optimization problems. Its situation dependent so We cant use this technique blindly.
  44. 44. References:1. C. Darwin.” On the Origin of Species by Means of Natural Selection”; or, “The Preservation of flavored Races in the Struggle for Life. “John Murray, London, 1859.2. “THE CELL:A molecular Approach” by Geoffrey M. Cooper and Robert E. Hausman3. “Cytology and Genetics” by Sumitra Sen and Dipak Kumar Kar4. “An Introduction to Genetic Algorithm” by Melanie Michell5.”An Introduction to Genetic Algorithm “ by S.N.Shivanandan and S.N. Deepa,Springer6. “Genetic Algorithms in Engineering Electromagnetics” by J. Michael Johnson and Yahya Rahmat-Samii,IEEE Antennas and Propagation Magazine, Vol. 39, No. 4, August 19977.”Genetic Algorithm (GA) and Particle Swarm Optimization (PSO) in Engineering Electromagnetics” Yahya Rahmat-Samii,ICECOM17, 17hlnternational Conference on Applied Electromagnetics and Communications1 - 3 October 2003. Dubrovnik, Croatia8. “Genetic Algorithm Optimization Applied to Electromagnetics:A Review “Daniel S. Weile and Eric Michielssen, IEEE TRANSACTIONS ON ANTENNAS AND PROPAGATION, VOL. 45, NO. 3, MARCH 19979. “An Introduction to Genetic Algorithms for Electromagnetics” by Randy L. Haupt, IEEE Antennas and Pmpagatiin Magazine, Vol. 37, No. 2, April 199510. “Design of Multiband Microstrip Antennas Using a Genetic Algorithm” by H. Choo, Student Member, IEEE, and H. Ling, Fellow, IEEE, IEEE MICROWAVE AND WIRELESS COMPONENTS LETTERS, VOL. 12, NO. 9, SEPTEMBER 200211. “COMPARISON OF GENETIC ALGORITHM AND PARTICLE SWARM OPTIMISATION” by Dr. Karl O. Jones International Conference on Computer Systems and Technologies - CompSysTech’200512. Manual:Genetic Algorithm TOOLBOX For Use with MATLAB
  45. 45. References Continued..13 .”Chariots of Gods” , by Erich Von Daniken14.” Swarm and Evolutionary Computation” by Swagatam Das and P.N. Suganathan15.”Gnenetic Algorithm and Engineering Optimization” by Mitsuo Gen and Runwei ChengWebsites:1.Overview:http://en.wikipedia.org/wiki/Genetic_algorithm2. Genetic Algorithm Implementation Using Matlab :http://www.scribd.com/doc/31235552/Genetic- Algorithm-Implementation-Using-Matlab3. http://www.optiwater.com/optiga/ga.html4. http://geneticalgorithms.ai-depot.com/Tutorials.html5.Genetic Algorithm Tutorial and JAVASCRIPT SIMULATION:http://www.obitko.com/tutorials/genetic- algorithms/biological-background.php6. http://www.ai-junkie.com/ga/intro/gat1.html7. http://www.coderprofile.com/networks/articles/34/genetic-algorithm-beginner-level8. http://en.wikipedia.org/wiki/Crossover_%28genetic_algorithm%299.Roulette-Wheel Selection at a glance:http://www.edc.ncl.ac.uk/highlight/rhjanuary2007g02.php/10.Methods of Selection and Crossover :http://en.wikipedia.org/wiki/Crossover_(genetic_algorithm)11.www.mathwork.com and MATLAB Demos for Genetic Algorithm.
  46. 46. QUESTIONS??? QUESTIONS???
  47. 47. THANK YOU

×