Lecture Notes (Genetic Algorithm)
Lecture Notes (Genetic Algorithm)
Traditional optimization
Kennedy and
Holland Kirkpatrick Eberhart Storn and Geem and
(1975) Dorigo (1992)
Glover (1977) et al. (1983) (1995) Price (1996) Kim (2001)
Genetic Ant Colony
Tabu Search Simulated Particle Differential Harmony
Algorithm Optimization
Annealing Swarm Evolution Search
Optimization
1970s 2001
-4-
Metaheuristic Algorithms I: Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
– Representations
– Mutations
– Crossovers
– Selection
-6-
Metaheuristic Algorithms I: Genetic Algorithm
Genetic Algorithm
-7-
Metaheuristic Algorithms I: Genetic Algorithm
Genetic Algorithm
-8-
Metaheuristic Algorithms I: Genetic Algorithm
Genetic Algorithm
-9-
Metaheuristic Algorithms I: Genetic Algorithm
Genetic Algorithm
- 10 -
Metaheuristic Algorithms I: Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
- 12 -
Metaheuristic Algorithms I: Genetic Algorithm
Genetic Algorithm
- 13 -
Metaheuristic Algorithms I: Genetic Algorithm
Genetic Algorithm
1/6 = 17%
A B fitness(A) = 3
C
3/6 = 50% 2/6 = 33%
fitness(B) = 1
fitness(C) = 2
- 14 -
Metaheuristic Algorithms I: Genetic Algorithm
Process of SGA
- 15 -
Metaheuristic Algorithms I: Genetic Algorithm
Genetic Algorithm
Global optimum
f(6 , 2) = 4
- 16 -
Metaheuristic Algorithms I: Genetic Algorithm
Genetic Algorithm
String
x1 x2
No.
1 0 0 1 0 0 1 0 0 1 1
2 1 0 1 0 1 1 1 1 1 1
3 0 1 1 1 0 0 1 1 0 1
4 0 1 1 0 0 0 1 1 1 0
5 1 1 0 1 1 0 0 0 0 0
6 0 0 1 0 1 1 1 0 0 0
7 0 1 1 1 0 0 0 1 0 0
8 0 1 0 0 0 1 0 1 1 0
9 1 0 1 0 1 0 0 0 0 0
10 1 0 1 1 - 17 -1 1 0 0 1 1
Metaheuristic Algorithms I: Genetic Algorithm
Genetic Algorithm
( f ) − f
n n fn
Min. problem :Prob n = n =1 Max. problem :Prob n = T
f
T T
n
n =1 n =1
( f ) − f n
n =1
n
- 18 -
Metaheuristic Algorithms I: Genetic Algorithm
Genetic Algorithm
Crossover
String No. x1 x2 Crossover team
point
3 0 1 1 1 0 0 1 1 0 1 A 1
1 0 0 1 0 0 1 0 0 1 1 B 9
10 1 0 1 1 1 1 0 0 1 1 C 7
1 0 0 1 0 0 1 0 0 1 1 D 9
8 0 1 0 0 0 1 0 1 1 0 E 3
10 1 0 1 1 1 1 0 0 1 1 E 3
4 0 1 1 0 0 0 1 1 1 0 D 9
1 0 0 1 0 0 1 0 0 1 1 C 7
9 1 0 1 0 1 0 0 0 0 0 B 9
9 1 0 1 0 1 0 0 0 0 0 A 1
point 1 2 3 4 5 6 7 8 9
String No. x1 x2
3 0 0 1 0 1 0 0 0 0 0
1 0 0 1 0 0 1 0 0 1 0
10 1 0 1 1 1 1 0 0 1 1
1 0 0 1 0 0 1 0 0 1 0
8 0 1 0 1 1 1 0 0 1 1
10 1 0 1 0 0 1 0 1 1 0
4 0 1 1 0 0 0 1 1 1 1
1 0 0 1 0 0 1 0 0 1 1
9 1 0 1 0 1 0 0 0 0 1
9 1 1 1 1 - 20 -0 0 1 1 0 1
Metaheuristic Algorithms I: Genetic Algorithm
Genetic Algorithm
String No. x1 x2
3 o o
1 o o
10
1
8 o
10
4
1 o
9 o
9 o
String No. x1 x2
3 0 1 1 0 1 0 1 0 0 0
1 0 0 1 0 0 1 0 1 1 1
10 1 0 1 1 1 1 0 0 1 1
1 0 0 1 0 0 1 0 0 1 0
8 0 1 1 1 1 1 0 0 1 1
10 1 0 1 0 0 1 0 1 1 0
4 0 1 1 0 0 0 1 1 1 1
1 0 0 1 0 0 1 1 0 1 1
9 0 0 1 0 1 0 0 0 0 1
9 1 1 1 1 - 21 -0 0 1 1 1 1
Metaheuristic Algorithms I: Genetic Algorithm
Genetic Algorithm
Parents Children
String
x1 x2 Fitness x1 x2 Fitness
No.
1 9 3 14 26 8 440
2 43 15 1542 9 7 38
3 28 13 609 47 3 1686
4 24 14 472 9 2 13
5 54 0 2312 31 3 630
6 11 8 65 41 6 1245
7 28 4 492 24 15 497
8 17 6 141 9 11 94
9 42 0 1304 10 1 21
10 47 3 1686 60 15 3089
sum 8637 7753
best 14 13
- 22 -
Metaheuristic Algorithms I: Genetic Algorithm
Genetic Algorithm
- 23 -
Metaheuristic Algorithms I: Genetic Algorithm
Genetic Algorithm
- 24 -
Metaheuristic Algorithms I: Genetic Algorithm
Genetic Algorithm
- 25 -
Metaheuristic Algorithms I: Genetic Algorithm
Genetic Algorithm
- 26 -
Metaheuristic Algorithms I: Genetic Algorithm
Genetic Algorithm
- 27 -
Metaheuristic Algorithms I: Genetic Algorithm
Genetic Algorithm
- 28 -
Metaheuristic Algorithms I: Genetic Algorithm
Exploration Vs. Exploitation
- 29 -
Metaheuristic Algorithms I: Genetic Algorithm
Exploration Vs. Exploitation
- 30 -
Metaheuristic Algorithms I: Genetic Algorithm
Exploration Vs. Exploitation
Genetic Algorithm
- 33 -
Metaheuristic Algorithms I: Genetic Algorithm
Exploration Vs. Exploitation
- 34 -
Metaheuristic Algorithms I: Genetic Algorithm
Exploration Vs. Exploitation
Heriot-Watt Universtiy
- 36 -
http://www.streamsim.com/sites/default/files/explorationvsexploitation.png
Metaheuristic Algorithms I: Genetic Algorithm
- 37 -
Metaheuristic Algorithms I: Genetic Algorithm
- 38 -
Metaheuristic Algorithms I: Genetic Algorithm
Hybrid Evolutionary Algorithms
- 39 -
Metaheuristic Algorithms I: Genetic Algorithm
Hybrid Evolutionary Algorithms
- 40 -
Metaheuristic Algorithms I: Genetic Algorithm
- 41 -
Metaheuristic Algorithms I: Genetic Algorithm
Hybrid Evolutionary Algorithms
- 42 -
Metaheuristic Algorithms I: Genetic Algorithm
- 44 -
Metaheuristic Algorithms I: Genetic Algorithm
• Homework Assignment #1
▣ Due date :
▣ 1. Program a Simple Genetic Algorithm (SGA) to solve <Min f(x) = x12 + x22 -
12x1 - 4x2 + 44> with integer x1 and x2 varying from 0 to 63 for x1 and 0 to 15
for x2.
First, use Population size = 10, Pc = 0.8, Pm = 0.1, Maximum number of
function evaluations = 1,000, Total number of individual runs = 10
1-1. Try various values of crossover rate (0.6, 0.8, 0.9), mutation rate (0.05,
0.1, 0.2, 0.4) in the above problem. Run 10 times for each mutation rate and
show the average f (x) for each mutation rate.
1-2. Also, try the n-point crossover approach and compare with the original
version of Genetic algorithm.