genetic algorithms 虞台文. content evolutional algorithms genetic algorithms main components of...

Download Genetic Algorithms 虞台文. Content Evolutional Algorithms Genetic Algorithms Main Components of Genetic Algorithms – Encoding – Fitness Function – Recombination

Post on 01-Jan-2016

220 views

Category:

Documents

2 download

Embed Size (px)

TRANSCRIPT

  • Genetic Algorithms

  • ContentEvolutional AlgorithmsGenetic AlgorithmsMain Components of Genetic AlgorithmsEncodingFitness FunctionRecombinationMutationPopulationSelection Models

  • Genetic AlgorithmsEvolutional Algorithms

  • Biological Evolution

  • Motivated from NatureNature evolve strikingly complex organisms in response to complex environmental adaptation problems with apparent easeLocalize and extract principles from natureApply them to design algorithms

  • Darwinian Evolution 1: Survival of the FittestAll environments have finite resourcescan only support a limited number of individualsLifeforms have basic instinct/lifecycles geared towards reproductionTherefore some kind of selection is inevitableThose individuals that compete for the resources most effectively have increased chance of reproductionNote: fitness in natural evolution is a derived, secondary measure, i.e., we (humans) assign a high fitness to individuals with many offspring1809-1882

  • Darwinian Evolution 2: Diversity Drives ChangePhenotypic traits:Behaviour/physical differences that affect response to environmentPartly determined by inheritance, partly by factors during developmentUnique to each individual, partly as a result of random changesIf phenotypic traits:Lead to higher chances of reproductionCan be inherited then they will tend to increase in subsequent generations and, hence, lead to new combinations of traits 1809-1882

  • Darwinian Evolution:SummaryPopulation consists of diverse set of individualsCombinations of traits that are better adapted tend to increase representation in population Individuals are units of selection Variations occur through random changes yielding constant source of diversity, coupled with selection means that: Population is the unit of evolutionNote the absence of guiding force w/o God1809-1882

  • General Scheme ofEvolutional Algorithms (EAs)PopulationParentsOffspring

  • General Scheme ofEvolutional Algorithms (EAs)PopulationParentsOffspringA set of individuals corresponding to candidate solutions to a problem.Each individual has a fitness value.How to represent the individuals?How to define the fitness function?

  • General Scheme ofEvolutional Algorithms (EAs)PopulationParentsOffspringBetter individuals get higher probability to become the parents of the next generation.Variation operators

  • General Scheme ofEvolutional Algorithms (EAs)PopulationParentsOffspringReplace some old individuals with newly born ones.

  • Pseudo-Code for Typical EA

  • Typical Behavior of an EAEarly phase:quasi-random population distributionMid-phase:population arranged around/on hillsLate phase:population concentrated on high hills

  • Components of EAsRepresentation definition of individualsEvaluation function fitness functionPopulationParent selection mechanismVariation operatorsRecombinationMutationSurvivor selection mechanism replacementTermination

  • Different Types of EAsHistorically, different flavours of EAs have been associated with different representationsBinary strings : Genetic AlgorithmsReal-valued vectors : Evolution StrategiesFinite state Machines: Evolutionary ProgrammingLISP trees: Genetic Programming

  • Different Types of EAsHistorically, different flavours of EAs have been associated with different representations Binary strings : Genetic Algorithms Real-valued vectors : Evolution Strategies Finite state Machines: Evolutionary Programming LISP trees: Genetic ProgrammingGeneticAlgorithmsEvolutionStrategies

  • Different Types of EAsHistorically, different flavours of EAs have been associated with different representations Binary strings : Genetic Algorithms Real-valued vectors : Evolution Strategies Finite state Machines: Evolutionary Programming LISP trees: Genetic ProgrammingEvolutionaryProgrammingGeneticProgramming

  • Genetic AlgorithmsGenetic Algorithms

  • The Genetic AlgorithmDirected search algorithms based on the mechanics of biological evolutionDeveloped by John Holland, University of Michigan (1970s)To understand the adaptive processes of natural systemsTo design artificial systems software that retains the robustness of natural systems

  • Genetic AlgorithmsHollands original GA is now known as the simple genetic algorithm (SGA)

    Other GAs use different:RepresentationsMutationsCrossoversSelection mechanisms

  • SGA Technical Summary Tableau

  • RepresentationGenotype spacePhenotype space0111010010100010011001001010010001

  • SGA Evolution CycleSelect parents for the mating pool (size of mating pool = population size)Shuffle the mating poolFor each consecutive pair apply crossover with probability pc , otherwise copy parentsFor each offspring apply mutation (bit-flip with probability pm independently for each bit)Replace the whole population with the resulting offspring

  • SGA Operators: 1-Point CrossoverChoose a random point on the two parentsSplit parents at this crossover pointCreate children by exchanging tailspc typically in range (0.6, 0.9)

  • SGA Operators: MutationAlter each gene independently with a probability pm pm is called the mutation rateTypically between 1/pop_size and 1/chromosome_length

  • SGA Operators: SelectionMain idea: better individuals get higher chanceChances proportional to fitnessImplementation roulette wheel techniqueAssign to each individual a part of the roulette wheel Spin the wheel n times to select n individuals

    Chart1

    3

    1

    2

    Sheet1

    A3

    B1

    C2

    Sheet1

    Sheet2

    Sheet3

  • An Example after Goldberg 89Simple problem: max x2 over {0,1,,31}GA approach:Representation: binary code, e.g. 01101 13Population size: 41-point xover, bitwise mutationRoulette wheel selectionRandom initialization

  • x2 Example: Initial Population

  • x2 Example: Selection0 1 1 0 11 1 0 0 01 1 0 0 01 0 0 1 1

  • x2 Example: Selection

  • x2 Example: Crossover

  • x2 Example: Mutation

  • Exercise: The OneMax Problem The OneMax Problem (or BitCounting) is a simple problem consisting in maximizing the number of ones of a bitstring.Formally, this problem can be described as finding a string x = (x1, x2, , xn) , with xi{0, 1} , that maximizes the following equation:

  • Genetic AlgorithmsMain Components of GAs

  • Nature-to-Computer Mapping

  • Main Components of GAsEncoding principles (gene, chromosome)Initialization procedure (creation)Selection of parents (reproduction)Genetic operators (mutation, recombination)Fitness function (environment)Termination condition

  • EncodingThe 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 characteristic of the individual, similarly, each bit in the string represents a characteristic of the solution.

    Hence, the encoding mechanism depends on the nature of the problem variables.

  • Commonly Used Encoding SchemesBinary Encoding most common and simplest onePermutation Encodingused in ordering problems, e.g., TSPDirect Value Encodingused in problems with complicated values Tree Encodingused mainly for evolving programs or expressions, e.g., genetic programming

  • Binary EncodingMost common method of encoding.Chromosomes are strings of 1s and 0s and each position in the chromosome represents a particular characteristic of the problem. Binary Encoding Permutation Encoding Direct Value Encoding Tree Encoding

  • Permutation EncodingUseful in ordering problems such as the Traveling Salesman Problem (TSP). Every chromosome is a string of numbers, each of which represents a city to be visited. Binary Encoding Permutation Encoding Direct Value Encoding Tree Encoding

  • Direct Value EncodingUsed 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. Binary Encoding Permutation Encoding Direct Value Encoding Tree Encoding

  • Tree EncodingTree encoding is used mainly for evolving programs or expressions for genetic programming.In tree encoding every chromosome is a tree of some objects, such as functions or commands in programming language. Binary Encoding Permutation Encoding Direct Value Encoding Tree Encoding

  • More on Binary Encoding Gray coding of integers

    IntegerBinaryGray00000001001001201001130110104100110510111161101017111100

  • More on Binary Encoding Gray coding of integersGray coding is a mapping that attempts to improve causality, i.e., small changes in the genotype cause small changes in the phenotype, unlike binary coding.Smoother genotype-phenotype mapping makes life easier for the GA.

    Nowadays it is generally accepted that it is better to encode numerical variables directly as integers and floating point variables

  • More on Binary Encoding Interval Representationz [x, y] represented by {a1,,aL} {0,1}L[x, y] {0,1}L must be invertible: {0,1}L [x, y] defines the representation

  • CrossoverIt is the process in which two chromosomes (strings) combine their genetic material (bits) to produce a new offspring which possesses both their characteristics.

    Two strings are picked from the mating pool at random to cross over.

    The method chosen depends on the Encoding Method.

  • CrossoverIt is the process in which two chromosomes