genetic algorithms. underlying concept charles darwin outlined the principle of natural selection. ...

17
Genetic Algorithms

Upload: nickolas-greene

Post on 19-Jan-2018

213 views

Category:

Documents


0 download

DESCRIPTION

Development of GAs  In 1975 John Holland developed the idea of Genetic Algorithms  These are algorithms that mimic the principles of natural selection to solve problems.  Often used for Optimization problems, and for biological simulations.

TRANSCRIPT

Page 1: Genetic Algorithms. Underlying Concept  Charles Darwin outlined the principle of natural selection.  Natural Selection is the process by which evolution

Genetic Algorithms

Page 2: Genetic Algorithms. Underlying Concept  Charles Darwin outlined the principle of natural selection.  Natural Selection is the process by which evolution

Underlying Concept

Charles Darwin outlined the principle of natural selection.

Natural Selection is the process by which evolution occurs.

The fittest members of a species will survive and propagate more than those less fit.

Page 3: Genetic Algorithms. Underlying Concept  Charles Darwin outlined the principle of natural selection.  Natural Selection is the process by which evolution

Development of GAs

In 1975 John Holland developed the idea of Genetic Algorithms

These are algorithms that mimic the principles of natural selection to solve problems.

Often used for Optimization problems, and for biological simulations.

Page 4: Genetic Algorithms. Underlying Concept  Charles Darwin outlined the principle of natural selection.  Natural Selection is the process by which evolution

The Basic Idea

Possible solutions to a problem are labelled “Chromosomes”

An initial population of these chromosomes is created and mated via crossover and mutation algorithms to create 'offspring'

This process is repeated until the optimal solution is found.

Page 5: Genetic Algorithms. Underlying Concept  Charles Darwin outlined the principle of natural selection.  Natural Selection is the process by which evolution

Step-By-Step GAs Step 1: Choose an initial population of

chromosomes Step 2: Create an offspring population from the

parent population Step 3:the offspring undergo a crossover Step 4: mutations occur in the offspring population

(this is based on a probability algorithm) Step 5: evaluate the fitness of each offspring Step 6: replace parents with offspring, and repeat 2-

5 until the optimal solution is reached

Page 6: Genetic Algorithms. Underlying Concept  Charles Darwin outlined the principle of natural selection.  Natural Selection is the process by which evolution

Psuedocode!Choose an initial population of chromosomeswhile (termination condition not satisfied) do

repeatif(crossover condition satisfied) then{

select parent chromosomes;choose crossover parameters;perform crossover;}

if(mutation condition satisfied) then{select chromosome for mutation;choose mutation point;perform mutation;

}Evaluate fitness of offspring;

until sufficient offspring created;select new population;

end whileCourtesy of Reves, Colin R. Genetic Algorithms – Principles and Perspectives : a Guide to GA Theory.

Page 7: Genetic Algorithms. Underlying Concept  Charles Darwin outlined the principle of natural selection.  Natural Selection is the process by which evolution

Step 1 – The Initial Population

These will be randomly generated strings in the problem set

The number of members in the initial population is determined on a case by case basis, but it is usually reliable in most cases to use lg(string length) initial chromosomes.

Page 8: Genetic Algorithms. Underlying Concept  Charles Darwin outlined the principle of natural selection.  Natural Selection is the process by which evolution

Step 2 & 3 – Create Offspring and Crossover

Two parents are chosen from the set, and an offspring is created.

The parent's chromosomes are then combined into the offspring through a process called “crossover”, in which certain genes from each parent are mixed together.

Page 9: Genetic Algorithms. Underlying Concept  Charles Darwin outlined the principle of natural selection.  Natural Selection is the process by which evolution

Crossover Schemes Linear Crossovers:

single-point crossoverA 'crossover point' is randomly chosenAll of the genes (alleles) after the crossover point from

one parent are copied into their corresponding location on the other.

(a,b,c,d,e,f,g) and (1,2,3,4,5,6,7)Crossover point is 3 (a,b,3,4,5,6,7) and (1,2,c,d,e,f,g) are createdThese are the offspring of the 2 parents

There are many other crossover techniques, most involving the same concept, but multiple crossover points

Page 10: Genetic Algorithms. Underlying Concept  Charles Darwin outlined the principle of natural selection.  Natural Selection is the process by which evolution

N-Point Crossover AlgorithmChoose a random integer n;choose n cross points;generate random permutation ð of (1...,n+1) for segment order;designate one parent for copying;k <-- 1;

repeatcopy all compatible alleles of segment ðk from designated parent;swap parent designations;k++;

until k = n+1;if child incomplete then insert legal alleles at required position, using random tie

breaking if necessary.

Page 11: Genetic Algorithms. Underlying Concept  Charles Darwin outlined the principle of natural selection.  Natural Selection is the process by which evolution

Step 4 - Mutations?

An important event for the evolution of any species is mutation. A new trait is developed, and if it is beneficial, often it will be propagated.

The same must be true for GAs Mutation is not always required in all matings. So a probability of

mutation equation should be set up (this will vary depending on the problem).

Each time a new child is created a random number is generated and checked by this mutation equation to see if a mutation should occur.

Page 12: Genetic Algorithms. Underlying Concept  Charles Darwin outlined the principle of natural selection.  Natural Selection is the process by which evolution

Step 5: Evaluate the Fitness In order to decide which traits are beneficial

and should be passed on, a fitness algorithm must be performed on the children.

These fitness algorithms are completely problem specific

There are 2 basic types of algorithm Probability dependent Rank Dependent

Page 13: Genetic Algorithms. Underlying Concept  Charles Darwin outlined the principle of natural selection.  Natural Selection is the process by which evolution

Probability Dependent Selection

Each one of the offspring is analysed using some problem specific algorithm to determine the probability that it will lead to a successful solution

Roulette wheel type: Each offspring is assigned a segment of the

roulette wheel based on its probability. A random number is then generated, and

whichever section of the wheel it fall into is the offspring that is chosen for reproduction

Page 14: Genetic Algorithms. Underlying Concept  Charles Darwin outlined the principle of natural selection.  Natural Selection is the process by which evolution

Rank Dependent Selection

Each offspring is analysed by a ranking algorithm and its fitness is returned as some number.

The greater the number the greater the fitness All of these ranks are ordered, and the best fit

offspring are chosen for reproduction.

Page 15: Genetic Algorithms. Underlying Concept  Charles Darwin outlined the principle of natural selection.  Natural Selection is the process by which evolution

Other Selection Methods

Scaling Generational Hierarchical

Page 16: Genetic Algorithms. Underlying Concept  Charles Darwin outlined the principle of natural selection.  Natural Selection is the process by which evolution

Step 6

The chosen offspring are then made the parents for the next iteration of the process

The algorithm repeats until some specified condition (Problem Specific) is met.

Page 17: Genetic Algorithms. Underlying Concept  Charles Darwin outlined the principle of natural selection.  Natural Selection is the process by which evolution

Analysis of GAs

Strengths GAs are ‘parallel’

Can examine multiple solutions at once

Limitations Deceptive fitness functions Can be time consuming Only deal with one trait at a time