Understanding Genetic Algorithms in Energy Management for Smart Grids

Slide Note
Embed
Share

Genetic Algorithms (GAs) are an optimization technique inspired by Darwinian theory, developed at the University of Michigan. GAs excel in searching for optimal solutions efficiently by intelligently selecting variables. They are particularly useful in solving complex problems that are NP-Hard. This approach is applied in various scenarios by generating populations, utilizing various transition rules, and objective functions. GAs offer a less time-consuming and more efficient method compared to exhaustive search algorithms.


Uploaded on Mar 23, 2024 | 1 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. Genetic Algorithm (GA) Presented By: Sakeena Javaid Supervised By: Dr. Nadeem Javaid Research Domain: Energy Management in Smart Grid Department of Computer Science Comsats Institute of Information Technology, 44000, Islamabad, Pakistan. 1

  2. Introduction Introduction GAs were developed By John Holland, David E. Goldberg and his students At the University of Michigan This is in line with the Darwinian Theory [1] Survival of the Fittest Fittest: ability to adapt to the environment More individuals are produced each generation that can survive Phenotypic variation exists among individuals and the variation is heritable Those individuals with heritable traits better suited to the environment will survive Darwin s Quotation "Variation is a feature of natural populations and every population produces more progeny than its environment can manage. The consequences of this overproduction is that those individuals with the best genetic fitness for the environment will produce offspring that can more successfully compete in that environment. Thus the subsequent generation will have a higher representation of these offspring and the population will have evolved." [1] Darwin's Theory of Evolution by Natural Selection. Available online: https://www.ndsu.edu/pubweb/~mcclean/plsc431/popgen/popgen5.htm (last accessed on 2 Feb 2017) 2

  3. Why GA? Exhaustive search (where every possible combination is checked) accurate result time consuming inefficient when the numbers of variables are large optimizers tend to : limit the number of variables they use limit the number of values these variables can take The genetic algorithm (does not try every possible combination) Optimal solution by selecting variables intelligently Far more variables can be utilized All values of a variable can be checked Simultaneous searching Less likely to become stuck in "local minima" Less time Efficient Solving Difficult Problems There is a large set of problems, which are NP-Hard 3

  4. Why GA is applied? At least three situations where GA is applied [2] GA work with the coding of the parameters Randomly generates population GAs use objective function information (without any derivative or auxiliary information) GAs use probabilistic transition rules (instead of deterministic transition rules) GAs search from population of points instead of using single point [2] Golberg, D. E. (1989). Genetic algorithms in search, optimization, and machine learning. Addion Wesley. Reading. 4

  5. Basic Terminologies of GA Representation Crossover Mutation (probability) Parent selection Survivor selection Speciality Binary strings N-point or uniform Bitwise bit-flipping Fitness-Proportionate children replace parents Emphasis on crossover 5

  6. What is GA (1/2)? A search based algorithm based on the concepts of: natural selection and genetics [3] To find true or approximate solutions Particular class of evolutionary algorithms Use techniques inspired by evolutionary biology Inheritance Mutation Selection Crossover ( Recombination) [3] Genetic Algorithm. Available online: https://www.tutorialspoint.com/genetic_algorithms/genetic_algorithms_tutorial.pdf (last accessed 2 Feb 2017) 6

  7. What is GA (2/2)? Solutions are represented in binary as strings 0s and 1s, however, Other encodings are also possible Implemented as a computer simulation Using abstract representations called Chromosomes, genotypes, phenotypes Candidate solutions (called individuals), Starts from a population Randomly generated individuals In each generation, fitness of every individual is evaluated Multiple individuals are selected (based on their fitness) The new population is used in next iteration Figure 1: Solution Representation 7

  8. GA Requirements A typical genetic algorithm requires two things The solution domain (set search space) A fitness function to evaluate the solution A standard representation of the solution is as an array of bits Chromosomes could be Bit strings (0101 ... 1100) Real numbers (43.2 -33.1 ... 0.0 89.2) Permutations of element (E11 E3 E7 ... E1 E15) Lists of rules (R1 R2 R3 ... R22 R23) Program elements (genetic programming) 8

  9. GA Steps (1/13) Complete cycle consists of some steps Initialization Selection Reproduction Survival Selection Termination Termination is based on the specified criteria 9 Figure 2: GA Steps

  10. GA Steps (2/13) Initialization Two primary methods to initialize a population in a GA Random Initialization Populate the initial population with completely random solutions. Random population is created with a group of individuals (the search space) Population size depends on the nature of the problem (typically contains several hundreds or thousands of possible solutions) Heuristic initialization Populate the initial population using a known heuristic for the problem. Starts with the couple of good solutions. 10

  11. GA Steps (3/13) Selection Fitness Proportionate Every individual can become a parent with a probability Which is proportional to its fitness Fitter individuals have a higher chance of mating Propagating their features to the next generation Two popular fitness proportionate techniques Roulette Wheel Selection Tournament Selection 11

  12. GA Steps (4/13) Roulette Wheel Selection Main idea: better individuals get higher chance Chances proportional to fitness Implementation: roulette wheel technique Assign to each individual a part of the roulette wheel Spin the wheel n times to select n individuals 1/6 = 17% B fitness(A) = 3 A C fitness(B) = 1 2/6 = 33% 3/6 = 50% fitness(C) = 2 12

  13. GA Steps (5/13) Tournament Selection Binary tournament Two individuals are randomly chosen The fitter of the two is selected as a parent Probabilistic binary tournament Two individuals are randomly chosen; with a chance p, 0.5<p<1, The fitter of the two is selected as a parent Larger tournaments n individuals are randomly chosen The fittest one is selected as a parent 13

  14. GA Steps (6/13) Fitness Function A fitness function simply defined is a function Which takes the solution as input Produces the suitability of the solution as the output In some cases, the fitness and the objective function may be same Premature convergence Fitness too large Relatively superfit individuals dominate population Population converges to a local maximum Too much exploitation; too few exploration Slow finishing Fitness too small No selection pressure After many generations, average fitness has converged, but no global maximum is found; not sufficient difference between best and average fitness Too few exploitation; too much exploration 14

  15. GA Steps (7/13) Crossover and Mutation Crossover (also called recombination), and/or mutation Exploration: Discovering promising areas in the search space, i.e. gaining information on the problem Exploitation: Optimising within a promising area, i.e. using information Crossover is explorative It makes a bigjump to an area somewhere in between two (parent) areas Mutation is exploitative Creating random small diversions, thereby staying near (in the area of ) the parent 15

  16. GA Steps (8/13) Crossover Operator Generating offspring from two selected parents Single point crossover Two point crossover (Multi point crossover) Uniform crossover Single point crossover Choose a random point on the two parents Split parents at this crossover point Create children by exchanging tails Pc typically in range (0.6, 0.9) Two point crossover (Multi point crossover) Crossover is a generalization of one point crossover Wherein alternating segments are swapped To get new off-springs 16

  17. GA Steps (9/13) Uniform crossover We don t divide the chromosome into segments We treat each gene separately We essentially flip a coin for each chromosome To decide whether or not it ll be offspring We can also bias the coin to one parent Mutation Is used to maintain and introduce diversity Is usually applied with a low probability Bit Flip Mutation Random Resetting Swap Mutation Scramble Mutation Inversion Mutation 17

  18. GA Steps (10/13) Bit flip mutation We select one or more random bits and flip them Used for binary encoded GAs Random Resetting Extension of the bit flip for the integer representation A random value from the set of permissible values is assigned to a randomly chosen gene Swap Mutation We select two positions on the chromosome at random Interchange the values 18

  19. GA Steps (11/13) Scramble Mutation Popular with permutation representations Entire chromosome, a subset of genes is chosen Their values are scrambled or shuffled randomly Inversion Mutation Select a subset of genes like in scramble mutation Instead of shuffling the subset invert the entire string in the subset 19

  20. GA Steps (12/13) Most of methods above used for parent selection Survivor Selection Policy Which individuals are to be kicked out Which are to be kept in the next generation Survivor selection can be divided into two approaches Age-Based Selection e.g. SGA In SSGA can implement as delete-random (not recommended) or as first-in-first-out (a.k.a. delete-oldest) 20

  21. GA Steps (13/13) Fitness-Based Selection Using one of the methods above Elitism Always keep at least one copy of the fittest solution Termination Criteria No improvement in the population Absolute number of generations Objective function value has reached a certain pre-defined value 21

  22. Algorithm Algorithm Randomly generate population Evaluate fitness of population While (termination criteria is reached) do Parent selection Crossover with probability pc Mutation with probability pm Decode and fitness calculation Survivor selection Find best Return best 22

  23. GA Example 1 (1/3) Example x2 example: selection Population of four strings Initial population is generated Simple x value is calculated Fitness is evaluated For the specified criteria x2 23

  24. Example 1 (2/3) Example 1 x2 example: Crossover Number of strings 1-bit crossover is chosen For finding the suitable offspring Crossover point is selected Offspring after crossover Simple x value is calculated Fitness value (x2) is determined 24

  25. Example 1 (3/3) Example 1 x2 example: Mutation To maintain the population diversity 1-bit mutation is applied Four strings are taken X value is calculated Fitness function is evaluated 25

  26. Example 2 Example 2 f(x) = {MAX(x2): 0 <= x <= 32 } Encode Solution Use 5 bits (1 or 0) Generate initial population Evaluate each solution against objective Create next generation of solutions Probability of being a parent depends on the fitness Ways for parents to create next generation Reproduction Crossover (Cut and paste portions of one string to another) Mutation (Randomly flip a bit) A 0 1 1 0 1 B 1 1 0 0 0 C 0 1 0 0 0 D 1 0 0 1 1 Sol. String Fitness % of Total A 01101 169 14.4 B 11000 576 49.2 C 01000 64 5.5 D 10011 361 30.9

  27. Example 3 Example 3 Works by constructing a table listing which edges are present in the two parents if an edge is common to both, mark with a + e.g. [1 2 3 4 5 6 7 8 9] and [9 3 7 8 2 6 5 1 4] 27

  28. Example 4 Edge Selection Pick an initial element at random put it in the offspring Set the variable current element entry Remove all references to current element from the table Examine list for current element: If there is a common edge, pick that to be next element Otherwise pick the entry in the list, which itself has the shortest list Ties are split at random In the case of reaching an empty list: Examine the other end of the offspring is for extension Otherwise a new element is chosen at random 28

  29. Applications Other Applications Optimization Most commonly used in optimization problems To maximize or minimize a given objective function value under a given set of constraints Parallelization Good parallel capabilities, and prove to be very effective means in solving certain problems, and also provide a good area for research Image Processing Used for various digital image processing (DIP) tasks as well like dense pixel matching Scheduling applications GAs are used to solve various scheduling problems Particularly the time tabling problem 29

  30. Thanks Questions and Answers 30

Related


More Related Content