new genetic algorithm

Upload: almuslim233869

Post on 30-May-2018

221 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/14/2019 New Genetic Algorithm

    1/24

    Genetic Algorithms

    Presented To : Dr. Sherin Youssof

    Presented By : Ahmad Abdullatif Goudah

  • 8/14/2019 New Genetic Algorithm

    2/24

    Out-line

    2.1. A Brief History of Evolutionary Computation

    2.2. Biological Terminology

    2.3. Search Spaces and Fitness Landscapes

    2.4. Elements of Genetic Algorithms 2.5. A Simple Genetic Algorithm

    2.6. Flowchart for a schematic genetic operation

    2.7. Encoding a Problem for a Genetic Algorithm

    (Binary and non-binary encoding)

    2.8. Examples of different problem encoding

    schemes

    2.9. Selection Methods

  • 8/14/2019 New Genetic Algorithm

    3/24

    2.1. A Brief History of Evolutionary

    Computation

    Evolutionary Computation is the field of studydevoted to the design, development, andanalysis is problem solvers based on naturalselection (simulated evolution).

    Idea of evolutionary computing was introduced inthe 1960s by Professor Dr. Ingo Rechenberg inhis work "Evolution strategies" .

    Genetic Algorithms (GAs) were invented by JohnHolland and lead to Holland's book "Adaption inNatural and Artificial Systems" published in 1975.

    In 1992 "genetic programming" (GP) methodused by John Koza to evolve programs toperform certain tasks.

  • 8/14/2019 New Genetic Algorithm

    4/24

    2.1. A Brief History of Evolutionary

    Computation (cont.)

    Evolutionary Computation has been successfully

    applied to a wide range of problems including:

    Aircraft Design

    Routing in Communications

    Networks Tracking Wind shear

    Game Playing (Checkers [Fogel])

    Robotics

    Air Traffic Control

    Design

    Scheduling Machine Learning

    Pattern Recognition

    Job Shop Scheduling

    Strike Force Allocation

    Theme Park Tours

    (Disney Land/World) VLSI Circuit Layout

    Market Forecasting

    Egg Price Forecasting

    Design of Filters andBarriers

    Data-Mining User-Mining

    Resource Allocation

    Path Planning

    Etc...

  • 8/14/2019 New Genetic Algorithm

    5/24

    2.1. A Brief History of Evolutionary

    Computation (cont.)

    Evolutionary computation comprises the four main areas of

    Genetic Algorithms, Evolution Strategies, Genetic

    Programming and Simulated Annealing

  • 8/14/2019 New Genetic Algorithm

    6/24

    2.2. Biological Terminology

    Chromosome: All living organisms

    consist of cells. In

    each cell there is the

    same set ofchromosomes.

    Chromosomes are

    strings ofDNA andserves as a model for

    the whole organism.

  • 8/14/2019 New Genetic Algorithm

    7/24

    2.2. Biological Terminology (cont.)

    A chromosome consist ofgenes, blocks of DNA. Each gene encodesa particular protein. Basically can be said, that each gene encodes a

    trait , for example color of eyes. Possible settings for a trait (e.g. blue,

    brown) are called alleles. Each gene has its own position in the

    chromosome. This position is called locus.

    Complete set of genetic material (all chromosomes) is called genome.

    Particular set of genes in genome is called genotype. The genotype is

    with later development after birth base for the organism's phenotype,

    its physical and mental characteristics, such as eye color, intelligence

    etc.

    During reproduction, first occurs recombination (orcrossover). The

    new created offspring can then be mutated. Mutation means, that the

    elements of DNA are a bit changed. The fitness of an organism is

    measured by success of the organism in its life.

  • 8/14/2019 New Genetic Algorithm

    8/24

    2.2. Biological Terminology (cont.)

    Summary .. Individual - Any possible solution

    Population - Group of all individuals

    Search Space - All possible solutions to the problem

    Chromosome - Blueprint for an individual Trait - Possible aspect of an individual

    Allele - Possible settings for a trait

    Locus - The position of a gene on the chromosome

    Genome - Collection of all chromosomes for an individual

  • 8/14/2019 New Genetic Algorithm

    9/24

    2.3. Search Spaces and Fitness

    Landscapes

    search space ( state space ) : The space of allfeasible solutions

    Each point in the search space represent one feasible

    solution.

    Each feasible solution can be "marked" by its value orfitness for the problem.

  • 8/14/2019 New Genetic Algorithm

    10/24

    2.3. Search Spaces and Fitness

    Landscapes (cont.)

    fitness landscape : In order to use evolutionaryoptimization, one has to define for every possible solution s

    to the problem of interest how 'good' it is. This is done by

    introducing a scalar-valued function f(s) which is called the

    fitness function or fitness landscape.

    A high f(s) implies that s is a good solution

    The best solution found can survive to end of run which is

    Darwinian principle of survival of the fittest

    http://en.wikipedia.org/wiki/Solution_pointhttp://en.wikipedia.org/wiki/Scalar_%28mathematics%29http://en.wikipedia.org/wiki/Function_%28mathematics%29http://en.wikipedia.org/wiki/Fitness_functionhttp://en.wikipedia.org/wiki/Fitness_functionhttp://en.wikipedia.org/wiki/Function_%28mathematics%29http://en.wikipedia.org/wiki/Scalar_%28mathematics%29http://en.wikipedia.org/wiki/Solution_point
  • 8/14/2019 New Genetic Algorithm

    11/24

    2.4. Elements of Genetic Algorithms

    1. a population of candidate solutions (CSs) is randomly generated.

    2. Each of the CSs is evaluated and assigned a fitness based on a

    user specified evaluation function to determine the goodness of

    a CS.

    3. A number of individuals are then selected to be parents based on

    their fitness.

    4. The Select_Parents method must be one that balances the urge

    for selecting the best performing CSs with the need for populationdiversity.

  • 8/14/2019 New Genetic Algorithm

    12/24

    2.5. A Simple Genetic Algorithm

    BEGINGenerate initial population;

    Compute fitness of each individual;

    REPEAT /* New generation /*

    FOR population_size / 2 DO

    Select two parents from old generation;

    /* biased to the fitter ones */

    Recombine parents for two offspring;

    Compute fitness of offspring;

    Insert offspring in new generationEND FOR

    UNTIL population has converged

    END

  • 8/14/2019 New Genetic Algorithm

    13/24

    2.6. Flowchart for a schematic genetic

    operation

  • 8/14/2019 New Genetic Algorithm

    14/24

    2.7. Encoding a Problem for a Genetic

    Algorithm (Binary and non-binary encoding)

    Encoding of chromosomes is one of the problems, when you are starting tosolve problem with GA. Encoding very depends on the problem.

    Binary Encoding

    every chromosome is a string of bits, 0 or 1.

    2.8.Example of Problem: Knapsack problem

    The problem: There are things with given value and size. The

    knapsack has given capacity. Select things to maximize the

    value of things in knapsack, but do not extend knapsack

    capacity.

    Encoding: Each bit says, if the corresponding thing is in

    knapsack.

  • 8/14/2019 New Genetic Algorithm

    15/24

    2.7. Encoding a Problem for a Genetic

    Algorithm (Binary and non-binary encoding)

    (cont.)

    Permutation Encoding

    every chromosome is a string of numbers

    2.8.Example of Problem: Travelling salesman problem (TSP)

    The problem: There are cities and given distances between

    them.Travelling salesman has to visit all of them, but he does not

    to travel very much. Find a sequence of cities to minimize travelled

    distance.

    Encoding: Chromosome says order of cities, in which salesman

    will visit them.

  • 8/14/2019 New Genetic Algorithm

    16/24

    2.7. Encoding a Problem for a Genetic

    Algorithm (Binary and non-binary encoding)

    (cont.) Value Encoding

    every chromosome is a string of some values.

    Values can be anything connected to problem, form numbers, real

    numbers or chars to some complicated objects.

    2.8.Example of Problem: Finding weights for neural network

    The problem: There is some neural network with givenarchitecture. Find weights for inputs of neurons to train the

    network for wanted output.

    Encoding: Real values in chromosomes represent

    corresponding weights for inputs.

  • 8/14/2019 New Genetic Algorithm

    17/24

    2.7. Encoding a Problem for a Genetic

    Algorithm (Binary and non-binary encoding)

    (cont.)

    Tree Encoding

    every chromosome is a tree of some

    objects, such as functions or

    commands in programming

    language. 2.8.Example of Problem: Finding a

    function from given values

    The problem: Some input and

    output values are given. Task is to

    find a function, which will give the

    best (closest to wanted) output to allinputs.

    Encoding: Chromosome are

    functions represented in a tree.

  • 8/14/2019 New Genetic Algorithm

    18/24

    2.9. Selection Methods

    chromosomes are selected from the population to be

    parents to crossover.

    There are many methods how to select the best

    chromosomes, for example :

    Roulette wheel selection. Boltzman selection.

    Tournament selection.

    Rank selection.

    Steady state selection.

  • 8/14/2019 New Genetic Algorithm

    19/24

    2.9. Selection Methods (cont.)

    Roulette wheel selection Parents are selected according to their fitness.

    The better the chromosomes are, the more chances to be

    selected they have.

    Imagine a roulette wheel where are placed all

    chromosomes in the population, every has its place bigaccordingly to its fitness function

    will have problems when the fitnesses differs very much

  • 8/14/2019 New Genetic Algorithm

    20/24

    2.9. Selection Methods (cont.)

    Rank Selection

    Rank selection first ranks the

    population .

    Every chromosome receives

    fitness from this ranking. The worst will have fitness 1,

    second worst 2etc.

    The best will have fitness N

    (number of chromosomes in

    population) . But this method can lead to

    slower convergence, because

    the best chromosomes do not

    differ so much from other

    ones.

  • 8/14/2019 New Genetic Algorithm

    21/24

    2.9. Selection Methods (cont.)

    Steady-State Selection

    Main idea of this selection is that big part of

    chromosomes should survive to next generation.

    In every generation are selected a few (good - withhigh fitness) chromosomes for creating a new offspring

    Then some (bad - with low fitness) chromosomes are

    removed and the new offspring is placed in their place.

    The rest of population survives to new generation.

  • 8/14/2019 New Genetic Algorithm

    22/24

    2.9. Selection Methods (cont.)

    Boltzmann selection

    In Boltzmann selection, a method inspired by the

    technique of simulated annealing, selection pressure is

    slowly increased over evolutionary time to gradually

    focus the search.

    Given a fitness of f, Boltzmann selection assigns a new

    fitness, f0, according to a differentiable function.

  • 8/14/2019 New Genetic Algorithm

    23/24

    2.9. Selection Methods (cont.)

    Tournament Selection Involves running several "tournaments" among a few

    individuals chosen at random from the population .

    The winner of each tournament (the one with the best

    fitness) is selected for crossover

    If the tournament size is larger, weak individuals havea smaller chance to be selected.

    Tournament selection pseudo code:

    (k=1) selection is equivalent to random selection. Deterministic tournament selection selects the best

    individual (when p=1) in any tournament

  • 8/14/2019 New Genetic Algorithm

    24/24

    Thanks