Genetic Algorithms
By
Dr. Sarbjeet Singh
Associate Professor, Computer Science & Engineering
University Institute of Engineering & Technology
Panjab University, Chandigarh - 160014
Agenda
• Introduction to Genetic Algorithms
• Genetic Algorithm Process
– Population Generation
– Evaluation
– Selection
– Crossover
– Mutation
– Next Generation
• Examples
Genetic Algorithms
• Genetic Algorithms are part of Evolutionary Computing.
• Genetic Algorithms are adaptive heuristic search
algorithms.
– In AI, the set of possible solutions for a given problem defines
the search space (also called state space).
• Genetic Algorithms are inspired by Darwin’s theory
about evolution – “survival of the fittest”.
• Genetic Algorithms represent an intelligent exploitation
of a random search used to solve optimization
problems.
– Genetic algorithms often escape from local optimums.
Biological Background
– Basic Genetics
• All living organisms consist of cells.
• In each cell, there is same set of chromosomes.
• Chromosomes consists of genes, blocks of DNA.
Chromosome contains the solution in form of genes.
• Each gene encodes a particular protein that represents a
trait (feature), e.g., color of eyes. A gene contains a part of
solution.
• Complete set of genetic material (all chromosomes) is called
a genome.
• Particular set of genes in a genome is called genotype.
General Scheme of Evolutionary Process
Flow Chart – Genetic Programming
Encoding
Before a genetic algorithm can be put to work on any problem,
a method is needed to encode potential solutions to that
problem in a form so that computer can process.
Encoding Methods
–Encoding as a binary string
• e.g. 10001101
–Encoding values as integers
• e.g. 45621873
–Encoding values as real numbers
•e.g. 4.56.78.39.52.36.45.57.48.5
–Encoding values as characters
•e.g. abdefcgh
–Encoding values as symbols
• e.g. αβγδλμνξ
Encoding method depends on the problem to work on.
Examples of Encoding
Examples of Encoding
Operators of Genetic Algorithm
Reproduction or Selection
Selection Methods
• Roulette Wheel Selection
• Boltzmann Selection
• Tournament Selection
• Rank Selection
• Steady State Selection
Roulette Wheel Selection
Crossover
One-point Crossover
Two-point Crossover
Uniform Crossover
Arithmetic Crossover
Heuristic Crossover
Mutation
Flip Bit
Mutation Operators
Mutation Operators
Example: Basic Genetic Algorithm
Example: Basic Genetic Algorithm
Example: Basic Genetic Algorithm
Example: Basic Genetic Algorithm
Example: Basic Genetic Algorithm
Example: Basic Genetic Algorithm
Example: Basic Genetic Algorithm
Thank You