Genetic Algorithm
Genetic Algorithm
Rovick P. Tarife
INTRODUCTION
What is GENETIC ALGORITHM? A genetic algorithm (GA) is a search heuristic that mimics the process of natural selection.
It used to generate useful solutions to optimization and search problems.
INTRODUCTION
Genetic algorithms belong to the larger class of evolutionary algorithms (EA), which generate solutions to optimization problems using techniques inspired by natural evolution, such as inheritance, mutation, selection, and crossover. It follows the idea of survival of the fittest
INTRODUCTION
G.A. was pioneered by John Holland in 1970s and was further developed by mathematicians, engineers and scientists in 1980s. It has now a flourishing field of research and application that goes much wider than the original GA.
TERMINOLOGIES
GA Terms Chromosome Gene Alleles Phenotype Genotype Locus Corresponding Optimization Description Solution set Part of solution Value of gene Decoded solution Encoded solution Position of gene
REPRESENTATION
REPRESENTATION
Chromosomes could be: Bit strings Real numbers Permutations of element Lists of rules Program elements ... any data structure ...
(0101 ... 1100) (43.2 -33.1 ... 0.0 89.2) (E11 E3 E7 ... E1 E15) (R1 R2 R3 ... R22 R23) (genetic programming)
REPRESENTATION
Genotype: Particular set of genes in a genome Phenotype: Physical characteristic of the genotype (smart, beautiful, healthy, etc.)
REPRESENTATION
Phenotype space Encoding (representation) Genotype space = {0,1}L
10010001
10010010 010001001
011101001
Decoding (inverse representation)
G.A. OUTLINE
Randomly generate a set of possible solutions to a problem, representing each as a fixed length character string Test each possible solution against the problem using a fitness function to evaluate each solution Keep the best solutions, and use them to generate new possible solutions Repeat the previous two steps until either an acceptable solution is found, or until the algorithm has iterated through a given number of cycles (generations)
G.A. OUTLINE
OPERATORS: SELECTION
OPERATORS: SELECTION
Roulette Wheel Parent Selection
100 0
OPERATORS: SELECTION
75.2
X1: 16.5% X2: 20.2% X3: 6.4% X4: 6.4% X5: 25.3% X6: 24.8%
OPERATORS: CROSSOVER
Crossover is an important random operator in GA and the function of the crossover operator is to generate new or child chromosomes from two parent chromosomes by combining the information extracted from the parents. It randomly chooses a crossover point where two parent chromosomes break, and then exchanges the chromosome parts after that point. As a result, two new offspring are created. Typically, the probability for crossover ranges from 0.6 to 0.95.
OPERATORS: CROSSOVER
OPERATORS: MUTATION
Mutation represents a change in the gene. Mutation is a background operator. Its role is to provide a guarantee that the search algorithm is not trapped on a local optimum. The mutation operator flips a randomly selected gene in a chromosome. The mutation probability is quite small in nature, and is kept low for GAs, typically in the range between 0.001 and 0.01.
OPERATORS: MUTATION
X6'i 1 0 0 0 X2'i 0 1 0 1 0 X1'i 1 0 1 1 1 1 1 X1"i
0 1 1 1
Generation ( i + 1) X1 i+1 1 0 0 X2 i+1 0 1 0 X3 i+1 1 0 1 X4 i+1 0 1 0 X5 i+1 0 1 1 X6 i+1 0 1 1 0 1 1 0 0 1 f = 56 f = 50 f = 44 f = 44 f = 54 f = 56 X1'i X5'i X2i X5i 0 1 1 1 1 1 1 X1"i 0 1 0 1 0 1 0 1 0 0 1 0 X2"i X6'i X2'i Mutation 1 0 0 0 0 1 0 1 0
0 1 1 1
EXAMPLE
An example after Goldberg 89 Simple problem: max x2 over {0,1,,31} GA approach:
Representation: binary code, e.g. 01101 13 Population size: 4 1-point crossover, bitwise mutation Roulette wheel selection Random initialization
EXAMPLE
x2 example: selection
EXAMPLE
X2 example: crossover
EXAMPLE
X2 example: mutation
EXAMPLE
EXAMPLE
MATLAB Program Example MATLAB Optimization Tool -GA (Add-In)
EXAMPLE
Easy to understand
APPLICATIONS
Parameter and System Identification Control Systems Robotics Pattern Recognition Engineering Designs Planning and Scheduling Classifier Systems and etc.
REFERENCES
Genetic Algorithms by Colin Reeves Chapter 13 (Genetic Algorithms) of Electric Power System Applications of Optimization by James Momoh Tutorial on Genetic Algorithm by Dr. Adel Abdennour Genetic Algorithm Toolbox by Chipperfield et. al. Genetic Algorithms: Concepts and Applications by Man et. al. http://en.wikipedia.org/wiki/Genetic_algorithm