The document introduces genetic algorithms, which are inspired by biological evolution. It describes how genetic algorithms use operations like selection, crossover and mutation to evolve solutions to problems in a way that is analogous to natural selection. It also outlines the basic components of a genetic algorithm, including representing solutions, initializing a population, evaluating fitness, and selecting solutions to breed new generations. Finally, it discusses some common applications of genetic algorithms to optimization problems.
1. Introduction
Biological Inspiration
Search Spaces
A Genetic Algorithm
Experimental Setup
Genetic Operators
Applications
Conclusions
GENETIC ALGORITHMS
Muhammad Adil Raja
Roaming Researchers, Inc.
August 12, 2014
Muhammad Adil Raja Genetic Algorithms
2. Introduction
Biological Inspiration
Search Spaces
A Genetic Algorithm
Experimental Setup
Genetic Operators
Applications
Conclusions
OUTLINE
INTRODUCTION
BIOLOGICAL INSPIRATION
SEARCH SPACES
A GENETIC ALGORITHM
EXPERIMENTAL SETUP
GENETIC OPERATORS
APPLICATIONS
CONCLUSIONS
Muhammad Adil Raja Genetic Algorithms
3. Introduction
Biological Inspiration
Search Spaces
A Genetic Algorithm
Experimental Setup
Genetic Operators
Applications
Conclusions
OUTLINE
INTRODUCTION
BIOLOGICAL INSPIRATION
SEARCH SPACES
A GENETIC ALGORITHM
EXPERIMENTAL SETUP
GENETIC OPERATORS
APPLICATIONS
CONCLUSIONS
Muhammad Adil Raja Genetic Algorithms
4. Introduction
Biological Inspiration
Search Spaces
A Genetic Algorithm
Experimental Setup
Genetic Operators
Applications
Conclusions
OUTLINE
INTRODUCTION
BIOLOGICAL INSPIRATION
SEARCH SPACES
A GENETIC ALGORITHM
EXPERIMENTAL SETUP
GENETIC OPERATORS
APPLICATIONS
CONCLUSIONS
Muhammad Adil Raja Genetic Algorithms
5. Introduction
Biological Inspiration
Search Spaces
A Genetic Algorithm
Experimental Setup
Genetic Operators
Applications
Conclusions
OUTLINE
INTRODUCTION
BIOLOGICAL INSPIRATION
SEARCH SPACES
A GENETIC ALGORITHM
EXPERIMENTAL SETUP
GENETIC OPERATORS
APPLICATIONS
CONCLUSIONS
Muhammad Adil Raja Genetic Algorithms
6. Introduction
Biological Inspiration
Search Spaces
A Genetic Algorithm
Experimental Setup
Genetic Operators
Applications
Conclusions
OUTLINE
INTRODUCTION
BIOLOGICAL INSPIRATION
SEARCH SPACES
A GENETIC ALGORITHM
EXPERIMENTAL SETUP
GENETIC OPERATORS
APPLICATIONS
CONCLUSIONS
Muhammad Adil Raja Genetic Algorithms
7. Introduction
Biological Inspiration
Search Spaces
A Genetic Algorithm
Experimental Setup
Genetic Operators
Applications
Conclusions
OUTLINE
INTRODUCTION
BIOLOGICAL INSPIRATION
SEARCH SPACES
A GENETIC ALGORITHM
EXPERIMENTAL SETUP
GENETIC OPERATORS
APPLICATIONS
CONCLUSIONS
Muhammad Adil Raja Genetic Algorithms
8. Introduction
Biological Inspiration
Search Spaces
A Genetic Algorithm
Experimental Setup
Genetic Operators
Applications
Conclusions
OUTLINE
INTRODUCTION
BIOLOGICAL INSPIRATION
SEARCH SPACES
A GENETIC ALGORITHM
EXPERIMENTAL SETUP
GENETIC OPERATORS
APPLICATIONS
CONCLUSIONS
Muhammad Adil Raja Genetic Algorithms
9. Introduction
Biological Inspiration
Search Spaces
A Genetic Algorithm
Experimental Setup
Genetic Operators
Applications
Conclusions
OUTLINE
INTRODUCTION
BIOLOGICAL INSPIRATION
SEARCH SPACES
A GENETIC ALGORITHM
EXPERIMENTAL SETUP
GENETIC OPERATORS
APPLICATIONS
CONCLUSIONS
Muhammad Adil Raja Genetic Algorithms
10. Introduction
Biological Inspiration
Search Spaces
A Genetic Algorithm
Experimental Setup
Genetic Operators
Applications
Conclusions
INTRODUCTION TO GENETIC ALGORITHMS (GAS)
Genetic algorithms are inspired by Charles Darwinās theory
of evolution.
Fall under the umbrella of evolutionary computing.
Idea came from John Holland.
Muhammad Adil Raja Genetic Algorithms
11. Introduction
Biological Inspiration
Search Spaces
A Genetic Algorithm
Experimental Setup
Genetic Operators
Applications
Conclusions
BIOLOGICAL INSPIRATION I
The idea is inspired from natural
evolutionary biological systems.
In natural biological evolutionary systems,
organisms are made of cells.
A cell is composed of a set of
chromosomes.
Chromosomes are found in the nucleus.
Chromosomes are made of DNA. FIGURE: Structure
of a Biological Cell
Muhammad Adil Raja Genetic Algorithms
12. Introduction
Biological Inspiration
Search Spaces
A Genetic Algorithm
Experimental Setup
Genetic Operators
Applications
Conclusions
BIOLOGICAL INSPIRATION II
Sections of Chromosomes are called
genes.
DNA - deoxyribonucleic acid.
it is the genetic code that contains all the
information needed to build and maintain
an organism.
FIGURE:
Chromosome
Structure
Muhammad Adil Raja Genetic Algorithms
13. Introduction
Biological Inspiration
Search Spaces
A Genetic Algorithm
Experimental Setup
Genetic Operators
Applications
Conclusions
BIOLOGICAL INSPIRATION III
Each organism has a distinct number of chromosomes.
In humans every cell contains 46 chromosomes (23 pairs).
Other organisms have different numbers.
A dog has 76 chromosomes per cell.
Chromosomes come in pairs.
These are called homologous pairs (homologs).
Homologs can be imagined as matching pairs.
But they are not exactly alike.
Like a pair of shoes they can be different.
Muhammad Adil Raja Genetic Algorithms
14. Introduction
Biological Inspiration
Search Spaces
A Genetic Algorithm
Experimental Setup
Genetic Operators
Applications
Conclusions
SOME JARGON I
Chromosomes are composed of DNA.
DNA (and consequently chromosomes) are made of
genes.
A chromosome contains hundreds of thousands of genes.
Trait: Each gene encodes a particular protein, e.g. eye
color.
Alleles: Possible settings for a trait (e.g. color can be blue,
brown or black).
Muhammad Adil Raja Genetic Algorithms
15. Introduction
Biological Inspiration
Search Spaces
A Genetic Algorithm
Experimental Setup
Genetic Operators
Applications
Conclusions
SOME JARGON II
Locus: Each geneās own position in chromosome.
Genome: Complete set of genetic material.
Genotype: A particular set of genes in a genome.
Phenotype: A genotypeās physical and apparent
characteristics. (e.g. color, height, intelligence etc.)
Muhammad Adil Raja Genetic Algorithms
16. Introduction
Biological Inspiration
Search Spaces
A Genetic Algorithm
Experimental Setup
Genetic Operators
Applications
Conclusions
REPRODUCTION I
Crossover: (recombination): Happens during
reproduction.
Genes from parents recombine in a meaningful sense to
form a whole new chromosome.
Offspring.
They can be genetically mutated.
Muhammad Adil Raja Genetic Algorithms
17. Introduction
Biological Inspiration
Search Spaces
A Genetic Algorithm
Experimental Setup
Genetic Operators
Applications
Conclusions
REPRODUCTION II
Mutation: Elements of the DNA are randomly changed a
little bit.
This change is mainly caused during reproduction by errors
committed during copying genes from parents.
Fitness: A measure of success of the organism in a typical
ecosystem.
Muhammad Adil Raja Genetic Algorithms
18. Introduction
Biological Inspiration
Search Spaces
A Genetic Algorithm
Experimental Setup
Genetic Operators
Applications
Conclusions
SEARCH SPACES I
Space of all feasible solutions.
Each point in a search space represents
one feasible solution.
Each feasible solution can be marked by
its value or ļ¬tness for a problem.
Good solutions are desired.
It is often not possible to prove what is an
optimum solution.
FIGURE: A Non-Linear
Search Space
Muhammad Adil Raja Genetic Algorithms
19. Introduction
Biological Inspiration
Search Spaces
A Genetic Algorithm
Experimental Setup
Genetic Operators
Applications
Conclusions
SEARCH SPACES II
Search spaces can be very non-linear.
Like a mountainous terrain.
Finding the optimum solution is the real challenge.
Many locally optimum solutions can exist.
One or few globally optimum solutions may also exist.
How to ļ¬nd the best one?
That is what optimization is all about.
Muhammad Adil Raja Genetic Algorithms
20. Introduction
Biological Inspiration
Search Spaces
A Genetic Algorithm
Experimental Setup
Genetic Operators
Applications
Conclusions
A GENETIC ALGORITHM I
Solutions to problems are actually evolved.
The algorithm starts with a set of randomly chosen
solutions.
The solutions can be good or really really bad.
Solutions are evaluated for their ļ¬tness.
Muhammad Adil Raja Genetic Algorithms
21. Introduction
Biological Inspiration
Search Spaces
A Genetic Algorithm
Experimental Setup
Genetic Operators
Applications
Conclusions
A GENETIC ALGORITHM II
Solutions from one population are taken and used to form
a new population of better solutions.
Solutions that are selected to form new offspring solutions
are selected according to their ļ¬tness.
The more suitable ones have more chances to reproduce.
The algorithm is repeated until some stopping criterion is
met.
Muhammad Adil Raja Genetic Algorithms
22. Introduction
Biological Inspiration
Search Spaces
A Genetic Algorithm
Experimental Setup
Genetic Operators
Applications
Conclusions
A GA LIFE CYCLE: THE PSEUDOCODE
A GA Life Cycle: The Pseudo Code
1. Create an initial population of candidate solutions to a given
problem.
2. Evaluation.
3. Selection.
4. Reproduction.
5. Evaluation.
6. Replacement.
7. Continue from 3.
Muhammad Adil Raja Genetic Algorithms
24. Introduction
Biological Inspiration
Search Spaces
A Genetic Algorithm
Experimental Setup
Genetic Operators
Applications
Conclusions
TABLE: Fiddle Parameters of a Typical GA Experiment
Parameter Value
Initial Population Size 300
Initial Tree Depth 6
Selection Tournament Selection & Roulette Wheel
Tournament Size 2
Genetic Operators Crossover and Mutation
Operators Probability Type Adaptive
Initial Operator probabilities 0.5 each
Survival Elitism and Generational
Generation Gap 1
Muhammad Adil Raja Genetic Algorithms
25. Introduction
Biological Inspiration
Search Spaces
A Genetic Algorithm
Experimental Setup
Genetic Operators
Applications
Conclusions
SELECTION
Roulette Wheel Selection ā Fitness Proportionate
Selection.
Tournament Selection.
Muhammad Adil Raja Genetic Algorithms
26. Introduction
Biological Inspiration
Search Spaces
A Genetic Algorithm
Experimental Setup
Genetic Operators
Applications
Conclusions
SOLUTION REPRESENTATION IN GAS I
Depending upon the problem and its formulation, a solution
can be represented in various ways in a GA.
Most notable representations are:
1. Binary string representation.
This is one of the most common way of representing a
solution in a GA.
The solution is represented as a string of binary numbers.
Akin to a chromosome in biology.
2. Integer-valued arrays ā Integer programming (?).
3. Real-valued arrays ā for continuous parameter optimization.
4. Complete computer programs ā as in GP.
Muhammad Adil Raja Genetic Algorithms
27. Introduction
Biological Inspiration
Search Spaces
A Genetic Algorithm
Experimental Setup
Genetic Operators
Applications
Conclusions
SOLUTION REPRESENTATION IN GAS II
TABLE: Binary String Representation
Chromosome 1 1101100100110110
Chromosome 2 1101111000011110
Muhammad Adil Raja Genetic Algorithms
28. Introduction
Biological Inspiration
Search Spaces
A Genetic Algorithm
Experimental Setup
Genetic Operators
Applications
Conclusions
CROSSOVER I
1. Randomly choose two individuals
(chromosomes/individuals).
2. Choose crossover points on each one of them.
3. Swap the sub-parts around crossover points to form new
offspring.
Respect Syntactic or semantic constraints.
The child should solve the problem somehow.
Muhammad Adil Raja Genetic Algorithms
29. Introduction
Biological Inspiration
Search Spaces
A Genetic Algorithm
Experimental Setup
Genetic Operators
Applications
Conclusions
CROSSOVER II
TABLE: Binary String Crossover
Chromosome 1 110110010 0110110
Chromosome 2 110111100 0011110
Child Chromosome 1 110110010 110111100
Child Chromosome 2 0110110 0011110
Muhammad Adil Raja Genetic Algorithms
30. Introduction
Biological Inspiration
Search Spaces
A Genetic Algorithm
Experimental Setup
Genetic Operators
Applications
Conclusions
MUTATION I
1. Choose a newly created offspring.
2. Pick a random gene, or a few genes, on it.
3. Change its value to something else randomly ā Change
allele.
Muhammad Adil Raja Genetic Algorithms
31. Introduction
Biological Inspiration
Search Spaces
A Genetic Algorithm
Experimental Setup
Genetic Operators
Applications
Conclusions
MUTATION II
TABLE: Binary String Mutation
Chromosome 1 1101100100110110
Chromosome 2 1101111010011110
Muhammad Adil Raja Genetic Algorithms
33. Introduction
Biological Inspiration
Search Spaces
A Genetic Algorithm
Experimental Setup
Genetic Operators
Applications
Conclusions
FITNESS EVALUATION
Mean squared error (MSE).
Chi squared error.
Scaled mean squared error.
Muhammad Adil Raja Genetic Algorithms
34. Introduction
Biological Inspiration
Search Spaces
A Genetic Algorithm
Experimental Setup
Genetic Operators
Applications
Conclusions
APPLICATIONS OF GAS I
Applications are quite too many.
GA as a hammer.
A hammer that ļ¬nds almost everything else as a nail.
Muhammad Adil Raja Genetic Algorithms
35. Introduction
Biological Inspiration
Search Spaces
A Genetic Algorithm
Experimental Setup
Genetic Operators
Applications
Conclusions
APPLICATIONS OF GAS II
In regression and classiļ¬cation.
Regression or Classiļ¬cation of nonlinear problems.
In Telecommunications: Speech quality estimation.
In Computer Networks: Network coding.
In Finance: In evolving effective bidding strategies.
In Clinical: Cancer detectors, seizure detectors, mental
health diagnosis etc.
Muhammad Adil Raja Genetic Algorithms
36. Introduction
Biological Inspiration
Search Spaces
A Genetic Algorithm
Experimental Setup
Genetic Operators
Applications
Conclusions
APPLICATIONS OF GAS III
In evolving chess players.
In evolving antenna designs.
Evolvable hardware.
Muhammad Adil Raja Genetic Algorithms
37. Introduction
Biological Inspiration
Search Spaces
A Genetic Algorithm
Experimental Setup
Genetic Operators
Applications
Conclusions
CONCLUSIONS
GAs are strong problem solving algorithms.
They can be applied to a large number of optimization
problems.
Alternative solution representations render them suitable
for a wide variety of problem domains.
They are easy to understand.
The analogue from biological evolution is quite helpful.
They are easy to implement and fun to use.
They can be used to solved difļ¬cult problems.
Particularly suitable for ļ¬nding acceptable solutions to
otherwise intractable problems.
...
Muhammad Adil Raja Genetic Algorithms