SlideShare ist ein Scribd-Unternehmen logo
1 von 38
Downloaden Sie, um offline zu lesen
Foundations in AI
Introduction to Genetic Algorithms
Dr Vanessa Camilleri 

Department of AI
October 2018
Overview
• Introduction
• GA Algorithm
• Components
• Examples
• Applications
Introduction
• Mimics Theory of Evolution

• GAs as a general purpose learning algorithm

• Solving a complex problem of problems

• Uses Natural Selection or Survival of the Fittest
Introduction
• Natural Selection:
variations in gene that
increases its chances of
survival
Introduction
Introduction
Introduction
Introduction
• NP (nondeterministic polynomial) Hard Problems

• cannot be solved in traditional way

• possible to guess the solution
Basic GA algorithm
1. [Start] Generate random population of n chromosomes (suitable solutions for the problem)

2. [Fitness] Evaluate the tness 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

1. [Selection] Select two parent chromosomes from a population according to their tness (the
better tness, the bigger chance to be selected)

2. [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.

3. [Mutation] With a mutation probability mutate new offspring at each locus (position in
chromosome).

4. [Accept] Place new offspring in a new population

5. [Replace] Use new generated population for a further run of algorithm

6. [Test] If the end condition is satised, stop, and return the best solution in current population

[Loop] Go to step 2
{
initialize	population;
evaluate	population;
while	TerminationCriteriaNotSatisfied
{
select	parents	for	reproduction;
perform	recombination	and	mutation;
evaluate	population;
}
}
GA Cycle of Reproduction
Reproduction Modification
EvaluationPopulation
Discard
Children
Modified	
Children
Evaluated	
Children
Deleted	
Members
Parents
GA Operators
1. Reproduction: aka selection operator, usually the rst
operator applied on the population. Chromosomes are
selected from the population to cross over and produce
offspring

2. Crossover: After reproduction population is enriched
with better individuals. 

3. Mutation: Happens after crossover, causing a random
change in the offspring.
Chromosomes	could	be:
– Bit	strings																						 (0101	...	1100)
– Real	numbers																	 (43.2	-33.1	...	0.0	89.2)	
– Permutations	of	element					(E11	E3	E7	...	E1	E15)
– Lists	of	rules																							 (R1	R2	R3	...	R22	R23)
– Program	elements													 (genetic	programming)
– Any	data	structure	...
Crossover
Chromosome 1 11011 | 00100110110
Chromosome 2 11011 | 11000011110
Offspring 1 11011 | 11000011110
Offspring 2 11011 | 00100110110
Chromosome 1 1101100100110110
Chromosome 2 1101111000011110
Mutation
Original offspring 1 1101111000011110
Original offspring 2 1101100100110110
Mutated offspring 1 1100111000011110
Mutated offspring 2 1101101100110110
GA Parameters
• Solving the problem by finding the extreme of a function

• GA Parameters

• Crossover and Mutation Probability

• Population Size
GA: Selection
Roulette Wheel Selection Rank Selection
before
after
Steady State Selection
Elitism
GA: Encoding
• Binary Encoding

• example Knapsack problem

• Permutation Encoding

• example Travelling Salesman problem
Chromosome A 101100101100101011100101
Chromosome B 111111100000110000011111
Chromosome A 1  5  3  2  6  4  7  9  8
Chromosome B 8  5  6  7  2  3  1  4  9
GA: Encoding
• Value Encoding

• example finding weights
for neural network

• Tree Encoding

• example finding a function
from given values
Chromosome A 1.2324  5.3243  0.4556  2.3293  2.4545
Chromosome B ABDJEIFJDHDIERJFDLDFLFEGT
Chromosome C (back), (back), (right), (forward), (left)
Chromosome A Chromosome B
( +  x  ( /  5  y ) ) ( do_until  step  wall )
• Binary Encoding: Crossover 

• Single Point Crossover 

• Two Point Crossover
Crossover & Mutation
11001011+11011111 = 11001111
11001011 + 11011111 = 11011111
Crossover & Mutation
• Uniform Crossover 

• Arithmetic Crossover
11001011 + 11011101 = 11011111
11001011 + 11011111 = 11001001 (AND)
Crossover & Mutation
• Mutation: Bit Inversion
11001001 =>  10001001
• Permutation Encoding 

• Crossover: Single Point Crossover 

• Mutation: Order Changing
Crossover & Mutation
(1 2 3 4 5 6 7 8 9) + (4 5 3 6 8 9 7 2 1) = (1 2 3 4 5 6 8 9 7)
(1 2 3 4 5 6 8 9 7) => (1 8 3 4 5 6 2 9 7)
• Value Encoding 

• Crossover: All crossovers from Binary Encoding can
be used 

• Mutation: Adding
Crossover & Mutation
1.29  5.68  2.86  4.11  5.55) => (1.29  5.68  2.73  4.22  5.55)
• Tree Encoding 

• Crossover: Tree Crossover 

• Mutation: Changing operator, number
Crossover & Mutation
Example
Distribution	of	Individuals	in	Generation	0
Distribution	of	Individuals	in	Generation	N
Example: Travelling
Salesman Problem
Problem Space: 30 cities
Example: Travelling
Salesman Problem
Solutioni [Distance=941]
Example: Travelling
Salesman Problem
Solutionj [Distance=800]
Example: Travelling
Salesman Problem
Solutionk [Distance=652]
Example: Travelling
Salesman Problem
Best Solution [Distance=420]
Applications of GAs
• GAs used to solve NP-hard
problems, but also for art,
evolving pictures and music

• In the first represented image,
a binary tree type of encoding
is used to generate the
images through mathematical
operations:
Source: [http://www.algosome.com/articles/genetic-algorithm-evolution-art.html]
Applications of GAs
• Data analysis

• Designing Neural Networks

• Robot trajectory

• Evolving LISP programs
• Strategy Planning 

• Finding the shape of protein
molecules

• Sequence Scheduling

• Functions for creating images
Issues for GAs
• Choosing basic implementation issues:

• representation

• population size, mutation rate, ...

• selection, deletion policies

• crossover, mutation operators

• Termination Criteria

• Performance, scalability

• Solution is only as good as the evaluation function (often
hardest part)
Strengths of GAs
• Concept is easy to understand

• Modular, separate from application

• Supports multi-objective optimization

• Good for “noisy” environments

• Always an answer; answer gets better with time

• Inherently parallel; easily distributed
Strengths of GAs
• Many ways to speed up and improve a GA-based
application as knowledge about problem domain is
gained

• Easy to exploit previous or alternate solutions

• Flexible building blocks for hybrid applications

• Substantial history and range of use
When to use GAs
• Alternate solutions are too slow or overly complicated

• Need an exploratory tool to examine new approaches

• Problem is similar to one that has already been
successfully solved by using a GA

• Want to hybridize with an existing solution

• Benefits of the GA technology meet key problem
requirements
Time for class exercise …

Weitere ähnliche Inhalte

Ähnlich wie Introduction to Genetic Algorithms

Genetic Algorithm
Genetic Algorithm Genetic Algorithm
Genetic Algorithm Bhushan Mohite
 
GA of a Paper 2012.pptx
GA of a Paper 2012.pptxGA of a Paper 2012.pptx
GA of a Paper 2012.pptxwaqasjavaid26
 
Genetic algorithm raktim
Genetic algorithm raktimGenetic algorithm raktim
Genetic algorithm raktimRaktim Halder
 
Genetic algorithm_raktim_IITKGP
Genetic algorithm_raktim_IITKGP Genetic algorithm_raktim_IITKGP
Genetic algorithm_raktim_IITKGP Raktim Halder
 
Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithmgarima931
 
CSA 3702 machine learning module 4
CSA 3702 machine learning module 4CSA 3702 machine learning module 4
CSA 3702 machine learning module 4Nandhini S
 
evolutionary algo's.ppt
evolutionary algo's.pptevolutionary algo's.ppt
evolutionary algo's.pptSherazAhmed103
 
Geneticalgorithms 100403002207-phpapp02
Geneticalgorithms 100403002207-phpapp02Geneticalgorithms 100403002207-phpapp02
Geneticalgorithms 100403002207-phpapp02Amna Saeed
 
ga-2.ppt
ga-2.pptga-2.ppt
ga-2.pptsayedmha
 
Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithmJari Abbas
 
Chapter09.ppt
Chapter09.pptChapter09.ppt
Chapter09.pptbutest
 
Introduction to Genetic Algorithms 2014
Introduction to Genetic Algorithms 2014Introduction to Genetic Algorithms 2014
Introduction to Genetic Algorithms 2014Aleksander Stensby
 
Final Presentation - Edan&Itzik
Final Presentation - Edan&ItzikFinal Presentation - Edan&Itzik
Final Presentation - Edan&Itzikitzik cohen
 
Introduction to Genetic Algorithms
Introduction to Genetic AlgorithmsIntroduction to Genetic Algorithms
Introduction to Genetic AlgorithmsAhmed Othman
 
ObjRecog2-17 (1).pptx
ObjRecog2-17 (1).pptxObjRecog2-17 (1).pptx
ObjRecog2-17 (1).pptxssuserc074dd
 
Ff meeting 25nov03
Ff meeting 25nov03Ff meeting 25nov03
Ff meeting 25nov03moniajit
 

Ähnlich wie Introduction to Genetic Algorithms (20)

Genetic Algorithm
Genetic Algorithm Genetic 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
 
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
 
Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
Genetic Algorithm
 
Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithm
 
CSA 3702 machine learning module 4
CSA 3702 machine learning module 4CSA 3702 machine learning module 4
CSA 3702 machine learning module 4
 
Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
Genetic Algorithm
 
evolutionary algo's.ppt
evolutionary algo's.pptevolutionary algo's.ppt
evolutionary algo's.ppt
 
genetic computing
genetic computinggenetic computing
genetic computing
 
Geneticalgorithms 100403002207-phpapp02
Geneticalgorithms 100403002207-phpapp02Geneticalgorithms 100403002207-phpapp02
Geneticalgorithms 100403002207-phpapp02
 
Introduction to Genetic algorithm and its significance in VLSI design and aut...
Introduction to Genetic algorithm and its significance in VLSI design and aut...Introduction to Genetic algorithm and its significance in VLSI design and aut...
Introduction to Genetic algorithm and its significance in VLSI design and aut...
 
ga-2.ppt
ga-2.pptga-2.ppt
ga-2.ppt
 
Genetic algorithm
Genetic algorithmGenetic algorithm
Genetic algorithm
 
Chapter09.ppt
Chapter09.pptChapter09.ppt
Chapter09.ppt
 
Introduction to Genetic Algorithms 2014
Introduction to Genetic Algorithms 2014Introduction to Genetic Algorithms 2014
Introduction to Genetic Algorithms 2014
 
Final Presentation - Edan&Itzik
Final Presentation - Edan&ItzikFinal Presentation - Edan&Itzik
Final Presentation - Edan&Itzik
 
Introduction to Genetic Algorithms
Introduction to Genetic AlgorithmsIntroduction to Genetic Algorithms
Introduction to Genetic Algorithms
 
ObjRecog2-17 (1).pptx
ObjRecog2-17 (1).pptxObjRecog2-17 (1).pptx
ObjRecog2-17 (1).pptx
 
Ff meeting 25nov03
Ff meeting 25nov03Ff meeting 25nov03
Ff meeting 25nov03
 

Mehr von Vanessa Camilleri

ICS 2208 Lecture 8 Slides AI and VR_.pdf
ICS 2208 Lecture 8 Slides AI and VR_.pdfICS 2208 Lecture 8 Slides AI and VR_.pdf
ICS 2208 Lecture 8 Slides AI and VR_.pdfVanessa Camilleri
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6Vanessa Camilleri
 
ICS2208 Lecture4 Intelligent Interface Agents.pdf
ICS2208 Lecture4 Intelligent Interface Agents.pdfICS2208 Lecture4 Intelligent Interface Agents.pdf
ICS2208 Lecture4 Intelligent Interface Agents.pdfVanessa Camilleri
 
ICS2208 Lecture3 2023-2024 - Model Based User Interfaces
ICS2208 Lecture3 2023-2024 - Model Based User InterfacesICS2208 Lecture3 2023-2024 - Model Based User Interfaces
ICS2208 Lecture3 2023-2024 - Model Based User InterfacesVanessa Camilleri
 
ICS2208 Lecture 2 Slides Interfaces_.pdf
ICS2208 Lecture 2 Slides Interfaces_.pdfICS2208 Lecture 2 Slides Interfaces_.pdf
ICS2208 Lecture 2 Slides Interfaces_.pdfVanessa Camilleri
 
ICS Lecture 11 - Intelligent Interfaces 2023
ICS Lecture 11 - Intelligent Interfaces 2023ICS Lecture 11 - Intelligent Interfaces 2023
ICS Lecture 11 - Intelligent Interfaces 2023Vanessa Camilleri
 
ICS3211_lecture 09_2023.pdf
ICS3211_lecture 09_2023.pdfICS3211_lecture 09_2023.pdf
ICS3211_lecture 09_2023.pdfVanessa Camilleri
 
ICS3211_lecture 08_2023.pdf
ICS3211_lecture 08_2023.pdfICS3211_lecture 08_2023.pdf
ICS3211_lecture 08_2023.pdfVanessa Camilleri
 
ICS3211_lecture_week72023.pdf
ICS3211_lecture_week72023.pdfICS3211_lecture_week72023.pdf
ICS3211_lecture_week72023.pdfVanessa Camilleri
 
ICS3211_lecture_week62023.pdf
ICS3211_lecture_week62023.pdfICS3211_lecture_week62023.pdf
ICS3211_lecture_week62023.pdfVanessa Camilleri
 
ICS3211_lecture_week52023.pdf
ICS3211_lecture_week52023.pdfICS3211_lecture_week52023.pdf
ICS3211_lecture_week52023.pdfVanessa Camilleri
 
ICS3211_lecture 04 2023.pdf
ICS3211_lecture 04 2023.pdfICS3211_lecture 04 2023.pdf
ICS3211_lecture 04 2023.pdfVanessa Camilleri
 
ICS3211_lecture 03 2023.pdf
ICS3211_lecture 03 2023.pdfICS3211_lecture 03 2023.pdf
ICS3211_lecture 03 2023.pdfVanessa Camilleri
 
ICS3211_lecture 11.pdf
ICS3211_lecture 11.pdfICS3211_lecture 11.pdf
ICS3211_lecture 11.pdfVanessa Camilleri
 
FoundationsAIEthics2023.pdf
FoundationsAIEthics2023.pdfFoundationsAIEthics2023.pdf
FoundationsAIEthics2023.pdfVanessa Camilleri
 
ICS3211_lecture 9_2022.pdf
ICS3211_lecture 9_2022.pdfICS3211_lecture 9_2022.pdf
ICS3211_lecture 9_2022.pdfVanessa Camilleri
 

Mehr von Vanessa Camilleri (20)

ICS 2208 Lecture 8 Slides AI and VR_.pdf
ICS 2208 Lecture 8 Slides AI and VR_.pdfICS 2208 Lecture 8 Slides AI and VR_.pdf
ICS 2208 Lecture 8 Slides AI and VR_.pdf
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6
 
ICS2208 Lecture4 Intelligent Interface Agents.pdf
ICS2208 Lecture4 Intelligent Interface Agents.pdfICS2208 Lecture4 Intelligent Interface Agents.pdf
ICS2208 Lecture4 Intelligent Interface Agents.pdf
 
ICS2208 Lecture3 2023-2024 - Model Based User Interfaces
ICS2208 Lecture3 2023-2024 - Model Based User InterfacesICS2208 Lecture3 2023-2024 - Model Based User Interfaces
ICS2208 Lecture3 2023-2024 - Model Based User Interfaces
 
ICS2208 Lecture 2 Slides Interfaces_.pdf
ICS2208 Lecture 2 Slides Interfaces_.pdfICS2208 Lecture 2 Slides Interfaces_.pdf
ICS2208 Lecture 2 Slides Interfaces_.pdf
 
ICS Lecture 11 - Intelligent Interfaces 2023
ICS Lecture 11 - Intelligent Interfaces 2023ICS Lecture 11 - Intelligent Interfaces 2023
ICS Lecture 11 - Intelligent Interfaces 2023
 
ICS3211_lecture 09_2023.pdf
ICS3211_lecture 09_2023.pdfICS3211_lecture 09_2023.pdf
ICS3211_lecture 09_2023.pdf
 
ICS3211_lecture 08_2023.pdf
ICS3211_lecture 08_2023.pdfICS3211_lecture 08_2023.pdf
ICS3211_lecture 08_2023.pdf
 
ICS3211_lecture_week72023.pdf
ICS3211_lecture_week72023.pdfICS3211_lecture_week72023.pdf
ICS3211_lecture_week72023.pdf
 
ICS3211_lecture_week62023.pdf
ICS3211_lecture_week62023.pdfICS3211_lecture_week62023.pdf
ICS3211_lecture_week62023.pdf
 
ICS3211_lecture_week52023.pdf
ICS3211_lecture_week52023.pdfICS3211_lecture_week52023.pdf
ICS3211_lecture_week52023.pdf
 
ICS3211_lecture 04 2023.pdf
ICS3211_lecture 04 2023.pdfICS3211_lecture 04 2023.pdf
ICS3211_lecture 04 2023.pdf
 
ICS3211_lecture 03 2023.pdf
ICS3211_lecture 03 2023.pdfICS3211_lecture 03 2023.pdf
ICS3211_lecture 03 2023.pdf
 
ICS3211_lecture 11.pdf
ICS3211_lecture 11.pdfICS3211_lecture 11.pdf
ICS3211_lecture 11.pdf
 
FoundationsAIEthics2023.pdf
FoundationsAIEthics2023.pdfFoundationsAIEthics2023.pdf
FoundationsAIEthics2023.pdf
 
ICS3211_lecture 9_2022.pdf
ICS3211_lecture 9_2022.pdfICS3211_lecture 9_2022.pdf
ICS3211_lecture 9_2022.pdf
 
ICS1020CV_2022.pdf
ICS1020CV_2022.pdfICS1020CV_2022.pdf
ICS1020CV_2022.pdf
 
ARI5902_2022.pdf
ARI5902_2022.pdfARI5902_2022.pdf
ARI5902_2022.pdf
 
ICS2208 Lecture10
ICS2208 Lecture10ICS2208 Lecture10
ICS2208 Lecture10
 

KĂźrzlich hochgeladen

Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxAmita Gupta
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxDavid Douglas School District
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxdhanalakshmis0310
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 

KĂźrzlich hochgeladen (20)

Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 

Introduction to Genetic Algorithms

  • 1. Foundations in AI Introduction to Genetic Algorithms Dr Vanessa Camilleri Department of AI October 2018
  • 2. Overview • Introduction • GA Algorithm • Components • Examples • Applications
  • 3. Introduction • Mimics Theory of Evolution • GAs as a general purpose learning algorithm • Solving a complex problem of problems • Uses Natural Selection or Survival of the Fittest
  • 4. Introduction • Natural Selection: variations in gene that increases its chances of survival
  • 8. Introduction • NP (nondeterministic polynomial) Hard Problems • cannot be solved in traditional way • possible to guess the solution
  • 9. Basic GA algorithm 1. [Start] Generate random population of n chromosomes (suitable solutions for the problem) 2. [Fitness] Evaluate the tness 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 1. [Selection] Select two parent chromosomes from a population according to their tness (the better tness, the bigger chance to be selected) 2. [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. 3. [Mutation] With a mutation probability mutate new offspring at each locus (position in chromosome). 4. [Accept] Place new offspring in a new population 5. [Replace] Use new generated population for a further run of algorithm 6. [Test] If the end condition is satised, stop, and return the best solution in current population [Loop] Go to step 2
  • 11. GA Cycle of Reproduction Reproduction Modification EvaluationPopulation Discard Children Modified Children Evaluated Children Deleted Members Parents
  • 12. GA Operators 1. Reproduction: aka selection operator, usually the rst operator applied on the population. Chromosomes are selected from the population to cross over and produce offspring 2. Crossover: After reproduction population is enriched with better individuals. 3. Mutation: Happens after crossover, causing a random change in the offspring.
  • 13. Chromosomes could be: – Bit strings (0101 ... 1100) – Real numbers (43.2 -33.1 ... 0.0 89.2) – Permutations of element (E11 E3 E7 ... E1 E15) – Lists of rules (R1 R2 R3 ... R22 R23) – Program elements (genetic programming) – Any data structure ...
  • 14. Crossover Chromosome 1 11011 | 00100110110 Chromosome 2 11011 | 11000011110 Offspring 1 11011 | 11000011110 Offspring 2 11011 | 00100110110 Chromosome 1 1101100100110110 Chromosome 2 1101111000011110
  • 15. Mutation Original offspring 1 1101111000011110 Original offspring 2 1101100100110110 Mutated offspring 1 1100111000011110 Mutated offspring 2 1101101100110110
  • 16. GA Parameters • Solving the problem by nding the extreme of a function • GA Parameters • Crossover and Mutation Probability • Population Size
  • 17. GA: Selection Roulette Wheel Selection Rank Selection before after Steady State Selection Elitism
  • 18. GA: Encoding • Binary Encoding • example Knapsack problem • Permutation Encoding • example Travelling Salesman problem Chromosome A 101100101100101011100101 Chromosome B 111111100000110000011111 Chromosome A 1  5  3  2  6  4  7  9  8 Chromosome B 8  5  6  7  2  3  1  4  9
  • 19. GA: Encoding • Value Encoding • example nding weights for neural network • Tree Encoding • example nding a function from given values Chromosome A 1.2324  5.3243  0.4556  2.3293  2.4545 Chromosome B ABDJEIFJDHDIERJFDLDFLFEGT Chromosome C (back), (back), (right), (forward), (left) Chromosome A Chromosome B ( +  x  ( /  5  y ) ) ( do_until  step  wall )
  • 20. • Binary Encoding: Crossover • Single Point Crossover • Two Point Crossover Crossover & Mutation 11001011+11011111 = 11001111 11001011 + 11011111 = 11011111
  • 21. Crossover & Mutation • Uniform Crossover • Arithmetic Crossover 11001011 + 11011101 = 11011111 11001011 + 11011111 = 11001001 (AND)
  • 22. Crossover & Mutation • Mutation: Bit Inversion 11001001 =>  10001001
  • 23. • Permutation Encoding • Crossover: Single Point Crossover • Mutation: Order Changing Crossover & Mutation (1 2 3 4 5 6 7 8 9) + (4 5 3 6 8 9 7 2 1) = (1 2 3 4 5 6 8 9 7) (1 2 3 4 5 6 8 9 7) => (1 8 3 4 5 6 2 9 7)
  • 24. • Value Encoding • Crossover: All crossovers from Binary Encoding can be used • Mutation: Adding Crossover & Mutation 1.29  5.68  2.86  4.11  5.55) => (1.29  5.68  2.73  4.22  5.55)
  • 25. • Tree Encoding • Crossover: Tree Crossover • Mutation: Changing operator, number Crossover & Mutation
  • 31. Example: Travelling Salesman Problem Best Solution [Distance=420]
  • 32. Applications of GAs • GAs used to solve NP-hard problems, but also for art, evolving pictures and music • In the rst represented image, a binary tree type of encoding is used to generate the images through mathematical operations: Source: [http://www.algosome.com/articles/genetic-algorithm-evolution-art.html]
  • 33. Applications of GAs • Data analysis • Designing Neural Networks • Robot trajectory • Evolving LISP programs • Strategy Planning • Finding the shape of protein molecules • Sequence Scheduling • Functions for creating images
  • 34. Issues for GAs • Choosing basic implementation issues: • representation • population size, mutation rate, ... • selection, deletion policies • crossover, mutation operators • Termination Criteria • Performance, scalability • Solution is only as good as the evaluation function (often hardest part)
  • 35. Strengths of GAs • Concept is easy to understand • Modular, separate from application • Supports multi-objective optimization • Good for “noisy” environments • Always an answer; answer gets better with time • Inherently parallel; easily distributed
  • 36. Strengths of GAs • Many ways to speed up and improve a GA-based application as knowledge about problem domain is gained • Easy to exploit previous or alternate solutions • Flexible building blocks for hybrid applications • Substantial history and range of use
  • 37. When to use GAs • Alternate solutions are too slow or overly complicated • Need an exploratory tool to examine new approaches • Problem is similar to one that has already been successfully solved by using a GA • Want to hybridize with an existing solution • Benets of the GA technology meet key problem requirements
  • 38. Time for class exercise …