THE CONTINUOUS GENETIC ALGORITHM
DR H.K. LAM
Department of Engineering
Kings College London
Office S2.14, Strand Building, Strand Campus
Email: [email protected]
https://nms.kcl.ac.uk/hk.lam
Nature-Inspired Learning Algorithms (7CCSMBIM)
DrH.K.Lam (KCL) TheContinuousGeneticAlgorithm NILAs2020-21 1/36
Outline
1 The Continuous Genetic Algorithm Variables and Cost Function Population
Natural Selection
Selection Crossover Mutation
2 Examples
DrH.K.Lam (KCL)
TheContinuousGeneticAlgorithm
NILAs2020-21 2/36
Learning Aims and Objectives
Aims
To understand the process of the continuous genetic algorithms.
To apply the continuous genetic algorithm to optimisation problems. To know the limitations of the continuous genetic algorithms.
Objectives
To study how the continuous genetic algorithm works in details.
To consider a number of applications and formulate as minimisation problems.
DrH.K.Lam (KCL) TheContinuousGeneticAlgorithm NILAs2020-21 3/36
The Continuous Genetic Algorithm
DrH.K.Lam (KCL) TheContinuousGeneticAlgorithm NILAs2020-21 4/36
Introduction
The Continuous Genetic Algorithm
Requires less storage than the binary GA.
A single floating-point number v.s. Nbit of 0s and 1s.
Allows representation to the machine precision.
Inherently runs faster than the binary GA as no encoding and decoding needed.
Deals with complex problem with high dimensionality.
More logical to represent variables by floating-point numbers when the problems are continuous.
DrH.K.Lam (KCL) TheContinuousGeneticAlgorithm NILAs2020-21 5/36
The Continuous Genetic Algorithm
E CONTINUOUS GENETIC ALGORITHM
Define cost function, cost, variables Select GA parameters
Generate initial population
Find cost for each chromosome
Select mates
Mating
Mutation
Convergence Check
Figure 3.1
Flowchart of a continuous GA.
Initial population with random members
Rating
Selection
Reproduction
Mutation
done
Figure 1: Flowchart of a continuous genetic algorithm
DrH.K.Lam (KCL) TheContinuousGeneticAlgorithm NILAs2020-21 6/36
MPONENTS OF A CONTINUOUS GENETIC ALGORITHM
H
O
Variables and Cost Function
The optimisation variables are represented by chromosome. chromosome = [p1,p2, ,pNvar ]
Each gene (pi, i = 1, 2, , Nvar) is a real-coded variable. The cost is evaluated by a cost (fitness) function.
cost = f (chromosome) = f (p1 , p2 , , pNvar )
Variable values are represented as floating-point number; no longer need to consider how many bits are necessary to accurately represent a value.
No encoding and decoding before cost function evaluation.
Only limited to the internal precision and round-off error of computers.
Natural form of real-valued cost function can be used directly.
DrH.K.Lam (KCL) TheContinuousGeneticAlgorithm NILAs2020-21 7/36
Population
The GA starts with an initial population with Npop chromosomes with an
Npop Nvar matrix filled with randomly generated real values.
Example: A cost function: cost = f (x, y) = x sin(4x) + 1.1y sin(2y) subject to 0 x 10 and 0 y 10.
chromosome = [x, y] x y Cost
6.9745 0.8342 0.30359 9.6828 2.402 9.3359 0.18758 8.9371 2.6974 6.2647 5.613 0.1289 7.7246 5.5655 6.8537 9.8784
3.4766
5.5408