SlideShare a Scribd company logo
1 of 16
Genetic Algorithm
40
states
(often encoded as a string of 0s and 1s)
better states.
crossover, and mutation
Genetic/ Evolutionary algorithms
 Developed by John Holland in 1975
 inspired by biological mutation & evolution
 stochastic (means non-deterministic) search techniques
based on the mechanism of natural selection and genetics
 A successor state is generated by combining two parent
 Start with k randomly generated states (population)
 A state is represented as a string over a finite alphabet
 Evaluation function (fitness function). Higher values for
 Produce the next generation of states by selection,
CSE, IUT
43
“Select The Best, Discard The Rest”
 fitness function is upto user (problem specific)-
means to evaluate the potential of a candidate in
the population. e.g. for a binary representation
fitness function could be:
 f(i) = ∑i f(i) ;where i is from 1 to l (l=total length of the sequence)
 And in the selection step, the probability of getting
selection for a candidate is:
 Prob i = f(i) / ∑i f(i)
CSE, IUT
44
Encoding
The process of representing the solution in the form of a string that
conveys the necessary information.
 Binary Encoding – Most common method of encoding.
Chromosomes are strings of 1s and 0s and each position in the
chromosome represents a particular characteristic of the problem.
Permutation Encoding – Useful in ordering problems such as the
Traveling Salesman Problem (TSP). Example. In TSP, every
chromosome is a string of numbers, each of which represents a city to
be visited.
 Value Encoding – Used in problems where complicated values, such
as real numbers, are used and where binary encoding would not suffice.
CSE, IUT
45
e.g. n-queen
 GA representation and encoding of the following
arrangement can be written as: fitness of the chromosome
v1 (24748552) is 28 – 4 = 24 (No. of non attacking pair of queens)
• Encoding is given by the row no. of each column.
 That is because only 4 pairs of queens attack each other:
 The queens on 1st and 8th column
 The queens on 2nd and 4th column
 The queens on 6th and 7th column
 The queens on 3rd and 8th column
CSE, IUT
46
Genetic algorithms
 Fitness function: number of non-attacking pairs of queens
(min = 0, max = 8c2 excluding same pair = 28)
 24/(24+23+20+11) = 31%

 23/(24+23+20+11) = 29% etc
 Here single point crossover & mutation occurred
CSE, IUT
41
Genetic/ Evolutionary algorithms
 Outline of the Basic Genetic Algorithm
1 [Start] Generate random population of n chromosomes (suitable solutions for the
problem)
2 [Fitness] Evaluate the fitness f(x) of each chromosome x in the population
3 [New population] Create a new population by repeating following steps until the new
population is complete
 [Selection] Select two parent chromosomes from a population according to their
fitness (the better fitness, the bigger chance to be selected)
 [Crossover] With a crossover probability cross over the parents to form a new
offspring (children). If no crossover was performed, offspring is an exact copy of
parents.
 [Mutation] With a mutation probability mutate new offspring at each locus (position
in chromosome).
 [Accepting] Place new offspring in a new population (keep population size constant)
4 [Replace] Use new generated population for a further run of algorithm
5 [Test] If the end condition is satisfied, stop, and return the best solution in current
population
 [Loop] Go to step 3
CSE, IUT
41
Genetic/ Evolutionary algorithms
CSE, IUT
47
Genetic algorithms
By doing this Crossover, it helps to accelerate the search at an
early stage of evolution
For detail about genetic algorithm refer to GA1.pdf in
ftp://10.220.20.25/CSE 4701
CSE, IUT
48
Another Example
(Assignment 1: Deadline 15 Feb, 2018)
 Data population: RGB colours
 Aim: to obtain darkest colour represented by
(0, 0, 0)
 This is a minimisation problem, i.e. a good
colour is one that fits for (colour) --> 0.
 We now tabulate our data as shown
CSE, IUT
49
 Start at a random pattern like this:
Colour Red Green Blue
C1 80 170 689
C2 130 690 15
C3 24 8 317
where
Fitness for (C1) = 80 + 170 + 689 = 939
Fitness for (C2) = 130 + 690 + 15 = 835
Fitness for (C3) = 24 + 8 + 317 = 349
CSE, IUT
50
Fitness (C2) = 130 + 690 + 15 = 835
C1
 Start at a random pattern like this:
Colour Red Green Blue
C1 80 170 689
C2 130 690 15
C3 24 8 317
FITTEST
PLACED TOP
C3
Fitness (C1) = 80 + 170 + 689 = 939
C2
Fitness (C3) = 24 + 8 + 317 = 349
CSE, IUT
51
 After a Selection is done on the sample:
** Remember, this is a minimisation problem..
Colour Fitness
C3 349
C2 835
C1 939
CSE, IUT
52
C4 24 8 15C4 is crossover(C3,C2)= (24, 8, 15)
C6 is crossover(C2,C1)= (130, 690, 689)
GA: Reproduction & Crossover
 So far, we have this
Colour Red Green Blue Colour Fitness
C1 80 170 689 C3 349
C2 130 690 15 C2 835
C3 24 8 317 C1 939
Next step is to reproduce the pattern, like this,
by crossing over:
Colour Red Green Blue
C5 is crossover(C3,C1)= (24, 8, 689)
C5 24 8 689
C6 130 690 689
CSE, IUT
53
 perform mutation, and we have
C7 is obtained by mutating(4) =(24, 8, 13)
C8 is obtained by mutating(5) =(25, 9, 689 )
C9 is obtained by mutating(6) =(128, 688, 689)
Colour Red Green Blue
New population of C7 24 8 13
3 chromosomes C8 25 9 689
C9 128 688 689
CSE, IUT
54
Conclusion (up to “mutation” to get a new data set)
 Some solutions have improved (after first iteration):
Getting better rather fast
Slightly improved of the answer
Fitness for C7 = (24 + 8 + 13) = 45
Fitness for C8 = (25 + 9 + 689) = 743
Fitness for C9 = (128 + 688 + 689 ) = 1505
If the process is iterated, population will converge to
have fitness near to zero (colour) --> 0.
Continue..............
CSE, IUT

More Related Content

What's hot

Genetic Algorithms for optimization
Genetic Algorithms for optimizationGenetic Algorithms for optimization
Genetic Algorithms for optimizationFethi Candan
 
Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithmgarima931
 
GENETIC ALGORITHM
GENETIC ALGORITHM GENETIC ALGORITHM
GENETIC ALGORITHM Abhishek Sur
 
Genetic_Algorithm_AI(TU)
Genetic_Algorithm_AI(TU)Genetic_Algorithm_AI(TU)
Genetic_Algorithm_AI(TU)Kapil Khatiwada
 
Genetic algorithms
Genetic algorithmsGenetic algorithms
Genetic algorithmsguest9938738
 
Genetic algorithms
Genetic algorithmsGenetic algorithms
Genetic algorithmszamakhan
 
Genetic Algorithms - Artificial Intelligence
Genetic Algorithms - Artificial IntelligenceGenetic Algorithms - Artificial Intelligence
Genetic Algorithms - Artificial IntelligenceSahil Kumar
 
Introduction to Genetic algorithm
Introduction to Genetic algorithmIntroduction to Genetic algorithm
Introduction to Genetic algorithmHEENA GUPTA
 
Genetic algorithms in Data Mining
Genetic algorithms in Data MiningGenetic algorithms in Data Mining
Genetic algorithms in Data MiningAtul Khanna
 
Genetic algorithms
Genetic algorithmsGenetic algorithms
Genetic algorithmsSaiful Islam
 
Genetic algorithm fitness function
Genetic algorithm fitness functionGenetic algorithm fitness function
Genetic algorithm fitness functionProf Ansari
 
Application of Genetic Algorithm in Software Testing
Application of Genetic Algorithm in Software TestingApplication of Genetic Algorithm in Software Testing
Application of Genetic Algorithm in Software TestingGhanshyam Yadav
 
GENETIC ALGORITHM ( GA )
GENETIC ALGORITHM ( GA )GENETIC ALGORITHM ( GA )
GENETIC ALGORITHM ( GA )abuamo
 
Introduction to Genetic Algorithm
Introduction to Genetic Algorithm Introduction to Genetic Algorithm
Introduction to Genetic Algorithm ramyaravindran12
 

What's hot (20)

Genetic Algorithms for optimization
Genetic Algorithms for optimizationGenetic Algorithms for optimization
Genetic Algorithms for optimization
 
Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
Genetic Algorithm
 
Modified Genetic Algorithm for Solving n-Queens Problem
Modified Genetic Algorithm for Solving n-Queens ProblemModified Genetic Algorithm for Solving n-Queens Problem
Modified Genetic Algorithm for Solving n-Queens Problem
 
Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithm
 
GENETIC ALGORITHM
GENETIC ALGORITHM GENETIC ALGORITHM
GENETIC ALGORITHM
 
Genetic_Algorithm_AI(TU)
Genetic_Algorithm_AI(TU)Genetic_Algorithm_AI(TU)
Genetic_Algorithm_AI(TU)
 
Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
Genetic Algorithm
 
Genetic algorithms
Genetic algorithmsGenetic algorithms
Genetic algorithms
 
Genetic algorithms
Genetic algorithmsGenetic algorithms
Genetic algorithms
 
Genetic Algorithms - Artificial Intelligence
Genetic Algorithms - Artificial IntelligenceGenetic Algorithms - Artificial Intelligence
Genetic Algorithms - Artificial Intelligence
 
Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithm
 
Introduction to Genetic Algorithms
Introduction to Genetic AlgorithmsIntroduction to Genetic Algorithms
Introduction to Genetic Algorithms
 
Introduction to Genetic algorithm
Introduction to Genetic algorithmIntroduction to Genetic algorithm
Introduction to Genetic algorithm
 
Genetic algorithms in Data Mining
Genetic algorithms in Data MiningGenetic algorithms in Data Mining
Genetic algorithms in Data Mining
 
Genetic algorithms
Genetic algorithmsGenetic algorithms
Genetic algorithms
 
Genetic algorithm fitness function
Genetic algorithm fitness functionGenetic algorithm fitness function
Genetic algorithm fitness function
 
Differential evolution
Differential evolutionDifferential evolution
Differential evolution
 
Application of Genetic Algorithm in Software Testing
Application of Genetic Algorithm in Software TestingApplication of Genetic Algorithm in Software Testing
Application of Genetic Algorithm in Software Testing
 
GENETIC ALGORITHM ( GA )
GENETIC ALGORITHM ( GA )GENETIC ALGORITHM ( GA )
GENETIC ALGORITHM ( GA )
 
Introduction to Genetic Algorithm
Introduction to Genetic Algorithm Introduction to Genetic Algorithm
Introduction to Genetic Algorithm
 

Similar to Genetic algorithm

ML.ppt
ML.pptML.ppt
ML.pptbutest
 
An Improved Iterative Method for Solving General System of Equations via Gene...
An Improved Iterative Method for Solving General System of Equations via Gene...An Improved Iterative Method for Solving General System of Equations via Gene...
An Improved Iterative Method for Solving General System of Equations via Gene...Zac Darcy
 
An Improved Iterative Method for Solving General System of Equations via Gene...
An Improved Iterative Method for Solving General System of Equations via Gene...An Improved Iterative Method for Solving General System of Equations via Gene...
An Improved Iterative Method for Solving General System of Equations via Gene...Zac Darcy
 
Latin square design
Latin square designLatin square design
Latin square designRojin Khadka
 
Two methods for optimising cognitive model parameters
Two methods for optimising cognitive model parametersTwo methods for optimising cognitive model parameters
Two methods for optimising cognitive model parametersUniversity of Huddersfield
 
The Concurrent Constraint Programming Research Programmes -- Redux (part2)
The Concurrent Constraint Programming Research Programmes -- Redux (part2)The Concurrent Constraint Programming Research Programmes -- Redux (part2)
The Concurrent Constraint Programming Research Programmes -- Redux (part2)Pierre Schaus
 
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 Automataijait
 
Lecture7 cross validation
Lecture7 cross validationLecture7 cross validation
Lecture7 cross validationStéphane Canu
 
Chapter09.ppt
Chapter09.pptChapter09.ppt
Chapter09.pptbutest
 
AN IMPROVED ITERATIVE METHOD FOR SOLVING GENERAL SYSTEM OF EQUATIONS VIA GENE...
AN IMPROVED ITERATIVE METHOD FOR SOLVING GENERAL SYSTEM OF EQUATIONS VIA GENE...AN IMPROVED ITERATIVE METHOD FOR SOLVING GENERAL SYSTEM OF EQUATIONS VIA GENE...
AN IMPROVED ITERATIVE METHOD FOR SOLVING GENERAL SYSTEM OF EQUATIONS VIA GENE...Zac Darcy
 
Parallel Computing 2007: Bring your own parallel application
Parallel Computing 2007: Bring your own parallel applicationParallel Computing 2007: Bring your own parallel application
Parallel Computing 2007: Bring your own parallel applicationGeoffrey Fox
 
Devnology Workshop Genpro 2 feb 2011
Devnology Workshop Genpro 2 feb 2011Devnology Workshop Genpro 2 feb 2011
Devnology Workshop Genpro 2 feb 2011Devnology
 
Inria Tech Talk - La classification de données complexes avec MASSICCC
Inria Tech Talk - La classification de données complexes avec MASSICCCInria Tech Talk - La classification de données complexes avec MASSICCC
Inria Tech Talk - La classification de données complexes avec MASSICCCStéphanie Roger
 

Similar to Genetic algorithm (20)

04 1 evolution
04 1 evolution04 1 evolution
04 1 evolution
 
ML.ppt
ML.pptML.ppt
ML.ppt
 
An Improved Iterative Method for Solving General System of Equations via Gene...
An Improved Iterative Method for Solving General System of Equations via Gene...An Improved Iterative Method for Solving General System of Equations via Gene...
An Improved Iterative Method for Solving General System of Equations via Gene...
 
An Improved Iterative Method for Solving General System of Equations via Gene...
An Improved Iterative Method for Solving General System of Equations via Gene...An Improved Iterative Method for Solving General System of Equations via Gene...
An Improved Iterative Method for Solving General System of Equations via Gene...
 
Latin square design
Latin square designLatin square design
Latin square design
 
Practice test1 solution
Practice test1 solutionPractice test1 solution
Practice test1 solution
 
Two methods for optimising cognitive model parameters
Two methods for optimising cognitive model parametersTwo methods for optimising cognitive model parameters
Two methods for optimising cognitive model parameters
 
03raster 1
03raster 103raster 1
03raster 1
 
The Concurrent Constraint Programming Research Programmes -- Redux (part2)
The Concurrent Constraint Programming Research Programmes -- Redux (part2)The Concurrent Constraint Programming Research Programmes -- Redux (part2)
The Concurrent Constraint Programming Research Programmes -- Redux (part2)
 
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
 
P1121133727
P1121133727P1121133727
P1121133727
 
Genetic Algorithm in Hill Cipher Encryption
Genetic Algorithm in Hill Cipher EncryptionGenetic Algorithm in Hill Cipher Encryption
Genetic Algorithm in Hill Cipher Encryption
 
Lecture7 cross validation
Lecture7 cross validationLecture7 cross validation
Lecture7 cross validation
 
Chapter09.ppt
Chapter09.pptChapter09.ppt
Chapter09.ppt
 
AN IMPROVED ITERATIVE METHOD FOR SOLVING GENERAL SYSTEM OF EQUATIONS VIA GENE...
AN IMPROVED ITERATIVE METHOD FOR SOLVING GENERAL SYSTEM OF EQUATIONS VIA GENE...AN IMPROVED ITERATIVE METHOD FOR SOLVING GENERAL SYSTEM OF EQUATIONS VIA GENE...
AN IMPROVED ITERATIVE METHOD FOR SOLVING GENERAL SYSTEM OF EQUATIONS VIA GENE...
 
Parallel Computing 2007: Bring your own parallel application
Parallel Computing 2007: Bring your own parallel applicationParallel Computing 2007: Bring your own parallel application
Parallel Computing 2007: Bring your own parallel application
 
Devnology Workshop Genpro 2 feb 2011
Devnology Workshop Genpro 2 feb 2011Devnology Workshop Genpro 2 feb 2011
Devnology Workshop Genpro 2 feb 2011
 
Inria Tech Talk - La classification de données complexes avec MASSICCC
Inria Tech Talk - La classification de données complexes avec MASSICCCInria Tech Talk - La classification de données complexes avec MASSICCC
Inria Tech Talk - La classification de données complexes avec MASSICCC
 
Hamlet_Khachatryan_57--61
Hamlet_Khachatryan_57--61Hamlet_Khachatryan_57--61
Hamlet_Khachatryan_57--61
 
Prac excises 3[1].5
Prac excises 3[1].5Prac excises 3[1].5
Prac excises 3[1].5
 

More from Bablu Shofi

Informed search (heuristics)
Informed search (heuristics)Informed search (heuristics)
Informed search (heuristics)Bablu Shofi
 
Uninformed search
Uninformed searchUninformed search
Uninformed searchBablu Shofi
 
Data linkcontrol
Data linkcontrolData linkcontrol
Data linkcontrolBablu Shofi
 
Inventory Management
Inventory ManagementInventory Management
Inventory ManagementBablu Shofi
 

More from Bablu Shofi (7)

Cyber security
Cyber securityCyber security
Cyber security
 
Informed search (heuristics)
Informed search (heuristics)Informed search (heuristics)
Informed search (heuristics)
 
Uninformed search
Uninformed searchUninformed search
Uninformed search
 
computer-memory
computer-memorycomputer-memory
computer-memory
 
Data linkcontrol
Data linkcontrolData linkcontrol
Data linkcontrol
 
ERP
ERPERP
ERP
 
Inventory Management
Inventory ManagementInventory Management
Inventory Management
 

Recently uploaded

Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 

Recently uploaded (20)

Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 

Genetic algorithm

  • 2. 40 states (often encoded as a string of 0s and 1s) better states. crossover, and mutation Genetic/ Evolutionary algorithms  Developed by John Holland in 1975  inspired by biological mutation & evolution  stochastic (means non-deterministic) search techniques based on the mechanism of natural selection and genetics  A successor state is generated by combining two parent  Start with k randomly generated states (population)  A state is represented as a string over a finite alphabet  Evaluation function (fitness function). Higher values for  Produce the next generation of states by selection, CSE, IUT
  • 3. 43 “Select The Best, Discard The Rest”  fitness function is upto user (problem specific)- means to evaluate the potential of a candidate in the population. e.g. for a binary representation fitness function could be:  f(i) = ∑i f(i) ;where i is from 1 to l (l=total length of the sequence)  And in the selection step, the probability of getting selection for a candidate is:  Prob i = f(i) / ∑i f(i) CSE, IUT
  • 4. 44 Encoding The process of representing the solution in the form of a string that conveys the necessary information.  Binary Encoding – Most common method of encoding. Chromosomes are strings of 1s and 0s and each position in the chromosome represents a particular characteristic of the problem. Permutation Encoding – Useful in ordering problems such as the Traveling Salesman Problem (TSP). Example. In TSP, every chromosome is a string of numbers, each of which represents a city to be visited.  Value Encoding – Used in problems where complicated values, such as real numbers, are used and where binary encoding would not suffice. CSE, IUT
  • 5. 45 e.g. n-queen  GA representation and encoding of the following arrangement can be written as: fitness of the chromosome v1 (24748552) is 28 – 4 = 24 (No. of non attacking pair of queens) • Encoding is given by the row no. of each column.  That is because only 4 pairs of queens attack each other:  The queens on 1st and 8th column  The queens on 2nd and 4th column  The queens on 6th and 7th column  The queens on 3rd and 8th column CSE, IUT
  • 6. 46 Genetic algorithms  Fitness function: number of non-attacking pairs of queens (min = 0, max = 8c2 excluding same pair = 28)  24/(24+23+20+11) = 31%   23/(24+23+20+11) = 29% etc  Here single point crossover & mutation occurred CSE, IUT
  • 7. 41 Genetic/ Evolutionary algorithms  Outline of the Basic Genetic Algorithm 1 [Start] Generate random population of n chromosomes (suitable solutions for the problem) 2 [Fitness] Evaluate the fitness f(x) of each chromosome x in the population 3 [New population] Create a new population by repeating following steps until the new population is complete  [Selection] Select two parent chromosomes from a population according to their fitness (the better fitness, the bigger chance to be selected)  [Crossover] With a crossover probability cross over the parents to form a new offspring (children). If no crossover was performed, offspring is an exact copy of parents.  [Mutation] With a mutation probability mutate new offspring at each locus (position in chromosome).  [Accepting] Place new offspring in a new population (keep population size constant) 4 [Replace] Use new generated population for a further run of algorithm 5 [Test] If the end condition is satisfied, stop, and return the best solution in current population  [Loop] Go to step 3 CSE, IUT
  • 9. 47 Genetic algorithms By doing this Crossover, it helps to accelerate the search at an early stage of evolution For detail about genetic algorithm refer to GA1.pdf in ftp://10.220.20.25/CSE 4701 CSE, IUT
  • 10. 48 Another Example (Assignment 1: Deadline 15 Feb, 2018)  Data population: RGB colours  Aim: to obtain darkest colour represented by (0, 0, 0)  This is a minimisation problem, i.e. a good colour is one that fits for (colour) --> 0.  We now tabulate our data as shown CSE, IUT
  • 11. 49  Start at a random pattern like this: Colour Red Green Blue C1 80 170 689 C2 130 690 15 C3 24 8 317 where Fitness for (C1) = 80 + 170 + 689 = 939 Fitness for (C2) = 130 + 690 + 15 = 835 Fitness for (C3) = 24 + 8 + 317 = 349 CSE, IUT
  • 12. 50 Fitness (C2) = 130 + 690 + 15 = 835 C1  Start at a random pattern like this: Colour Red Green Blue C1 80 170 689 C2 130 690 15 C3 24 8 317 FITTEST PLACED TOP C3 Fitness (C1) = 80 + 170 + 689 = 939 C2 Fitness (C3) = 24 + 8 + 317 = 349 CSE, IUT
  • 13. 51  After a Selection is done on the sample: ** Remember, this is a minimisation problem.. Colour Fitness C3 349 C2 835 C1 939 CSE, IUT
  • 14. 52 C4 24 8 15C4 is crossover(C3,C2)= (24, 8, 15) C6 is crossover(C2,C1)= (130, 690, 689) GA: Reproduction & Crossover  So far, we have this Colour Red Green Blue Colour Fitness C1 80 170 689 C3 349 C2 130 690 15 C2 835 C3 24 8 317 C1 939 Next step is to reproduce the pattern, like this, by crossing over: Colour Red Green Blue C5 is crossover(C3,C1)= (24, 8, 689) C5 24 8 689 C6 130 690 689 CSE, IUT
  • 15. 53  perform mutation, and we have C7 is obtained by mutating(4) =(24, 8, 13) C8 is obtained by mutating(5) =(25, 9, 689 ) C9 is obtained by mutating(6) =(128, 688, 689) Colour Red Green Blue New population of C7 24 8 13 3 chromosomes C8 25 9 689 C9 128 688 689 CSE, IUT
  • 16. 54 Conclusion (up to “mutation” to get a new data set)  Some solutions have improved (after first iteration): Getting better rather fast Slightly improved of the answer Fitness for C7 = (24 + 8 + 13) = 45 Fitness for C8 = (25 + 9 + 689) = 743 Fitness for C9 = (128 + 688 + 689 ) = 1505 If the process is iterated, population will converge to have fitness near to zero (colour) --> 0. Continue.............. CSE, IUT