04 Evolution Computing
04 Evolution Computing
Intelligence
Lecture 4:
Evolutionary Computing
Evolutionary Computing
Evolution is an optimization process.
discard
parents
population
discard
Generational GA:
entire populations replaced with each iteration
Steady-state GA:
a few members replaced each generation
Mutate offspring
Sum 1170 1
Average 293 0.25
Max 576 0.49
Sum 1754
Average 439
Max 729
• Issues:
– size of the initial population
experimentally determined for problem
– diversity of the initial population (genetic diversity)
a problem resulting from lack of diversity is premature
• Deterministic Selection
– relies heavily on evaluation/fitness function
– converges fast
• Two approaches:
– next generation is parents and their children
• parents are the best of the current generation
• parents produce children and survive to next generation
– next generation is only the children
• parents are the best of the current generation
• parents are used to produce children only
• parents don't survive
• Parameters:
– number of crossover points
– positions of the crossover points
Advanced AI - 4: Evolutionary Computing 33
Alteration: Producing New Individuals
1-point Crossover
pick a dividing point in the parents' vectors
and swap their segments
Example
given parents: 1101101101 and 0001001000
crossover point: after the 4th digit
children produced are:
1101 + 001000 and 0001 + 101101
• N-point Crossover
– generalization of 1-point crossover
– pick n dividing points in the parents' vectors
and splice together alternating segments
• Uniform Crossover
– the value of each element of the vector is
randomly chosen from the values in the
corresponding elements of the two parents
• Techniques also exist for permutation representations
Advanced AI - 4: Evolutionary Computing 36
N-point Crossover
uniform Crossover
Advanced AI - 4: Evolutionary Computing 37
Alteration: Producing New Individuals
• Alteration is used to produce new individuals
• Mutation
– randomly change an individual
– e.g. TSP: two-swap, two-interchange
• Parameters:
– mutation rate
– size of the mutation
?
?
? ?
? ?
?
?
?
? ?
? ?
•Noisy?
•Discontinuous? ?
?
Advanced AI - 4: Evolutionary Computing 44
Genetic algorithms
CityList1 (3 5 7 2 1 6 4 8)
CityList2 (2 5 7 6 8 1 3 4)
Child (2 5 7 2 1 6 3 4)
* *
Before: (5 8 7 2 1 6 3 4)
After: (5 8 6 2 1 7 3 4)
100
80
y 60
40
20
0
0 10 20 30 40 50 60 70 80 90 100
x
120
100
80
y 60
40
20
0
0 10 20 30 40 50 60 70 80 90 100
x
120
100
80
y 60
40
20
0
0 10 20 30 40 50 60 70 80 90 100
x
1800
1600
1400
1200
e
1000 c
n
a
t
800 s
i
D
600
400
200
0 Best
31 29 27 25 23 21 19 17 15 13 11 9 7 5 3 1
Worst
Generations (1000)
Average