Professional Documents
Culture Documents
Algorithms
∑ fitness( j )
j =1
Rank Selection
• In rank selection, the individuals are sorted
by fitness. The probability that individual i
is selected is then inversely proportional to
its position in this sorted list, i.e. the
individual at the head of the list is more
likely to be selected than the next
individual, and so on through the sorted list.
Steady state selection
• In this method, in every generation a few good
chromosomes are used for creating new
offspring in every iteration.
• Then some bad chromosomes are removed
and the new offspring is placed in their places.
• The rest of population migrates to the next
generation without going through selection
process.
Elitism
• When creating new population by
crossover and mutation, we have a big
chance, that we will loose the best
chromosome.
(1
1 2 3 4 5 6 7 8 9) + (4
4 5 3 6 8 9 7 2 1) = (1 2 3 4 5 6 8 9 7)
Value Encoding
•
• All crossovers from binary encoding can be
used
Tree Encoding
• Tree crossover - in both parent one crossover point is
selected, parents are divided in that point and
exchange part below crossover point to produce new
offspring
Mutation
• After a crossover is performed, mutation take place.
This is to prevent falling all solutions in population into
a local optimum of solved problem.
CityList1 (3 5 7 2 1 6 4 8)
CityList2 (2 5 7 6 8 1 3 4)
Crossover
Crossover combines inversion and
recombination:
* *
Parent1 (3 5 7 2 1 6 4 8)
Parent2 (2 5 7 6 8 1 3 4)
Child (5 8 7 2 1 6 3 4)
* *
Before: (5 8 7 2 1 6 3 4)
After: (5 8 6 2 1 7 3 4)
TSP Example: 30 Cities
120
100
80
60
y
40
20
0
0 10 20 30 40 50 60 70 80 90 100
x
Solution i (Distance = 941)
TSP30 (Performance = 941)
120
100
80
60
y
40
20
0
0 10 20 30 40 50 60 70 80 90 100
x
Solution j(Distance = 800)
44
62 TSP30 (Performance = 800)
69
67 120
78
64 100
62
54
80
42
50
40 60
y
40
38 40
21
35
67 20
60
60 0
40 0 10 20 30 40 50 60 70 80 90 100
42 x
50
99
Solution k(Distance = 652)
TSP30 (Performance = 652)
120
100
80
60
y
40
20
0
0 10 20 30 40 50 60 70 80 90 100
x
Best Solution (Distance = 420)
42
38 TSP30 Solution (Performance = 420)
35
120
26
21
35 100
32
7
80
38
46
44 60
y
58
60 40
69
76
20
78
71
69 0
67 0 10 20 30 40 50 60 70 80 90 100
62 x
84
94
Overview of Performance
TSP30 - Overview of Performance
1800
1600
1400
1200
Distance
1000
800
600
400
200
0 Best
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31
Worst
Generations (1000)
Average
Issues for GA Practitioners
• Choosing basic implementation issues:
– representation
– population size, mutation rate, ...
– selection, deletion policies
– crossover, mutation operators
• Termination Criteria
• Performance, scalability
• Solution is only as good as the evaluation
function (often hardest part)