Presentation is loading. Please wait.

Presentation is loading. Please wait.

Presented By: Farid, Alidoust Vahid, Akbari 18 th May-2011 --------------------------------------------------------------------- IAUT University – Faculty.

Similar presentations


Presentation on theme: "Presented By: Farid, Alidoust Vahid, Akbari 18 th May-2011 --------------------------------------------------------------------- IAUT University – Faculty."— Presentation transcript:

1 Presented By: Farid, Alidoust Vahid, Akbari 18 th May-2011 --------------------------------------------------------------------- IAUT University – Faculty of Mechanical Engineering (MSC in Mechatronics) www.iaut.ac.ir | www.alidoost.ir

2  Topics:  Introduction to GA  Biological Background  GA Operations  where to use it !?  Solving a problem in Matlab Introduction to Genetic Algorithm 2

3  The genetic algorithm is a probabilistic search algorithm that iteratively transforms a set (called a population) of objects (typically fixed-length trings), each with an associated fitness value, into a new population of offspring objects using the Darwinian principle of natural selection and using operations that are patterned after naturally occurring genetic operations, such as crossover and mutation. Introduction to Genetic Algorithm 3  Intorduction to GA (1)

4 Introduction to Genetic Algorithm 4  Intorduction to GA (2)  Genetic algorithms are based on a biological metaphor and the search for the optimal solution is viewed as a competition amongst the population of evolving candidate problem solutions.  + =>

5 Introduction to Genetic Algorithm 5  Intorduction to GA (3)  Genetic Algorithm is based on Biological Evolution.  Primal idea posed by Rechenberg in 1960.  introduced in 1970 by John,Holland in Michigan University.  GA, also known as Evolutionary Algorithms.

6 Introduction to Genetic Algorithm 6  Biological Background  All live creatures can be defined by their:  Chromosome (Genome)  Genes  Proteins (A T G C)  Trait (property)  Allele (Neighbour Non-Homogen Genes)  Natural Selection Based on darwinian theory, only those who adapt with nature will survive. (in GA we say : survival of fittest)

7 Introduction to Genetic Algorithm 7  GA Operations  Encodings (convert problem to a sequence of bits to be interpretable by machine)  Initiate Population (randomly produce some sequences)  Selection (Select Elites of the population)  Reproduction  Crossover (reproduction)  Mutation

8 Introduction to Genetic Algorithm 8  GA Operations (Cont.) ENCODING(1/3)  Fixed-Length encoding  1D encoding: arrays, lists, strings,…  2D encoding: matrices, graphs  Variable-Length encoding  Tree encoding: binary parser trees (used in GP)

9 Introduction to Genetic Algorithm 9  GA Operations (Cont.) ENCODING (2/3)  Permutation Encoding :  Map Coloring problem, TSP,…  Array in size of regions, each cell has an integer corresponding to available colors.  R=1 G=2 B=3 W=4  Binary Encoding:  equation solving ()  Chromosome A 101100101100101011100101 Chromosome B 111111100000110000011111

10 Introduction to Genetic Algorithm 10 GA Operations (Cont.) ENCODING (3/3)  Tree encoding  Genetic programming, finding function of given values (elementary system identification) ( x + ( 5/ y ) ) ( do_until step wall )

11 Introduction to Genetic Algorithm 11  GA Operations (Cont.) SELECTION (1/3)  In GA,the object is to Maximizing or Minimizing fitness values of population of Chromes.  Fitness Function should be applicable to any Chromes. Mostly a positive number, showing a distance between present state to goal state.

12 Introduction to Genetic Algorithm 12  GA Operations (Cont.) SELECTION (2/3)  Roulette Wheel Selection  [Sum] Calculate sum of all chromosome fitnesses in population - sum S.  [Select] Generate random number from interval (0,S) - r.  [Loop] Go through the population and sum fitnesses from 0 - sum s. When the sum s is greater then r, stop and return the selected chromosome.  Not suitable for highly variance populations  Using RANK Selection  Converge Slowly. 12

13 Introduction to Genetic Algorithm 13  GA Operations (Cont.) SELECTION (3/3)  Steady-state Selection (threshold)  Elitism  Boltzmann Selection  P(E)=exp(-E/kT), like SA. Number of selections reduces in order of growing of age  Tournament Selection

14 Introduction to Genetic Algorithm 14  GA Operations (Cont.) REPRODUCTION(1/1)  Reproduction rate  Selected gene transfers directly to new Generation without any change.

15 Introduction to Genetic Algorithm 15  GA Operations (Cont.) CROSSOVER(1/1)  CROSSOVER rate and range  Single Child  Single-Point  11001011+11011111 = 11001111  Multi-Point  Uniform  Arithmetic  11001011 + 11011111 = 11001001 (AND)  Multi Children

16 Introduction to Genetic Algorithm 16  GA Operations (Cont.) MUTATION(1/1)  Mutation rate  Inversion  Deletion and Regeneration  For TSP is proved that some kind of mutation causes to most efficient solution 11001001 => 10001001

17 Introduction to Genetic Algorithm 17  where to use it !?  optimization,  automatic programming,  machine learning,  economics,  operations research,  ecology,  studies of evolution and learning, and  social systems

18 Introduction to Genetic Algorithm 18  Nonlinear dynamical systems : predicting, data analysis  Designing neural networks including Architecture(neurons distribution) and weights  Robot trajectory (Optimum Path Selection)  Behavior Learning in humanoid robots  Evolving LISP programs (genetic programming)  Distributed computer networks topology  Designing Antenna’s with a given Radiation Pattern  Optimum aircraft’s wing design  Sequence scheduling  AND All Optimization Problems…!!  where to use it !?

19 19 Introduction to Genetic Algorithm  Parallelization of Genetic Programming  In 1999, Genetic Programming Inc. used a parallel computer with 1000 nodes including P2,350Mhz, to implement Genetic Algorithms

20 Introduction to Genetic Algorithm 20  Solving a problem with GA in matlab (1)  Consider we have a 3*3 Square that must be filled with numbers from 1 to 15 with this rules:  Rule #1- Summing all numbers in a row must be equal to 24  Rule #2- Summing all numbers in a column must be equal to 24  This problem is to some extent complex !! A human can solve it in a particular time, but a computer almost can’t solve it only by assigning random numbers in each cell. N1N2N3 N4N5N6 N78N9 +=24 +=24+=24 +=24

21 Introduction to Genetic Algorithm 21  Solving a problem with GA in matlab (2)  First step in all genetic algorithms is to produce first generation of randomly generated population.  Before generating random population, we must define Chromosome(gene) structure to define our problem.  A simple structure may be defined as :  We need 9 integers (1->15) to fill square, so we can use a 1*9 array to define a solution to our problem.  Integers(1->15) needs only 4 bit to demonstrate.  So we can define a string with length of (4*9=) 36 bits.

22 Introduction to Genetic Algorithm 22  Solving a problem with GA in matlab (3) 61215 11410 7514 +=33 +=25 +=26 +=24+=21 +=39

23 Introduction to Genetic Algorithm 23 Introduction to Genetic Algorithm 23  Solving a problem with GA in matlab (4)  Now we have a way to determine integrity of our solutions.  Now we have to generate first random generation, for example we start with population of 10. *randi([1 15],10,9);  This command Produce an array (10*9) with random integers(1->15) in matlab  After producing 1 st generation we have to define their fitness values and select best individuals.  We have multiple selection methods, we use Rank selection method.

24 Introduction to Genetic Algorithm 24  Solving a problem with GA in matlab (5)  After selecting Elite individuals, next step is to merge these elites to have a new generation with a hope to find a better solution in next generation.  For generating next generation we can use:  1-Crossover: in our case, we use single point  2- Mutation: we use 1 random cell mutation.

25 Introduction to Genetic Algorithm 25  Solving a problem with GA in matlab (6)  After selecting Elite individuals, next step is to merge these elites to have a new generation with a hope to find a better solution in next generation.  For generating next generation we can use:  1-Crossover: in our case, we use single point  2- Mutation: we use random 1 bit mutation.

26 Introduction to Genetic Algorithm 26  Solving a problem with GA in matlab (7) Simulating in Matlab…!

27 Introduction to Genetic Algorithm 27  References:  الگوریتم های ژنتیک,سعید شیری  GENETIC ALGORITHMS AND GENETIC PROGRAMMING, Ehsan Khoddam Mohammadi  Genetic Algorithm and Direct Search Toolbox, Matlab user’s guide  Introduction to Genetic Algorithms, S.N.Sivanandam - S.N.Deepa,Springer,2008

28 Introduction to Genetic Algorithm 28 Thanks for your attention!

29 Introduction to Genetic Algorithm 29 Questions?!


Download ppt "Presented By: Farid, Alidoust Vahid, Akbari 18 th May-2011 --------------------------------------------------------------------- IAUT University – Faculty."

Similar presentations


Ads by Google