Genetic Algorithm in Artificial Intelligence
Genetic term is directly concern with Biology Science Context.
It works on the basis of genetically repetition concept.
In computer science genetic algorithm is used for large and
complicated scenarios.
**Genetic Algorithm is not any intelligent Algorithm. And it is not smart
type algorithm but it can reflect changes very fast.
Due to its rapid adaptation in changes , it called as genetic algorithm.
For Example “ if in any country Prime Minister needs to change its
population as good one.
Then only focuses on promotion of good ones and stop to Bad Ones for
population production.”
OOOOOOOOOOOOOOOOOOOO
Good Peoples OOOOOOOOOOOOOOOOOOOOO
XXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Bad Peoples
Only allow to Good ones for population growth. One day whole
population becomes good and Bad one removes from that country.
INTIALIZATION
Selection
“fitness function”
crossover
mutation
If True
Stop
Select Chromosomes according to the fitness (in computer science only
binary digits will be used).
Cromosomes
0 0 1 0 1 1 1 1
0 0 1 1 00 1 1
After Selection
Mutation and crossover
Will have to perform.
Poppulation BoX
Cell on which we perform mutation
crossover:
Step 1 : Select Cromosomes (Suppose after two digits from left
exchange bits mutually 0 by 1 and 1 by 0, if bit is similar then no
changes will be applied.
0 0 1 0 1 1 1 1
0 0 1 1 0 1 1
Reproduction after Crossover
0 0 1 1 0 1 1 1
0 0 1 0 1 1 1 1
Mutation : it means to add some exatra added features after crossover
reproduction to increase fitness
Now perform mutation as below.
0 0 1 1 0 1 1 1
0 0 1 0 1 1 1 1
This 0 is replaced with 1 after mutation of cell
Now,
0 0 1 1 1 1 1 1
After mutation it will be our new population and this cycle will repeat
again and again. Cycle repeate until true condition does not matched.
Note : Cell is known as Gene in Genetic Algorithm .
Algorithm:
Step 1: Initialize the population.
Step2 : Selection according to fitness.
Step3: Crossover between selected chromosomes.
Step4: Perform Mutation.
Step5: Repeat Cycle till the condition of stop is true.