You are on page 1of 15

?? ?

Evolutionary programing
and genetic algorithms
GA – general recombination scheme

 B / O – parents / descendants population


 dim – parents population size
 K – nr. of recombination operations between 2 individuals from B; (each produces 2 descendants)
 - recombination probability

A. Problems without constraints


for i=1:K
1. randomly chose 2 individuals from B:
2. generate
3. if
3.1.
3.2. evaluate and
else
3.3.
4. → O
GA – general recombination scheme

B. Problems with constraints 3.2. a=1


for i=1:K for j=1:2
1. randomly chose 2 individuals from B, if
2. generate a=0
3. if if a==1
3.1. evaluate and
3.2. for j=1:2 else go to 3.1
if
evaluate
else
else
3.3. asexual recombination:
4. → O
GA – recombination operators

 Recombination (crossover): 2 parents, probability, descendants


 Binary / / strings: discrete recombination
▪ Single point (one-point) / multiple points (n-points) / uniform recombination
 strings: arithmetic
▪ Simple / single / total (whole) recombination
 Permutations
▪ PMX (Partially Mapped Crossover)
▪ OCX (Order Crossover)
▪ CX (Cycle Crossover)
▪ ECX (Edge Crossover)

 Multiple recombination
GA – recombination. Binary strings

 Single point
 pr
 1 position

 Multiple points
 pr
 n positions

 Uniform
 pr
 Every position
GA – recombination. Integer strings

 Discrete recombination, similar to binary strings

 Single point: pr, one crossover point (gene)

 Multiple points: pr, n crossover points (genes)

 Uniform: pr, crossover at each position (gene)

 Other operations (ex. arithmetic)  possible aberrant descendants (not


integer alleles. Variations?
GA – recombination. Real value strings

 Discrete recombination
 Same as binary / integer strings
 Does not produce new alleles

 Arithmetic recombination: , (weight)


 weighted average of a gene pair: , ,

 Simple: from to last gene ()


 Single: only on gene
 Total: on each gene
▪  identical descendants. Other bad values?
GA – recombination. Permutations. OCX

 OCX (order crossover)


 Problems where the permutation indicates the order of events

x, y – parents, d – descendant, p(1), p(2) – positions

d( p(1):p(2) ) = x(p(1):p(2))
where = p(2)+1
for i = [p(2):m 1:p(2)-1]
if y(i) d
if where > m
where=1
d(where) = y(i)
where = where+1
GA – recombination. Permutations. PMX

 PMX (partially mapped crossover)


 Problems with adjacency dependencies

22 55 77

6 9 3

x, y – parents, d – descendant, p(1), p(2) – positions

d( p(1):p(2) ) = x( p(1):p(2) )
for k = p(1):p(2)
if y(k) d k=7 y(k)=5 d
i = position of d(k) in y d(k)=8
while d(i) 0 i=5
i = position of d(i) in y d(i)=10
d(i)=y(k) i=9
for i=1:m d(9)=0
if y(i) d d(9)=y(7)
j = first free position in d
d(j)=y(i)
GA – recombination. Permutations. CX

 CX (cycle crossover)

 Saves as much as possible the information regarding the absolute position of an allele in
parent chromosomes.

 Cycle: alleles in the same gene in the two parents are part of the same cycle

 Two steps
▪ Compute cycles
▪ Build descendants, by alternatively copying alleles from cycles
GA – recombination. Permutations. CX

 CX (cycle crossover)
GA – recombination. Permutations. ECX

 ECX (edge crossover)

 Creates descendants by copying pairs of consecutive alleles that are present in at least
one parent.

 Saves common sequences from parents


▪ First step: create lists of adjacent alleles (edge table)

 Optional, individual study


GA – recombinare multiplă

 Recombinare multiplă  mai mult de 2 părinți (n-tupluri)

 Ușor de implementat, dar fără echivalent biologic

 În general nu duce la îmbunătățirea rezultatelor


▪ Pentru cazuri particulare s-au obținut rezultate mai bune

 Tipuri de operatori
▪ Bazați pe frecvența alelelor – generalizare a încrucișării uniforme
▪ Bazați pe segmentare și recombinarea secvențelor – generalizare a recombinării multipunct
▪ Bazați pe operații asupra alelelor – recombinare de tip baricentru, generalizare a operatorilor de
recombinare aritmetică
References and homework

 References
 Manual: chapter 3.4

 Homework
 Implement all operators (a function for each of them)
▪ I: parents, recombination probability, other parameters (weight etc.)
▪ E: two descendants
?? ?
?

Spor la învăţat!

You might also like