SlideShare une entreprise Scribd logo
1  sur  51
Genetic
Algorithm
by
Mrs Shimi S.L
Assistant Professor , EE
NITTTR, Chandigarh
Maxima and Minima from Calculus
•Great powers of calculus is in the determination of the
maximum or minimum value of a function.
•Take f(x) to be a function of x. Then the value of x for
which the derivative of f(x) with respect to x is equal
to zero corresponds to a maximum, a minimum or an
inflexion point of the function f(x).
• The height of a projectile that is fired straight up is given by the
motion equations
Classes of Search Techniques
Finonacci Newton
Direct methods Indirect methods
Calculus-based techniques
Evolutionarystrategies
Centralized Distributed
Parallel
Steady-state Generational
Sequential
Genetic algorithms
Evolutionary algorithms Simulated annealing
Guided random search techniques
Dynamic programming
Enumerative techniques
Search techniques
Genetic Algorithms is the most
commonly used prominent
computational algorithm introduced by
I. Rechenberg in 1960’s and developed
by John Holland in 1975. This
evolutionary algorithm mimics the
Darwin’s theory of evolution by natural
selection for problem solving.
Structure of a Cell
Simple Genetic Algorithm
{
initialize population;
evaluate population;
while Termination Criteria Not Satisfied
{
select parents for reproduction;
perform crossover and mutation;
evaluate population;
}
}
The GA Cycle of Reproduction
reproduction
population evaluation
modification
discard
deleted
members
parents
children
modified
children
evaluated children
Population
Chromosomes could be:
• Bit strings (0101 ... 1100)
• Real numbers (43.2 -33.1 ... 0.0 89.2)
• Permutations of element (E11 E3 E7 ... E1 E15)
• Lists of rules (R1 R2 R3 ... R22 R23)
• Program elements (genetic programming)
• ... any data structure ...
population
Population Size
Population size depicts the number of
chromosomes in one generation. If the population
size is very small, then only a small part of the
search space is explored. Whereas, if the
population size is too large then a very large part of
the search space is explored and due to obvious
reasons the algorithm slows down.
Selection
• Best chromosomes are selected from the population to form the
parents for next generation
• The different selection methods for choosing the best chromosomes
are
(i) Roulette Wheel Selection,
(ii) Tournament Selection,
(iii) Rank Selection,
(iv) Boltzman Selection,
(v) Steady-State Selection, etc.
Roulette Wheel Selection
Better chromosomes have high probability to be selected as new
parents. The probability of each individual chromosome getting
selected is given by the equation.
𝑃𝑖 =
𝑓 𝑖
𝑗=1
𝑁 𝑓 𝑖
where,
fi is the fitness of the individual i in the population
N is the number of individuals in the population
Reproduction
reproduction
population
parents
children
Parents are selected at random with selection chances biased
in relation to chromosome evaluations.
Chromosome Modification
modification
children
• Modifications are stochastically triggered
• Operator types are:
• Crossover (recombination)
• Mutation
modified children
Crossover
Crossover: Recombination
Single point crossover
Two points crossover
Arithmetic Crossover
Crossover is a critical feature of genetic algorithms:
•It greatly accelerates search early in evolution of a
population
•It leads to effective combination of schemata
(subsolutions on different chromosomes)
Mutation
Mutation: Local Modification
Before: (1 0 1 1 0 1 1 0)
After: (0 1 1 0 0 1 1 0)
Before: (1.38 -69.4 326.44 0.1)
After: (1.38 -67.5 326.44 0.1)
• Causes movement in the search space
(local or global)
• Restores lost information to the population
Exploration: Discovering promising areas in the search space, i.e.
gaining information on the problem
Exploitation: Optimising within a promising area, i.e. using
information
There is co-operation and competition between them
• Crossover is explorative, it makes a big jump to an area
somewhere “in between” two (parent) areas
• Mutation is exploitative, it creates random small diversions,
thereby staying near (in the area of ) the parent
Crossover OR mutation?
• Only crossover can combine information from two parents
• Only mutation can introduce new information (alleles)
• Crossover does not change the allele frequencies of the
population
• To hit the optimum you often need a ‘lucky’ mutation
Crossover OR mutation?
Evaluation
• The evaluator decodes a chromosome and assigns it a fitness
measure
• The evaluator is the only link between a classical GA and the problem
it is solving
evaluation
evaluated
children
modified
children
Deletion
• Generational GA:
entire populations replaced with each iteration
• Steady-state GA:
a few members replaced each generation
population
discard
discarded members
Termination
This evolutionary process is continued until the
termination condition is satisfied. The termination
conditions may be:
• Reaching the maximum number of generations
• Successive iteration does not provide proper results
• An optimal fitness value of the population is reached.
TSP Example: 30 Cities
0
20
40
60
80
100
120
0 10 20 30 40 50 60 70 80 90 100
y
x
Solution i (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)
Solution j(Distance = 800)
TSP30 (Performance = 800)
0
10
20
30
40
50
60
70
80
90
100
0 10 20 30 40 50 60 70 80 90 100
x
y
Solution k(Distance = 652)
0
20
40
60
80
100
120
0 10 20 30 40 50 60 70 80 90 100
y
x
TSP30 (Performance = 652)
Best Solution (Distance = 420)
42
38
35
26
21
35
32
7
38
46
44
58
60
69
76
78
71
69
67
62
84
94
0
20
40
60
80
100
120
0 10 20 30 40 50 60 70 80 90 100
y
x
TSP30 Solution (Performance = 420)
Overview of Performance
0
200
400
600
800
1000
1200
1400
1600
1800
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31
D
is
ta
n
c
e
Generations (1000)
TSP30 - Overview of Performance
Best
Worst
Average
Consider the problem of maximizing the function,
f(x) = x2
Where x is permitted to vary between 0 to 31.
(i) 0(00000) and 31(11111) code x into finite
length string
(ii) Select initial population at random (size 4)
(iii) Calculate fitness value for all strings
(iv) probability of selection by:
𝑃𝑟𝑜𝑏𝑖=
𝑓(𝑥) 𝑖
𝑖=1
𝑛
𝑓(𝑥) 𝑖
,
Table 1. Selection
String
No.
Initial
population
X
Value
Fitness
value
Prob. %age
Prob.
Expected
Count
Actual
Count
1. 01100 12 144 0.1247 12.47% 0.4987 1
2. 11001 25 625 0.5411 54.11% 2.1645 2
3. 00101 5 25 0.0216 2.16% 0.0866 0
4. 10011 19 361 0.3126 31.26% 1.2502 1
Sum
Avg.
Max.
1155
288.75
625
1.0000
0.2500
0.5411
100%
25%
54.11%
4.0000
1.0000
2.1645
Table 2. Crossover
String
No.
Mating
Pool
Crossover
point
Offspring
after
crossover
X value Fitness
value
1. 01100 4 01101 13 169
2. 11001 4 11000 24 576
3. 11001 3 11011 27 729
4. 10011 3 10001 17 289
Sum
Avg.
Max.
1763
440.75
729
Table 3. Mutation
String
No.
Offspring
After
crossover
Mutation
chromosomes
Offspring
after
mutation
X value Fitness
value
1. 01101 10000 11101 29 841
2. 11000 00000 11000 24 576
3. 11011 00000 11011 27 729
4. 10001 00100 10101 20 400
Sum
Avg.
Max.
2546
636.5
841
Minimize the following fitness function
including 2 variables:
𝒎𝒊𝒏 𝒙 𝒇 𝒙 = 𝟏𝟎𝟎(𝒙 𝟏
𝟐
− 𝒙 𝟐) 𝟐
+ (𝟏 − 𝒙 𝟏) 𝟐
Subject to the following linear constraints and
bounds:
𝑥1 𝑥2 + 𝑥1 − 𝑥2 + 1.5 ≤ 0
10 − 𝑥1 𝑥2 ≤ 0
0 ≤ 𝑥1 ≤ 1 and 0 ≤ 𝑥2 ≤ 13
The function has one output ‘y’ and two input
variables ‘x1’ and ‘x2’.
We use the vector ‘x’ to include both ‘x1’ and ‘x2’.
>> gatool
Advantages of Genetic Algorithm
 Parallelism, robustness and liability
 Solution space is wider
 Handles large, poorly understood search spaces easily
 Easily modified for different problems
 Easy to discover global optimum
 Handles noisy functions as well
 Only uses function evaluations
 They require no information about the response surface
 Perform very well for large-scale optimization problems
 Can be employed for a wide variety of optimization problems
 The problem has multi objective function
 Very robust to difficulties in the evaluation of the objective function
Limitations of Genetic Algorithm
 The problem of identifying fitness function
 Requires large number of fitness function evaluations
 The problem of choosing the various parameters like
the size of the population, mutation rate, crossover
rate, the selection method and its strength.
 Definition of representation of the problem
 No effective terminator
 Needs to be coupled with a local search technique
 Have trouble finding the exact global optimum

Contenu connexe

Tendances

Genetic_Algorithm_AI(TU)
Genetic_Algorithm_AI(TU)Genetic_Algorithm_AI(TU)
Genetic_Algorithm_AI(TU)
Kapil Khatiwada
 

Tendances (20)

Genetic Algorithms
Genetic AlgorithmsGenetic Algorithms
Genetic Algorithms
 
Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithm
 
Ga
GaGa
Ga
 
MACHINE LEARNING - GENETIC ALGORITHM
MACHINE LEARNING - GENETIC ALGORITHMMACHINE LEARNING - GENETIC ALGORITHM
MACHINE LEARNING - GENETIC ALGORITHM
 
Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
Genetic Algorithm
 
Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithm
 
Genetic algorithm raktim
Genetic algorithm raktimGenetic algorithm raktim
Genetic algorithm raktim
 
Introduction to Genetic Algorithms
Introduction to Genetic AlgorithmsIntroduction to Genetic Algorithms
Introduction to Genetic Algorithms
 
Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithm
 
Introduction to Genetic Algorithms
Introduction to Genetic AlgorithmsIntroduction to Genetic Algorithms
Introduction to Genetic Algorithms
 
Genetic_Algorithm_AI(TU)
Genetic_Algorithm_AI(TU)Genetic_Algorithm_AI(TU)
Genetic_Algorithm_AI(TU)
 
GENETIC ALGORITHM
GENETIC ALGORITHMGENETIC ALGORITHM
GENETIC ALGORITHM
 
Data Science - Part XIV - Genetic Algorithms
Data Science - Part XIV - Genetic AlgorithmsData Science - Part XIV - Genetic Algorithms
Data Science - Part XIV - Genetic Algorithms
 
Introduction to Genetic Algorithms
Introduction to Genetic AlgorithmsIntroduction to Genetic Algorithms
Introduction to Genetic Algorithms
 
Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
Genetic Algorithm
 
Genetic Algorithms
Genetic AlgorithmsGenetic Algorithms
Genetic Algorithms
 
Introduction to Genetic algorithms
Introduction to Genetic algorithmsIntroduction to Genetic algorithms
Introduction to Genetic algorithms
 
Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithm
 
Genetic Algorithms - GAs
Genetic Algorithms - GAsGenetic Algorithms - GAs
Genetic Algorithms - GAs
 
Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
Genetic Algorithm
 

En vedette

Genetic algorithms
Genetic algorithmsGenetic algorithms
Genetic algorithms
guest9938738
 
Genetic Algorithms
Genetic AlgorithmsGenetic Algorithms
Genetic Algorithms
anas_elf
 
genetic algorithms-artificial intelligence
 genetic algorithms-artificial intelligence genetic algorithms-artificial intelligence
genetic algorithms-artificial intelligence
Karunakar Singh Thakur
 

En vedette (17)

Genetic Algorithms Made Easy
Genetic Algorithms Made EasyGenetic Algorithms Made Easy
Genetic Algorithms Made Easy
 
Advance operator and technique in genetic algorithm
Advance operator and technique in genetic algorithmAdvance operator and technique in genetic algorithm
Advance operator and technique in genetic algorithm
 
Genetic algorithms
Genetic algorithmsGenetic algorithms
Genetic algorithms
 
Fuzzy Logic and Neural Network
Fuzzy Logic and Neural NetworkFuzzy Logic and Neural Network
Fuzzy Logic and Neural Network
 
Genetic Algorithms
Genetic AlgorithmsGenetic Algorithms
Genetic Algorithms
 
Fuzzy Genetic Algorithm
Fuzzy Genetic AlgorithmFuzzy Genetic Algorithm
Fuzzy Genetic Algorithm
 
Flexible AC Transmission (FACTS)
Flexible AC Transmission (FACTS)Flexible AC Transmission (FACTS)
Flexible AC Transmission (FACTS)
 
genetic algorithms-artificial intelligence
 genetic algorithms-artificial intelligence genetic algorithms-artificial intelligence
genetic algorithms-artificial intelligence
 
Project Weka
Project WekaProject Weka
Project Weka
 
Genetic Algorithm
Genetic Algorithm Genetic Algorithm
Genetic Algorithm
 
Advance control theory
Advance control theoryAdvance control theory
Advance control theory
 
Arduino
ArduinoArduino
Arduino
 
Application of genetic algorithm to the optimization of resonant frequency of...
Application of genetic algorithm to the optimization of resonant frequency of...Application of genetic algorithm to the optimization of resonant frequency of...
Application of genetic algorithm to the optimization of resonant frequency of...
 
PNRG & MT by Rio
PNRG & MT by RioPNRG & MT by Rio
PNRG & MT by Rio
 
A Practical Schema Theorem for Genetic Algorithm Design and Tuning
A Practical Schema Theorem for Genetic Algorithm Design and TuningA Practical Schema Theorem for Genetic Algorithm Design and Tuning
A Practical Schema Theorem for Genetic Algorithm Design and Tuning
 
Effects of population initialization on differential evolution for large scal...
Effects of population initialization on differential evolution for large scal...Effects of population initialization on differential evolution for large scal...
Effects of population initialization on differential evolution for large scal...
 
Genetic Algorithms
Genetic AlgorithmsGenetic Algorithms
Genetic Algorithms
 

Similaire à Genetic Algorithm

Genetic algorithm_raktim_IITKGP
Genetic algorithm_raktim_IITKGP Genetic algorithm_raktim_IITKGP
Genetic algorithm_raktim_IITKGP
Raktim Halder
 

Similaire à Genetic Algorithm (20)

Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
Genetic Algorithm
 
GA.pptx
GA.pptxGA.pptx
GA.pptx
 
Genetic algorithm_raktim_IITKGP
Genetic algorithm_raktim_IITKGP Genetic algorithm_raktim_IITKGP
Genetic algorithm_raktim_IITKGP
 
Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithm
 
Geneticalgorithms 100403002207-phpapp02
Geneticalgorithms 100403002207-phpapp02Geneticalgorithms 100403002207-phpapp02
Geneticalgorithms 100403002207-phpapp02
 
Diversity mechanisms for evolutionary populations in Search-Based Software En...
Diversity mechanisms for evolutionary populations in Search-Based Software En...Diversity mechanisms for evolutionary populations in Search-Based Software En...
Diversity mechanisms for evolutionary populations in Search-Based Software En...
 
introduction of genetic algorithm
introduction of genetic algorithmintroduction of genetic algorithm
introduction of genetic algorithm
 
CI_L02_Optimization_ag2_eng.pdf
CI_L02_Optimization_ag2_eng.pdfCI_L02_Optimization_ag2_eng.pdf
CI_L02_Optimization_ag2_eng.pdf
 
evolutionary algo's.ppt
evolutionary algo's.pptevolutionary algo's.ppt
evolutionary algo's.ppt
 
Introduction to Genetic Algorithms
Introduction to Genetic AlgorithmsIntroduction to Genetic Algorithms
Introduction to Genetic Algorithms
 
genetic computing
genetic computinggenetic computing
genetic computing
 
Solving non linear programming minimization problem using genetic algorithm
Solving non linear programming minimization problem using genetic algorithmSolving non linear programming minimization problem using genetic algorithm
Solving non linear programming minimization problem using genetic algorithm
 
Extensive Survey on Datamining Algoritms for Pattern Extraction
Extensive Survey on Datamining Algoritms for Pattern ExtractionExtensive Survey on Datamining Algoritms for Pattern Extraction
Extensive Survey on Datamining Algoritms for Pattern Extraction
 
1582997627872.pdf
1582997627872.pdf1582997627872.pdf
1582997627872.pdf
 
Genetic algorithm (ga) binary and real Vijay Bhaskar Semwal
Genetic algorithm (ga) binary and real  Vijay Bhaskar SemwalGenetic algorithm (ga) binary and real  Vijay Bhaskar Semwal
Genetic algorithm (ga) binary and real Vijay Bhaskar Semwal
 
Advanced Optimization Techniques
Advanced Optimization TechniquesAdvanced Optimization Techniques
Advanced Optimization Techniques
 
GA of a Paper 2012.pptx
GA of a Paper 2012.pptxGA of a Paper 2012.pptx
GA of a Paper 2012.pptx
 
CI_L11_Optimization_ag2_eng.pptx
CI_L11_Optimization_ag2_eng.pptxCI_L11_Optimization_ag2_eng.pptx
CI_L11_Optimization_ag2_eng.pptx
 
Genetic Algorithm (1).pdf
Genetic Algorithm (1).pdfGenetic Algorithm (1).pdf
Genetic Algorithm (1).pdf
 
Genetic Algorithms : A class of Evolutionary Algorithms
Genetic Algorithms : A class of Evolutionary AlgorithmsGenetic Algorithms : A class of Evolutionary Algorithms
Genetic Algorithms : A class of Evolutionary Algorithms
 

Plus de SHIMI S L (11)

Real Time System Validation using Hardware in Loop (HIL) Digital Platform
Real Time System Validation using Hardware in Loop (HIL) Digital PlatformReal Time System Validation using Hardware in Loop (HIL) Digital Platform
Real Time System Validation using Hardware in Loop (HIL) Digital Platform
 
Preparation for NBA
Preparation for  NBAPreparation for  NBA
Preparation for NBA
 
NBA - laboratories
NBA -  laboratoriesNBA -  laboratories
NBA - laboratories
 
NBA
NBANBA
NBA
 
Nba co attainment
Nba co attainmentNba co attainment
Nba co attainment
 
Selective harmonic elimination in a solar powered multilevel inverter
Selective harmonic elimination in a solar powered multilevel inverterSelective harmonic elimination in a solar powered multilevel inverter
Selective harmonic elimination in a solar powered multilevel inverter
 
MPPT of a solar system
MPPT of a solar systemMPPT of a solar system
MPPT of a solar system
 
Solar energy application for electric power generation
Solar energy application for electric power generationSolar energy application for electric power generation
Solar energy application for electric power generation
 
Solid State Control of Electric Drive
Solid State Control of Electric DriveSolid State Control of Electric Drive
Solid State Control of Electric Drive
 
Choppers and cycloconverters
Choppers and cycloconvertersChoppers and cycloconverters
Choppers and cycloconverters
 
Thyristor technology
Thyristor technologyThyristor technology
Thyristor technology
 

Dernier

Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
chumtiyababu
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
Kamal Acharya
 

Dernier (20)

Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech Civil
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and properties
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLEGEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal load
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxOrlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
 

Genetic Algorithm

  • 1. Genetic Algorithm by Mrs Shimi S.L Assistant Professor , EE NITTTR, Chandigarh
  • 2. Maxima and Minima from Calculus •Great powers of calculus is in the determination of the maximum or minimum value of a function. •Take f(x) to be a function of x. Then the value of x for which the derivative of f(x) with respect to x is equal to zero corresponds to a maximum, a minimum or an inflexion point of the function f(x).
  • 3. • The height of a projectile that is fired straight up is given by the motion equations
  • 4.
  • 5.
  • 6.
  • 7. Classes of Search Techniques Finonacci Newton Direct methods Indirect methods Calculus-based techniques Evolutionarystrategies Centralized Distributed Parallel Steady-state Generational Sequential Genetic algorithms Evolutionary algorithms Simulated annealing Guided random search techniques Dynamic programming Enumerative techniques Search techniques
  • 8. Genetic Algorithms is the most commonly used prominent computational algorithm introduced by I. Rechenberg in 1960’s and developed by John Holland in 1975. This evolutionary algorithm mimics the Darwin’s theory of evolution by natural selection for problem solving.
  • 10. Simple Genetic Algorithm { initialize population; evaluate population; while Termination Criteria Not Satisfied { select parents for reproduction; perform crossover and mutation; evaluate population; } }
  • 11. The GA Cycle of Reproduction reproduction population evaluation modification discard deleted members parents children modified children evaluated children
  • 12. Population Chromosomes could be: • Bit strings (0101 ... 1100) • Real numbers (43.2 -33.1 ... 0.0 89.2) • Permutations of element (E11 E3 E7 ... E1 E15) • Lists of rules (R1 R2 R3 ... R22 R23) • Program elements (genetic programming) • ... any data structure ... population
  • 13. Population Size Population size depicts the number of chromosomes in one generation. If the population size is very small, then only a small part of the search space is explored. Whereas, if the population size is too large then a very large part of the search space is explored and due to obvious reasons the algorithm slows down.
  • 14. Selection • Best chromosomes are selected from the population to form the parents for next generation • The different selection methods for choosing the best chromosomes are (i) Roulette Wheel Selection, (ii) Tournament Selection, (iii) Rank Selection, (iv) Boltzman Selection, (v) Steady-State Selection, etc.
  • 15. Roulette Wheel Selection Better chromosomes have high probability to be selected as new parents. The probability of each individual chromosome getting selected is given by the equation. 𝑃𝑖 = 𝑓 𝑖 𝑗=1 𝑁 𝑓 𝑖 where, fi is the fitness of the individual i in the population N is the number of individuals in the population
  • 16. Reproduction reproduction population parents children Parents are selected at random with selection chances biased in relation to chromosome evaluations.
  • 17. Chromosome Modification modification children • Modifications are stochastically triggered • Operator types are: • Crossover (recombination) • Mutation modified children
  • 19.
  • 20.
  • 23. Arithmetic Crossover Crossover is a critical feature of genetic algorithms: •It greatly accelerates search early in evolution of a population •It leads to effective combination of schemata (subsolutions on different chromosomes)
  • 25.
  • 26. Mutation: Local Modification Before: (1 0 1 1 0 1 1 0) After: (0 1 1 0 0 1 1 0) Before: (1.38 -69.4 326.44 0.1) After: (1.38 -67.5 326.44 0.1) • Causes movement in the search space (local or global) • Restores lost information to the population
  • 27.
  • 28. Exploration: Discovering promising areas in the search space, i.e. gaining information on the problem Exploitation: Optimising within a promising area, i.e. using information There is co-operation and competition between them • Crossover is explorative, it makes a big jump to an area somewhere “in between” two (parent) areas • Mutation is exploitative, it creates random small diversions, thereby staying near (in the area of ) the parent Crossover OR mutation?
  • 29. • Only crossover can combine information from two parents • Only mutation can introduce new information (alleles) • Crossover does not change the allele frequencies of the population • To hit the optimum you often need a ‘lucky’ mutation Crossover OR mutation?
  • 30. Evaluation • The evaluator decodes a chromosome and assigns it a fitness measure • The evaluator is the only link between a classical GA and the problem it is solving evaluation evaluated children modified children
  • 31.
  • 32.
  • 33. Deletion • Generational GA: entire populations replaced with each iteration • Steady-state GA: a few members replaced each generation population discard discarded members
  • 34.
  • 35. Termination This evolutionary process is continued until the termination condition is satisfied. The termination conditions may be: • Reaching the maximum number of generations • Successive iteration does not provide proper results • An optimal fitness value of the population is reached.
  • 36. TSP Example: 30 Cities 0 20 40 60 80 100 120 0 10 20 30 40 50 60 70 80 90 100 y x
  • 37. Solution i (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)
  • 38. Solution j(Distance = 800) TSP30 (Performance = 800) 0 10 20 30 40 50 60 70 80 90 100 0 10 20 30 40 50 60 70 80 90 100 x y
  • 39. Solution k(Distance = 652) 0 20 40 60 80 100 120 0 10 20 30 40 50 60 70 80 90 100 y x TSP30 (Performance = 652)
  • 40. Best Solution (Distance = 420) 42 38 35 26 21 35 32 7 38 46 44 58 60 69 76 78 71 69 67 62 84 94 0 20 40 60 80 100 120 0 10 20 30 40 50 60 70 80 90 100 y x TSP30 Solution (Performance = 420)
  • 41. Overview of Performance 0 200 400 600 800 1000 1200 1400 1600 1800 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 D is ta n c e Generations (1000) TSP30 - Overview of Performance Best Worst Average
  • 42. Consider the problem of maximizing the function, f(x) = x2 Where x is permitted to vary between 0 to 31. (i) 0(00000) and 31(11111) code x into finite length string (ii) Select initial population at random (size 4) (iii) Calculate fitness value for all strings (iv) probability of selection by: 𝑃𝑟𝑜𝑏𝑖= 𝑓(𝑥) 𝑖 𝑖=1 𝑛 𝑓(𝑥) 𝑖 ,
  • 43. Table 1. Selection String No. Initial population X Value Fitness value Prob. %age Prob. Expected Count Actual Count 1. 01100 12 144 0.1247 12.47% 0.4987 1 2. 11001 25 625 0.5411 54.11% 2.1645 2 3. 00101 5 25 0.0216 2.16% 0.0866 0 4. 10011 19 361 0.3126 31.26% 1.2502 1 Sum Avg. Max. 1155 288.75 625 1.0000 0.2500 0.5411 100% 25% 54.11% 4.0000 1.0000 2.1645
  • 44. Table 2. Crossover String No. Mating Pool Crossover point Offspring after crossover X value Fitness value 1. 01100 4 01101 13 169 2. 11001 4 11000 24 576 3. 11001 3 11011 27 729 4. 10011 3 10001 17 289 Sum Avg. Max. 1763 440.75 729
  • 45. Table 3. Mutation String No. Offspring After crossover Mutation chromosomes Offspring after mutation X value Fitness value 1. 01101 10000 11101 29 841 2. 11000 00000 11000 24 576 3. 11011 00000 11011 27 729 4. 10001 00100 10101 20 400 Sum Avg. Max. 2546 636.5 841
  • 46. Minimize the following fitness function including 2 variables: 𝒎𝒊𝒏 𝒙 𝒇 𝒙 = 𝟏𝟎𝟎(𝒙 𝟏 𝟐 − 𝒙 𝟐) 𝟐 + (𝟏 − 𝒙 𝟏) 𝟐 Subject to the following linear constraints and bounds: 𝑥1 𝑥2 + 𝑥1 − 𝑥2 + 1.5 ≤ 0 10 − 𝑥1 𝑥2 ≤ 0 0 ≤ 𝑥1 ≤ 1 and 0 ≤ 𝑥2 ≤ 13
  • 47. The function has one output ‘y’ and two input variables ‘x1’ and ‘x2’. We use the vector ‘x’ to include both ‘x1’ and ‘x2’.
  • 48.
  • 50. Advantages of Genetic Algorithm  Parallelism, robustness and liability  Solution space is wider  Handles large, poorly understood search spaces easily  Easily modified for different problems  Easy to discover global optimum  Handles noisy functions as well  Only uses function evaluations  They require no information about the response surface  Perform very well for large-scale optimization problems  Can be employed for a wide variety of optimization problems  The problem has multi objective function  Very robust to difficulties in the evaluation of the objective function
  • 51. Limitations of Genetic Algorithm  The problem of identifying fitness function  Requires large number of fitness function evaluations  The problem of choosing the various parameters like the size of the population, mutation rate, crossover rate, the selection method and its strength.  Definition of representation of the problem  No effective terminator  Needs to be coupled with a local search technique  Have trouble finding the exact global optimum