Genetic algorithms Prof Kang Li

Slides:



Advertisements
Similar presentations
CS6800 Advanced Theory of Computation
Advertisements

Biologically Inspired AI (mostly GAs). Some Examples of Biologically Inspired Computation Neural networks Evolutionary computation (e.g., genetic algorithms)
1 Wendy Williams Metaheuristic Algorithms Genetic Algorithms: A Tutorial “Genetic Algorithms are good at taking large, potentially huge search spaces and.
Genetic Algorithms By Chhavi Kashyap
1 Lecture 8: Genetic Algorithms Contents : Miming nature The steps of the algorithm –Coosing parents –Reproduction –Mutation Deeper in GA –Stochastic Universal.
COMP305. Part II. Genetic Algorithms. Genetic Algorithms.
Evolutionary Computational Intelligence
Introduction to Genetic Algorithms Yonatan Shichel.
Intro to AI Genetic Algorithm Ruth Bergman Fall 2002.
Genetic Algorithms Nehaya Tayseer 1.Introduction What is a Genetic algorithm? A search technique used in computer science to find approximate solutions.
7/2/2015Intelligent Systems and Soft Computing1 Lecture 9 Evolutionary Computation: Genetic algorithms Introduction, or can evolution be intelligent? Introduction,
Intro to AI Genetic Algorithm Ruth Bergman Fall 2004.
Chapter 6: Transform and Conquer Genetic Algorithms The Design and Analysis of Algorithms.
Evolutionary Computation 22c: 145, Chapter 9. What is Evolutionary Computation? A technique borrowed from the theory of biological evolution that is used.
Genetic Algorithms Overview Genetic Algorithms: a gentle introduction –What are GAs –How do they work/ Why? –Critical issues Use in Data Mining –GAs.
Pawel Drozdowski – November Introduction GA basics Solving simple problem GA more advanced topics Solving complex problem Question and Answers.
Genetic Algorithms: A Tutorial
Genetic Algorithm.
Genetic Algorithms and Ant Colony Optimisation
Evolutionary Intelligence
© Negnevitsky, Pearson Education, CSC 4510 – Machine Learning Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University.
Introduction to Genetic Algorithms and Evolutionary Computation
SOFT COMPUTING (Optimization Techniques using GA) Dr. N.Uma Maheswari Professor/CSE PSNA CET.
Intro. ANN & Fuzzy Systems Lecture 36 GENETIC ALGORITHM (1)
CS 484 – Artificial Intelligence1 Announcements Lab 3 due Tuesday, November 6 Homework 6 due Tuesday, November 6 Lab 4 due Thursday, November 8 Current.
Zorica Stanimirović Faculty of Mathematics, University of Belgrade
More on Heuristics Genetic Algorithms (GA) Terminology Chromosome –candidate solution - {x 1, x 2,...., x n } Gene –variable - x j Allele –numerical.
An Introduction to Genetic Algorithms Lecture 2 November, 2010 Ivan Garibay
Genetic Algorithms Genetic Algorithms – What are they? And how they are inspired from evolution. Operators and Definitions in Genetic Algorithms paradigm.
Genetic Algorithms Introduction Advanced. Simple Genetic Algorithms: Introduction What is it? In a Nutshell References The Pseudo Code Illustrations Applications.
1 “Genetic Algorithms are good at taking large, potentially huge search spaces and navigating them, looking for optimal combinations of things, solutions.
Soft Computing A Gentle introduction Richard P. Simpson.
Derivative Free Optimization G.Anuradha. Contents Genetic Algorithm Simulated Annealing Random search method Downhill simplex method.
© Negnevitsky, Pearson Education, Lecture 9 Evolutionary Computation: Genetic algorithms Introduction, or can evolution be intelligent? Introduction,
2005MEE Software Engineering Lecture 11 – Optimisation Techniques.
 Negnevitsky, Pearson Education, Lecture 9 Evolutionary Computation: Genetic algorithms n Introduction, or can evolution be intelligent? n Simulation.
1 Genetic Algorithms and Ant Colony Optimisation.
1 Genetic Algorithms K.Ganesh Introduction GAs and Simulated Annealing The Biology of Genetics The Logic of Genetic Programmes Demo Summary.
Genetic Algorithms Przemyslaw Pawluk CSE 6111 Advanced Algorithm Design and Analysis
Genetic Algorithms What is a GA Terms and definitions Basic algorithm.
Genetic Algorithms. 2 Overview Introduction To Genetic Algorithms (GAs) GA Operators and Parameters Genetic Algorithms To Solve The Traveling Salesman.
Chapter 12 FUSION OF FUZZY SYSTEM AND GENETIC ALGORITHMS Chi-Yuan Yeh.
EE749 I ntroduction to Artificial I ntelligence Genetic Algorithms The Simple GA.
D Nagesh Kumar, IIScOptimization Methods: M8L5 1 Advanced Topics in Optimization Evolutionary Algorithms for Optimization and Search.
Genetic Algorithms Chapter Description of Presentations
Neural Networks And Its Applications By Dr. Surya Chitra.
An Introduction to Genetic Algorithms Lecture 2 November, 2010 Ivan Garibay
Genetic Algorithms. Underlying Concept  Charles Darwin outlined the principle of natural selection.  Natural Selection is the process by which evolution.
Genetic Algorithm Dr. Md. Al-amin Bhuiyan Professor, Dept. of CSE Jahangirnagar University.
Artificial Intelligence By Mr. Ejaz CIIT Sahiwal Evolutionary Computation.
Genetic Algorithms. Solution Search in Problem Space.
EVOLUTIONARY SYSTEMS AND GENETIC ALGORITHMS NAME: AKSHITKUMAR PATEL STUDENT ID: GRAD POSITION PAPER.
1 Introduction To Genetic Algorithms (GAs). Genetic Algorithms Also known as evolutionary algorithms, genetic algorithms demonstrate self organization.
Genetic Algorithms And other approaches for similar applications Optimization Techniques.
Genetic Algorithm. Outline Motivation Genetic algorithms An illustrative example Hypothesis space search.
 Presented By: Abdul Aziz Ghazi  Roll No:  Presented to: Sir Harris.
Presented By: Farid, Alidoust Vahid, Akbari 18 th May IAUT University – Faculty.
Introduction to Genetic Algorithms
Genetic Algorithms.
Artificial Intelligence Methods (AIM)
Introduction to Genetic Algorithm (GA)
Basics of Genetic Algorithms (MidTerm – only in RED material)
Genetic Algorithms: A Tutorial
GENETIC ALGORITHMS & MACHINE LEARNING
Basics of Genetic Algorithms
EE368 Soft Computing Genetic Algorithms.
A Gentle introduction Richard P. Simpson
Traveling Salesman Problem by Genetic Algorithm
Population Based Metaheuristics
Genetic Algorithms: A Tutorial
Presentation transcript:

Genetic algorithms Prof Kang Li Email: K.Li@qub.ac.uk

Last lecture RBF This Lecture Genetic algorithm Basic GA operations

Content What is Genetic Algorithm? How to implement GA? A example Encoding Selection Crossover Mutation A example Matlab demo Differential evolution

What is Genetic Algorithm? Bio-Inspired artificial intelligence class of probabilistic optimization algorithms Well-suited for nonlinear/hard problems with a large search space Influenced by Darwin’s Origin of species Developed by John Holland, Adaptation in Natural and Artificial Systems, U of Michigan Press, 1975

Natural Selection (Darwin’s theory) Genetic contents -> survival capacity -> features Reproduction recombination (or crossover) first occurs. Genes from parents combine to form a whole new chromosome. Newly created offspring mutated, elements of DNA are changed.  Diversity Survival of the fittest Gene of the fittest survive, gene of weaker die out Elitism Evolution - change of species’ feature to fit environment

Natural Selection

Main idea Produce a population of candidate solutions for a given problem Use operators inspired by the mechanisms of natural genetic variation Apply selective pressure toward certain properties Evolve to a more fit solution

Nature to Computer Mapping Population Individual Fitness Chromosome Gene Set of solutions Solution to a problem Quality of a solution Encoding for a Solution Part of the encoding of a solution

Simple Genetic Algorithm Simple_Genetic_Algorithm() { Initialize the Population; Calculate Fitness Function; While(the number of generation > maximum number) { Selection;//Natural Selection, Survival Of Fittest Crossover;//Reproduction, Propagate favorable characteristics Mutation;//Mutation Calculate Fitness Function; } }

Structure of Genetic Algorithm crossover 1 selection Search space 1 1 population A B C D mutation Fitness evaluation 1 reproduction Substitution

Genetic Algorithm Process 2017/4/23 Genetic Algorithm Process Initial population 5th generation 10th generation

Applications of GA Difficult Problems such as NP-class Nonlinear dynamical systems - predicting, data analysis Designing neural networks, both architecture and weights Robot Trajectory Planning Evolving LISP programs (genetic programming) Strategy planning Finding shape of protein molecules TSP and sequence scheduling Functions for creating images VLSI layout planning …

GA Process Crossover Selection Encoding Mutation

Encoding The process of representing the solution in the form of a string that conveys the necessary information. Just as in a chromosome, each gene controls a particular characteristics of the individual, and each bit in the string represents a characteristics of the solution.

Encoding Methods Binary Encoding Most common method of encoding. Chromosomes are strings of 1s and 0s and a gene of chromosomes represents the a particular characteristics of the problem. 11111110000000011111 Chromosome B 10110010110011100101 Chromosome A

Encoding Methods (contd.) Permutation Encoding Useful in ordering problems such as the Traveling Salesman Problem (TSP). Example. In TSP, every chromosome is a string of numbers, each of which represents a city to be visited. 8  5  6  7  2  3  1  4  9 Chromosome B 1  5  3  2  6  4  7  9  8 Chromosome A

Encoding Methods (contd.) Value Encoding Used in problems where complicated values, such as real numbers, are used and where binary encoding would not suffice. Good for some problems, but often necessary to develop some specific crossover and mutation techniques for these chromosomes. (left), (back), (left), (right), (forward) Chromosome B 1.235  5.323  0.454  2.321  2.454 Chromosome A

Selection Based on fitness function: Determines how ‘good’ an individual is (fitness) Better fitness, higher probability of survival Selection of individuals for differential reproduction of offspring in next generation Favors better solutions Decreases diversity in population B A C

Selection – Roulette Wheel Each solution gets a region on a roulette wheel according to its fitness Spin wheel, select solution marked by roulette-wheel pointer stochastic selection (better fitness = higher chance of reproduction) Individual i will have a probability to be chosen

Selection - Tournament randomly select q individuals from current population Winner: individual(s) with best fitness among these q individuals Example: select the best two individuals as parents for recombination q=6 selection

Crossover Crossover is a critical feature of genetic algorithms: Crossover process simulates the exchange of genetic material that occurs during biological reproduction In this process pairs in the breeding population are mated randomly with a crossover rate, Pc Typical crossover properties include that an offspring inherits the common feature from the parents along with the ability of the offspring to inherit two completely different features Popular crossover techniques: one point, two point and uniform crossover Chromosome A Chromosome B Chromosome A* Chromosome B* …

Example-Bit string Crossover Single point crossover Two point Crossover 11001011+11011111 = 11001111+11011011 11001011 + 11011110 = 11011111+11001010

Bit string Crossover Uniform crossover : bits are randomly copied from the parents 11001011 + 11011101 = 11011111 if random-number > Crossover-rate then Crossover otherwise remain unaltered

Mutation Mutation consists of making small alterations to the values of one or more genes in a chromosome Mutation randomly perturbs the population’s characteristics, and prevents evolutionary dead ends Most mutations are damaging rather than beneficial and hence mutation rate must be low to avoid the destruction of species It works by randomly selecting a bit with a certain mutation rate in the string and reversing its value 42 58 Offspring 0010 1010 Mutated Offspring 0011 1010

Fitness Function A measure of how successful an individual is in the environment Problem dependent Given chromosome, the fitness function returns a number f : S  R Smooth and regular Similar chromosomes produce close fitness values Not have too many local extremes and isolated global extreme

Example(1) Finding the maximum of a function: f(x) = x² Range [0, 31] Goal: find max (31² = 961) Binary representation: string length 5 = 32 numbers (0-31) = f(x)

Start Population Typical parameter values population size : 30 -100 crossover rate : 0.7 -1 mutation rate : 0.01 - 0.2 1 00001 String 5 441 21 10101 String 4 100 10 01010 String 3 9 3 00011 String 2 36 6 00110 String 1 fitness value binary

Selection Worst one removed 1 00001 String 5 441 21 10101 String 4 100 01010 String 3 9 3 00011 String 2 36 6 00110 String 1 fitness value binary 6.13% 1.53% 17.04% 75.13% 0.17% Worst one removed

Selection Best individual: reproduces twice  keep population size constant 1 00001 String 5 441 21 10101 String 4 100 10 01010 String 3 9 3 00011 String 2 36 6 00110 String 1 fitness value binary

Selection All others are reproduced once 441 10101 String 5 21 100 10 01010 String 3 9 3 00011 String 2 36 6 00110 String 1 fitness value binary All others are reproduced once

Crossover Parents and x-position randomly selected 1 1 1 1 1 1 1 1 1 1 2 String 4 String 3 4 String 2 String 1 x-position partner Parents and x-position randomly selected 1 1 1 1 1 6 7 String 1: 1 1 1 String 2: 3 23 1 1 1 1 1 10 21 String 3: 1 1 1 1 1 String 4: 21 17

Mutation bit-flip Offspring -String 1: 00111 (7) 10111 (23)

New population All individuals in the parent population are replaced by offspring in the new generation (generations are discrete!) New population (Offspring): binary value fitness String 1 00111 7 49 String 2 10111 23 529 String 3 10101 21 441 String 4 10001 17 289 String 5 10101 21 441

End Iterate until termination condition reached, e.g.: Number of generations Best fitness Process time No improvements after a number of generations Result after one generation: Best individual: 10111 (23) – fitness 529 Best solution after 100 generation: Best solution: 11111 (31) – fitness 961

When to Use a GA Alternate solutions are too slow or overly complicated Need an exploratory tool to examine new approaches Problem is similar to one that has already been successfully solved by using a GA Want to hybridize with an existing solution Benefits of the GA technology meet key problem requirements

Summary Introduction to GA Basic GA operations