SlideShare a Scribd company logo
Genetic Algorithms
BY
RIMPLE DHAMIJA
Genetic Algorithms
•Genetic Algorithms are part of evolutionary computing.
•Genetic Algorithm (GA) is a search-based optimization technique based on the principles
of Genetics and Natural Selection. It is frequently used to find optimal or near-optimal solutions
to difficult problems which otherwise would take a lifetime to solve.
• Optimization is the process of making something better. In any process, we have a set of inputs
and a set of outputs
•Optimization refers to finding the values of inputs in such a way that we get the “best” output
values.
•The definition of “best” varies from problem to problem, but in mathematical terms, it refers to
maximizing or minimizing one or more objective functions, by varying the input parameters.
Search Space
If We are solving some problem, we are usually looking for solutions best among others.
The space of all feasible solutions is called Search Space( State space).
Each point in the Search space represent one feasible solution. Each feasible solution can be
marked by its value of fitness for the problem.
Various techniques to find suitable solution are Hill Climbing, Best-First Search etc.
The solution is often considered as good solution because it is not possible to prove what is real
optimum.
NP-Hard Problems are kind of difficult problems which cannot be solved by traditional way.
It is difficult to find solution but once we have it, it is easy to check the solution. This fact led to
NP-Complete Problem.
Search Space(contd.)
NP- means Non-Deterministic Polynomial
 It means that it is possible to guess the solution( by some non-deterministic algorithm) and
then check it, both in polynomial time.
 NP-Complete problems are of type for which answer is simply ‘Yes’ or ‘No’.
 The problems with complicated outputs are called NP-Hard problems.
 To find a solution, simply try all the alternatives but this is very slow and sometimes not
usable at all.
 Genetic Algorithms are alternative method to solve NP-Problem. E.g. Travelling Salesman
Problem
Principle behind Genetic Algorithms
•SELECT THE BEST, DISCARD THE REST
•It is based on Darwin’s principle of natural selection.
• If there are Organisms that reproduce, and
• If Offsprings inherit traits from there progenitors, and
• If there is variability of traits, and
• If the environment cannot support all members of a growing population,
• Then those members of the population with less adaptive traits( determined by the
environment) will die out, and
• Those members with more adaptive traits( determined by the environment ) will thrive.
• The Result is evolution of Species.
Evolution through Natural Selection
Initial Population of Animals
Struggle for existence, survival of the fittest
Surviving individuals reproduce, propagate favourable characteristics
Millions of Years
Evolved Species
[Favourable characteristic now a trait of Species.]
Nature to Computer Mapping
NATURE
Population
Individual
Fitness
Chromosome
Gene
Reproduction
COMPUTER
Set Of Solutions
Solution to a Problem
Quality of a Solution
Encoding for a Solution
Part of encoding
Crossover
Requirements to implement Genetic
Algorithm
Two important elements required for any problem before a genetic algorithm can be used for a solution are
•Method for representing a solution ex: a string of bits, numbers, character ex: determination total weight.
•Method for measuring the quality of any proposed solution, using fitness function.
Basi
GA
Genetic Algorithm is started with a set of solutions(represented by Chromosomes) called
population.
Solutions from one Population are taken and used to form a new population.( This is motivated
by hope that the new population will be better than the old one)
Solutions which are selected to form new solutions(Offsprings) are selected according to their
fitness value( the more suitable they are, the more chances they have to reproduce.)
This process is repeated until some condition is satisfied. E.g. No of Populations or improvement
of the best solution.
Genetic Algorithm
Step 1- [START] Generate random population of n Chromosomes i.e. suitable solutions to the
problem.
Step 2- [Fitness] Evaluate the fitness f(x) of each Chromosome x in the Population.
Step 3-[New Population] Create a new population by repeating following steps until the new
population is complete.
◦ (a) [Selection] Select two parent Chromosomes from a Population according to their
fitness.(the better fitness, the bigger chances to be selected)
◦ (b)[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.
◦ ( c)[Mutation] With a mutation probability, mutate new offspring at each locus( position in
chromosome)
Genetic Algorithm(contd.)
◦ ( d)[Accepting] Place new offspring in a new Population.
Step 4- [Replace] Use new generated population for a further run of algorithm.
Step 5- [Test] If the end condition is satisfied, Stop, and return the best Solution in current
Population.
Step 6- [Loop] Go To Step 2.
Genetic Algorithm( an alternate)
Simple_Genetic_Algorithm()
{
Initialize the Population;
Calculate Fitness Function;
While( Fitness Value != Optimal Value)
{
◦ Selection; // Natural Selection, Survival of Fittest
◦ Crossover; //Reproduction, Propagate favourable characteristics
◦ Mutation; // Mutation
◦ Calculate Fitness Function;
}
}

More Related Content

Similar to Genetic algorithms

4.Genetic-Algorithms.ppt
4.Genetic-Algorithms.ppt4.Genetic-Algorithms.ppt
4.Genetic-Algorithms.ppt
RamjiChaurasiya
 
Explanation and example of genetic algorithm
Explanation and example of genetic algorithmExplanation and example of genetic algorithm
Explanation and example of genetic algorithm
MarkKhan23
 
Introduction to genetic algorithms
Introduction to genetic algorithmsIntroduction to genetic algorithms
Introduction to genetic algorithms
shadanalam
 
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
 
RM 701 Genetic Algorithm and Fuzzy Logic lecture
RM 701 Genetic Algorithm and Fuzzy Logic lectureRM 701 Genetic Algorithm and Fuzzy Logic lecture
RM 701 Genetic Algorithm and Fuzzy Logic lecture
VIT University (Chennai Campus)
 
Parallel evolutionary approach paper
Parallel evolutionary approach paperParallel evolutionary approach paper
Parallel evolutionary approach paper
Priti Punia
 
Genetic algorithm raktim
Genetic algorithm raktimGenetic algorithm raktim
Genetic algorithm raktim
Raktim Halder
 
Genetic algorithm_raktim_IITKGP
Genetic algorithm_raktim_IITKGP Genetic algorithm_raktim_IITKGP
Genetic algorithm_raktim_IITKGP Raktim Halder
 
Info to Genetic Algorithms - DC Ruby Users Group 11.10.2016
Info to Genetic Algorithms - DC Ruby Users Group 11.10.2016Info to Genetic Algorithms - DC Ruby Users Group 11.10.2016
Info to Genetic Algorithms - DC Ruby Users Group 11.10.2016
Geoff Harcourt
 
Flowchart of ga
Flowchart of gaFlowchart of ga
Flowchart of ga
DEEPIKA T
 
generic optimization techniques lecture slides
generic optimization techniques  lecture slidesgeneric optimization techniques  lecture slides
generic optimization techniques lecture slides
SardarHamidullah
 
Genetic Algorithms : A class of Evolutionary Algorithms
Genetic Algorithms : A class of Evolutionary AlgorithmsGenetic Algorithms : A class of Evolutionary Algorithms
Genetic Algorithms : A class of Evolutionary Algorithms
Kavya Barnadhya Hazarika
 
Genetic Algorithm: A Crisp And Concise Introduction [Shakeeb A.]
Genetic Algorithm: A Crisp And Concise Introduction [Shakeeb A.]Genetic Algorithm: A Crisp And Concise Introduction [Shakeeb A.]
Genetic Algorithm: A Crisp And Concise Introduction [Shakeeb A.]
Shakeeb Ahmad Mohammad Mukhtar
 
CI_L02_Optimization_ag2_eng.pdf
CI_L02_Optimization_ag2_eng.pdfCI_L02_Optimization_ag2_eng.pdf
CI_L02_Optimization_ag2_eng.pdf
SantiagoGarridoBulln
 
Genetic algorithm ppt
Genetic algorithm pptGenetic algorithm ppt
Genetic algorithm ppt
Mayank Jain
 
MACHINE LEARNING - GENETIC ALGORITHM
MACHINE LEARNING - GENETIC ALGORITHMMACHINE LEARNING - GENETIC ALGORITHM
MACHINE LEARNING - GENETIC ALGORITHM
Puneet Kulyana
 
A Review On Genetic Algorithm And Its Applications
A Review On Genetic Algorithm And Its ApplicationsA Review On Genetic Algorithm And Its Applications
A Review On Genetic Algorithm And Its Applications
Karen Gomez
 
SoftComputing4
SoftComputing4SoftComputing4
SoftComputing4
DrPrafullNarooka
 
Document1
Document1Document1
Document1shruti0293
 
GENETIC ALGORITHM
GENETIC ALGORITHMGENETIC ALGORITHM
GENETIC ALGORITHM
sowfi
 

Similar to Genetic algorithms (20)

4.Genetic-Algorithms.ppt
4.Genetic-Algorithms.ppt4.Genetic-Algorithms.ppt
4.Genetic-Algorithms.ppt
 
Explanation and example of genetic algorithm
Explanation and example of genetic algorithmExplanation and example of genetic algorithm
Explanation and example of genetic algorithm
 
Introduction to genetic algorithms
Introduction to genetic algorithmsIntroduction to genetic algorithms
Introduction to genetic algorithms
 
Data Science - Part XIV - Genetic Algorithms
Data Science - Part XIV - Genetic AlgorithmsData Science - Part XIV - Genetic Algorithms
Data Science - Part XIV - Genetic Algorithms
 
RM 701 Genetic Algorithm and Fuzzy Logic lecture
RM 701 Genetic Algorithm and Fuzzy Logic lectureRM 701 Genetic Algorithm and Fuzzy Logic lecture
RM 701 Genetic Algorithm and Fuzzy Logic lecture
 
Parallel evolutionary approach paper
Parallel evolutionary approach paperParallel evolutionary approach paper
Parallel evolutionary approach paper
 
Genetic algorithm raktim
Genetic algorithm raktimGenetic algorithm raktim
Genetic algorithm raktim
 
Genetic algorithm_raktim_IITKGP
Genetic algorithm_raktim_IITKGP Genetic algorithm_raktim_IITKGP
Genetic algorithm_raktim_IITKGP
 
Info to Genetic Algorithms - DC Ruby Users Group 11.10.2016
Info to Genetic Algorithms - DC Ruby Users Group 11.10.2016Info to Genetic Algorithms - DC Ruby Users Group 11.10.2016
Info to Genetic Algorithms - DC Ruby Users Group 11.10.2016
 
Flowchart of ga
Flowchart of gaFlowchart of ga
Flowchart of ga
 
generic optimization techniques lecture slides
generic optimization techniques  lecture slidesgeneric optimization techniques  lecture slides
generic optimization techniques lecture slides
 
Genetic Algorithms : A class of Evolutionary Algorithms
Genetic Algorithms : A class of Evolutionary AlgorithmsGenetic Algorithms : A class of Evolutionary Algorithms
Genetic Algorithms : A class of Evolutionary Algorithms
 
Genetic Algorithm: A Crisp And Concise Introduction [Shakeeb A.]
Genetic Algorithm: A Crisp And Concise Introduction [Shakeeb A.]Genetic Algorithm: A Crisp And Concise Introduction [Shakeeb A.]
Genetic Algorithm: A Crisp And Concise Introduction [Shakeeb A.]
 
CI_L02_Optimization_ag2_eng.pdf
CI_L02_Optimization_ag2_eng.pdfCI_L02_Optimization_ag2_eng.pdf
CI_L02_Optimization_ag2_eng.pdf
 
Genetic algorithm ppt
Genetic algorithm pptGenetic algorithm ppt
Genetic algorithm ppt
 
MACHINE LEARNING - GENETIC ALGORITHM
MACHINE LEARNING - GENETIC ALGORITHMMACHINE LEARNING - GENETIC ALGORITHM
MACHINE LEARNING - GENETIC ALGORITHM
 
A Review On Genetic Algorithm And Its Applications
A Review On Genetic Algorithm And Its ApplicationsA Review On Genetic Algorithm And Its Applications
A Review On Genetic Algorithm And Its Applications
 
SoftComputing4
SoftComputing4SoftComputing4
SoftComputing4
 
Document1
Document1Document1
Document1
 
GENETIC ALGORITHM
GENETIC ALGORITHMGENETIC ALGORITHM
GENETIC ALGORITHM
 

Recently uploaded

1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 

Recently uploaded (20)

1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 

Genetic algorithms

  • 2. Genetic Algorithms •Genetic Algorithms are part of evolutionary computing. •Genetic Algorithm (GA) is a search-based optimization technique based on the principles of Genetics and Natural Selection. It is frequently used to find optimal or near-optimal solutions to difficult problems which otherwise would take a lifetime to solve. • Optimization is the process of making something better. In any process, we have a set of inputs and a set of outputs •Optimization refers to finding the values of inputs in such a way that we get the “best” output values. •The definition of “best” varies from problem to problem, but in mathematical terms, it refers to maximizing or minimizing one or more objective functions, by varying the input parameters.
  • 3. Search Space If We are solving some problem, we are usually looking for solutions best among others. The space of all feasible solutions is called Search Space( State space). Each point in the Search space represent one feasible solution. Each feasible solution can be marked by its value of fitness for the problem. Various techniques to find suitable solution are Hill Climbing, Best-First Search etc. The solution is often considered as good solution because it is not possible to prove what is real optimum. NP-Hard Problems are kind of difficult problems which cannot be solved by traditional way. It is difficult to find solution but once we have it, it is easy to check the solution. This fact led to NP-Complete Problem.
  • 4. Search Space(contd.) NP- means Non-Deterministic Polynomial  It means that it is possible to guess the solution( by some non-deterministic algorithm) and then check it, both in polynomial time.  NP-Complete problems are of type for which answer is simply ‘Yes’ or ‘No’.  The problems with complicated outputs are called NP-Hard problems.  To find a solution, simply try all the alternatives but this is very slow and sometimes not usable at all.  Genetic Algorithms are alternative method to solve NP-Problem. E.g. Travelling Salesman Problem
  • 5. Principle behind Genetic Algorithms •SELECT THE BEST, DISCARD THE REST •It is based on Darwin’s principle of natural selection. • If there are Organisms that reproduce, and • If Offsprings inherit traits from there progenitors, and • If there is variability of traits, and • If the environment cannot support all members of a growing population, • Then those members of the population with less adaptive traits( determined by the environment) will die out, and • Those members with more adaptive traits( determined by the environment ) will thrive. • The Result is evolution of Species.
  • 6. Evolution through Natural Selection Initial Population of Animals Struggle for existence, survival of the fittest Surviving individuals reproduce, propagate favourable characteristics Millions of Years Evolved Species [Favourable characteristic now a trait of Species.]
  • 7. Nature to Computer Mapping NATURE Population Individual Fitness Chromosome Gene Reproduction COMPUTER Set Of Solutions Solution to a Problem Quality of a Solution Encoding for a Solution Part of encoding Crossover
  • 8. Requirements to implement Genetic Algorithm Two important elements required for any problem before a genetic algorithm can be used for a solution are •Method for representing a solution ex: a string of bits, numbers, character ex: determination total weight. •Method for measuring the quality of any proposed solution, using fitness function. Basi
  • 9. GA Genetic Algorithm is started with a set of solutions(represented by Chromosomes) called population. Solutions from one Population are taken and used to form a new population.( This is motivated by hope that the new population will be better than the old one) Solutions which are selected to form new solutions(Offsprings) are selected according to their fitness value( the more suitable they are, the more chances they have to reproduce.) This process is repeated until some condition is satisfied. E.g. No of Populations or improvement of the best solution.
  • 10. Genetic Algorithm Step 1- [START] Generate random population of n Chromosomes i.e. suitable solutions to the problem. Step 2- [Fitness] Evaluate the fitness f(x) of each Chromosome x in the Population. Step 3-[New Population] Create a new population by repeating following steps until the new population is complete. ◦ (a) [Selection] Select two parent Chromosomes from a Population according to their fitness.(the better fitness, the bigger chances to be selected) ◦ (b)[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. ◦ ( c)[Mutation] With a mutation probability, mutate new offspring at each locus( position in chromosome)
  • 11. Genetic Algorithm(contd.) ◦ ( d)[Accepting] Place new offspring in a new Population. Step 4- [Replace] Use new generated population for a further run of algorithm. Step 5- [Test] If the end condition is satisfied, Stop, and return the best Solution in current Population. Step 6- [Loop] Go To Step 2.
  • 12. Genetic Algorithm( an alternate) Simple_Genetic_Algorithm() { Initialize the Population; Calculate Fitness Function; While( Fitness Value != Optimal Value) { ◦ Selection; // Natural Selection, Survival of Fittest ◦ Crossover; //Reproduction, Propagate favourable characteristics ◦ Mutation; // Mutation ◦ Calculate Fitness Function; } }