SlideShare a Scribd company logo
Genetic Algorithm
What is Genetic Algorithms?
Genetic Algorithms (GAs) are adaptive heuristic search algorithm based
on the evolutionary ideas of natural selection and genetics. As such
they represent an intelligent exploitation of a random search used to
solve optimization problems. Although randomised, GAs are by no
means random, instead they exploit historical information to direct the
search into the region of better performance within the search space.
The basic techniques of the GAs are designed to simulate processes in
natural systems necessary for evolution, specially those follow the
principles first laid down by Charles Darwin of "survival of the fittest.".
Since in nature, competition among individuals for scanty resources
results in the fittest individuals dominating over the weaker ones.
Why Genetic Algorithms?
It is better than conventional AI in that it is more robust. Unlike older AI
systems, they do not break easily even if the inputs changed slightly, or
in the presence of reasonable noise. Also, in searching a large state-
space, multi-modal state-space, or n-dimensional surface, a genetic
algorithm may offer significant benefits over more typical search of
optimization techniques. (linear programming, heuristic, depth-first,
breath-first, and praxis.)
Genetic Algorithms Overview
GAs simulate the survival of the fittest among individuals over consecutive
generation for solving a problem. Each generation consists of a population of
character strings that are analogous to the chromosome that we see in our DNA.
Each individual represents a point in a search space and a possible solution. The
individuals in the population are then made to go through a process of evolution.
GAs are based on an analogy with the genetic structure and behaviour of
chromosomes within a population of individuals using the following foundations:
• Individuals in a population compete for resources and mates.
• Those individuals most successful in each 'competition' will produce more offspring than
those individuals that perform poorly.
• Genes from `good' individuals propagate throughout the population so that two good parents
will sometimes produce offspring that are better than either parent.
• Thus each successive generation will become more suited to their environment.
Cell
Nucleus
Mitosis
Mutation
Population Mutation Crossover Genotype to Phenotype Fitness
88
66
24
Fitness
to
Probability
0.8
0.1
Selection
New Generation
Implementation Details
After an initial population is randomly generated, the algorithm evolves
the through three operators:
• selection which equates to survival of the fittest;
• crossover which represents mating between individuals;
• mutation which introduces random modifications.
1. Selection Operator
• key idea: give preference to better individuals, allowing them to pass
on their genes to the next generation.
• The goodness of each individual depends on its fitness.
• Fitness may be determined by an objective function or by a subjective
judgement.
2. Crossover Operator
• Prime distinguished factor of GA from other optimization techniques
• Two individuals are chosen from the population using the selection
operator
• A crossover site along the bit strings is randomly chosen
• The values of the two strings are exchanged up to this point
• If S1=000000 and s2=111111 and the crossover point is 2 then S1'=110000
and s2'=001111
• The two new offspring created from this mating are put into the next
generation of the population
• By recombining portions of good individuals, this process is likely to create
even better individuals
Crossover Operator Cont.
3. Mutation Operator
• With some low probability, a portion of the new individuals will have
some of their bits flipped.
• Its purpose is to maintain diversity within the population and inhibit
premature convergence.
• Mutation alone induces a random walk through the search space
• Mutation and selection (without crossover) create a parallel, noise-
tolerant, hill-climbing algorithms
Effects of Genetic Operators
• Using selection alone will tend to fill the population with copies of the
best individual from the population
• Using selection and crossover operators will tend to cause the
algorithms to converge on a good but sub-optimal solution
• Using mutation alone induces a random walk through the search
space.
• Using selection and mutation creates a parallel, noise-tolerant, hill
climbing algorithm
The Algorithms
1. randomly initialize population(t)
2. determine fitness of population(t)
3. repeat
1. select parents from population(t)
2. perform crossover on parents creating population(t+1)
3. perform mutation of population(t+1)
4. determine fitness of population(t+1)
4. until best individual is good enough
Genetics Algorithm
GENETIC ALGORITHM
Evaluation/Fitness Function
It is used to determine the fitness of a chromosome
Creating a good fitness function is one of the challenging tasks of using GA
Fitness Function
The fitness function can be the score of the classification accuracy of the rule-set over a set of provided training
examples
Often other criteria may be included as well, such as the complexity of the rules or the size of the rule set
GENETIC ALGORITHM
(Probability)
• Two-point crossover at point 3 and 5
P1 = 101 00 10 = O1 = 101 10 10
P2 = 011 10 01 O2 = 011 00 01
Artificial Intelligence (Genetic Algorithm)
32
Simple example
• Suppose your “organisms” are 32-bit computer words
• You want a string in which all the bits are ones
• Here’s how you can do it:
• Create 100 randomly generated computer words
• Repeatedly do the following:
• Count the 1 bits in each word
• Exit if any of the words have all 32 bits set to 1
• Keep the ten words that have the most 1s (discard the rest)
• From each word, generate 9 new words as follows:
• Pick a random bit in the word and toggle (change) it
• Note that this procedure does not guarantee that the next “generation” will
have more 1 bits, but it’s likely
Realistic Example
• Suppose you have a large number of (x, y) data points
• For example, (1, 4), (3, 9), (5, 8), ...
• You would like to fit a polynomial (of up to degree 1) through these data points
• That is, you want a formula y = mx + c that gives you a reasonably good fit to the actual data
• Here’s the usual way to compute goodness of fit:
• Compute the sum of (actual y – predicted y)2 for all the data points
• The lowest sum represents the best fit
• You can use a genetic algorithm to find a “pretty good” solution
Realistic Example
• Your formula is y = mx + c
• Your unknowns are m and c; where m and c are integers
• Your representation is the array [m, c]
• Your evaluation function for one array is:
• For every actual data point (x, y)
• Compute ý = mx + c
• Find the sum of (y – ý)2 over all x
• The sum is your measure of “badness” (larger numbers are worse)
• Example: For [m,c] = [5, 7] and the data points (1, 10) and (2, 13):
• ý = 5x + 7 = 12 when x is 1
• ý = 5x + 7 = 17 when x is 2
• Now compute the badness
(10 - 12)2 + (13 – 17)2 = 22 + 42 = 20
• If these are the only two data points, the “badness” of [5, 7] is 20
Realistic Example
• Your GA might be as follows:
• Create two-element arrays of random numbers
• Repeat 50 times (or any other number):
• For each of the arrays, compute its badness (using all data points)
• Keep the best arrays (with low badness)
• From the arrays you keep, generate new arrays as follows:
• Convert the numbers in the array to binary, toggle one of the bits at random
• Quit if the badness of any of the solution is zero
• After all 50 trials, pick the best array as your final answer
Realistic Example
• (x, y) : {(1,5) (3, 9)}
• [2 7][1 3] (initial random population, where m and c represent genes)
• ý = 2x + 7 = 9 when x is 1
• ý = 2x + 7 = 13 when x is 3
• Badness: (5 – 9)2 + (9 – 13)2 = 42 + 42 = 32
• ý = 1x + 3 = 4 when x is 1
• ý = 1x + 3 = 6 when x is 3
• Badness: (5 – 4)2 + (9 – 6)2 = 12 + 32 = 10
• Now, lets keep the one with low “badness” [1 3]
• Binary representation [001 011]
• Apply mutation to generate new arrays [011 011]
• Now we have [1 3] [3 3] as the new population considering that we keep the two best individuals
Realistic Example
• (x, y) : {(1,5) (3, 9)}
• [1 3][3 3] (current population)
• ý = 1x + 3 = 4 when x is 1
• ý = 1x + 3 = 6 when x is 3
• Badness: (5 – 4)2 + (9 – 6)2 = 1 + 9 = 10
• ý = 3x + 3 = 6 when x is 1
• ý = 3x + 3 = 12 when x is 3
• Badness: (5 – 6)2 + (9 – 12)2 = 1 + 9 = 10
• Lets keep the [3 3]
• Representation [011 011]
• Apply mutation to generate new arrays [010 011] i.e. [2,3]
• Now we have [3 3] [2 3] as the new population
Realistic Example
• (x, y) : {(1,5) (3, 9)}
• [3 3][2 3] (current population)
• ý = 3x + 3 = 6 when x is 1
• ý = 3x + 3 = 12 when x is 3
• Badness: (5 – 6)2 + (9 – 12)2 = 1 + 9 = 10
• ý = 2x + 3 = 5 when x is 1
• ý = 2x + 3 = 9 when x is 3
• Badness: (5 – 5)2 + (9 – 9)2 = 02 + 02 = 0
• Solution found [2 3]
• y = 2x+3
• Note: It is not necessary that the badness must always be zero. It can be some other threshold value as
well.
GENETIC ALGORITHM
Reproduction Operators: Crossover
Crossover operation takes two candidate solutions and divides them, swapping components to produce two new
candidates
GENETIC ALGORITHM
Reproduction Operators: Crossover
Figure illustrates crossover on bit string patterns of length 8
The operator splits them and forms two children whose initial segment comes from one parent and whose tail
comes from the other
Input Bit Strings
1 1 # 0 1 0 1 # # 1 1 0 # 0 # 1
Resulting Strings
1 1 # 0 # 0 # 1 # 1 1 0 1 0 1 #
GENETIC ALGORITHM
Reproduction Operators: Crossover
The place of split in the candidate solution is an arbitrary choice. This split may be at any point in the solution
This splitting point may be randomly chosen or changed systematically during the solution process
Crossover can unite an individual that is doing well in one dimension with another individual that is doing well in
the other dimension
GENETIC ALGORITHM
Reproduction Operators: Crossover
Two types: Single point crossover & Uniform crossover
Single type crossover
This operator takes two parents and randomly selects a single point between two genes to cut both
chromosomes into two parts (this point is called cut point)
The first part of the first parent is combined with the second part of the second parent to create the first child
The first part of the second parent is combined with the second part of first parent to create the second child
1000010 1000001
1110001 1110010
GENETIC ALGORITHM
Reproduction Operators: Crossover
Uniform crossover
The value of each gene of an offspring’s chromosome is randomly taken from either parent
This is equivalent to multiple point crossover
1000010
1110001 1010010
44
GENETIC ALGORITHM
Example
Find a number: 001010
You have guessed this binary number. If you write a program to find it, then there are 26 = 64 possibilities
If you find it with the help of Genetic Algorithm, then the program gives a number and you tell its fitness
The fitness score is the number of correctly guessed bits
45
GENETIC ALGORITHM
Example
Find a number: 001010
Step 1. Chromosomes produced.
A) 010101 - 1
B) 111101 - 1
C) 011011 - 4 *
D) 101100 - 3 *
Best ones C & D
46
GENETIC ALGORITHM
Example
Find a number: 001010
Mating New Variants Evaluation
C) 01:1011 01:1100 (E) 3
D) 10:1100 10:1011 (F) 4 *
C) 0110:11 0110:00 (G) 4 *
D) 1011:00 1011:11 (H) 3
Selection of F & G
47
GENETIC ALGORITHM
Example
Mating New Variants Evaluation
F) 1:01011 1:11000 (H) 3
G) 0:11000 0:01011 (I) 5 *
F) 101:011 101:000 (J) 4 *
G) 011:000 011:011 (K) 4
Selection of I and J
48
GENETIC ALGORITHM
Example
Mating New Variants Evaluation
I) 0010:11 0010:00 (L) 5
J) 1010:00 1010:11 (M) 4
I) 00101:1 00101:0 (N) 6 (success) *
J) 10100:0 10100:1 (O) 3
In this game success was achieved after 16 questions, which is 4 times faster then checking all possible 26 = 64
combination
49
GENETIC ALGORITHM
Example
Mutation was not used in this example. Mutation would have been necessary, if, e.g. there was a 0 in the third bit of
all 3 initial individuals. In that case no matter how the individuals are combined, we can never change this bit into 1.
Mutation takes evolution out of a dead end.

More Related Content

What's hot

Ga ppt (1)
Ga ppt (1)Ga ppt (1)
Ga ppt (1)
RAHUL SOLANKI
 
Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
Genetic Algorithm
Pratheeban Rajendran
 
Genetic algorithm raktim
Genetic algorithm raktimGenetic algorithm raktim
Genetic algorithm raktim
Raktim Halder
 
GENETIC ALGORITHM
GENETIC ALGORITHMGENETIC ALGORITHM
GENETIC ALGORITHM
Harsh Sinha
 
Flowchart of GA
Flowchart of GAFlowchart of GA
Flowchart of GA
Ishucs
 
Genetic_Algorithm_AI(TU)
Genetic_Algorithm_AI(TU)Genetic_Algorithm_AI(TU)
Genetic_Algorithm_AI(TU)Kapil Khatiwada
 
Genetic algorithms
Genetic algorithmsGenetic algorithms
Genetic algorithmszamakhan
 
Genetic Algorithm by Example
Genetic Algorithm by ExampleGenetic Algorithm by Example
Genetic Algorithm by Example
Nobal Niraula
 
Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithm
Jari Abbas
 
Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
Genetic Algorithm
rabidityfactor
 
Genetic Algorithms
Genetic AlgorithmsGenetic Algorithms
Genetic Algorithmsanas_elf
 
Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithm
garima931
 
Nature-inspired algorithms
Nature-inspired algorithmsNature-inspired algorithms
Nature-inspired algorithms
Lars Marius Garshol
 
MACHINE LEARNING - GENETIC ALGORITHM
MACHINE LEARNING - GENETIC ALGORITHMMACHINE LEARNING - GENETIC ALGORITHM
MACHINE LEARNING - GENETIC ALGORITHM
Puneet Kulyana
 
Genetic Algorithms Made Easy
Genetic Algorithms Made EasyGenetic Algorithms Made Easy
Genetic Algorithms Made Easy
Prakash Pimpale
 
Introduction to Genetic Algorithms
Introduction to Genetic AlgorithmsIntroduction to Genetic Algorithms
Introduction to Genetic Algorithms
Ahmed Othman
 
Genetic Algorithms
Genetic AlgorithmsGenetic Algorithms
Genetic Algorithms
Karthik Sankar
 
Nature-Inspired Optimization Algorithms
Nature-Inspired Optimization Algorithms Nature-Inspired Optimization Algorithms
Nature-Inspired Optimization Algorithms
Xin-She Yang
 
Genetic Algorithms
Genetic AlgorithmsGenetic Algorithms
Genetic Algorithms
adil raja
 

What's hot (20)

Ga ppt (1)
Ga ppt (1)Ga ppt (1)
Ga ppt (1)
 
Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
Genetic Algorithm
 
Genetic algorithm raktim
Genetic algorithm raktimGenetic algorithm raktim
Genetic algorithm raktim
 
GENETIC ALGORITHM
GENETIC ALGORITHMGENETIC ALGORITHM
GENETIC ALGORITHM
 
Flowchart of GA
Flowchart of GAFlowchart of GA
Flowchart of GA
 
Genetic_Algorithm_AI(TU)
Genetic_Algorithm_AI(TU)Genetic_Algorithm_AI(TU)
Genetic_Algorithm_AI(TU)
 
Genetic algorithms
Genetic algorithmsGenetic algorithms
Genetic algorithms
 
Genetic Algorithm by Example
Genetic Algorithm by ExampleGenetic Algorithm by Example
Genetic Algorithm by Example
 
Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithm
 
Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
Genetic Algorithm
 
Genetic Algorithms
Genetic AlgorithmsGenetic Algorithms
Genetic Algorithms
 
Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithm
 
Nature-inspired algorithms
Nature-inspired algorithmsNature-inspired algorithms
Nature-inspired algorithms
 
Evolutionary Computing
Evolutionary ComputingEvolutionary Computing
Evolutionary Computing
 
MACHINE LEARNING - GENETIC ALGORITHM
MACHINE LEARNING - GENETIC ALGORITHMMACHINE LEARNING - GENETIC ALGORITHM
MACHINE LEARNING - GENETIC ALGORITHM
 
Genetic Algorithms Made Easy
Genetic Algorithms Made EasyGenetic Algorithms Made Easy
Genetic Algorithms Made Easy
 
Introduction to Genetic Algorithms
Introduction to Genetic AlgorithmsIntroduction to Genetic Algorithms
Introduction to Genetic Algorithms
 
Genetic Algorithms
Genetic AlgorithmsGenetic Algorithms
Genetic Algorithms
 
Nature-Inspired Optimization Algorithms
Nature-Inspired Optimization Algorithms Nature-Inspired Optimization Algorithms
Nature-Inspired Optimization Algorithms
 
Genetic Algorithms
Genetic AlgorithmsGenetic Algorithms
Genetic Algorithms
 

Similar to Genetic algorithm

Artificial intelligence cs607 handouts lecture 11 - 45
Artificial intelligence   cs607 handouts lecture 11 - 45Artificial intelligence   cs607 handouts lecture 11 - 45
Artificial intelligence cs607 handouts lecture 11 - 45
Sattar kayani
 
Lec 06
Lec 06Lec 06
Lec 06
Nilt1234
 
Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
Genetic Algorithm
Jagadish Mohanty
 
GA.pptx
GA.pptxGA.pptx
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
 
Geneticalgorithms 100403002207-phpapp02
Geneticalgorithms 100403002207-phpapp02Geneticalgorithms 100403002207-phpapp02
Geneticalgorithms 100403002207-phpapp02
Amna Saeed
 
Introduction to Genetic Algorithms
Introduction to Genetic AlgorithmsIntroduction to Genetic Algorithms
Introduction to Genetic Algorithms
Vanessa Camilleri
 
Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
Genetic Algorithm
ESUG
 
CI_L02_Optimization_ag2_eng.pdf
CI_L02_Optimization_ag2_eng.pdfCI_L02_Optimization_ag2_eng.pdf
CI_L02_Optimization_ag2_eng.pdf
SantiagoGarridoBulln
 
Ff meeting 25nov03
Ff meeting 25nov03Ff meeting 25nov03
Ff meeting 25nov03
moniajit
 
Genetic algorithm_raktim_IITKGP
Genetic algorithm_raktim_IITKGP Genetic algorithm_raktim_IITKGP
Genetic algorithm_raktim_IITKGP Raktim Halder
 
CSA 3702 machine learning module 4
CSA 3702 machine learning module 4CSA 3702 machine learning module 4
CSA 3702 machine learning module 4
Nandhini S
 
Lec 7 genetic algorithms
Lec 7 genetic algorithmsLec 7 genetic algorithms
Lec 7 genetic algorithms
Eyob Sisay
 
Genetic Algorithm
Genetic Algorithm Genetic Algorithm
Genetic Algorithm
Bhushan Mohite
 
Cost Optimized Design Technique for Pseudo-Random Numbers in Cellular Automata
Cost Optimized Design Technique for Pseudo-Random Numbers in Cellular AutomataCost Optimized Design Technique for Pseudo-Random Numbers in Cellular Automata
Cost Optimized Design Technique for Pseudo-Random Numbers in Cellular Automata
ijait
 
Machine Learning on Azure - AzureConf
Machine Learning on Azure - AzureConfMachine Learning on Azure - AzureConf
Machine Learning on Azure - AzureConf
Seth Juarez
 
Data Science - Part XIV - Genetic Algorithms
Data Science - Part XIV - Genetic AlgorithmsData Science - Part XIV - Genetic Algorithms
Data Science - Part XIV - Genetic Algorithms
Derek Kane
 
introduction of genetic algorithm
introduction of genetic algorithmintroduction of genetic algorithm
introduction of genetic algorithm
ritambharaaatre
 
Introduction to Genetic algorithms
Introduction to Genetic algorithmsIntroduction to Genetic algorithms
Introduction to Genetic algorithms
Akhil Kaushik
 
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
Lahiru Dilshan
 

Similar to Genetic algorithm (20)

Artificial intelligence cs607 handouts lecture 11 - 45
Artificial intelligence   cs607 handouts lecture 11 - 45Artificial intelligence   cs607 handouts lecture 11 - 45
Artificial intelligence cs607 handouts lecture 11 - 45
 
Lec 06
Lec 06Lec 06
Lec 06
 
Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
Genetic Algorithm
 
GA.pptx
GA.pptxGA.pptx
GA.pptx
 
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...
 
Geneticalgorithms 100403002207-phpapp02
Geneticalgorithms 100403002207-phpapp02Geneticalgorithms 100403002207-phpapp02
Geneticalgorithms 100403002207-phpapp02
 
Introduction to Genetic Algorithms
Introduction to Genetic AlgorithmsIntroduction to Genetic Algorithms
Introduction to Genetic Algorithms
 
Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
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
 
Ff meeting 25nov03
Ff meeting 25nov03Ff meeting 25nov03
Ff meeting 25nov03
 
Genetic algorithm_raktim_IITKGP
Genetic algorithm_raktim_IITKGP Genetic algorithm_raktim_IITKGP
Genetic algorithm_raktim_IITKGP
 
CSA 3702 machine learning module 4
CSA 3702 machine learning module 4CSA 3702 machine learning module 4
CSA 3702 machine learning module 4
 
Lec 7 genetic algorithms
Lec 7 genetic algorithmsLec 7 genetic algorithms
Lec 7 genetic algorithms
 
Genetic Algorithm
Genetic Algorithm Genetic Algorithm
Genetic Algorithm
 
Cost Optimized Design Technique for Pseudo-Random Numbers in Cellular Automata
Cost Optimized Design Technique for Pseudo-Random Numbers in Cellular AutomataCost Optimized Design Technique for Pseudo-Random Numbers in Cellular Automata
Cost Optimized Design Technique for Pseudo-Random Numbers in Cellular Automata
 
Machine Learning on Azure - AzureConf
Machine Learning on Azure - AzureConfMachine Learning on Azure - AzureConf
Machine Learning on Azure - AzureConf
 
Data Science - Part XIV - Genetic Algorithms
Data Science - Part XIV - Genetic AlgorithmsData Science - Part XIV - Genetic Algorithms
Data Science - Part XIV - Genetic Algorithms
 
introduction of genetic algorithm
introduction of genetic algorithmintroduction of genetic algorithm
introduction of genetic algorithm
 
Introduction to Genetic algorithms
Introduction to Genetic algorithmsIntroduction to Genetic algorithms
Introduction to Genetic algorithms
 
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
 

More from Syed Muhammad Zeejah Hashmi

Corporate social responsibility
Corporate social responsibilityCorporate social responsibility
Corporate social responsibility
Syed Muhammad Zeejah Hashmi
 
Digital divide
Digital divideDigital divide
Human development index (HDI)
Human development index (HDI)Human development index (HDI)
Human development index (HDI)
Syed Muhammad Zeejah Hashmi
 
Meeting Scheduler using android and web application (UML Diagrams)
Meeting Scheduler using android and web application (UML Diagrams)Meeting Scheduler using android and web application (UML Diagrams)
Meeting Scheduler using android and web application (UML Diagrams)
Syed Muhammad Zeejah Hashmi
 
Android controller by SMS [control one android phone from another]
Android controller by SMS [control one android phone from another]Android controller by SMS [control one android phone from another]
Android controller by SMS [control one android phone from another]
Syed Muhammad Zeejah Hashmi
 
Online Job Portal (UML Diagrams)
Online Job Portal (UML Diagrams)Online Job Portal (UML Diagrams)
Online Job Portal (UML Diagrams)
Syed Muhammad Zeejah Hashmi
 
Khalil Gibran by Zee Production
Khalil Gibran by Zee ProductionKhalil Gibran by Zee Production
Khalil Gibran by Zee Production
Syed Muhammad Zeejah Hashmi
 
Can ethics be taught..!!
Can ethics be taught..!!Can ethics be taught..!!
Can ethics be taught..!!
Syed Muhammad Zeejah Hashmi
 
Can ethics be taught.?
Can ethics be taught.?Can ethics be taught.?
Can ethics be taught.?
Syed Muhammad Zeejah Hashmi
 
Co-factor matrix..
Co-factor matrix..Co-factor matrix..
Co-factor matrix..
Syed Muhammad Zeejah Hashmi
 
Importance of learning business communication skills
Importance of learning business communication skillsImportance of learning business communication skills
Importance of learning business communication skills
Syed Muhammad Zeejah Hashmi
 
Accounting Project
Accounting ProjectAccounting Project
Accounting Project
Syed Muhammad Zeejah Hashmi
 
Poverty
PovertyPoverty
MIS chap # 11.....
MIS chap # 11.....MIS chap # 11.....
MIS chap # 11.....
Syed Muhammad Zeejah Hashmi
 
MIS chap # 10..
MIS chap # 10..MIS chap # 10..
MIS chap # 9.....
MIS chap # 9.....MIS chap # 9.....
MIS chap # 9.....
Syed Muhammad Zeejah Hashmi
 
MIS chap # 8.....
MIS chap # 8.....MIS chap # 8.....
MIS chap # 8.....
Syed Muhammad Zeejah Hashmi
 
MIS Chap # 7.....
MIS Chap # 7.....MIS Chap # 7.....
MIS Chap # 7.....
Syed Muhammad Zeejah Hashmi
 
MIS chap # 6....
MIS chap # 6....MIS chap # 6....
MIS chap # 6....
Syed Muhammad Zeejah Hashmi
 
MIS Chap # 5...
MIS Chap # 5...MIS Chap # 5...

More from Syed Muhammad Zeejah Hashmi (20)

Corporate social responsibility
Corporate social responsibilityCorporate social responsibility
Corporate social responsibility
 
Digital divide
Digital divideDigital divide
Digital divide
 
Human development index (HDI)
Human development index (HDI)Human development index (HDI)
Human development index (HDI)
 
Meeting Scheduler using android and web application (UML Diagrams)
Meeting Scheduler using android and web application (UML Diagrams)Meeting Scheduler using android and web application (UML Diagrams)
Meeting Scheduler using android and web application (UML Diagrams)
 
Android controller by SMS [control one android phone from another]
Android controller by SMS [control one android phone from another]Android controller by SMS [control one android phone from another]
Android controller by SMS [control one android phone from another]
 
Online Job Portal (UML Diagrams)
Online Job Portal (UML Diagrams)Online Job Portal (UML Diagrams)
Online Job Portal (UML Diagrams)
 
Khalil Gibran by Zee Production
Khalil Gibran by Zee ProductionKhalil Gibran by Zee Production
Khalil Gibran by Zee Production
 
Can ethics be taught..!!
Can ethics be taught..!!Can ethics be taught..!!
Can ethics be taught..!!
 
Can ethics be taught.?
Can ethics be taught.?Can ethics be taught.?
Can ethics be taught.?
 
Co-factor matrix..
Co-factor matrix..Co-factor matrix..
Co-factor matrix..
 
Importance of learning business communication skills
Importance of learning business communication skillsImportance of learning business communication skills
Importance of learning business communication skills
 
Accounting Project
Accounting ProjectAccounting Project
Accounting Project
 
Poverty
PovertyPoverty
Poverty
 
MIS chap # 11.....
MIS chap # 11.....MIS chap # 11.....
MIS chap # 11.....
 
MIS chap # 10..
MIS chap # 10..MIS chap # 10..
MIS chap # 10..
 
MIS chap # 9.....
MIS chap # 9.....MIS chap # 9.....
MIS chap # 9.....
 
MIS chap # 8.....
MIS chap # 8.....MIS chap # 8.....
MIS chap # 8.....
 
MIS Chap # 7.....
MIS Chap # 7.....MIS Chap # 7.....
MIS Chap # 7.....
 
MIS chap # 6....
MIS chap # 6....MIS chap # 6....
MIS chap # 6....
 
MIS Chap # 5...
MIS Chap # 5...MIS Chap # 5...
MIS Chap # 5...
 

Recently uploaded

How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 

Recently uploaded (20)

How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 

Genetic algorithm

  • 2. What is Genetic Algorithms? Genetic Algorithms (GAs) are adaptive heuristic search algorithm based on the evolutionary ideas of natural selection and genetics. As such they represent an intelligent exploitation of a random search used to solve optimization problems. Although randomised, GAs are by no means random, instead they exploit historical information to direct the search into the region of better performance within the search space. The basic techniques of the GAs are designed to simulate processes in natural systems necessary for evolution, specially those follow the principles first laid down by Charles Darwin of "survival of the fittest.". Since in nature, competition among individuals for scanty resources results in the fittest individuals dominating over the weaker ones.
  • 3. Why Genetic Algorithms? It is better than conventional AI in that it is more robust. Unlike older AI systems, they do not break easily even if the inputs changed slightly, or in the presence of reasonable noise. Also, in searching a large state- space, multi-modal state-space, or n-dimensional surface, a genetic algorithm may offer significant benefits over more typical search of optimization techniques. (linear programming, heuristic, depth-first, breath-first, and praxis.)
  • 4. Genetic Algorithms Overview GAs simulate the survival of the fittest among individuals over consecutive generation for solving a problem. Each generation consists of a population of character strings that are analogous to the chromosome that we see in our DNA. Each individual represents a point in a search space and a possible solution. The individuals in the population are then made to go through a process of evolution. GAs are based on an analogy with the genetic structure and behaviour of chromosomes within a population of individuals using the following foundations: • Individuals in a population compete for resources and mates. • Those individuals most successful in each 'competition' will produce more offspring than those individuals that perform poorly. • Genes from `good' individuals propagate throughout the population so that two good parents will sometimes produce offspring that are better than either parent. • Thus each successive generation will become more suited to their environment.
  • 6. Population Mutation Crossover Genotype to Phenotype Fitness 88 66 24 Fitness to Probability 0.8 0.1 Selection New Generation
  • 7. Implementation Details After an initial population is randomly generated, the algorithm evolves the through three operators: • selection which equates to survival of the fittest; • crossover which represents mating between individuals; • mutation which introduces random modifications.
  • 8. 1. Selection Operator • key idea: give preference to better individuals, allowing them to pass on their genes to the next generation. • The goodness of each individual depends on its fitness. • Fitness may be determined by an objective function or by a subjective judgement.
  • 9. 2. Crossover Operator • Prime distinguished factor of GA from other optimization techniques • Two individuals are chosen from the population using the selection operator • A crossover site along the bit strings is randomly chosen • The values of the two strings are exchanged up to this point • If S1=000000 and s2=111111 and the crossover point is 2 then S1'=110000 and s2'=001111 • The two new offspring created from this mating are put into the next generation of the population • By recombining portions of good individuals, this process is likely to create even better individuals
  • 11. 3. Mutation Operator • With some low probability, a portion of the new individuals will have some of their bits flipped. • Its purpose is to maintain diversity within the population and inhibit premature convergence. • Mutation alone induces a random walk through the search space • Mutation and selection (without crossover) create a parallel, noise- tolerant, hill-climbing algorithms
  • 12. Effects of Genetic Operators • Using selection alone will tend to fill the population with copies of the best individual from the population • Using selection and crossover operators will tend to cause the algorithms to converge on a good but sub-optimal solution • Using mutation alone induces a random walk through the search space. • Using selection and mutation creates a parallel, noise-tolerant, hill climbing algorithm
  • 13. The Algorithms 1. randomly initialize population(t) 2. determine fitness of population(t) 3. repeat 1. select parents from population(t) 2. perform crossover on parents creating population(t+1) 3. perform mutation of population(t+1) 4. determine fitness of population(t+1) 4. until best individual is good enough
  • 15.
  • 16.
  • 17.
  • 18.
  • 19. GENETIC ALGORITHM Evaluation/Fitness Function It is used to determine the fitness of a chromosome Creating a good fitness function is one of the challenging tasks of using GA
  • 20. Fitness Function The fitness function can be the score of the classification accuracy of the rule-set over a set of provided training examples Often other criteria may be included as well, such as the complexity of the rules or the size of the rule set GENETIC ALGORITHM
  • 21.
  • 22.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29. • Two-point crossover at point 3 and 5 P1 = 101 00 10 = O1 = 101 10 10 P2 = 011 10 01 O2 = 011 00 01
  • 30.
  • 32. 32 Simple example • Suppose your “organisms” are 32-bit computer words • You want a string in which all the bits are ones • Here’s how you can do it: • Create 100 randomly generated computer words • Repeatedly do the following: • Count the 1 bits in each word • Exit if any of the words have all 32 bits set to 1 • Keep the ten words that have the most 1s (discard the rest) • From each word, generate 9 new words as follows: • Pick a random bit in the word and toggle (change) it • Note that this procedure does not guarantee that the next “generation” will have more 1 bits, but it’s likely
  • 33. Realistic Example • Suppose you have a large number of (x, y) data points • For example, (1, 4), (3, 9), (5, 8), ... • You would like to fit a polynomial (of up to degree 1) through these data points • That is, you want a formula y = mx + c that gives you a reasonably good fit to the actual data • Here’s the usual way to compute goodness of fit: • Compute the sum of (actual y – predicted y)2 for all the data points • The lowest sum represents the best fit • You can use a genetic algorithm to find a “pretty good” solution
  • 34. Realistic Example • Your formula is y = mx + c • Your unknowns are m and c; where m and c are integers • Your representation is the array [m, c] • Your evaluation function for one array is: • For every actual data point (x, y) • Compute ý = mx + c • Find the sum of (y – ý)2 over all x • The sum is your measure of “badness” (larger numbers are worse) • Example: For [m,c] = [5, 7] and the data points (1, 10) and (2, 13): • ý = 5x + 7 = 12 when x is 1 • ý = 5x + 7 = 17 when x is 2 • Now compute the badness (10 - 12)2 + (13 – 17)2 = 22 + 42 = 20 • If these are the only two data points, the “badness” of [5, 7] is 20
  • 35. Realistic Example • Your GA might be as follows: • Create two-element arrays of random numbers • Repeat 50 times (or any other number): • For each of the arrays, compute its badness (using all data points) • Keep the best arrays (with low badness) • From the arrays you keep, generate new arrays as follows: • Convert the numbers in the array to binary, toggle one of the bits at random • Quit if the badness of any of the solution is zero • After all 50 trials, pick the best array as your final answer
  • 36. Realistic Example • (x, y) : {(1,5) (3, 9)} • [2 7][1 3] (initial random population, where m and c represent genes) • ý = 2x + 7 = 9 when x is 1 • ý = 2x + 7 = 13 when x is 3 • Badness: (5 – 9)2 + (9 – 13)2 = 42 + 42 = 32 • ý = 1x + 3 = 4 when x is 1 • ý = 1x + 3 = 6 when x is 3 • Badness: (5 – 4)2 + (9 – 6)2 = 12 + 32 = 10 • Now, lets keep the one with low “badness” [1 3] • Binary representation [001 011] • Apply mutation to generate new arrays [011 011] • Now we have [1 3] [3 3] as the new population considering that we keep the two best individuals
  • 37. Realistic Example • (x, y) : {(1,5) (3, 9)} • [1 3][3 3] (current population) • ý = 1x + 3 = 4 when x is 1 • ý = 1x + 3 = 6 when x is 3 • Badness: (5 – 4)2 + (9 – 6)2 = 1 + 9 = 10 • ý = 3x + 3 = 6 when x is 1 • ý = 3x + 3 = 12 when x is 3 • Badness: (5 – 6)2 + (9 – 12)2 = 1 + 9 = 10 • Lets keep the [3 3] • Representation [011 011] • Apply mutation to generate new arrays [010 011] i.e. [2,3] • Now we have [3 3] [2 3] as the new population
  • 38. Realistic Example • (x, y) : {(1,5) (3, 9)} • [3 3][2 3] (current population) • ý = 3x + 3 = 6 when x is 1 • ý = 3x + 3 = 12 when x is 3 • Badness: (5 – 6)2 + (9 – 12)2 = 1 + 9 = 10 • ý = 2x + 3 = 5 when x is 1 • ý = 2x + 3 = 9 when x is 3 • Badness: (5 – 5)2 + (9 – 9)2 = 02 + 02 = 0 • Solution found [2 3] • y = 2x+3 • Note: It is not necessary that the badness must always be zero. It can be some other threshold value as well.
  • 39. GENETIC ALGORITHM Reproduction Operators: Crossover Crossover operation takes two candidate solutions and divides them, swapping components to produce two new candidates
  • 40. GENETIC ALGORITHM Reproduction Operators: Crossover Figure illustrates crossover on bit string patterns of length 8 The operator splits them and forms two children whose initial segment comes from one parent and whose tail comes from the other Input Bit Strings 1 1 # 0 1 0 1 # # 1 1 0 # 0 # 1 Resulting Strings 1 1 # 0 # 0 # 1 # 1 1 0 1 0 1 #
  • 41. GENETIC ALGORITHM Reproduction Operators: Crossover The place of split in the candidate solution is an arbitrary choice. This split may be at any point in the solution This splitting point may be randomly chosen or changed systematically during the solution process Crossover can unite an individual that is doing well in one dimension with another individual that is doing well in the other dimension
  • 42. GENETIC ALGORITHM Reproduction Operators: Crossover Two types: Single point crossover & Uniform crossover Single type crossover This operator takes two parents and randomly selects a single point between two genes to cut both chromosomes into two parts (this point is called cut point) The first part of the first parent is combined with the second part of the second parent to create the first child The first part of the second parent is combined with the second part of first parent to create the second child 1000010 1000001 1110001 1110010
  • 43. GENETIC ALGORITHM Reproduction Operators: Crossover Uniform crossover The value of each gene of an offspring’s chromosome is randomly taken from either parent This is equivalent to multiple point crossover 1000010 1110001 1010010
  • 44. 44 GENETIC ALGORITHM Example Find a number: 001010 You have guessed this binary number. If you write a program to find it, then there are 26 = 64 possibilities If you find it with the help of Genetic Algorithm, then the program gives a number and you tell its fitness The fitness score is the number of correctly guessed bits
  • 45. 45 GENETIC ALGORITHM Example Find a number: 001010 Step 1. Chromosomes produced. A) 010101 - 1 B) 111101 - 1 C) 011011 - 4 * D) 101100 - 3 * Best ones C & D
  • 46. 46 GENETIC ALGORITHM Example Find a number: 001010 Mating New Variants Evaluation C) 01:1011 01:1100 (E) 3 D) 10:1100 10:1011 (F) 4 * C) 0110:11 0110:00 (G) 4 * D) 1011:00 1011:11 (H) 3 Selection of F & G
  • 47. 47 GENETIC ALGORITHM Example Mating New Variants Evaluation F) 1:01011 1:11000 (H) 3 G) 0:11000 0:01011 (I) 5 * F) 101:011 101:000 (J) 4 * G) 011:000 011:011 (K) 4 Selection of I and J
  • 48. 48 GENETIC ALGORITHM Example Mating New Variants Evaluation I) 0010:11 0010:00 (L) 5 J) 1010:00 1010:11 (M) 4 I) 00101:1 00101:0 (N) 6 (success) * J) 10100:0 10100:1 (O) 3 In this game success was achieved after 16 questions, which is 4 times faster then checking all possible 26 = 64 combination
  • 49. 49 GENETIC ALGORITHM Example Mutation was not used in this example. Mutation would have been necessary, if, e.g. there was a 0 in the third bit of all 3 initial individuals. In that case no matter how the individuals are combined, we can never change this bit into 1. Mutation takes evolution out of a dead end.