genetic algorithm
-
Upload
gaurav-khandelwal -
Category
Documents
-
view
500 -
download
0
description
Transcript of genetic algorithm
![Page 1: genetic algorithm](https://reader033.fdocuments.us/reader033/viewer/2022050919/54727307b4af9f21638b45ce/html5/thumbnails/1.jpg)
Presented by:Gaurav Khandelwal08BCE131
Genetic Algorithm
![Page 2: genetic algorithm](https://reader033.fdocuments.us/reader033/viewer/2022050919/54727307b4af9f21638b45ce/html5/thumbnails/2.jpg)
• General introduction to Genetic Algorithms (GA’s)
• Biological background
• Cell
• Chromosomes
• Origin of species
• Natural selection
• Genetic Algorithm
• Search space
• Basic algorithm
• Coding
• Examples
Overview
![Page 3: genetic algorithm](https://reader033.fdocuments.us/reader033/viewer/2022050919/54727307b4af9f21638b45ce/html5/thumbnails/3.jpg)
• Genetic algorithms (GA’s) are technique to solve problems which need optimization
• GA’s are a subclass of Evolutionary Computing
• GA’s are based on Darwin’s theory of evolution
• History of GA’s• Evolutionary computing evolved in the 1960’s.
• GA’s were created by John Holland in the mid-70’s.
General Introduction to GA’s
![Page 4: genetic algorithm](https://reader033.fdocuments.us/reader033/viewer/2022050919/54727307b4af9f21638b45ce/html5/thumbnails/4.jpg)
• Every animal cell is a complex of many small “factories” working together
• The center of this all is the cell nucleus
• The nucleus contains the genetic information
Biological Background(Cell)
![Page 5: genetic algorithm](https://reader033.fdocuments.us/reader033/viewer/2022050919/54727307b4af9f21638b45ce/html5/thumbnails/5.jpg)
• Genetic information is stored in the chromosomes
• Each chromosome is build of DNA
• Chromosomes in humans form pairs
• There are 23 pairs
• The chromosome is divided in parts: genes
• Genes code for properties
• The posibilities of the genes for one property is called: allele
• Every gene has an unique position on the chromosome: locus
Biological Background(Chromosomes)
![Page 6: genetic algorithm](https://reader033.fdocuments.us/reader033/viewer/2022050919/54727307b4af9f21638b45ce/html5/thumbnails/6.jpg)
• The entire combination of genes is called genotype
• A genotype develops to a phenotype
• Alleles can be either dominant or recessive
• Dominant alleles will always express from the genotype to the fenotype
• Recessive alleles can survive in the population for many generations, without being expressed.
Biological Background(Genetics)
![Page 7: genetic algorithm](https://reader033.fdocuments.us/reader033/viewer/2022050919/54727307b4af9f21638b45ce/html5/thumbnails/7.jpg)
• Reproduction of genetical information
• Mitosis
• Meiosis
• Mitosis is copying the same genetic information to new offspring: there is no exchange of information
• Meiosis is the basis of the sexual reproduction
• During reproduction “errors ” occur
• Due to these “errors” genetic variation exists
• Most important “errors” are:Recombination(cross-over)
mutation
Biological Background(Reproduction)
![Page 8: genetic algorithm](https://reader033.fdocuments.us/reader033/viewer/2022050919/54727307b4af9f21638b45ce/html5/thumbnails/8.jpg)
• The origin of species: “Preservation of favourable variations and rejection of unfavourable variations.”
• There are more individuals born than can survive, so there is a continuous struggle for life.
• Individuals with an advantage have a greater chance for survive: survival of the fittest.
• Important aspects in natural selection are:• adaptation to the environment• isolation of populations in different groups which cannot
mutually mate
Biological background(Natural-selection)
![Page 9: genetic algorithm](https://reader033.fdocuments.us/reader033/viewer/2022050919/54727307b4af9f21638b45ce/html5/thumbnails/9.jpg)
Genetics + Algorithm = Genetic Algorithm
Genetic Algorithm is robust and probabilistic search algorithm based on the mechanics of natural selection and genetics
Genetic Algorithm follows the principle of “Survival of the Fittest” laid down by Charles Darwin
Random search method
Genetic Algorithms
![Page 10: genetic algorithm](https://reader033.fdocuments.us/reader033/viewer/2022050919/54727307b4af9f21638b45ce/html5/thumbnails/10.jpg)
• Most often one is looking for the best solution in a specific subset of solutions
• This subset is called the search space (or state space)
• Every point in the search space is a possible solution
• Therefore every point has a fitness value, depending on the problem definition
• GA’s are used to search the search space for the bestsolution, e.g. a minimum
Genetic Algorithm-Search space
![Page 11: genetic algorithm](https://reader033.fdocuments.us/reader033/viewer/2022050919/54727307b4af9f21638b45ce/html5/thumbnails/11.jpg)
• Starting with a subset of n randomly chosen solutions from the search space (i.e. chromosomes). This is the population
• This population is used to produce a next generation of individuals by reproduction
• Individuals with a higher fitness have more chance to reproduce (i.e. natural selection)
Genetic algorithm-Basic algorithm
![Page 12: genetic algorithm](https://reader033.fdocuments.us/reader033/viewer/2022050919/54727307b4af9f21638b45ce/html5/thumbnails/12.jpg)
START : Create random population of n chromosomes
1 FITNESS : Evaluate fitness f(x) of each chromosome in the population
2 NEW POPULATION
0 SELECTION : Based on f(x)
1 RECOMBINATION : Cross-over chromosomes
2 MUTATION : Mutate chromosomes
3 ACCEPTATION : Reject or accept new one
3 REPLACE : Replace old with new population: the new
generation
4 TEST : Test problem criterium
5 LOOP : Continue step 1 – 4 until criterium is satisfied
Genetic Algorithm-Basis algorithm
• Outline of basis algorithm
![Page 13: genetic algorithm](https://reader033.fdocuments.us/reader033/viewer/2022050919/54727307b4af9f21638b45ce/html5/thumbnails/13.jpg)
• Chromosomes are encoded by bitstrings
• Every bitstring therefore is a solution but not necisseraly the best solution
• The way bitstrings can code differs from problem to problem
Genetic Algorithm-Coding
0
1
0
1
1
![Page 14: genetic algorithm](https://reader033.fdocuments.us/reader033/viewer/2022050919/54727307b4af9f21638b45ce/html5/thumbnails/14.jpg)
Recombination (cross-over) can when using bitstrings schematically be represented:
Using a specific cross-over point
Genetic Algorithm-Coding
1
0
0
1
1
0
1
0
1
0
1
1
1
0
X
1
0
0
1
1
1
0
0
1
0
1
1
0
1
![Page 15: genetic algorithm](https://reader033.fdocuments.us/reader033/viewer/2022050919/54727307b4af9f21638b45ce/html5/thumbnails/15.jpg)
• Mutation prevents the algorithm to be trapped in a local minimum
• In the bitstring approach mutation is simpy the flipping of one of the bits
Genetic Algorithm-Coding
0
1
0
1
0
1
0
0
0
1
0
1
![Page 16: genetic algorithm](https://reader033.fdocuments.us/reader033/viewer/2022050919/54727307b4af9f21638b45ce/html5/thumbnails/16.jpg)
• Both recombination and mutation depend a lot on the exact definition of the problem and the choice of representing the chromosomes (e.g. no bitstrings)
• Different encodings can be used:
• Binary encoding
• Permutation encoding
• Value encoding
• Tree encoding
• Focus in this presentation stays with binary encoding
Genetic Algorithm-Coding
![Page 17: genetic algorithm](https://reader033.fdocuments.us/reader033/viewer/2022050919/54727307b4af9f21638b45ce/html5/thumbnails/17.jpg)
We require small finger and long feet.Gene are encoded as first two gene represent finger
characteristic and other two represent feet characteristic.We have population size four. Here 0 represent small and 1 represent longIdeal gene:
Example
0 0 1 1
1 0 0 00 1 0 0
0 1 0 1 0 0 1 0
A B
C D
![Page 18: genetic algorithm](https://reader033.fdocuments.us/reader033/viewer/2022050919/54727307b4af9f21638b45ce/html5/thumbnails/18.jpg)
Now fitness:
We apply crossover and mutation for optimum sol.
Example
Name Fitness
A 1
B 1
C 2
D 3
![Page 19: genetic algorithm](https://reader033.fdocuments.us/reader033/viewer/2022050919/54727307b4af9f21638b45ce/html5/thumbnails/19.jpg)
Crossover:
Example
Name Received gene
Genome Fitness
A’ A(0,1)+D(1,0)
A’(0,1,1,0) 2
B’ B(1,0)+D(1,0)
B’(1,0,1,0) 2
C’ D(0,0)+C(0,1)
C’(0,0,0,1) 3
D’ D D’(0,0,1,0) 3
![Page 20: genetic algorithm](https://reader033.fdocuments.us/reader033/viewer/2022050919/54727307b4af9f21638b45ce/html5/thumbnails/20.jpg)
Mutation:
Example
Name Gene Genome Fitness
A’ A’(0,1,1,0) A’’(0,0,1,0) 3
B’ B’(1,0,1,0) B’’(1,0,1,1) 3
C’ C’(0,0,0,1) C’’(0,0,1,1) 4
D’ D’(0,0,1,0) D’’(0,0,1,0) 3
![Page 21: genetic algorithm](https://reader033.fdocuments.us/reader033/viewer/2022050919/54727307b4af9f21638b45ce/html5/thumbnails/21.jpg)
Find a tour of a given set of cities so that • each city is visited only once• the total distance traveled is minimized
Representation is an ordered list of city numbers known as an order-based GA.
1) London 3) Dunedin 5) Beijing 7) Tokyo
2) Venice 4) Singapore 6) Phoenix 8) Victoria
CityList1 (3 5 7 2 1 6 4 8)
CityList2 (2 5 7 6 8 1 3 4)
Example(Travel salesman problem)
Representation
![Page 22: genetic algorithm](https://reader033.fdocuments.us/reader033/viewer/2022050919/54727307b4af9f21638b45ce/html5/thumbnails/22.jpg)
Crossover combines inversion and recombination:
Parent1 (1 2 3 4 5 6 7 8 9)
Parent2 (9 3 7 8 2 6 5 1 4)
Child (9 3 2 4 5 6 7 1 8)
This operator is called the partial crossover.
Example(Travel salesman problem)
Crossover
![Page 23: genetic algorithm](https://reader033.fdocuments.us/reader033/viewer/2022050919/54727307b4af9f21638b45ce/html5/thumbnails/23.jpg)
Mutation involves reordering of the list:
* *Before: (9 3 2 4 5 6 7 1 8)
After: (9 3 2 7 5 6 4 1 8)
Example(Travel salesman problem)
Mutation
![Page 24: genetic algorithm](https://reader033.fdocuments.us/reader033/viewer/2022050919/54727307b4af9f21638b45ce/html5/thumbnails/24.jpg)
0
20
40
60
80
100
120
0 10 20 30 40 50 60 70 80 90 100
y
x
TSP Example: 30 cities
![Page 25: genetic algorithm](https://reader033.fdocuments.us/reader033/viewer/2022050919/54727307b4af9f21638b45ce/html5/thumbnails/25.jpg)
TSP Example: 30 cities Solution (Distance = 941)
0
20
40
60
80
100
120
0 10 20 30 40 50 60 70 80 90 100
y
x
TSP30 (Performance = 941)
![Page 26: genetic algorithm](https://reader033.fdocuments.us/reader033/viewer/2022050919/54727307b4af9f21638b45ce/html5/thumbnails/26.jpg)
0
20
40
60
80
100
120
0 10 20 30 40 50 60 70 80 90 100
y
x
TSP30 (Performance = 652)
TSP Example: 30 citiesSolution (Distance = 652)
![Page 27: genetic algorithm](https://reader033.fdocuments.us/reader033/viewer/2022050919/54727307b4af9f21638b45ce/html5/thumbnails/27.jpg)
0
20
40
60
80
100
120
0 10 20 30 40 50 60 70 80 90 100
y
x
TSP30 Solution (Performance = 420)
TSP Example: 30 citiesBest solution(Distance = 420)
![Page 28: genetic algorithm](https://reader033.fdocuments.us/reader033/viewer/2022050919/54727307b4af9f21638b45ce/html5/thumbnails/28.jpg)
Concept is easy to understand
Supports multi-objective optimization
Good for “noisy” environments
Answer gets better with time
Inherently parallel; easily distributed
Advantages of Genetic algorithms
![Page 29: genetic algorithm](https://reader033.fdocuments.us/reader033/viewer/2022050919/54727307b4af9f21638b45ce/html5/thumbnails/29.jpg)
Genetic algorithm applications in controls which are
performed in real time are limited because of random
solutions and convergence.
Certain optimisation problems (they are called variant
problems) cannot be solved by means of genetic algorithms. This occurs due to poorly known fitness functions
Disadvantage of Genetic algorithm
![Page 30: genetic algorithm](https://reader033.fdocuments.us/reader033/viewer/2022050919/54727307b4af9f21638b45ce/html5/thumbnails/30.jpg)
Management ApplicationsSchedulingControl VLSI DesignIdentification & Pattern recognition
Application of GA
![Page 31: genetic algorithm](https://reader033.fdocuments.us/reader033/viewer/2022050919/54727307b4af9f21638b45ce/html5/thumbnails/31.jpg)
Thank you