Genetic Algorithms Evolution Heres a very oversimplified description

  • Slides: 31
Download presentation
Genetic Algorithms

Genetic Algorithms

Evolution • Here’s a very oversimplified description of how evolution works in biology •

Evolution • Here’s a very oversimplified description of how evolution works in biology • Organisms (animals or plants) produce a number of offspring which are almost, but not entirely, like themselves – Variation may be due to mutation (random changes) – Variation may be due to sexual reproduction (offspring have some characteristics from each parent) • Some of these offspring may survive to produce offspring of their own—some won’t – The “better adapted” offspring are more likely to survive – Over time, later generations become better and better adapted • Genetic algorithms use this same process to “evolve” better programs 2

Genotypes and phenotypes • Genes are the basic “instructions” for building an organism •

Genotypes and phenotypes • Genes are the basic “instructions” for building an organism • A chromosome is a sequence of genes • Biologists distinguish between an organism’s genotype (the genes and chromosomes) and its phenotype (what the organism actually is like) – Example: You might have genes to be tall, but never grow to be tall for other reasons (such as poor diet) • Similarly, “genes” may describe a possible solution to a problem, without actually being the solution 3

What Do the Following 3 Things Have in Common?

What Do the Following 3 Things Have in Common?

Genetic Algorithms (GAs) • GAs design jet engines. • GAs draw criminals. • GAs

Genetic Algorithms (GAs) • GAs design jet engines. • GAs draw criminals. • GAs program computers.

DEFINATION • A genetic algorithm (or short GA) is a search technique used in

DEFINATION • A genetic algorithm (or short GA) is a search technique used in computing to find true or approximate solutions to optimization and search problems. Genetic algorithms are categorized as global search heuristics. Genetic algorithms are a particular class of evolutionary algorithms that use techniques inspired by evolutionary biology such as inheritance, mutation, selection, and recombination.

Genetic Algorithm Presenting Generation Cycle

Genetic Algorithm Presenting Generation Cycle

Travelling Salesman Problem The traveling salesman problem is a simple problem: given a 2

Travelling Salesman Problem The traveling salesman problem is a simple problem: given a 2 D graph of cities, what is the shortest circuit - the shortest route that visits each city exactly once? The triviality of this task is deceptive: it is, in fact, NP-complete: while many algorithms can produce a very good route, no known method exists of finding the shortest route without some measure of brute-force trial-and-error computation.

Travelling salesman problem Continue. • This application is an attempt to solve the Traveling

Travelling salesman problem Continue. • This application is an attempt to solve the Traveling Salesman Problem with a genetic algorithm. This algorithm creates a number of full solutions, measures their comparative finesses, and selects the best ones for a new generation of solutions, while also featuring genetic mutation, and immigration features. In this way, the algorithm borrows from the process of biological evolution in order to "evolve" a very good solution for the Traveling Salesman Problem in a short timeframe.

Basic Genetic Algorithm • Step 1. Generate a random population of n chromosomes •

Basic Genetic Algorithm • Step 1. Generate a random population of n chromosomes • Step 2. Assign a fitness to each individual • Step 3. Repeat until n children have been produced – Choose 2 parents based on fitness proportional selection – Apply genetic operators to copies of the parents – Produce new chromosomes

Fitness Function • For each individual in the population, evaluate its relative fitness •

Fitness Function • For each individual in the population, evaluate its relative fitness • For a problem with m parameters, the fitness can be plotted in an m+1 dimensional space

Sample Search Space • A randomly generated population of individuals will be randomly distributed

Sample Search Space • A randomly generated population of individuals will be randomly distributed throughout the search space Image from http: //www 2. informatik. unierlangen. de/~jacob/Evolvica/Java/Multi. Modal. Search/rats. 017/Surface. gif

Natural Selection • The likelihood of any individual becoming a parent is directly proportional

Natural Selection • The likelihood of any individual becoming a parent is directly proportional to its relative fitness Image from http: //www. genetic-programming. org

Genetic Operators • Cross-over • Mutation

Genetic Operators • Cross-over • Mutation

Production of New Chromosomes • 2 parents give rise to 2 children

Production of New Chromosomes • 2 parents give rise to 2 children

Generations • As each new generation of n individuals is generated, they replace their

Generations • As each new generation of n individuals is generated, they replace their parent generation • To achieve the desired results, 500 to 5000 generations are required

Ultimate Goal • Each subsequent generation will evolve toward the global maximum • After

Ultimate Goal • Each subsequent generation will evolve toward the global maximum • After sufficient generations a near optimal solution will be present in the population of chromosomes

Genetic Optimization With genetic algorithm optimization, we may have a more difficult time in

Genetic Optimization With genetic algorithm optimization, we may have a more difficult time in coming up with a better solution than the computer program. The genetic algorithm does not examine every single timing plan candidate either, but is a random guided search, capable of intelligently tracking down the global optimum solution. As with the human race, the weakest candidates are eliminated from the gene pool, and each successive generation of individuals contains stronger and stronger characteristics. It’s survival of the fittest, and the unique processes of crossover and mutation conspire to keep the species as strong as possible.

Genes and biological evolution A gene is a unit of biological information transferred from

Genes and biological evolution A gene is a unit of biological information transferred from one generation to another. Genes determine our physical traits, what you look like, what you inherit from either one of your parents. 19

Biological Evolution • Natural Selection • Survival of The Fittest • Origin of New

Biological Evolution • Natural Selection • Survival of The Fittest • Origin of New Species 20

Examples of Biological Evolution and Natural Adaptation Frog Skin Hollow Bones in Birds Biological

Examples of Biological Evolution and Natural Adaptation Frog Skin Hollow Bones in Birds Biological Evolution of Human • Characteristic Thumb • Erect Vertebral Column • Lower Jaw

Biological Evolution Cultural Evolution. . ? ? Source: www. wikipedia. org 22

Biological Evolution Cultural Evolution. . ? ? Source: www. wikipedia. org 22

Biological Evolution Meme. . !!! 23

Biological Evolution Meme. . !!! 23

Meme “the basic unit of cultural transmission, or imitation” - Richard Dawkins “an element

Meme “the basic unit of cultural transmission, or imitation” - Richard Dawkins “an element of culture that may be considered to be passed on by non-genetic means” English Oxford Dictionary 24

Genes and Memes, where they are similar Genes propagate biologically from chromosome to chromosome

Genes and Memes, where they are similar Genes propagate biologically from chromosome to chromosome Memes propagate from brain to brain via imitation Survival of fittest in meme Concept of God is survived though no scientific evidence is present 25

Genes and Memes, where they differ Genes are pre-decided Genes are (almost always) static

Genes and Memes, where they differ Genes are pre-decided Genes are (almost always) static through generations, memes can be changed! Memes allow improvement After learning language, we contribute to it through literature New heuristics to search problems We use this property to improve algorithms 26

Genetic Algorithm solves (typically optimization) problems by combining features of candidate solutions to create

Genetic Algorithm solves (typically optimization) problems by combining features of candidate solutions to create new populations of candidate solutions. applicable to complex optimization problems, e. g. , when it is hard to tackle the problem via an exact search approach. 27

Genetic Algorithm Initialize population Pop Evaluate Pop While not stop criterion do Select Parents

Genetic Algorithm Initialize population Pop Evaluate Pop While not stop criterion do Select Parents from Pop Recombine Parents Evaluate Pop Return the best solution in Pop

Crossover Purpose: to combine features of feasible solutions already visited in order to provide

Crossover Purpose: to combine features of feasible solutions already visited in order to provide new potential candidate solutions with better objective function value. Mechanism that restarts the search by “exploring” the space “between” solutions. parents offspring 0000000 0001111 1110000 29

Mutation ■ Purpose: to introduce new characteristics in the population by random modifications. before

Mutation ■ Purpose: to introduce new characteristics in the population by random modifications. before after ■ Explores the “neighborhood” of a solution. 1 1 1 1 1 0 1 1 1 mutated gene value

Memetic Algorithm Initialize population Pop Optimize Pop(Local search) Evaluate Pop While not stop criterion

Memetic Algorithm Initialize population Pop Optimize Pop(Local search) Evaluate Pop While not stop criterion do Select Parents from Pop Recombine Parents Optimize Pop(Local search) Evaluate Pop Return the best solution in Pop