SlideShare a Scribd company logo
Genetic Algorithm
Nobal Niraula
University of Memphis
Nov 11, 2010
1
Outline
 Introduction to Genetic Algorithm (GA)
 GA Components
Representation
Recombination
Mutation
Parent Selection
Survivor selection
Example
2
Slide sources
Most of the contents are taken from :
Genetic Algorithms: A Tutorial By Dr. Nysret Musliu,
Associate Professor Database and Artificial Intelligence
Group, Vienna University of Technology.
Introduction to Genetic Algorithms, Assaf Zaritsky Ben-
Gurion University, Israel (www.cs.bgu.ac.il/~assafza)
3
Introduction to GA (1)
4
Calculus Base
Techniques
Fibonacci
Search Techniqes
Guided random search
techniqes
Enumerative
Techniqes
BFSDFS Dynamic
Programming
Tabu Search Hill
Climbing
Simulated
Anealing
Evolutionary
Algorithms
Genetic
Programming
Genetic
Algorithms
Sort
Introduction to GA (2)
“Genetic Algorithms are good at taking large, potentially huge
search spaces and navigating them, looking for optimal
combinations of things, solutions you might not otherwise
find in a lifetime.”- Salvatore Mangano, Computer Design,
May 1995.
Originally developed by John Holland (1975)
The genetic algorithm (GA) is a search heuristic that
mimics the process of natural evolution
Uses concepts of “Natural Selection” and “Genetic
Inheritance” (Darwin 1859)
5
Use of GA
Widely-used in business, science and
engineering
Optimization and Search Problems
Scheduling and Timetabling
6
Let’s Learn Biology (1) 
Our body is made up of trillions of cells. Each cell has a
core structure (nucleus) that contains your
chromosomes.
Each chromosome is made up of tightly coiled strands
of deoxyribonucleic acid (DNA). Genes are segments of
DNA that determine specific traits, such as eye or hair
color. You have more than 20,000 genes.
A gene mutation is an alteration in your DNA. It can be
inherited or acquired during your lifetime, as cells age or
are exposed to certain chemicals. Some changes in your
genes result in genetic disorders.
7
Let’s Learn Biology (2) 
8
Source: http://www.riversideonline.com/health_reference/Tools/DS00549.cfm
1101101
Let’s Learn Biology (3) 
9
Let’s Learn Biology (4) 
Natural Selection
Darwin's theory of evolution: only the organisms best
adapted to their environment tend to survive and
transmit their genetic characteristics in increasing
numbers to succeeding generations while those less
adapted tend to be eliminated.
10
Source: http://www.bbc.co.uk/programmes/p0022nyy
GA is inspired from Nature
A genetic algorithm maintains a population of
candidate solutions for the problem at hand,
and makes it evolve by iteratively applying a set
of stochastic operators
11
Nature VS GA
The computer model introduces simplifications
(relative to the real biological mechanisms),
BUT
surprisingly complex and interesting structures
have emerged out of evolutionary algorithms
12
High-level Algorithm
produce an initial population of individuals
evaluate the fitness of all individuals
while termination condition not met do
select fitter individuals for reproduction
recombine between individuals
mutate individuals
evaluate the fitness of the modified individuals
generate a new population
End while
13
GA Components
14
Source: http://www.engineering.lancs.ac.uk
GA Components With Example
The MAXONE problem : Suppose we want to
maximize the number of ones in a string of L
binary digits
It may seem trivial because we know the answer
in advance
However, we can think of it as maximizing the
number of correct answers, each encoded by 1,
to L yes/no difficult questions`
15
GA Components: Representation
Encoding
An individual is encoded (naturally) as a string
of l binary digits
 Let’s say L = 10. Then, 1 = 0000000001 (10 bits)
16
Algorithm
produce an initial population of individuals
evaluate the fitness of all individuals
while termination condition not met do
select fitter individuals for reproduction
recombine between individuals
mutate individuals
evaluate the fitness of the modified individuals
generate a new population
End while
17
Initial Population
 We start with a population of n random strings. Suppose that l = 10 and n
= 6
 We toss a fair coin 60 times and get the following initial population:
s1 = 1111010101
s2 = 0111000101
s3 = 1110110101
s4 = 0100010011
s5 = 1110111101
s6 = 0100110000
18
Algorithm
produce an initial population of individuals
evaluate the fitness of all individuals
while termination condition not met do
select fitter individuals for reproduction
recombine between individuals
mutate individuals
evaluate the fitness of the modified individuals
generate a new population
End while
19
Fitness Function: f()
We toss a fair coin 60 times and get the following initial population:
s1 = 1111010101 f (s1) = 7
s2 = 0111000101 f (s2) = 5
s3 = 1110110101 f (s3) = 7
s4 = 0100010011 f (s4) = 4
s5 = 1110111101 f (s5) = 8
s6 = 0100110000 f (s6) = 3
---------------------------------------------------
= 34
20
Algorithm
produce an initial population of individuals
evaluate the fitness of all individuals
while termination condition not met do
select fitter individuals for reproduction
recombine between individuals
mutate individuals
evaluate the fitness of the modified individuals
generate a new population
End while
21
Selection (1)
Next we apply fitness proportionate selection
with the roulette wheel method:
We repeat the extraction as many times as the
number of individuals
we need to have the same parent population
size (6 in our case)
22
Individual i will have a
probability to be chosen
i
if
if
)(
)(
21
n
3
Area is
Proportional to
fitness value
4
Selection (2)
Suppose that, after performing selection, we get
the following population:
s1` = 1111010101 (s1)
s2` = 1110110101 (s3)
s3` = 1110111101 (s5)
s4` = 0111000101 (s2)
s5` = 0100010011 (s4)
s6` = 1110111101 (s5)
23
Algorithm
produce an initial population of individuals
evaluate the fitness of all individuals
while termination condition not met do
select fitter individuals for reproduction
recombine between individuals
mutate individuals
evaluate the fitness of the modified individuals
generate a new population
End while
24
Recombination (1)
 aka Crossover
For each couple we decide according to
crossover probability (for instance 0.6) whether
to actually perform crossover or not
Suppose that we decide to actually perform
crossover only for couples (s1`, s2`) and (s5`,
s6`).
For each couple, we randomly extract a
crossover point, for instance 2 for the first and 5
for the second
25
Recombination (2)
26
Algorithm
produce an initial population of individuals
evaluate the fitness of all individuals
while termination condition not met do
select fitter individuals for reproduction
recombine between individuals
mutate individuals
evaluate the fitness of the modified individuals
generate a new population
End while
27
Mutation (1)
28
Before applying mutation:
s1`` = 1110110101
s2`` = 1111010101
s3`` = 1110111101
s4`` = 0111000101
s5`` = 0100011101
s6`` = 1110110011
After applying mutation:
s1``` = 1110100101
s2``` = 1111110100
s3``` = 1110101111
s4``` = 0111000101
s5``` = 0100011101
s6``` = 1110110001
Mutation (2)
The final step is to apply random mutation: for
each bit that we are to copy to the new
population we allow a small probability of error
(for instance 0.1)
 Causes movement in the search space
(local or global)
 Restores lost information to the population
29
High-level Algorithm
produce an initial population of individuals
evaluate the fitness of all individuals
while termination condition not met do
select fitter individuals for reproduction
recombine between individuals
mutate individuals
evaluate the fitness of the modified individuals
generate a new population
End while
30
Fitness of New Population
 After Applying Mutation:
s1``` = 1110100101 f (s1```) = 6
s2``` = 1111110100 f (s2```) = 7
s3``` = 1110101111 f (s3```) = 8
s4``` = 0111000101 f (s4```) = 5
s5``` = 0100011101 f (s5```) = 5
s6``` = 1110110001 f (s6```) = 6
-------------------------------------------------------------
37
31
Example (End)
In one generation, the total population fitness
changed from 34 to 37, thus improved by ~9%
At this point, we go through the same process
all over again, until a stopping criterion is met
32
Distribution of Individuals
Distribution of Individuals in Generation 0
Distribution of Individuals in Generation N
Issues
Choosing basic implementation issues:
representation
population size, mutation rate, ...
selection, deletion policies
crossover, mutation operators
Termination Criteria
Performance, scalability
Solution is only as good as the evaluation function
(often hardest part)
34
When to Use a GA
Alternate solutions are too slow or overly complicated
Need an exploratory tool to examine new approaches
Problem is similar to one that has already been
successfully solved by using a GA
Want to hybridize with an existing solution
Benefits of the GA technology meet key problem
requirements
Conclusion
 Inspired from Nature
 Has many areas of Applications
 GA is powerful
36
References
 Genetic Algorithms: A Tutorial By Dr. Nysret Musliu , Associate Professor
Database and Artificial Intelligence Group, Vienna University of Technology.
 Introduction to Genetic Algorithms, Assaf Zaritsky Ben-Gurion University,
Israel (www.cs.bgu.ac.il/~assafza)
37
38
Thank You !

More Related Content

What's hot

Genetic Algorithms
Genetic AlgorithmsGenetic Algorithms
Genetic Algorithms
Shruti Railkar
 
Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
Genetic Algorithm
rabidityfactor
 
Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithm
Jari Abbas
 
Introduction to Genetic Algorithms
Introduction to Genetic AlgorithmsIntroduction to Genetic Algorithms
Introduction to Genetic Algorithms
Premsankar Chakkingal
 
Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
Genetic Algorithm
SHIMI S L
 
Ga
GaGa
MACHINE LEARNING - GENETIC ALGORITHM
MACHINE LEARNING - GENETIC ALGORITHMMACHINE LEARNING - GENETIC ALGORITHM
MACHINE LEARNING - GENETIC ALGORITHM
Puneet Kulyana
 
Introduction to Genetic Algorithms
Introduction to Genetic AlgorithmsIntroduction to Genetic Algorithms
Introduction to Genetic Algorithms
Ahmed Othman
 
Genetic algorithm ppt
Genetic algorithm pptGenetic algorithm ppt
Genetic algorithm ppt
Mayank Jain
 
Practical Swarm Optimization (PSO)
Practical Swarm Optimization (PSO)Practical Swarm Optimization (PSO)
Practical Swarm Optimization (PSO)
khashayar Danesh Narooei
 
Genetic_Algorithm_AI(TU)
Genetic_Algorithm_AI(TU)Genetic_Algorithm_AI(TU)
Genetic_Algorithm_AI(TU)Kapil Khatiwada
 
Ga ppt (1)
Ga ppt (1)Ga ppt (1)
Ga ppt (1)
RAHUL SOLANKI
 
Introduction to Optimization with Genetic Algorithm (GA)
Introduction to Optimization with Genetic Algorithm (GA)Introduction to Optimization with Genetic Algorithm (GA)
Introduction to Optimization with Genetic Algorithm (GA)
Ahmed Gad
 
Introduction to Genetic Algorithms
Introduction to Genetic AlgorithmsIntroduction to Genetic Algorithms
Introduction to Genetic Algorithms
Dr. C.V. Suresh Babu
 
Genetic Algorithms
Genetic AlgorithmsGenetic Algorithms
Genetic Algorithms
adil raja
 
Genetic algorithm raktim
Genetic algorithm raktimGenetic algorithm raktim
Genetic algorithm raktim
Raktim Halder
 
Genetic Algorithms
Genetic AlgorithmsGenetic Algorithms
Genetic Algorithms
Karthik Sankar
 
Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
Genetic Algorithm
SEKHARREDDYAMBATI
 
Nature-Inspired Optimization Algorithms
Nature-Inspired Optimization Algorithms Nature-Inspired Optimization Algorithms
Nature-Inspired Optimization Algorithms
Xin-She Yang
 
Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithm
Syed Muhammad Zeejah Hashmi
 

What's hot (20)

Genetic Algorithms
Genetic AlgorithmsGenetic Algorithms
Genetic Algorithms
 
Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
Genetic Algorithm
 
Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithm
 
Introduction to Genetic Algorithms
Introduction to Genetic AlgorithmsIntroduction to Genetic Algorithms
Introduction to 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
 
Introduction to Genetic Algorithms
Introduction to Genetic AlgorithmsIntroduction to Genetic Algorithms
Introduction to Genetic Algorithms
 
Genetic algorithm ppt
Genetic algorithm pptGenetic algorithm ppt
Genetic algorithm ppt
 
Practical Swarm Optimization (PSO)
Practical Swarm Optimization (PSO)Practical Swarm Optimization (PSO)
Practical Swarm Optimization (PSO)
 
Genetic_Algorithm_AI(TU)
Genetic_Algorithm_AI(TU)Genetic_Algorithm_AI(TU)
Genetic_Algorithm_AI(TU)
 
Ga ppt (1)
Ga ppt (1)Ga ppt (1)
Ga ppt (1)
 
Introduction to Optimization with Genetic Algorithm (GA)
Introduction to Optimization with Genetic Algorithm (GA)Introduction to Optimization with Genetic Algorithm (GA)
Introduction to Optimization with Genetic Algorithm (GA)
 
Introduction to Genetic Algorithms
Introduction to Genetic AlgorithmsIntroduction to Genetic Algorithms
Introduction to Genetic Algorithms
 
Genetic Algorithms
Genetic AlgorithmsGenetic Algorithms
Genetic Algorithms
 
Genetic algorithm raktim
Genetic algorithm raktimGenetic algorithm raktim
Genetic algorithm raktim
 
Genetic Algorithms
Genetic AlgorithmsGenetic Algorithms
Genetic Algorithms
 
Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
Genetic Algorithm
 
Nature-Inspired Optimization Algorithms
Nature-Inspired Optimization Algorithms Nature-Inspired Optimization Algorithms
Nature-Inspired Optimization Algorithms
 
Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithm
 

Viewers also liked

شرح مبسط عن الخوارزميات الجينية باستخدام الحاسبات
شرح مبسط عن الخوارزميات الجينية باستخدام الحاسباتشرح مبسط عن الخوارزميات الجينية باستخدام الحاسبات
شرح مبسط عن الخوارزميات الجينية باستخدام الحاسبات
sayAAhmad
 
Fuzzy Genetic Algorithm
Fuzzy Genetic AlgorithmFuzzy Genetic Algorithm
Fuzzy Genetic Algorithm
Pintu Khan
 
NNFL 16- Guru Nanak Dev Engineering College
NNFL   16- Guru Nanak Dev Engineering CollegeNNFL   16- Guru Nanak Dev Engineering College
NNFL 16- Guru Nanak Dev Engineering College
MR. VIKRAM SNEHI
 
Ant colony optimization
Ant colony optimizationAnt colony optimization
Ant colony optimizationvk1dadhich
 
Neuro-fuzzy systems
Neuro-fuzzy systemsNeuro-fuzzy systems
Neuro-fuzzy systems
Sagar Ahire
 
An Introduction to Soft Computing
An Introduction to Soft ComputingAn Introduction to Soft Computing
An Introduction to Soft ComputingTameem Ahmad
 
Genetic Algorithms Made Easy
Genetic Algorithms Made EasyGenetic Algorithms Made Easy
Genetic Algorithms Made Easy
Prakash Pimpale
 
Soft computing (ANN and Fuzzy Logic) : Dr. Purnima Pandit
Soft computing (ANN and Fuzzy Logic)  : Dr. Purnima PanditSoft computing (ANN and Fuzzy Logic)  : Dr. Purnima Pandit
Soft computing (ANN and Fuzzy Logic) : Dr. Purnima Pandit
Purnima Pandit
 
Unit I & II in Principles of Soft computing
Unit I & II in Principles of Soft computing Unit I & II in Principles of Soft computing
Unit I & II in Principles of Soft computing
Sivagowry Shathesh
 
Fuzzy logic application (aircraft landing)
Fuzzy logic application (aircraft landing)Fuzzy logic application (aircraft landing)
Fuzzy logic application (aircraft landing)
Piyumal Samarathunga
 
Fuzzy logic ppt
Fuzzy logic pptFuzzy logic ppt
Fuzzy logic ppt
Priya_Srivastava
 
Chapter 5 - Fuzzy Logic
Chapter 5 - Fuzzy LogicChapter 5 - Fuzzy Logic
Chapter 5 - Fuzzy Logic
Ashique Rasool
 

Viewers also liked (14)

شرح مبسط عن الخوارزميات الجينية باستخدام الحاسبات
شرح مبسط عن الخوارزميات الجينية باستخدام الحاسباتشرح مبسط عن الخوارزميات الجينية باستخدام الحاسبات
شرح مبسط عن الخوارزميات الجينية باستخدام الحاسبات
 
Fuzzy Genetic Algorithm
Fuzzy Genetic AlgorithmFuzzy Genetic Algorithm
Fuzzy Genetic Algorithm
 
NNFL 16- Guru Nanak Dev Engineering College
NNFL   16- Guru Nanak Dev Engineering CollegeNNFL   16- Guru Nanak Dev Engineering College
NNFL 16- Guru Nanak Dev Engineering College
 
Naive bayes
Naive bayesNaive bayes
Naive bayes
 
Ant colony optimization
Ant colony optimizationAnt colony optimization
Ant colony optimization
 
Neuro-fuzzy systems
Neuro-fuzzy systemsNeuro-fuzzy systems
Neuro-fuzzy systems
 
An Introduction to Soft Computing
An Introduction to Soft ComputingAn Introduction to Soft Computing
An Introduction to Soft Computing
 
Genetic Algorithms Made Easy
Genetic Algorithms Made EasyGenetic Algorithms Made Easy
Genetic Algorithms Made Easy
 
Soft computing (ANN and Fuzzy Logic) : Dr. Purnima Pandit
Soft computing (ANN and Fuzzy Logic)  : Dr. Purnima PanditSoft computing (ANN and Fuzzy Logic)  : Dr. Purnima Pandit
Soft computing (ANN and Fuzzy Logic) : Dr. Purnima Pandit
 
Unit I & II in Principles of Soft computing
Unit I & II in Principles of Soft computing Unit I & II in Principles of Soft computing
Unit I & II in Principles of Soft computing
 
Soft computing
Soft computingSoft computing
Soft computing
 
Fuzzy logic application (aircraft landing)
Fuzzy logic application (aircraft landing)Fuzzy logic application (aircraft landing)
Fuzzy logic application (aircraft landing)
 
Fuzzy logic ppt
Fuzzy logic pptFuzzy logic ppt
Fuzzy logic ppt
 
Chapter 5 - Fuzzy Logic
Chapter 5 - Fuzzy LogicChapter 5 - Fuzzy Logic
Chapter 5 - Fuzzy Logic
 

Similar to Genetic Algorithm by Example

Genetic algorithm artificial intelligence presentation
Genetic algorithm   artificial intelligence presentationGenetic algorithm   artificial intelligence presentation
Genetic algorithm artificial intelligence presentation
Tauhidul Khandaker
 
GA.pptx
GA.pptxGA.pptx
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
IIIT Allahabad
 
Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
Genetic Algorithm
Jagadish Mohanty
 
A Comparison Of Fitness Scallng Methods In Evolutionary Algorithms
A Comparison Of Fitness Scallng Methods In Evolutionary AlgorithmsA Comparison Of Fitness Scallng Methods In Evolutionary Algorithms
A Comparison Of Fitness Scallng Methods In Evolutionary Algorithms
Tracy Hill
 
Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithmUjjawal
 
Modeling selection pressure in XCS for proportionate and tournament selection
Modeling selection pressure in XCS for proportionate and tournament selectionModeling selection pressure in XCS for proportionate and tournament selection
Modeling selection pressure in XCS for proportionate and tournament selection
kknsastry
 
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...
Annibale Panichella
 
Machine Learning - Genetic Algorithm Fundamental
Machine Learning - Genetic Algorithm FundamentalMachine Learning - Genetic Algorithm Fundamental
Machine Learning - Genetic Algorithm Fundamental
Anggi Andriyadi
 
Thomas Lenormand - Génétique des populations
Thomas Lenormand - Génétique des populationsThomas Lenormand - Génétique des populations
Thomas Lenormand - Génétique des populationsSeminaire MEE
 
Solution to the practice test ch 10 correlation reg ch 11 gof ch12 anova
Solution to the practice test ch 10 correlation reg ch 11 gof ch12 anovaSolution to the practice test ch 10 correlation reg ch 11 gof ch12 anova
Solution to the practice test ch 10 correlation reg ch 11 gof ch12 anova
Long Beach City College
 
Top of Form1. Stream quality is based on the levels of many .docx
Top of Form1. Stream quality is based on the levels of many .docxTop of Form1. Stream quality is based on the levels of many .docx
Top of Form1. Stream quality is based on the levels of many .docx
edwardmarivel
 
Ch04 Probability
Ch04 ProbabilityCh04 Probability
Ch04 Probability
Akshay Thapar
 
A Moment Inequality for Overall Decreasing Life Class of Life Distributions w...
A Moment Inequality for Overall Decreasing Life Class of Life Distributions w...A Moment Inequality for Overall Decreasing Life Class of Life Distributions w...
A Moment Inequality for Overall Decreasing Life Class of Life Distributions w...
inventionjournals
 
Chapter09.ppt
Chapter09.pptChapter09.ppt
Chapter09.pptbutest
 
A study on the ANOVA ANALYSIS OF VARIANCE.pptx
A study on the ANOVA ANALYSIS OF VARIANCE.pptxA study on the ANOVA ANALYSIS OF VARIANCE.pptx
A study on the ANOVA ANALYSIS OF VARIANCE.pptx
jibinjohn140
 
Computational Pool-Testing with Retesting Strategy
Computational Pool-Testing with Retesting StrategyComputational Pool-Testing with Retesting Strategy
Computational Pool-Testing with Retesting Strategy
Waqas Tariq
 
Practice Test 5B Multinomial Experiments and Contingency Tables Solution
Practice Test 5B Multinomial Experiments and Contingency Tables SolutionPractice Test 5B Multinomial Experiments and Contingency Tables Solution
Practice Test 5B Multinomial Experiments and Contingency Tables Solution
Long Beach City College
 

Similar to Genetic Algorithm by Example (20)

Genetic algorithm artificial intelligence presentation
Genetic algorithm   artificial intelligence presentationGenetic algorithm   artificial intelligence presentation
Genetic algorithm artificial intelligence presentation
 
GA.pptx
GA.pptxGA.pptx
GA.pptx
 
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
 
Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
Genetic Algorithm
 
A Comparison Of Fitness Scallng Methods In Evolutionary Algorithms
A Comparison Of Fitness Scallng Methods In Evolutionary AlgorithmsA Comparison Of Fitness Scallng Methods In Evolutionary Algorithms
A Comparison Of Fitness Scallng Methods In Evolutionary Algorithms
 
Ai presentation
Ai presentationAi presentation
Ai presentation
 
Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithm
 
Modeling selection pressure in XCS for proportionate and tournament selection
Modeling selection pressure in XCS for proportionate and tournament selectionModeling selection pressure in XCS for proportionate and tournament selection
Modeling selection pressure in XCS for proportionate and tournament selection
 
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...
 
Machine Learning - Genetic Algorithm Fundamental
Machine Learning - Genetic Algorithm FundamentalMachine Learning - Genetic Algorithm Fundamental
Machine Learning - Genetic Algorithm Fundamental
 
Thomas Lenormand - Génétique des populations
Thomas Lenormand - Génétique des populationsThomas Lenormand - Génétique des populations
Thomas Lenormand - Génétique des populations
 
Solution to the practice test ch 10 correlation reg ch 11 gof ch12 anova
Solution to the practice test ch 10 correlation reg ch 11 gof ch12 anovaSolution to the practice test ch 10 correlation reg ch 11 gof ch12 anova
Solution to the practice test ch 10 correlation reg ch 11 gof ch12 anova
 
Top of Form1. Stream quality is based on the levels of many .docx
Top of Form1. Stream quality is based on the levels of many .docxTop of Form1. Stream quality is based on the levels of many .docx
Top of Form1. Stream quality is based on the levels of many .docx
 
Ch04 Probability
Ch04 ProbabilityCh04 Probability
Ch04 Probability
 
A Moment Inequality for Overall Decreasing Life Class of Life Distributions w...
A Moment Inequality for Overall Decreasing Life Class of Life Distributions w...A Moment Inequality for Overall Decreasing Life Class of Life Distributions w...
A Moment Inequality for Overall Decreasing Life Class of Life Distributions w...
 
Chapter09.ppt
Chapter09.pptChapter09.ppt
Chapter09.ppt
 
A study on the ANOVA ANALYSIS OF VARIANCE.pptx
A study on the ANOVA ANALYSIS OF VARIANCE.pptxA study on the ANOVA ANALYSIS OF VARIANCE.pptx
A study on the ANOVA ANALYSIS OF VARIANCE.pptx
 
autoDock.ppt
autoDock.pptautoDock.ppt
autoDock.ppt
 
Computational Pool-Testing with Retesting Strategy
Computational Pool-Testing with Retesting StrategyComputational Pool-Testing with Retesting Strategy
Computational Pool-Testing with Retesting Strategy
 
Practice Test 5B Multinomial Experiments and Contingency Tables Solution
Practice Test 5B Multinomial Experiments and Contingency Tables SolutionPractice Test 5B Multinomial Experiments and Contingency Tables Solution
Practice Test 5B Multinomial Experiments and Contingency Tables Solution
 

Recently uploaded

135. Reviewer Certificate in Journal of Engineering
135. Reviewer Certificate in Journal of Engineering135. Reviewer Certificate in Journal of Engineering
135. Reviewer Certificate in Journal of Engineering
Manu Mitra
 
一比一原版(UVic毕业证)维多利亚大学毕业证如何办理
一比一原版(UVic毕业证)维多利亚大学毕业证如何办理一比一原版(UVic毕业证)维多利亚大学毕业证如何办理
一比一原版(UVic毕业证)维多利亚大学毕业证如何办理
pxyhy
 
han han widi kembar tapi beda han han dan widi kembar tapi sama
han han widi kembar tapi beda han han dan widi kembar tapi samahan han widi kembar tapi beda han han dan widi kembar tapi sama
han han widi kembar tapi beda han han dan widi kembar tapi sama
IrlanMalik
 
The Impact of Artificial Intelligence on Modern Society.pdf
The Impact of Artificial Intelligence on Modern Society.pdfThe Impact of Artificial Intelligence on Modern Society.pdf
The Impact of Artificial Intelligence on Modern Society.pdf
ssuser3e63fc
 
Operating system. short answes and Interview questions .pdf
Operating system. short answes and Interview questions .pdfOperating system. short answes and Interview questions .pdf
Operating system. short answes and Interview questions .pdf
harikrishnahari6276
 
Digital Marketing Training In Bangalore
Digital  Marketing Training In BangaloreDigital  Marketing Training In Bangalore
Digital Marketing Training In Bangalore
nidm599
 
一比一原版(YU毕业证)约克大学毕业证如何办理
一比一原版(YU毕业证)约克大学毕业证如何办理一比一原版(YU毕业证)约克大学毕业证如何办理
一比一原版(YU毕业证)约克大学毕业证如何办理
yuhofha
 
DOC-20240602-WA0001..pdf DOC-20240602-WA0001..pdf
DOC-20240602-WA0001..pdf DOC-20240602-WA0001..pdfDOC-20240602-WA0001..pdf DOC-20240602-WA0001..pdf
DOC-20240602-WA0001..pdf DOC-20240602-WA0001..pdf
Pushpendra Kumar
 
Luke Royak's Personal Brand Exploration!
Luke Royak's Personal Brand Exploration!Luke Royak's Personal Brand Exploration!
Luke Royak's Personal Brand Exploration!
LukeRoyak
 
Personal Brand Exploration Comedy Jxnelle.
Personal Brand Exploration Comedy Jxnelle.Personal Brand Exploration Comedy Jxnelle.
Personal Brand Exploration Comedy Jxnelle.
alexthomas971
 
Interactive Dictionary AIDS-B.pptx aaaaaaaaaaaaaaaaaaaaaaaaaa
Interactive Dictionary AIDS-B.pptx aaaaaaaaaaaaaaaaaaaaaaaaaaInteractive Dictionary AIDS-B.pptx aaaaaaaaaaaaaaaaaaaaaaaaaa
Interactive Dictionary AIDS-B.pptx aaaaaaaaaaaaaaaaaaaaaaaaaa
23211a7274
 
Andrea Kate Portfolio Presentation.pdf
Andrea Kate  Portfolio  Presentation.pdfAndrea Kate  Portfolio  Presentation.pdf
Andrea Kate Portfolio Presentation.pdf
andreakaterasco
 
New Explore Careers and College Majors 2024.pdf
New Explore Careers and College Majors 2024.pdfNew Explore Careers and College Majors 2024.pdf
New Explore Careers and College Majors 2024.pdf
Dr. Mary Askew
 
Midterm Contract Law and Adminstration.pptx
Midterm Contract Law and Adminstration.pptxMidterm Contract Law and Adminstration.pptx
Midterm Contract Law and Adminstration.pptx
Sheldon Byron
 
Full Sail_Morales_Michael_SMM_2024-05.pptx
Full Sail_Morales_Michael_SMM_2024-05.pptxFull Sail_Morales_Michael_SMM_2024-05.pptx
Full Sail_Morales_Michael_SMM_2024-05.pptx
mmorales2173
 
How to create an effective K-POC tutorial
How to create an effective K-POC tutorialHow to create an effective K-POC tutorial
How to create an effective K-POC tutorial
vencislavkaaa
 
欧洲杯投注app-欧洲杯投注app推荐-欧洲杯投注app| 立即访问【ac123.net】
欧洲杯投注app-欧洲杯投注app推荐-欧洲杯投注app| 立即访问【ac123.net】欧洲杯投注app-欧洲杯投注app推荐-欧洲杯投注app| 立即访问【ac123.net】
欧洲杯投注app-欧洲杯投注app推荐-欧洲杯投注app| 立即访问【ac123.net】
foismail170
 
DIGITAL MARKETING COURSE IN CHENNAI.pptx
DIGITAL MARKETING COURSE IN CHENNAI.pptxDIGITAL MARKETING COURSE IN CHENNAI.pptx
DIGITAL MARKETING COURSE IN CHENNAI.pptx
FarzanaRbcomcs
 
How Mentoring Elevates Your PM Career | PMI Silver Spring Chapter
How Mentoring Elevates Your PM Career | PMI Silver Spring ChapterHow Mentoring Elevates Your PM Career | PMI Silver Spring Chapter
How Mentoring Elevates Your PM Career | PMI Silver Spring Chapter
Hector Del Castillo, CPM, CPMM
 
RECOGNITION AWARD 13 - TO ALESSANDRO MARTINS.pdf
RECOGNITION AWARD 13 - TO ALESSANDRO MARTINS.pdfRECOGNITION AWARD 13 - TO ALESSANDRO MARTINS.pdf
RECOGNITION AWARD 13 - TO ALESSANDRO MARTINS.pdf
AlessandroMartins454470
 

Recently uploaded (20)

135. Reviewer Certificate in Journal of Engineering
135. Reviewer Certificate in Journal of Engineering135. Reviewer Certificate in Journal of Engineering
135. Reviewer Certificate in Journal of Engineering
 
一比一原版(UVic毕业证)维多利亚大学毕业证如何办理
一比一原版(UVic毕业证)维多利亚大学毕业证如何办理一比一原版(UVic毕业证)维多利亚大学毕业证如何办理
一比一原版(UVic毕业证)维多利亚大学毕业证如何办理
 
han han widi kembar tapi beda han han dan widi kembar tapi sama
han han widi kembar tapi beda han han dan widi kembar tapi samahan han widi kembar tapi beda han han dan widi kembar tapi sama
han han widi kembar tapi beda han han dan widi kembar tapi sama
 
The Impact of Artificial Intelligence on Modern Society.pdf
The Impact of Artificial Intelligence on Modern Society.pdfThe Impact of Artificial Intelligence on Modern Society.pdf
The Impact of Artificial Intelligence on Modern Society.pdf
 
Operating system. short answes and Interview questions .pdf
Operating system. short answes and Interview questions .pdfOperating system. short answes and Interview questions .pdf
Operating system. short answes and Interview questions .pdf
 
Digital Marketing Training In Bangalore
Digital  Marketing Training In BangaloreDigital  Marketing Training In Bangalore
Digital Marketing Training In Bangalore
 
一比一原版(YU毕业证)约克大学毕业证如何办理
一比一原版(YU毕业证)约克大学毕业证如何办理一比一原版(YU毕业证)约克大学毕业证如何办理
一比一原版(YU毕业证)约克大学毕业证如何办理
 
DOC-20240602-WA0001..pdf DOC-20240602-WA0001..pdf
DOC-20240602-WA0001..pdf DOC-20240602-WA0001..pdfDOC-20240602-WA0001..pdf DOC-20240602-WA0001..pdf
DOC-20240602-WA0001..pdf DOC-20240602-WA0001..pdf
 
Luke Royak's Personal Brand Exploration!
Luke Royak's Personal Brand Exploration!Luke Royak's Personal Brand Exploration!
Luke Royak's Personal Brand Exploration!
 
Personal Brand Exploration Comedy Jxnelle.
Personal Brand Exploration Comedy Jxnelle.Personal Brand Exploration Comedy Jxnelle.
Personal Brand Exploration Comedy Jxnelle.
 
Interactive Dictionary AIDS-B.pptx aaaaaaaaaaaaaaaaaaaaaaaaaa
Interactive Dictionary AIDS-B.pptx aaaaaaaaaaaaaaaaaaaaaaaaaaInteractive Dictionary AIDS-B.pptx aaaaaaaaaaaaaaaaaaaaaaaaaa
Interactive Dictionary AIDS-B.pptx aaaaaaaaaaaaaaaaaaaaaaaaaa
 
Andrea Kate Portfolio Presentation.pdf
Andrea Kate  Portfolio  Presentation.pdfAndrea Kate  Portfolio  Presentation.pdf
Andrea Kate Portfolio Presentation.pdf
 
New Explore Careers and College Majors 2024.pdf
New Explore Careers and College Majors 2024.pdfNew Explore Careers and College Majors 2024.pdf
New Explore Careers and College Majors 2024.pdf
 
Midterm Contract Law and Adminstration.pptx
Midterm Contract Law and Adminstration.pptxMidterm Contract Law and Adminstration.pptx
Midterm Contract Law and Adminstration.pptx
 
Full Sail_Morales_Michael_SMM_2024-05.pptx
Full Sail_Morales_Michael_SMM_2024-05.pptxFull Sail_Morales_Michael_SMM_2024-05.pptx
Full Sail_Morales_Michael_SMM_2024-05.pptx
 
How to create an effective K-POC tutorial
How to create an effective K-POC tutorialHow to create an effective K-POC tutorial
How to create an effective K-POC tutorial
 
欧洲杯投注app-欧洲杯投注app推荐-欧洲杯投注app| 立即访问【ac123.net】
欧洲杯投注app-欧洲杯投注app推荐-欧洲杯投注app| 立即访问【ac123.net】欧洲杯投注app-欧洲杯投注app推荐-欧洲杯投注app| 立即访问【ac123.net】
欧洲杯投注app-欧洲杯投注app推荐-欧洲杯投注app| 立即访问【ac123.net】
 
DIGITAL MARKETING COURSE IN CHENNAI.pptx
DIGITAL MARKETING COURSE IN CHENNAI.pptxDIGITAL MARKETING COURSE IN CHENNAI.pptx
DIGITAL MARKETING COURSE IN CHENNAI.pptx
 
How Mentoring Elevates Your PM Career | PMI Silver Spring Chapter
How Mentoring Elevates Your PM Career | PMI Silver Spring ChapterHow Mentoring Elevates Your PM Career | PMI Silver Spring Chapter
How Mentoring Elevates Your PM Career | PMI Silver Spring Chapter
 
RECOGNITION AWARD 13 - TO ALESSANDRO MARTINS.pdf
RECOGNITION AWARD 13 - TO ALESSANDRO MARTINS.pdfRECOGNITION AWARD 13 - TO ALESSANDRO MARTINS.pdf
RECOGNITION AWARD 13 - TO ALESSANDRO MARTINS.pdf
 

Genetic Algorithm by Example

  • 1. Genetic Algorithm Nobal Niraula University of Memphis Nov 11, 2010 1
  • 2. Outline  Introduction to Genetic Algorithm (GA)  GA Components Representation Recombination Mutation Parent Selection Survivor selection Example 2
  • 3. Slide sources Most of the contents are taken from : Genetic Algorithms: A Tutorial By Dr. Nysret Musliu, Associate Professor Database and Artificial Intelligence Group, Vienna University of Technology. Introduction to Genetic Algorithms, Assaf Zaritsky Ben- Gurion University, Israel (www.cs.bgu.ac.il/~assafza) 3
  • 4. Introduction to GA (1) 4 Calculus Base Techniques Fibonacci Search Techniqes Guided random search techniqes Enumerative Techniqes BFSDFS Dynamic Programming Tabu Search Hill Climbing Simulated Anealing Evolutionary Algorithms Genetic Programming Genetic Algorithms Sort
  • 5. Introduction to GA (2) “Genetic Algorithms are good at taking large, potentially huge search spaces and navigating them, looking for optimal combinations of things, solutions you might not otherwise find in a lifetime.”- Salvatore Mangano, Computer Design, May 1995. Originally developed by John Holland (1975) The genetic algorithm (GA) is a search heuristic that mimics the process of natural evolution Uses concepts of “Natural Selection” and “Genetic Inheritance” (Darwin 1859) 5
  • 6. Use of GA Widely-used in business, science and engineering Optimization and Search Problems Scheduling and Timetabling 6
  • 7. Let’s Learn Biology (1)  Our body is made up of trillions of cells. Each cell has a core structure (nucleus) that contains your chromosomes. Each chromosome is made up of tightly coiled strands of deoxyribonucleic acid (DNA). Genes are segments of DNA that determine specific traits, such as eye or hair color. You have more than 20,000 genes. A gene mutation is an alteration in your DNA. It can be inherited or acquired during your lifetime, as cells age or are exposed to certain chemicals. Some changes in your genes result in genetic disorders. 7
  • 8. Let’s Learn Biology (2)  8 Source: http://www.riversideonline.com/health_reference/Tools/DS00549.cfm 1101101
  • 10. Let’s Learn Biology (4)  Natural Selection Darwin's theory of evolution: only the organisms best adapted to their environment tend to survive and transmit their genetic characteristics in increasing numbers to succeeding generations while those less adapted tend to be eliminated. 10 Source: http://www.bbc.co.uk/programmes/p0022nyy
  • 11. GA is inspired from Nature A genetic algorithm maintains a population of candidate solutions for the problem at hand, and makes it evolve by iteratively applying a set of stochastic operators 11
  • 12. Nature VS GA The computer model introduces simplifications (relative to the real biological mechanisms), BUT surprisingly complex and interesting structures have emerged out of evolutionary algorithms 12
  • 13. High-level Algorithm produce an initial population of individuals evaluate the fitness of all individuals while termination condition not met do select fitter individuals for reproduction recombine between individuals mutate individuals evaluate the fitness of the modified individuals generate a new population End while 13
  • 15. GA Components With Example The MAXONE problem : Suppose we want to maximize the number of ones in a string of L binary digits It may seem trivial because we know the answer in advance However, we can think of it as maximizing the number of correct answers, each encoded by 1, to L yes/no difficult questions` 15
  • 16. GA Components: Representation Encoding An individual is encoded (naturally) as a string of l binary digits  Let’s say L = 10. Then, 1 = 0000000001 (10 bits) 16
  • 17. Algorithm produce an initial population of individuals evaluate the fitness of all individuals while termination condition not met do select fitter individuals for reproduction recombine between individuals mutate individuals evaluate the fitness of the modified individuals generate a new population End while 17
  • 18. Initial Population  We start with a population of n random strings. Suppose that l = 10 and n = 6  We toss a fair coin 60 times and get the following initial population: s1 = 1111010101 s2 = 0111000101 s3 = 1110110101 s4 = 0100010011 s5 = 1110111101 s6 = 0100110000 18
  • 19. Algorithm produce an initial population of individuals evaluate the fitness of all individuals while termination condition not met do select fitter individuals for reproduction recombine between individuals mutate individuals evaluate the fitness of the modified individuals generate a new population End while 19
  • 20. Fitness Function: f() We toss a fair coin 60 times and get the following initial population: s1 = 1111010101 f (s1) = 7 s2 = 0111000101 f (s2) = 5 s3 = 1110110101 f (s3) = 7 s4 = 0100010011 f (s4) = 4 s5 = 1110111101 f (s5) = 8 s6 = 0100110000 f (s6) = 3 --------------------------------------------------- = 34 20
  • 21. Algorithm produce an initial population of individuals evaluate the fitness of all individuals while termination condition not met do select fitter individuals for reproduction recombine between individuals mutate individuals evaluate the fitness of the modified individuals generate a new population End while 21
  • 22. Selection (1) Next we apply fitness proportionate selection with the roulette wheel method: We repeat the extraction as many times as the number of individuals we need to have the same parent population size (6 in our case) 22 Individual i will have a probability to be chosen i if if )( )( 21 n 3 Area is Proportional to fitness value 4
  • 23. Selection (2) Suppose that, after performing selection, we get the following population: s1` = 1111010101 (s1) s2` = 1110110101 (s3) s3` = 1110111101 (s5) s4` = 0111000101 (s2) s5` = 0100010011 (s4) s6` = 1110111101 (s5) 23
  • 24. Algorithm produce an initial population of individuals evaluate the fitness of all individuals while termination condition not met do select fitter individuals for reproduction recombine between individuals mutate individuals evaluate the fitness of the modified individuals generate a new population End while 24
  • 25. Recombination (1)  aka Crossover For each couple we decide according to crossover probability (for instance 0.6) whether to actually perform crossover or not Suppose that we decide to actually perform crossover only for couples (s1`, s2`) and (s5`, s6`). For each couple, we randomly extract a crossover point, for instance 2 for the first and 5 for the second 25
  • 27. Algorithm produce an initial population of individuals evaluate the fitness of all individuals while termination condition not met do select fitter individuals for reproduction recombine between individuals mutate individuals evaluate the fitness of the modified individuals generate a new population End while 27
  • 28. Mutation (1) 28 Before applying mutation: s1`` = 1110110101 s2`` = 1111010101 s3`` = 1110111101 s4`` = 0111000101 s5`` = 0100011101 s6`` = 1110110011 After applying mutation: s1``` = 1110100101 s2``` = 1111110100 s3``` = 1110101111 s4``` = 0111000101 s5``` = 0100011101 s6``` = 1110110001
  • 29. Mutation (2) The final step is to apply random mutation: for each bit that we are to copy to the new population we allow a small probability of error (for instance 0.1)  Causes movement in the search space (local or global)  Restores lost information to the population 29
  • 30. High-level Algorithm produce an initial population of individuals evaluate the fitness of all individuals while termination condition not met do select fitter individuals for reproduction recombine between individuals mutate individuals evaluate the fitness of the modified individuals generate a new population End while 30
  • 31. Fitness of New Population  After Applying Mutation: s1``` = 1110100101 f (s1```) = 6 s2``` = 1111110100 f (s2```) = 7 s3``` = 1110101111 f (s3```) = 8 s4``` = 0111000101 f (s4```) = 5 s5``` = 0100011101 f (s5```) = 5 s6``` = 1110110001 f (s6```) = 6 ------------------------------------------------------------- 37 31
  • 32. Example (End) In one generation, the total population fitness changed from 34 to 37, thus improved by ~9% At this point, we go through the same process all over again, until a stopping criterion is met 32
  • 33. Distribution of Individuals Distribution of Individuals in Generation 0 Distribution of Individuals in Generation N
  • 34. Issues Choosing basic implementation issues: representation population size, mutation rate, ... selection, deletion policies crossover, mutation operators Termination Criteria Performance, scalability Solution is only as good as the evaluation function (often hardest part) 34
  • 35. When to Use a GA Alternate solutions are too slow or overly complicated Need an exploratory tool to examine new approaches Problem is similar to one that has already been successfully solved by using a GA Want to hybridize with an existing solution Benefits of the GA technology meet key problem requirements
  • 36. Conclusion  Inspired from Nature  Has many areas of Applications  GA is powerful 36
  • 37. References  Genetic Algorithms: A Tutorial By Dr. Nysret Musliu , Associate Professor Database and Artificial Intelligence Group, Vienna University of Technology.  Introduction to Genetic Algorithms, Assaf Zaritsky Ben-Gurion University, Israel (www.cs.bgu.ac.il/~assafza) 37