This action might not be possible to undo. Are you sure you want to continue?

Chapter 3

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

GA Quick Overview

Developed: USA in the 1970¶s

Early names: J. Holland, K. DeJong, D. Goldberg

Typically applied to:

± discrete optimization

Attributed features:

± not too fast

± good heuristic for combinatorial problems

Special Features:

± Traditionally emphasizes combining information from good

parents (crossover)

± many variants, e.g., reproduction models, operators

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Genetic algorithms

Holland¶s original GA is now known as the

simple genetic algorithm (SGA)

Other GAs use different:

± Representations

± Mutations

± Crossovers

± Selection mechanisms

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

SGA technical summary tableau

Representation Binary strings

Recombination N-point or uniform

Mutation Bitwise bit-flipping with fixed

probability

Parent selection Fitness-Proportionate

Survivor selection All children replace parents

Speciality Emphasis on crossover

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Genotype space =

{0,1}

L

Phenotype space

Encoding

(representation)

Decoding

(inverse representation)

011101001

010001001

10010010

10010001

Representation

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

SGA reproduction cycle

1. Select parents for the mating pool

(size of mating pool = population size)

2. Shuffle the mating pool

3. For each consecutive pair apply crossover with

probability p

c

, otherwise copy parents

4. For each offspring apply mutation (bit-flip with

probability p

m

independently for each bit)

5. Replace the whole population with the resulting

offspring

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

SGA operators: 1-point crossover

Choose a random point on the two parents

Split parents at this crossover point

Create children by exchanging tails

P

c

typically in range (0.6, 0.9)

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

SGA operators: mutation

Alter each gene independently with a probability p

m

p

m

is called the mutation rate

± Typically between 1/pop_size and 1/ chromosome_length

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Main idea: better individuals get higher chance

± Chances proportional to fitness

± Implementation: roulette wheel technique

Assign to each individual a part of the

roulette wheel

Spin the wheel n times to select n

individuals

SGA operators: Selection

fitness(A) = 3

fitness(B) = 1

fitness(C) = 2

A

C

1/6 = 17%

3/6 = 50%

B

2/6 = 33%

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

An example after Goldberg µ89 (1)

Simple problem: max x

2

over {0,1,«,31}

GA approach:

± Representation: binary code, e.g. 01101 ÷13

± Population size: 4

± 1-point xover, bitwise mutation

± Roulette wheel selection

± Random initialisation

We show one generational cycle done by hand

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

x

2

example: selection

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

X

2

example: crossover

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

X

2

example: mutation

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

The simple GA

Has been subject of many (early) studies

± still often used as benchmark for novel GAs

Shows many shortcomings, e.g.

± Representation is too restrictive

± Mutation & crossovers only applicable for bit-string &

integer representations

± Selection mechanism sensitive for converging

populations with close fitness values

± Generational population model (step 5 in SGA repr.

cycle) can be improved with explicit survivor selection

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Alternative Crossover Operators

Performance with 1 Point Crossover depends on the

order that variables occur in the representation

± more likely to keep together genes that are near

each other

± Can never keep together genes from opposite ends

of string

± This is known as Positional Bias

± Can be exploited if we know about the structure of

our problem, but this is not usually the case

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

n-point crossover

Choose n random crossover points

Split along those points

Glue parts, alternating between parents

Generalisation of 1 point (still some positional bias)

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Uniform crossover

Assign 'heads' to one parent, 'tails' to the other

Flip a coin for each gene of the first child

Make an inverse copy of the gene for the second child

Inheritance is independent of position

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Crossover OR mutation?

Decade long debate: which one is better / necessary /

main-background

Answer (at least, rather wide agreement):

± it depends on the problem, but

± in general, it is good to have both

± both have another role

± mutation-only-EA is possible, xover-only-EA would not work

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Exploration: Discovering promising areas in the search

space, i.e. gaining information on the problem

Exploitation: Optimising within a promising area, i.e. using

information

There is co-operation AND competition between them

Crossover is explorative, it makes a big jump to an area

somewhere ³in between´ two (parent) areas

Mutation is exploitative, it creates random small

diversions, thereby staying near (in the area of ) the parent

Crossover OR mutation? (cont¶d)

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Only crossover can combine information from two

parents

Only mutation can introduce new information (alleles)

Crossover does not change the allele frequencies of

the population (thought experiment: 50% 0¶s on first

bit in the population, ?% after performing n

crossovers)

To hit the optimum you often need a µlucky¶ mutation

Crossover OR mutation? (cont¶d)

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Other representations

Gray coding of integers (still binary chromosomes)

± Gray coding is a mapping that means that 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

Floating point variables

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Integer representations

Some problems naturally have integer variables, e.g.

image processing parameters

Others take categorical values from a fixed set e.g.

{blue, green, yellow, pink}

N-point / uniform crossover operators work

Extend bit-flipping mutation to make

± ³creep´ i.e. more likely to move to similar value

± Random choice (esp. categorical variables)

± For ordinal problems, it is hard to know correct range for

creep, so often use two mutation operators in tandem

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Real valued problems

Many problems occur as real valued problems, e.g.

continuous parameter optimisation f : T

n

T

Illustration: Ackley¶s function (often used in EC)

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Mapping real values on bit strings

z [x,y] _ Trepresented by {a

1

,«,a

L

} {0,1}

L

[x,y] ÷{0,1}

L

must be invertible (one phenotype per

genotype)

I: {0,1}

L

÷[x,y] defines the representation

Only 2

L

values out of infinite are represented

L determines possible maximum precision of solution

High precision long chromosomes (slow evolution)

] , [ ) 2 (

1 2

) ,..., (

1

0

1

y x a

x y

x a a

j

L

j

j L

L

L

+ = I

¿

=

**A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing
**

Genetic Algorithms

Floating point mutations 1

General scheme of floating point mutations

Uniform mutation:

Analogous to bit-flipping (binary) or random resetting

(integers)

l l

x x x x x x

d d

=

d

÷ = ..., , ..., ,

1 1

? A

i i i i

UB LB x x , ,

d

? A

i i i

UB LB x , from (uniform) randomly drawn d

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Floating point mutations 2

Non-uniform mutations:

± Many methods proposed,such as time-varying

range of change etc.

± Most schemes are probabilistic but usually only

make a small change to value

± Most common method is to add random deviate to

each variable separately, taken from N(0, W)

Gaussian distribution and then curtail to range

± Standard deviation W controls amount of change

(2/3 of deviations will lie in range (- W to + W)

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Crossover operators for real valued GAs

Discrete:

± each allele value in offspring z comes from one of its

parents (x,y) with equal probability: z

i

= x

i

or y

i

± Could use n-point or uniform

Intermediate

± exploits idea of creating children ³between´ parents

(hence a.k.a. arithmetic recombination)

± z

i

= E x

i

+ (1 - E) y

i

where E : 0 e E e 1.

± The parameter E can be:

constant: uniform arithmetical crossover

variable (e.g. depend on the age of the population)

picked at random every time

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Single arithmetic crossover

Parents: x

1

,«,x

n

³ and £y

1

,«,y

n

³

Pick a single gene (k) at random,

child

1

is:

reverse for other child. e.g. with E = 0.5

n k k k

x x y x x ..., , ) 1 ( , ..., ,

1

+ E E

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Simple arithmetic crossover

Parents: £x

1

,«,x

n

³ and £y

1

,«,y

n

³

Pick random gene (k) after this point mix values

child

1

is:

reverse for other child. e.g. with E = 0.5

n

x

k

x

k

y

k

x x +

+

+

+

) 1 (

n

y ..., ,

1

) 1 (

1

, ..., ,

1

E E E E

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Most commonly used

Parents: £x

1

,«,x

n

³ and £y

1

,«,y

n

³

child

1

is:

reverse for other child. e.g. with E = 0.5

Whole arithmetic crossover

y a x a + ) 1 (

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Permutation Representations

Ordering/sequencing problems form a special type

Task is (or can be solved by) arranging some objects in

a certain order

± Example: sort algorithm: important thing is which elements

occur before others (order)

± Example: Travelling Salesman Problem (TSP) : important thing

is which elements occur next to each other (adjacency)

These problems are generally expressed as a

permutation:

± if there are n variables then the representation is as a list of n

integers, each of which occurs exactly once

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Permutation representation: TSP example

Problem:

Given n cities

Find a complete tour with

minimal length

Encoding:

Label the cities 1, 2, « , n

One complete tour is one

permutation (e.g. for n =4

[1,2,3,4], [3,4,2,1] are OK)

Search space is BIG:

for 30 cities there are 30! } 10

32

possible tours

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Mutation operators for permutations

Normal mutation operators lead to inadmissible

solutions

± e.g. bit-wise mutation : let gene i have value j

± changing to some other value k would mean that k

occurred twice and j no longer occurred

Therefore must change at least two values

Mutation parameter now reflects the probability

that some operator is applied once to the

whole string, rather than individually in each

position

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Insert Mutation for permutations

Pick two allele values at random

Move the second to follow the first, shifting the

rest along to accommodate

Note that this preserves most of the order and

the adjacency information

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Swap mutation for permutations

Pick two alleles at random and swap their

positions

Preserves most of adjacency information (4

links broken), disrupts order more

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Inversion mutation for permutations

Pick two alleles at random and then invert the

substring between them.

Preserves most adjacency information (only

breaks two links) but disruptive of order

information

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Scramble mutation for permutations

Pick a subset of genes at random

Randomly rearrange the alleles in those

positions

(note subset does not have to be contiguous)

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

³Normal´ crossover operators will often lead to

inadmissible solutions

Many specialised operators have been devised

which focus on combining order or adjacency

information from the two parents

Crossover operators for permutations

1 2 3 4 5

5 4 3 2 1

1 2 3 2 1

5 4 3 4 5

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Order 1 crossover

Idea is to preserve relative order that elements occur

Informal procedure:

1. Choose an arbitrary part from the first parent

2. Copy this part to the first child

3. Copy the numbers that are not in the first part, to

the first child:

starting right from cut point of the copied part,

using the order of the second parent

and wrapping around at the end

4. Analogous for the second child, with parent roles

reversed

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Order 1 crossover example

Copy randomly selected set from first parent

Copy rest from second parent in order 1,9,3,8,2

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Informal procedure for parents P1 and P2:

1. Choose random segment and copy it from P1

2. Starting from the first crossover point look for elements in that

segment of P2 that have not been copied

3. For each of these i look in the offspring to see what element j has

been copied in its place from P1

4. Place i into the position occupied j in P2, since we know that we will

not be putting j there (as is already in offspring)

5. If the place occupied by j in P2 has already been filled in the

offspring k, put i in the position occupied by k in P2

6. Having dealt with the elements from the crossover segment, the rest

of the offspring can be filled from P2.

Second child is created analogously

Partially Mapped Crossover (PMX)

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

PMX example

Step 1

Step 2

Step 3

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Cycle crossover

Basic idea:

Each allele comes from one parent together with its position.

Informal procedure:

1. Make a cycle of alleles from P1 in the following way.

(a) Start with the first allele of P1.

(b) Look at the allele at the same position in P2.

(c) Go to the position with the same allele in P1.

(d) Add this allele to the cycle.

(e) Repeat step b through d until you arrive at the first allele of P1.

2. Put the alleles of the cycle in the first child on the positions

they have in the first parent.

3. Take next cycle from second parent

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Cycle crossover example

Step 1: identify cycles

Step 2: copy alternate cycles into offspring

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Edge Recombination

Works by constructing a table listing which

edges are present in the two parents, if an

edge is common to both, mark with a +

e.g. [1 2 3 4 5 6 7 8 9] and [9 3 7 8 2 6 5 1 4]

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Edge Recombination 2

Informal procedure once edge table is constructed

1. Pick an initial element at random and put it in the offspring

2. Set the variable current element = entry

3. Remove all references to current element from the table

4. Examine list for current element:

± If there is a common edge, pick that to be next element

± Otherwise pick the entry in the list which itself has the shortest list

± Ties are split at random

5. In the case of reaching an empty list:

± Examine the other end of the offspring is for extension

± Otherwise a new element is chosen at random

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Edge Recombination example

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Multiparent recombination

Recall that we are not constricted by the practicalities

of nature

Noting that mutation uses 1 parent, and ³traditional´

crossover 2, the extension to a>2 is natural to examine

Been around since 1960s, still rare but studies indicate

useful

Three main types:

± Based on allele frequencies, e.g., p-sexual voting generalising

uniform crossover

± Based on segmentation and recombination of the parents, e.g.,

diagonal crossover generalising n-point crossover

± Based on numerical operations on real-valued alleles, e.g.,

center of mass crossover, generalising arithmetic

recombination operators

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Population Models

SGA uses a Generational model:

± each individual survives for exactly one generation

± the entire set of parents is replaced by the offspring

At the other end of the scale are Steady-State

models:

± one offspring is generated per generation,

± one member of population replaced,

Generation Gap

± the proportion of the population replaced

± 1.0 for GGA, 1/pop_size for SSGA

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Fitness Based Competition

Selection can occur in two places:

± Selection from current generation to take part in

mating (parent selection)

± Selection from parents + offspring to go into next

generation (survivor selection)

Selection operators work on whole individual

± i.e. they are representation-independent

Distinction between selection

± operators: define selection probabilities

± algorithms: define how probabilities are implemented

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Implementation example: SGA

Expected number of copies of an individual i

E( n

i

) = Q f(i)/ £f³

(Q = pop.size, f(i) = fitness of i, £f³ avg. fitness in pop.)

Roulette wheel algorithm:

± Given a probability distribution, spin a 1-armed

wheel n times to make n selections

± No guarantees on actual value of n

i

Baker¶s SUS algorithm:

± n evenly spaced arms on wheel and spin once

± Guarantees floor(E( n

i

) ) e n

i

e ceil(E( n

i

) )

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Problems include

± One highly fit member can rapidly take over if rest of

population is much less fit: Premature Convergence

± At end of runs when fitnesses are similar, lose

selection pressure

± Highly susceptible to function transposition

Scaling can fix last two problems

± Windowing: f¶(i) = f(i) - F

t

where F is worst fitness in this (last n) generations

± Sigma Scaling: f¶(i) = max( f(i) ± (£ f ³ - c W

f

), 0.0)

where c is a constant, usually 2.0

Fitness-Proportionate Selection

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Function transposition for FPS

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Rank ± Based Selection

Attempt to remove problems of FPS by basing

selection probabilities on relative rather than

absolute fitness

Rank population according to fitness and then

base selection probabilities on rank where

fittest has rank Q and worst rank 1

This imposes a sorting overhead on the

algorithm, but this is usually negligible

compared to the fitness evaluation time

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Linear Ranking

Parameterised by factor s: 1.0 < s e 2.0

± measures advantage of best individual

± in GGA this is the number of children allotted to it

Simple 3 member example

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Exponential Ranking

Linear Ranking is limited to selection pressure

Exponential Ranking can allocate more than 2

copies to fittest individual

Normalise constant factor c according to

population size

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Tournament Selection

All methods above rely on global population

statistics

± Could be a bottleneck esp. on parallel machines

± Relies on presence of external fitness function

which might not exist: e.g. evolving game players

Informal Procedure:

± Pick k members at random then select the best of

these

± Repeat to select more individuals

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Tournament Selection 2

Probability of selecting i will depend on:

± Rank of i

± Size of sample k

higher k increases selection pressure

± Whether contestants are picked with replacement

Picking without replacement increases selection pressure

± Whether fittest contestant always wins

(deterministic) or this happens with probability p

For k = 2, time for fittest individual to take over

population is the same as linear ranking with s = 2 p

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Survivor Selection

Most of methods above used for parent

selection

Survivor selection can be divided into two

approaches:

± Age-Based Selection

e.g. SGA

In SSGA can implement as ³delete-random´ (not

recommended) or as first-in-first-out (a.k.a. delete-oldest)

± Fitness-Based Selection

Using one of the methods above or

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Two Special Cases

Elitism

± Widely used in both population models (GGA,

SSGA)

± Always keep at least one copy of the fittest solution

so far

GENITOR: a.k.a. ³delete-worst´

± From Whitley¶s original Steady-State algorithm (he

also used linear ranking for parent selection)

± Rapid takeover : use with large populations or ³no

duplicates´ policy

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Example application of order based GAs: JSSP

Precedence constrained job shop scheduling problem

J is a set of jobs.

O is a set of operations

M is a set of machines

Able _ O v M defines which machines can perform which

operations

Pre _ O v O defines which operation should precede which

Dur : _ O v M ÷IR defines the duration of o O on m M

The goal is now to find a schedule that is:

Complete: all jobs are scheduled

Correct: all conditions defined by Able and Pre are satisfied

Optimal: the total duration of the schedule is minimal

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

Precedence constrained job shop scheduling GA

Representation: individuals are permutations of operations

Permutations are decoded to schedules by a decoding procedure

± take the first (next) operation from the individual

± look up its machine (here we assume there is only one)

± assign the earliest possible starting time on this machine, subject to

machine occupation

precedence relations holding for this operation in the schedule created so far

fitness of a permutation is the duration of the corresponding

schedule (to be minimized)

use any suitable mutation and crossover

use roulette wheel parent selection on inverse fitness

Generational GA model for survivor selection

use random initialisation

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing

Genetic Algorithms

JSSP example: operator comparison

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing Genetic Algorithms

**GA Quick Overview
**

**Developed: USA in the 1970¶s Early names: J. Holland, K. DeJong, D. Goldberg Typically applied to:
**

±

discrete optimization not too fast good heuristic for combinatorial problems Traditionally emphasizes combining information from good parents (crossover) many variants, e.g., reproduction models, operators

Attributed features:

± ±

Special Features:

± ±

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing Genetic Algorithms

Genetic algorithms

**Holland¶s original GA is now known as the simple genetic algorithm (SGA) Other GAs use different:
**

± ± ± ±

Representations Mutations Crossovers Selection mechanisms

Smith.E. Eiben and J. Introduction to Evolutionary Computing Genetic Algorithms SGA technical summary tableau Representation Recombination Mutation Parent selection Survivor selection Speciality Binary strings N-point or uniform Bitwise bit-flipping with fixed probability Fitness-Proportionate All children replace parents Emphasis on crossover .A.E.

E.1}L 10010001 10010010 010001001 011101001 Decoding (inverse representation) . Eiben and J.E. Introduction to Evolutionary Computing Genetic Algorithms Representation Phenotype space Encoding (representation) Genotype space = {0. Smith.A.

For each consecutive pair apply crossover with probability pc . Eiben and J.E. Replace the whole population with the resulting offspring .A. Shuffle the mating pool 3. otherwise copy parents 4. Smith.E. For each offspring apply mutation (bit-flip with probability pm independently for each bit) 5. Select parents for the mating pool (size of mating pool = population size) 2. Introduction to Evolutionary Computing Genetic Algorithms SGA reproduction cycle 1.

A.E.6. 0. Introduction to Evolutionary Computing Genetic Algorithms SGA operators: 1-point crossover Choose a random point on the two parents Split parents at this crossover point Create children by exchanging tails Pc typically in range (0. Smith.E. Eiben and J.9) .

Smith. Eiben and J. Introduction to Evolutionary Computing Genetic Algorithms SGA operators: mutation Alter each gene independently with a probability pm pm is called the mutation rate ± Typically between 1/pop_size and 1/ chromosome_length .A.E.E.

Introduction to Evolutionary Computing Genetic Algorithms SGA operators: Selection Main idea: better individuals get higher chance ± Chances proportional to fitness ± Implementation: roulette wheel technique Assign to each individual a part of the roulette wheel Spin the wheel n times to select n individuals 1/6 = 17% A 3/6 = 50% B C fitness(A) = 3 fitness(B) = 1 fitness(C) = 2 2/6 = 33% .A.E.E. Smith. Eiben and J.

E. 01101 m 13 Population size: 4 1-point xover.A. e.E. Introduction to Evolutionary Computing Genetic Algorithms An example after Goldberg µ89 (1) Simple problem: max x2 over {0. Smith.1. Eiben and J.g. bitwise mutation Roulette wheel selection Random initialisation We show one generational cycle done by hand .«.31} GA approach: ± ± ± ± ± Representation: binary code.

E. Eiben and J.A. Introduction to Evolutionary Computing Genetic Algorithms x2 example: selection .E. Smith.

E.A.E. Smith. Eiben and J. Introduction to Evolutionary Computing Genetic Algorithms X2 example: crossover .

Introduction to Evolutionary Computing Genetic Algorithms X2 example: mutation . Smith.A.E.E. Eiben and J.

cycle) can be improved with explicit survivor selection Shows many shortcomings. e.E.A. Smith. Eiben and J. ± ± ± ± .E. Introduction to Evolutionary Computing Genetic Algorithms The simple GA Has been subject of many (early) studies ± still often used as benchmark for novel GAs Representation is too restrictive Mutation & crossovers only applicable for bit-string & integer representations Selection mechanism sensitive for converging populations with close fitness values Generational population model (step 5 in SGA repr.g.

A. but this is not usually the case ± ± ± . Eiben and J.E. Introduction to Evolutionary Computing Genetic Algorithms Alternative Crossover Operators Performance with 1 Point Crossover depends on the order that variables occur in the representation ± more likely to keep together genes that are near each other Can never keep together genes from opposite ends of string This is known as Positional Bias Can be exploited if we know about the structure of our problem.E. Smith.

A.E. alternating between parents Generalisation of 1 point (still some positional bias) .E. Smith. Introduction to Evolutionary Computing Genetic Algorithms n-point crossover Choose n random crossover points Split along those points Glue parts. Eiben and J.

A. Introduction to Evolutionary Computing Genetic Algorithms Uniform crossover Assign 'heads' to one parent.E. Smith.E. Eiben and J. 'tails' to the other Flip a coin for each gene of the first child Make an inverse copy of the gene for the second child Inheritance is independent of position .

it is good to have both both have another role mutation-only-EA is possible.E. Eiben and J. Smith. rather wide agreement): ± ± ± ± it depends on the problem. but in general.E.A. xover-only-EA would not work . Introduction to Evolutionary Computing Genetic Algorithms Crossover OR mutation? Decade long debate: which one is better / necessary / main-background Answer (at least.

gaining information on the problem Exploitation: Optimising within a promising area. thereby staying near (in the area of ) the parent .e. Introduction to Evolutionary Computing Genetic Algorithms Crossover OR mutation? (cont¶d) Exploration: Discovering promising areas in the search space. Smith. it creates random small somewhere ³in between´ two (parent) areas diversions. Eiben and J. i.e.E. it makes a big jump to an area Mutation is exploitative. i.A.E. using information There is co-operation AND competition between them Crossover is explorative.

E.A. ?% after performing n crossovers) To hit the optimum you often need a µlucky¶ mutation . Smith.E. Introduction to Evolutionary Computing Genetic Algorithms Crossover OR mutation? (cont¶d) Only crossover can combine information from two parents Only mutation can introduce new information (alleles) Crossover does not change the allele frequencies of the population (thought experiment: 50% 0¶s on first bit in the population. Eiben and J.

³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 Floating point variables .A. Introduction to Evolutionary Computing Genetic Algorithms Other representations Gray coding of integers (still binary chromosomes) ± Gray coding is a mapping that means that small changes in the genotype cause small changes in the phenotype (unlike binary coding).E.E. Smith. Eiben and J.

yellow. more likely to move to similar value Random choice (esp. Eiben and J.E.g.E. pink} N-point / uniform crossover operators work Extend bit-flipping mutation to make ± ± ± ³creep´ i. {blue. image processing parameters Others take categorical values from a fixed set e. categorical variables) For ordinal problems. Smith. Introduction to Evolutionary Computing Genetic Algorithms Integer representations Some problems naturally have integer variables. it is hard to know correct range for creep. so often use two mutation operators in tandem .g.A. e. green.e.

A.E. Introduction to Evolutionary Computing Genetic Algorithms Real valued problems Many problems occur as real valued problems. continuous parameter optimisation f : n Illustration: Ackley¶s function (often used in EC) .g. Eiben and J. Smith. e.E.

..A.y] p {0..1}L [x.aL} {0.y] represented by {a1. Introduction to Evolutionary Computing Genetic Algorithms Mapping real values on bit strings z [x. aL ) ! x L ( § aL j 2 j ) [ x.«. Eiben and J.. Smith.E.1}L must be invertible (one phenotype per genotype) +: {0.E. y ] 2 1 j !0 Only 2L values out of infinite are represented L determines possible maximum precision of solution High precision long chromosomes (slow evolution) .1}L p [x.y] defines the representation y x L1 +( a1 .

Eiben and J. xid ?LBi .. xl p x d x1 . UBi A Uniform mutation: xid drawn randomly (uniform) from ?LBi .UBi A Analogous to bit-flipping (binary) or random resetting (integers) . .. Smith.E.E.. ... Introduction to Evolutionary Computing Genetic Algorithms Floating point mutations 1 General scheme of floating point mutations x ! x1 . xld ! d xi .A..

Smith. Most schemes are probabilistic but usually only make a small change to value Most common method is to add random deviate to each variable separately.E. W) Gaussian distribution and then curtail to range Standard deviation W controls amount of change (2/3 of deviations will lie in range (.E.such as time-varying range of change etc.W to + W) . taken from N(0. Introduction to Evolutionary Computing Genetic Algorithms Floating point mutations 2 Non-uniform mutations: ± ± ± ± Many methods proposed.A. Eiben and J.

arithmetic recombination) Intermediate ± ± ± zi = E xi + (1 .k.A. The parameter E can be: constant: uniform arithmetical crossover variable (e. Eiben and J.g.E. depend on the age of the population) picked at random every time . Introduction to Evolutionary Computing Genetic Algorithms Crossover operators for real valued GAs Discrete: ± ± each allele value in offspring z comes from one of its parents (x.E) yi where E : 0 e E e 1.a. Smith.y) with equal probability: zi = xi or yi Could use n-point or uniform exploits idea of creating children ³between´ parents (hence a.E.

xn ³ and £y1. xk .. with E = 0. Eiben and J...E.yn³ Pick a single gene (k) at random.5 .«.g. e.A. xn reverse for other child. Introduction to Evolutionary Computing Genetic Algorithms Single arithmetic crossover Parents: x1. . E yk (1 E ) xk . .E..«... child1 is: x1 . Smith.

. Eiben and J.E. x .5 .«.... Smith.xn ³ and £y1. Introduction to Evolutionary Computing Genetic Algorithms Simple arithmetic crossover Parents: £x1. .E.yn³ Pick random gene (k) after this point mix values child1 is: x . E y (1 E ) x 1 k k 1 k 1 n n reverse for other child. ..A..g. with E = 0. E y (1 E ) x . e.«.

«.yn³ child1 is: a x (1 a ) y reverse for other child. Introduction to Evolutionary Computing Genetic Algorithms Whole arithmetic crossover Most commonly used Parents: £x1. with E = 0.A.E.g.xn ³ and £y1. e.5 . Smith.E. Eiben and J.«.

E. Eiben and J. each of which occurs exactly once . Introduction to Evolutionary Computing Genetic Algorithms Permutation Representations Ordering/sequencing problems form a special type Task is (or can be solved by) arranging some objects in a certain order ± ± Example: sort algorithm: important thing is which elements occur before others (order) Example: Travelling Salesman Problem (TSP) : important thing is which elements occur next to each other (adjacency) These problems are generally expressed as a permutation: ± if there are n variables then the representation is as a list of n integers.A.E. Smith.

2. [3.4.4].A.g. Introduction to Evolutionary Computing Genetic Algorithms Permutation representation: TSP example Problem: Given n cities Find a complete tour with minimal length Encoding: Label the cities 1.E.1] are OK) Search space is BIG: for 30 cities there are 30! } 1032 possible tours . for n =4 [1.E. Smith.2. « .2.3. Eiben and J. n One complete tour is one permutation (e.

g. rather than individually in each position . bit-wise mutation : let gene i have value j changing to some other value k would mean that k occurred twice and j no longer occurred Therefore must change at least two values Mutation parameter now reflects the probability that some operator is applied once to the whole string.E. Eiben and J. Smith.A.E. Introduction to Evolutionary Computing Genetic Algorithms Mutation operators for permutations Normal mutation operators lead to inadmissible solutions ± ± e.

A.E. Eiben and J. Introduction to Evolutionary Computing Genetic Algorithms Insert Mutation for permutations Pick two allele values at random Move the second to follow the first. Smith. shifting the rest along to accommodate Note that this preserves most of the order and the adjacency information .E.

A. Introduction to Evolutionary Computing Genetic Algorithms Swap mutation for permutations Pick two alleles at random and swap their positions Preserves most of adjacency information (4 links broken).E. Smith. disrupts order more . Eiben and J.E.

Preserves most adjacency information (only breaks two links) but disruptive of order information .E.A.E. Introduction to Evolutionary Computing Genetic Algorithms Inversion mutation for permutations Pick two alleles at random and then invert the substring between them. Smith. Eiben and J.

A. Smith. Eiben and J. Introduction to Evolutionary Computing Genetic Algorithms Scramble mutation for permutations Pick a subset of genes at random Randomly rearrange the alleles in those positions (note subset does not have to be contiguous) .E.E.

Eiben and J.E. Smith. Introduction to Evolutionary Computing Genetic Algorithms Crossover operators for permutations ³Normal´ crossover operators will often lead to inadmissible solutions 12345 54321 12321 54345 Many specialised operators have been devised which focus on combining order or adjacency information from the two parents .E.A.

E. Choose an arbitrary part from the first parent 2.E. Analogous for the second child.A. to the first child: starting right from cut point of the copied part. using the order of the second parent and wrapping around at the end 4. Introduction to Evolutionary Computing Genetic Algorithms Order 1 crossover Idea is to preserve relative order that elements occur Informal procedure: 1. Smith. Copy the numbers that are not in the first part. with parent roles reversed . Copy this part to the first child 3. Eiben and J.

Eiben and J.E.2 . Smith.9.3.8. Introduction to Evolutionary Computing Genetic Algorithms Order 1 crossover example Copy randomly selected set from first parent Copy rest from second parent in order 1.E.A.

Place i into the position occupied j in P2. the rest of the offspring can be filled from P2.E. Introduction to Evolutionary Computing Genetic Algorithms Partially Mapped Crossover (PMX) Informal procedure for parents P1 and P2: 1. since we know that we will not be putting j there (as is already in offspring) 5. Starting from the first crossover point look for elements in that segment of P2 that have not been copied 3. If the place occupied by j in P2 has already been filled in the offspring k. Having dealt with the elements from the crossover segment.A. For each of these i look in the offspring to see what element j has been copied in its place from P1 4. Choose random segment and copy it from P1 2. put i in the position occupied by k in P2 6. Second child is created analogously .E. Smith. Eiben and J.

E.E. Eiben and J. Introduction to Evolutionary Computing Genetic Algorithms PMX example Step 1 Step 2 Step 3 .A. Smith.

Put the alleles of the cycle in the first child on the positions they have in the first parent. Informal procedure: 1. 3.E.A. (d) Add this allele to the cycle. (a) Start with the first allele of P1. Make a cycle of alleles from P1 in the following way. (b) Look at the allele at the same position in P2. (e) Repeat step b through d until you arrive at the first allele of P1. 2. Take next cycle from second parent . (c) Go to the position with the same allele in P1. Introduction to Evolutionary Computing Genetic Algorithms Cycle crossover Basic idea: Each allele comes from one parent together with its position.E. Eiben and J. Smith.

E. Introduction to Evolutionary Computing Genetic Algorithms Cycle crossover example Step 1: identify cycles Step 2: copy alternate cycles into offspring .A. Smith. Eiben and J.E.

g. Eiben and J. mark with a + e. [1 2 3 4 5 6 7 8 9] and [9 3 7 8 2 6 5 1 4] . if an edge is common to both. Introduction to Evolutionary Computing Genetic Algorithms Edge Recombination Works by constructing a table listing which edges are present in the two parents.E.E. Smith.A.

E. In the case of reaching an empty list: ± ± . Set the variable current element = entry 3. Remove all references to current element from the table 4. Examine list for current element: ± ± ± If there is a common edge.A.E. Smith. Eiben and J. Pick an initial element at random and put it in the offspring 2. Introduction to Evolutionary Computing Genetic Algorithms Edge Recombination 2 Informal procedure once edge table is constructed 1. pick that to be next element Otherwise pick the entry in the list which itself has the shortest list Ties are split at random Examine the other end of the offspring is for extension Otherwise a new element is chosen at random 5.

A. Introduction to Evolutionary Computing Genetic Algorithms Edge Recombination example .E. Smith.E. Eiben and J.

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing Genetic Algorithms

Multiparent recombination

Recall that we are not constricted by the practicalities of nature Noting that mutation uses 1 parent, and ³traditional´ crossover 2, the extension to a>2 is natural to examine Been around since 1960s, still rare but studies indicate useful Three main types:

± ± ±

Based on allele frequencies, e.g., p-sexual voting generalising uniform crossover Based on segmentation and recombination of the parents, e.g., diagonal crossover generalising n-point crossover Based on numerical operations on real-valued alleles, e.g., center of mass crossover, generalising arithmetic recombination operators

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing Genetic Algorithms

Population Models

**SGA uses a Generational model:
**

± ±

each individual survives for exactly one generation the entire set of parents is replaced by the offspring

**At the other end of the scale are Steady-State models:
**

± ±

one offspring is generated per generation, one member of population replaced, the proportion of the population replaced 1.0 for GGA, 1/pop_size for SSGA

Generation Gap

± ±

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing Genetic Algorithms

Fitness Based Competition

**Selection can occur in two places:
**

±

±

Selection from current generation to take part in mating (parent selection) Selection from parents + offspring to go into next generation (survivor selection) i.e. they are representation-independent operators: define selection probabilities algorithms: define how probabilities are implemented

**Selection operators work on whole individual
**

±

**Distinction between selection
**

± ±

E. f(i) = fitness of i. Smith.) ± Given a probability distribution. Eiben and J. fitness in pop.A. £f³ avg.size.E. spin a 1-armed wheel n times to make n selections No guarantees on actual value of ni n evenly spaced arms on wheel and spin once Guarantees floor(E( ni ) ) e ni e ceil(E( ni ) ) Baker¶s SUS algorithm: ± ± . Introduction to Evolutionary Computing Genetic Algorithms Implementation example: SGA Expected number of copies of an individual i E( ni ) = Q f(i)/ £f³ Roulette wheel algorithm: ± (Q = pop.

E. lose selection pressure Highly susceptible to function transposition Windowing: f¶(i) = f(i) .E.A.F t Scaling can fix last two problems ± where F is worst fitness in this (last n) generations where c is a constant.0) .0 ± Sigma Scaling: f¶(i) = max( f(i) ± (£ f ³ .c Wf ). 0. usually 2. Introduction to Evolutionary Computing Genetic Algorithms Fitness-Proportionate Selection Problems include ± ± ± One highly fit member can rapidly take over if rest of population is much less fit: Premature Convergence At end of runs when fitnesses are similar. Smith. Eiben and J.

Smith. Introduction to Evolutionary Computing Genetic Algorithms Function transposition for FPS .E.E.A. Eiben and J.

E. Introduction to Evolutionary Computing Genetic Algorithms Rank ± Based Selection Attempt to remove problems of FPS by basing selection probabilities on relative rather than absolute fitness Rank population according to fitness and then base selection probabilities on rank where fittest has rank Q and worst rank 1 This imposes a sorting overhead on the algorithm. but this is usually negligible compared to the fitness evaluation time . Eiben and J. Smith.E.A.

Smith.0 ± measures advantage of best individual ± in GGA this is the number of children allotted to it Simple 3 member example .E.0 < s e 2. Eiben and J.A. Introduction to Evolutionary Computing Genetic Algorithms Linear Ranking Parameterised by factor s: 1.E.

Smith.A.E. Eiben and J. Introduction to Evolutionary Computing Genetic Algorithms Exponential Ranking Linear Ranking is limited to selection pressure Exponential Ranking can allocate more than 2 copies to fittest individual Normalise constant factor c according to population size .E.

Introduction to Evolutionary Computing Genetic Algorithms Tournament Selection All methods above rely on global population statistics ± ± Could be a bottleneck esp. on parallel machines Relies on presence of external fitness function which might not exist: e.g. evolving game players Pick k members at random then select the best of these Repeat to select more individuals Informal Procedure: ± ± .A. Smith.E.E. Eiben and J.

Smith. Introduction to Evolutionary Computing Genetic Algorithms Tournament Selection 2 Probability of selecting i will depend on: ± ± ± ± Rank of i Size of sample k higher k increases selection pressure Picking without replacement increases selection pressure Whether contestants are picked with replacement Whether fittest contestant always wins (deterministic) or this happens with probability p For k = 2.E.E.A. Eiben and J. time for fittest individual to take over population is the same as linear ranking with s = 2 p .

E.A. delete-oldest) Using one of the methods above or ± Fitness-Based Selection . SGA In SSGA can implement as ³delete-random´ (not recommended) or as first-in-first-out (a.a.k. Eiben and J.E. Smith.g. Introduction to Evolutionary Computing Genetic Algorithms Survivor Selection Most of methods above used for parent selection Survivor selection can be divided into two approaches: ± Age-Based Selection e.

E. ³delete-worst´ ± ± .E.a.k. Introduction to Evolutionary Computing Genetic Algorithms Two Special Cases Elitism ± ± Widely used in both population models (GGA. SSGA) Always keep at least one copy of the fittest solution so far From Whitley¶s original Steady-State algorithm (he also used linear ranking for parent selection) Rapid takeover : use with large populations or ³no duplicates´ policy GENITOR: a. Eiben and J.A. Smith.

O is a set of operations M is a set of machines Able O v M defines which machines can perform which operations Pre O v O defines which operation should precede which Dur : O v M p IR defines the duration of o O on m M The goal is now to find a schedule that is: Complete: all jobs are scheduled Correct: all conditions defined by Able and Pre are satisfied Optimal: the total duration of the schedule is minimal .E. Introduction to Evolutionary Computing Genetic Algorithms Example application of order based GAs: JSSP Precedence constrained job shop scheduling problem J is a set of jobs. Smith.E.A. Eiben and J.

Smith. Introduction to Evolutionary Computing Genetic Algorithms Precedence constrained job shop scheduling GA Representation: individuals are permutations of operations Permutations are decoded to schedules by a decoding procedure ± ± ± take the first (next) operation from the individual look up its machine (here we assume there is only one) assign the earliest possible starting time on this machine.E.E. subject to machine occupation precedence relations holding for this operation in the schedule created so far fitness of a permutation is the duration of the corresponding schedule (to be minimized) use any suitable mutation and crossover use roulette wheel parent selection on inverse fitness Generational GA model for survivor selection use random initialisation .A. Eiben and J.

Introduction to Evolutionary Computing Genetic Algorithms JSSP example: operator comparison .E.E.A. Eiben and J. Smith.

Sign up to vote on this title

UsefulNot useful- A. Zilhao-Evolution, Rationality and Cognition_ a Cognitive Science for the Twenty-First Century -Routledge (2005)by bluesette
- Biology Topicsby Vahidin Qerimi
- A New Evolutionary Method With a Hybrid Approach Combining Particle Swarm Optimization and Genetic Algorithms Using Fuzzy Logic for Decision Makingby Harshal Patil
- Wiliam Durham Adaptive Significance of Cultural Behaviorby Puji Hastuti

- Genetic Algorithm
- SOFTWARE TESTING USING GENETIC ALGORITHMS
- Phillips ThesisDraft8
- eco+LOAD+DISPATCH
- Genetic Algorithm in MATLAB
- Submit Paper Final
- WINE-D-16-01154.pdf
- Reinforced Concrete Beam Optimimization
- rhodes_2
- Parameter Estimation in a Mathematical Model of a Heat-Conducting Rod
- PhD Student Francisco J. Ruiz-Ruano
- The Case Against Darwin
- English Section Test
- Icccbe x 120
- 10.1.1.195
- Hidraulica en tuberias y canales.ppsx
- A. Zilhao-Evolution, Rationality and Cognition_ a Cognitive Science for the Twenty-First Century -Routledge (2005)
- Biology Topics
- A New Evolutionary Method With a Hybrid Approach Combining Particle Swarm Optimization and Genetic Algorithms Using Fuzzy Logic for Decision Making
- Wiliam Durham Adaptive Significance of Cultural Behavior
- WHAT IS LIFE-211(1)
- Seckbach - Divine Action and Natural Selection
- [John F. Haught] God After Darwin a Theology of E(Book4You)
- The Structure of Cultural Revolutions
- art%3A10.1007%2Fs40903-015-0019-4
- Chapt 27
- Biologi - Biology Chapter 7
- 149-2011
- UT Dallas Syllabus for nats3330.001.09s taught by Homer Montgomery (mont)
- ijfs16-2-r-1-20140121115156_v2
- Genetic Algorithms