SlideShare a Scribd company logo
1 of 25
WIX3001
Soft Computing
Lecture 6: Principles of Genetic Algorithms
Dr. Liew Wei Shiung
FSKTM Block B 2-22
liew.wei.shiung.phd@um.edu.my
Principles of Genetic Algorithms
• Genetic Algorithm variants
• Genetic Programming
Genetic Algorithm variants
• Messy GA
• Adaptive GA
• Parallel GA
• Independent Sampling GA
• Real-Coded GA
GA Glossary
Chromosome
A set of genes / parameters representing a complete solution to a
problem being optimized.
Population A set of chromosomes.
Fitness Function
The function used for evaluating how well a chromosome solves the
optimization problem. Outputs a fitness score.
Generation
A complete cycle where the population of chromosomes is evaluated,
and a new population is created using selection, reproduction, and
mutation.
Selection / Rejection
Selects or rejects chromosomes from the population. Elitism is when the
best chromosomes carry over to the next generation.
Reproduction Combining two or more chromosomes to create a new chromosome.
Mutation Changing the value of one or more genes in a chromosome.
Convergence When the GA finds the global optimum or the fitness no longer improves.
Messy GA
• Traditional GA: fixed-order genes.
• Messy GA: variable-length, position-independent genes.
• Each gene is appended with an index.
• Positions of the genes in the chromosome can be swapped without
changing the meaning of the chromosome.
• Why?
• Irregular-length solutions.
Messy GA: Representation
Messy GA: Genetic Operations
• Crossover: cut and splice
Messy GA: Potential Problems
• Over-Specification: more than one gene with the same index.
• Positional preference: choose the first or last.
• Performance preference: choose the best.
• Under-Specification: one or more indices are missing.
• Random.
• Optimization.
Adaptive GA
• Traditional GA: fixed population size, crossover rate, mutation
rate.
• Adaptive GA: variable population size, crossover rate, mutation
rate.
• Example: Mutation+ if population converges; Mutation- if population
diverges.
• Why?
• Control the rate of searching and rate of convergence.
• Exploration: unknown solution space.
• Exploitation: known solution space.
Adaptive GA: How to Detect Convergence?
• Criterion: Max fitness – Avg. fitness
Convergence Divergence
Selection
++
Keep more local
optima from known
areas
--
Keep more solutions
from unknown areas
Crossover
++
Look for more
unknown areas
--
Narrow down
searching in known
areas
Mutation
++
Look for more
unknown areas
--
Narrow down
searching in known
areas
Adaptive GA
Parallel GA
• Parallel Chromosomes
• Fitness test multiple chromosomes simultaneously.
• Parallel Populations (i.e. Island Model)
• Optimize multiple populations simultaneously.
• Limited migration between populations.
• Diversity.
Independent-Sampling GA
• Traditional GA: search solution space by generating offspring
with selection, crossover, mutation.
• ISGA: search solution space using independent sampling.
• Independent sampling phase.
• Breeding phase.
• Why?
• Better population diversity.
• Adaptive mechanism.
• Fewer parameters to tune.
Independent-Sampling GA
• Population initialization and fitness testing as normal.
• Independent Sampling:
• Generate offspring chromosome, one gene at a time, by independent
sampling.
• Evaluate new offspring. If fitness score is higher than the lowest
population fitness, replace the low-fitness chromosome with the offspring.
• Breeding:
• Select two parent chromosomes (i.e. using tournament fitness).
• Generate offspring using crossover, and then fitness test.
• Replace parents if offspring have higher fitness.
Real-Coded GA
• Traditional GA: uses binary genes.
• Real-coded GA: uses real floating value genes.
• Why?
• Better precision.
• Solve optimization problems with continuous variables and solution space.
Genetic Algorithm variants
GA Variant Advantages Disadvantages
Messy
- Overlapping genes can handle problems
with high epistasis
- Non-binary encoding scheme
- Each gene can contribute to multiple traits, which can
be difficult to interpret
Adaptive
- Adapt to changing problem landscapes
- More efficient than fixed-parameter GAs
in some cases
- Requires a self-adaptive mutation rate, which can be
complex to implement
Parallel
- Speed up the optimization process by
utilizing multiple processors or machines
- Handle large-scale optimization problems
- Requires a suitable parallelization technique and
infrastructure
- Synchronization and communication overheads may
affect performance
Independent
Sampling
- Reduce the risk of getting stuck in local
optima
- Increase the diversity of the final solution
- Requires multiple independent runs, which can be time-
consuming
- Final solution may not be as good as that of a single run
Real-Coded
- Handle continuous variables and improve
search efficiency for certain problems
- Produce more accurate solutions than
binary-coded GAs for certain problems
- Requires a larger search space, which can be
computationally expensive
- More complex to implement than binary-coded GAs
Genetic Programming: Principles
• GP uses natural evolution principles for different problem
domains.
1. Multiple individuals form a population. Individuals can reproduce.
2. Reproduction transfers traits from parents to offspring.
3. Many factors affect the survival of individuals.
4. Natural selection favours fit individuals.
• GP evolves computer programs to solve problems, i.e. automatic
programming.
Genetic Programming: Program
• Program using tree structure
representation.
• Each node can be:
1. Arithmetic function (i.e. addition, subtraction).
2. Logical function (i.e. AND, NOT).
3. Terminal: input variables, constants.
4. Tree structure: depth, complexity, branches.
Genetic Programming
1. Initialize population of computer programs.
2. Fitness test each program.
a) Performance: does the program run? How well does it solve the
problem?
b) Complexity: how big is the program? How long does it run?
3. Create new offspring program:
a) Selection: choose two or more parent programs.
b) Crossover: randomly swap nodes between parents.
c) Mutation: change a node to another type of node.
d) Architecture: modify the architecture of the offspring.
Genetic Programming: Characteristics
• Human-competitive.
• High-return.
• Routine.
• Machine intelligence.
Genetic Programming: Characteristics
• Human-competitive:
Genetic Programming: Characteristics
• High-Return: described using “artificial-to-intelligence ratio”.
• Artificial: how much of the program is automated.
• Intelligence: how much of the program requires human
intervention.
• Examples:
• Deep Blue chess computer.
• High A: very good at playing chess.
• High I: requires years of development by a dedicated team.
• Results: low A-to-I ratio.
Genetic Programming: Characteristics
• Routine: how well does the program handle new problems intra-
domain, and inter-domain, with minimal human intervention.
• Machine Intelligence: how well does the program fulfil the three
principles inspired by Turing:
• Logic-driven search: search algorithms, constraints, rule-based systems.
• Cultural search: previously acquired knowledge is stored and used for
solving future problems, i.e. knowledge-based expert systems.
• Genetic or evolutionary search: evolve newer, better solutions from
existing solutions.

More Related Content

Similar to WIX3001 Lecture 6 Principles of GA.pptx

Genetic algorithms in Data Mining
Genetic algorithms in Data MiningGenetic algorithms in Data Mining
Genetic algorithms in Data MiningAtul Khanna
 
GA of a Paper 2012.pptx
GA of a Paper 2012.pptxGA of a Paper 2012.pptx
GA of a Paper 2012.pptxwaqasjavaid26
 
Introduction to Genetic Algorithms 2014
Introduction to Genetic Algorithms 2014Introduction to Genetic Algorithms 2014
Introduction to Genetic Algorithms 2014Aleksander Stensby
 
Ga presentation
Ga presentationGa presentation
Ga presentationziad zohdy
 
introduction of genetic algorithm
introduction of genetic algorithmintroduction of genetic algorithm
introduction of genetic algorithmritambharaaatre
 
Analysis of Parameter using Fuzzy Genetic Algorithm in E-learning System
Analysis of Parameter using Fuzzy Genetic Algorithm in E-learning SystemAnalysis of Parameter using Fuzzy Genetic Algorithm in E-learning System
Analysis of Parameter using Fuzzy Genetic Algorithm in E-learning SystemHarshal Jain
 
GENETIC ALGORITHM ( GA )
GENETIC ALGORITHM ( GA )GENETIC ALGORITHM ( GA )
GENETIC ALGORITHM ( GA )abuamo
 
Geneticalgorithms 100403002207-phpapp02
Geneticalgorithms 100403002207-phpapp02Geneticalgorithms 100403002207-phpapp02
Geneticalgorithms 100403002207-phpapp02Amna Saeed
 
Applied Artificial Intelligence Unit 4 Semester 3 MSc IT Part 2 Mumbai Univer...
Applied Artificial Intelligence Unit 4 Semester 3 MSc IT Part 2 Mumbai Univer...Applied Artificial Intelligence Unit 4 Semester 3 MSc IT Part 2 Mumbai Univer...
Applied Artificial Intelligence Unit 4 Semester 3 MSc IT Part 2 Mumbai Univer...Madhav Mishra
 
Genetic-Algorithms.ppt
Genetic-Algorithms.pptGenetic-Algorithms.ppt
Genetic-Algorithms.pptNipun85
 
AI_PPT_Genetic-Algorithms.ppt
AI_PPT_Genetic-Algorithms.pptAI_PPT_Genetic-Algorithms.ppt
AI_PPT_Genetic-Algorithms.pptHotTea
 
Genetic-Algorithms forv artificial .ppt
Genetic-Algorithms forv artificial  .pptGenetic-Algorithms forv artificial  .ppt
Genetic-Algorithms forv artificial .pptneelamsanjeevkumar
 
Genetic-Algorithms for machine learning and ai.ppt
Genetic-Algorithms for machine learning and ai.pptGenetic-Algorithms for machine learning and ai.ppt
Genetic-Algorithms for machine learning and ai.pptneelamsanjeevkumar
 
Genetic-Algorithms.ppt
Genetic-Algorithms.pptGenetic-Algorithms.ppt
Genetic-Algorithms.pptssuser2e437f
 
Genetic-Algorithms-computersciencepptnew.ppt
Genetic-Algorithms-computersciencepptnew.pptGenetic-Algorithms-computersciencepptnew.ppt
Genetic-Algorithms-computersciencepptnew.pptFitnessfreaksfam
 
Evolutionary Design of Swarms (SSCI 2014)
Evolutionary Design of Swarms (SSCI 2014)Evolutionary Design of Swarms (SSCI 2014)
Evolutionary Design of Swarms (SSCI 2014)Benjamin Bengfort
 

Similar to WIX3001 Lecture 6 Principles of GA.pptx (20)

Genetic algorithms in Data Mining
Genetic algorithms in Data MiningGenetic algorithms in Data Mining
Genetic algorithms in Data Mining
 
0101.genetic algorithm
0101.genetic algorithm0101.genetic algorithm
0101.genetic algorithm
 
Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithm
 
GA of a Paper 2012.pptx
GA of a Paper 2012.pptxGA of a Paper 2012.pptx
GA of a Paper 2012.pptx
 
Introduction to Genetic Algorithms 2014
Introduction to Genetic Algorithms 2014Introduction to Genetic Algorithms 2014
Introduction to Genetic Algorithms 2014
 
BGA.pptx
BGA.pptxBGA.pptx
BGA.pptx
 
Ga presentation
Ga presentationGa presentation
Ga presentation
 
introduction of genetic algorithm
introduction of genetic algorithmintroduction of genetic algorithm
introduction of genetic algorithm
 
Analysis of Parameter using Fuzzy Genetic Algorithm in E-learning System
Analysis of Parameter using Fuzzy Genetic Algorithm in E-learning SystemAnalysis of Parameter using Fuzzy Genetic Algorithm in E-learning System
Analysis of Parameter using Fuzzy Genetic Algorithm in E-learning System
 
GENETIC ALGORITHM ( GA )
GENETIC ALGORITHM ( GA )GENETIC ALGORITHM ( GA )
GENETIC ALGORITHM ( GA )
 
Geneticalgorithms 100403002207-phpapp02
Geneticalgorithms 100403002207-phpapp02Geneticalgorithms 100403002207-phpapp02
Geneticalgorithms 100403002207-phpapp02
 
Applied Artificial Intelligence Unit 4 Semester 3 MSc IT Part 2 Mumbai Univer...
Applied Artificial Intelligence Unit 4 Semester 3 MSc IT Part 2 Mumbai Univer...Applied Artificial Intelligence Unit 4 Semester 3 MSc IT Part 2 Mumbai Univer...
Applied Artificial Intelligence Unit 4 Semester 3 MSc IT Part 2 Mumbai Univer...
 
Genetic-Algorithms.ppt
Genetic-Algorithms.pptGenetic-Algorithms.ppt
Genetic-Algorithms.ppt
 
AI_PPT_Genetic-Algorithms.ppt
AI_PPT_Genetic-Algorithms.pptAI_PPT_Genetic-Algorithms.ppt
AI_PPT_Genetic-Algorithms.ppt
 
Genetic-Algorithms forv artificial .ppt
Genetic-Algorithms forv artificial  .pptGenetic-Algorithms forv artificial  .ppt
Genetic-Algorithms forv artificial .ppt
 
Genetic-Algorithms for machine learning and ai.ppt
Genetic-Algorithms for machine learning and ai.pptGenetic-Algorithms for machine learning and ai.ppt
Genetic-Algorithms for machine learning and ai.ppt
 
Genetic-Algorithms.ppt
Genetic-Algorithms.pptGenetic-Algorithms.ppt
Genetic-Algorithms.ppt
 
Genetic-Algorithms-computersciencepptnew.ppt
Genetic-Algorithms-computersciencepptnew.pptGenetic-Algorithms-computersciencepptnew.ppt
Genetic-Algorithms-computersciencepptnew.ppt
 
Evolutionary Design of Swarms (SSCI 2014)
Evolutionary Design of Swarms (SSCI 2014)Evolutionary Design of Swarms (SSCI 2014)
Evolutionary Design of Swarms (SSCI 2014)
 
Metaheuristics
MetaheuristicsMetaheuristics
Metaheuristics
 

Recently uploaded

Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 

Recently uploaded (20)

Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 

WIX3001 Lecture 6 Principles of GA.pptx

  • 1. WIX3001 Soft Computing Lecture 6: Principles of Genetic Algorithms Dr. Liew Wei Shiung FSKTM Block B 2-22 liew.wei.shiung.phd@um.edu.my
  • 2. Principles of Genetic Algorithms • Genetic Algorithm variants • Genetic Programming
  • 3. Genetic Algorithm variants • Messy GA • Adaptive GA • Parallel GA • Independent Sampling GA • Real-Coded GA
  • 4. GA Glossary Chromosome A set of genes / parameters representing a complete solution to a problem being optimized. Population A set of chromosomes. Fitness Function The function used for evaluating how well a chromosome solves the optimization problem. Outputs a fitness score. Generation A complete cycle where the population of chromosomes is evaluated, and a new population is created using selection, reproduction, and mutation. Selection / Rejection Selects or rejects chromosomes from the population. Elitism is when the best chromosomes carry over to the next generation. Reproduction Combining two or more chromosomes to create a new chromosome. Mutation Changing the value of one or more genes in a chromosome. Convergence When the GA finds the global optimum or the fitness no longer improves.
  • 5. Messy GA • Traditional GA: fixed-order genes. • Messy GA: variable-length, position-independent genes. • Each gene is appended with an index. • Positions of the genes in the chromosome can be swapped without changing the meaning of the chromosome. • Why? • Irregular-length solutions.
  • 7. Messy GA: Genetic Operations • Crossover: cut and splice
  • 8. Messy GA: Potential Problems • Over-Specification: more than one gene with the same index. • Positional preference: choose the first or last. • Performance preference: choose the best. • Under-Specification: one or more indices are missing. • Random. • Optimization.
  • 9. Adaptive GA • Traditional GA: fixed population size, crossover rate, mutation rate. • Adaptive GA: variable population size, crossover rate, mutation rate. • Example: Mutation+ if population converges; Mutation- if population diverges. • Why? • Control the rate of searching and rate of convergence. • Exploration: unknown solution space. • Exploitation: known solution space.
  • 10. Adaptive GA: How to Detect Convergence? • Criterion: Max fitness – Avg. fitness Convergence Divergence Selection ++ Keep more local optima from known areas -- Keep more solutions from unknown areas Crossover ++ Look for more unknown areas -- Narrow down searching in known areas Mutation ++ Look for more unknown areas -- Narrow down searching in known areas
  • 12. Parallel GA • Parallel Chromosomes • Fitness test multiple chromosomes simultaneously. • Parallel Populations (i.e. Island Model) • Optimize multiple populations simultaneously. • Limited migration between populations. • Diversity.
  • 13. Independent-Sampling GA • Traditional GA: search solution space by generating offspring with selection, crossover, mutation. • ISGA: search solution space using independent sampling. • Independent sampling phase. • Breeding phase. • Why? • Better population diversity. • Adaptive mechanism. • Fewer parameters to tune.
  • 14. Independent-Sampling GA • Population initialization and fitness testing as normal. • Independent Sampling: • Generate offspring chromosome, one gene at a time, by independent sampling. • Evaluate new offspring. If fitness score is higher than the lowest population fitness, replace the low-fitness chromosome with the offspring. • Breeding: • Select two parent chromosomes (i.e. using tournament fitness). • Generate offspring using crossover, and then fitness test. • Replace parents if offspring have higher fitness.
  • 15. Real-Coded GA • Traditional GA: uses binary genes. • Real-coded GA: uses real floating value genes. • Why? • Better precision. • Solve optimization problems with continuous variables and solution space.
  • 16. Genetic Algorithm variants GA Variant Advantages Disadvantages Messy - Overlapping genes can handle problems with high epistasis - Non-binary encoding scheme - Each gene can contribute to multiple traits, which can be difficult to interpret Adaptive - Adapt to changing problem landscapes - More efficient than fixed-parameter GAs in some cases - Requires a self-adaptive mutation rate, which can be complex to implement Parallel - Speed up the optimization process by utilizing multiple processors or machines - Handle large-scale optimization problems - Requires a suitable parallelization technique and infrastructure - Synchronization and communication overheads may affect performance Independent Sampling - Reduce the risk of getting stuck in local optima - Increase the diversity of the final solution - Requires multiple independent runs, which can be time- consuming - Final solution may not be as good as that of a single run Real-Coded - Handle continuous variables and improve search efficiency for certain problems - Produce more accurate solutions than binary-coded GAs for certain problems - Requires a larger search space, which can be computationally expensive - More complex to implement than binary-coded GAs
  • 17. Genetic Programming: Principles • GP uses natural evolution principles for different problem domains. 1. Multiple individuals form a population. Individuals can reproduce. 2. Reproduction transfers traits from parents to offspring. 3. Many factors affect the survival of individuals. 4. Natural selection favours fit individuals. • GP evolves computer programs to solve problems, i.e. automatic programming.
  • 18. Genetic Programming: Program • Program using tree structure representation. • Each node can be: 1. Arithmetic function (i.e. addition, subtraction). 2. Logical function (i.e. AND, NOT). 3. Terminal: input variables, constants. 4. Tree structure: depth, complexity, branches.
  • 19.
  • 20. Genetic Programming 1. Initialize population of computer programs. 2. Fitness test each program. a) Performance: does the program run? How well does it solve the problem? b) Complexity: how big is the program? How long does it run? 3. Create new offspring program: a) Selection: choose two or more parent programs. b) Crossover: randomly swap nodes between parents. c) Mutation: change a node to another type of node. d) Architecture: modify the architecture of the offspring.
  • 21.
  • 22. Genetic Programming: Characteristics • Human-competitive. • High-return. • Routine. • Machine intelligence.
  • 24. Genetic Programming: Characteristics • High-Return: described using “artificial-to-intelligence ratio”. • Artificial: how much of the program is automated. • Intelligence: how much of the program requires human intervention. • Examples: • Deep Blue chess computer. • High A: very good at playing chess. • High I: requires years of development by a dedicated team. • Results: low A-to-I ratio.
  • 25. Genetic Programming: Characteristics • Routine: how well does the program handle new problems intra- domain, and inter-domain, with minimal human intervention. • Machine Intelligence: how well does the program fulfil the three principles inspired by Turing: • Logic-driven search: search algorithms, constraints, rule-based systems. • Cultural search: previously acquired knowledge is stored and used for solving future problems, i.e. knowledge-based expert systems. • Genetic or evolutionary search: evolve newer, better solutions from existing solutions.

Editor's Notes

  1. Messy: designed to handle problems with a high degree of epistasis, which occurs when the effect of a gene depends on the presence or absence of other genes. This is achieved by allowing overlapping genes, so that a single gene can contribute to multiple traits. Adaptive: dynamically adjusts its parameters during the optimization process. This allows the algorithm to adapt to changes in the problem landscape or to different problem instances. Hybrid: combines multiple optimization techniques. For example, it can use both local search methods and global search methods to explore the problem space more efficiently. Hybrid GA can also combine genetic algorithm with other optimization methods such as simulated annealing or gradient descent. Parallel: uses multiple processors or machines to perform the optimization process simultaneously. This can greatly reduce the time required to find the optimal solution. Parallel GA can be implemented using various approaches such as master-slave, island model, or cellular model. ISGA: uses independent runs to search for the optimal solution. Each run is performed independently, and the best individual from each run is selected as the final solution. This approach can reduce the risk of getting stuck in local optima, as different runs may explore different parts of the problem space. RCGA: handle problems with continuous variables. It represents each individual as a vector of real values instead of binary strings. Real-Coded GA uses real-valued crossover and mutation operators, and may use gradient-based methods to improve the search efficiency in some cases.
  2. In a “classical” GA, the genes are encoded in a fixed order. The meaning of a single gene is determined by its position inside the chromosome. What happens if the coding is chosen such that couplings occur between distant genes? Messy GAs try to overcome this difficulty by using a variable-length, position-independent coding. The key idea is to append an index to each gene which allows identifying its position. A gene, therefore, is no longer represented as a single allele value and a fixed position, but as a pair of an index and an allele. Since with the help of the index we can identify the genes uniquely, genes may be swapped arbitrarily without changing the meaning of the string. Messy Genetic Algorithms are a powerful optimization technique that can tackle problems with irregular or variable-length structures. They overcome some of the limitations of traditional GAs by using variable-length chromosomes, gene expression, template-based crossover, specialized mutation operators, and a coarse-to-fine search strategy. These features enable mGAs to effectively explore complex search spaces and find high-quality solutions to challenging problems.
  3. With appropriate genetic operations, which also change the order of the pairs, the GA could possibly group coupled genes together automatically.
  4. Owing to the free arrangement of genes and the variable length of the encoding, we can, however, run into problems, which do not occur, in a simple GA. First of all, it can happen that there are two entries in a string, which correspond to the same index but have conflicting alleles. The most obvious way to overcome this “over-specification” is positional preference – the first entry, which refers to a gene, is taken. This problem of “under specification” is more complicated and its solution is not as obvious as for over-specification. One approach could be to check all possible combinations and to take the best one (for k missing genes, there are 2k combinations). With the objective to reduce this effort, Goldberg et al. have suggested to use so-called competitive templates for finding specifications for k missing genes. It is nothing else than applying a local hill climbing method with random initial value to the k missing genes.
  5. Adaptive GAs are those whose parameters, such as the population size, the crossing over probability, or the mutation probability, are varied while the GA is running. A simple variant could be the following: The mutation rate is changed according to changes in the population – the longer the population does not improve, the higher the mutation rate is chosen. Vice versa, it is decreased again as soon as an improvement of the population occurs.
  6. K2=K4=0.5; prevent the GA from getting stuck at a local optimum. K1=K3=1.0; ensures that all solutions with a fitness value less than or equal to global optimum compulsorily undergo crossover. The probability of crossover decreases as the fitness value approaches global optimum
  7. It has been established that GA’s efficiency to find optimal solution is largely determined by the population size. With a larger population size, the genetic diversity increases, and so the algorithm is more likely to find a global optimum. A large population requires more memory to be stored; it has also been proved that it takes a longer time to converge. If n is the population size, the convergence is expected after nlog(n) function evaluations.
  8. Fitness is usually multi-objective. Fitness is also run multiple times under different test cases. Mutation in GP can involve one or more of the following changes: Replace a function node with another function that has the same arity (number of arguments). Replace a terminal node (variable or constant) with another terminal. c. Replace a function node with a terminal node, effectively pruning the subtree rooted at that function node. d. Replace a terminal node with a function node, requiring the addition of a new subtree rooted at the new function node.