Genetic Algo
Genetic Algo
Represented By :
CSE 4TH Year, Sec-A
Debasish Karmakar (0922051)
Md. Nasim Ansari (0922121)
Pitambar Mandal (0922126)
Nirmalya Neogi (0922127)
Tania Paul (0922128)
INTRODUCTION
A B C D E F G H I J..
chromosome
gene
FLOWCHART OF GENETIC
ALGORITHM
start
chromosome encoding
Generation=0 population creation
fitness evaluation
yes
stop convergence?
Next Generation
no
selection
cross-over
mutation
replacement
Initial Population
A B fitness(A) = 3
C fitness(B) = 1
3/6 = 50% 2/6 = 33%
fitness(C) = 2
Reproduction
N no. of queens
• M o. of rooms
• Does not sit in same row,same column and
same diagonal
Explain this here
• N=8
• M=64
Initial Population
Initial Population
Randomly put those queen in the rooms
Consider this operation for ‘K(5)’ no. of times
1 3 5 7 8 2 4 6
1 2 3 4 5 6 7 8
1 3 4 7 6 5 2 8
2 1 3 5 6 7 4 8
3 1 2 4 6 5 8 7
We are putting value for Chromosomes no. =5
into 64 rooms.
Q3
Q1
Q2
Q4
Q6
Q5
Q8
Q7
Calculate total cost(no. of time does not satisfied the confition)
Calculate feetness value
Total Fitness
cost value
1 8
1 3 5 7 8 2 4 6
8 1
1 2 3 4 5 6 7 8
4 5
1 3 4 7 6 5 2 8
5 4
2 1 3 5 6 7 4 8
3 6
3 1 2 4 6 5 8 7
Selection Method
Using : roulette
6/24=.25
• 8/24=.33 wheel technique
• C • C1 according to the
5 example
C4
• 4/24 = .17
5/
24
=.2
C3
1
Crossover: two types
3 1 2 4 6 5 8 7
After crossover-
Children:
2 1 3 4 6 5 8 7
Total cost = 4 Fitness value=1
3 1 2 5 6 7 4 8
Total cost = 3 Fitness value=2
Multipoint crossover:-
• Before crossover –
• Parents:
• Considering crossover point are 3 and 5
2 1 3 5 6 7 4 8
3 1 2 4 6 5 8 7
• After crossover-
• Children:
• Here
2 4 is1 coming
3 two times
4 & 65 is missing
7 in 4the cell8
After Mutation
3 1 4 5 7 8 7 2