B219 Intelligent Systems
Week 4 Lecture Notes page 1 of 1
Evolutionary Computation Evolution and Intelligent
§ Besides learning ability, intelligence can also be
defined as the capability of a system to adapt its
behaviour to ever changing environment.
§ Evolutionary computation simulates evolution on a
computer. The result of such a simulation is a series of
optimisation algorithms, usually based on a simple set
of rules.
§ Optimisation iteratively improves the quality of
solutions until an optimal, or at least feasible,
solution is found.
§ The behaviour of an individual organism is an
inductive inference about some yet unknown aspects
of its environment.
B219 Intelligent Systems
Week 4 Lecture Notes page 2 of 2
§ If, over successive generations, the organism survives,
we can say that this organism is capable of learning to
predict changes in its environment.
§ The evolutionary approach is based on computational
models of natural selection and genetics. It is call
evolutionary computation, an umbrella term that
combines genetic algorithms, evolution strategies and
genetic programming.
§ Evolution can be seen as a process leading to the
maintenance of a population’s ability to survive and
reproduce in a specific environment. This ability is
called evolutionary fitness.
§ Evolutionary fitness can also be viewed as a measure
of the organism’s ability to anticipate changes in its
environment.
B219 Intelligent Systems
Week 4 Lecture Notes page 3 of 3
§ The fitness, or the quantitative measure of the ability
to predict environment changes and respond
adequately, can be considered as the quality that is
optimised in natural life.
How is a population with increasing fitness
generated?
§ Let us consider a population of rabbits. Some rabbits
are faster than others, and we may say that these
rabbits posses superior fitness, because they have a
greater chance of avoiding foxes, surviving and then
breeding.
§ If two parents have superior fitness, there is a good
chance that a combination of their genes will produce
an offspring with even higher fitness. Over time the
entire population of rabbits becomes faster to meet
their environment challenges in the face of foxes.
B219 Intelligent Systems
Week 4 Lecture Notes page 4 of 4
Genetic Algorithms
§ Genetic Algorithm (GA) is a sub branch of
Evolutionary Algorithm (EA)
§ GA was introduced in 1970s by John Holland with
the aim to make computes do what nature does
§ He was concerned with algorithms that manipulate
strings of binary digits
§ Each artificial “chromosomes” consists of a number of
“genes”, and each gene is represented by 0 or 1:
§ Nature has an ability to adapt and learn without being
told what to do. In other words, nature finds good
chromosomes blindly, and GAs do the same.
§ Two mechanisms link a GA to the problem it is
solving: encoding and evaluation.
B219 Intelligent Systems
Week 4 Lecture Notes page 5 of 5
§ The GA uses a measure of fitness of individual
chromosomes to carry out reproduction.
§ As reproduction takes place, the crossover operator
exchanges parts of two single chromosomes, and the
mutation operator changes the gene value in some
randomly chosen location of the chromosome.
Basic Genetic Algorithms
§ Step 1: Represent the problem variable domain as a
chromosome of a fixed length, choose the size of a
chromosome population N, the crossover probability
pc, and the mutation probability pm.
§ Step 2: Define a fitness function to measure the
performance, or fitness, of an individual chromosome
in the problem domain. The fitness function
establishes the basis for selecting chromosomes that
will be mated during reproduction.
B219 Intelligent Systems
Week 4 Lecture Notes page 6 of 6
§ Step 3: Randomly generate an initial population of
chromosomes of size N:
Nxxx ,...,, 21
§ Step 4: Calculate the fitness of each individual
chromosome:
)(),...,(),( 21 Nxfxfxf
§ Step 5: Select a pair of chromosomes for mating from
the current population. Parent chromosomes are
selected with a probability related to their fitness.
§ Step 6: Create a pair of offspring chromosomes by
applying the genetic operators – crossover and
mutation.
§ Step 7: Place the created offspring chromosomes in
the new population.
B219 Intelligent Systems
Week 4 Lecture Notes page 7 of 7
§ Step 8: Repeat Step 5 until the size of new
chromosome population becomes equal to the size of
the initial population, N.
§ Step 9: Replace the initial (parent) chromosome
population with the new (offspring) population.
§ Step 10: Go to Step 4, and repeat the process until the
termination criterion is satisfied.
§ GA represents an iterative process. Each iteration is
called a generation.
B219 Intelligent Systems
Week 4 Lecture Notes page 8 of 8
§ A typical number of generations for a simple GA
can range from 50 to over 500. The entire of set of
generation is called a run.
§ Chromosomes could be:
o Bit strings (0101 ... 1100) o Real numbers (43.2 -33.1 ... 0.0 89.2) o Permutations of element (E11 E3 E7 ... E1 E15) o Lists of rules (R1 R2 R3 ... R22 R23) o Program elements (genetic programming)
... any data structure ... An Example: The Travelling Salesman Problem § Find a tour of a given set of cities so that
o each city is visited only once o the total distance travelled is minimized
§ Representation is an ordered list of city numbers
known as an order-based GA
1) London 3) Dunedin 5) Beijing 7) Tokyo 2) Venice 4) Singapore 6) Phoenix 8) Victoria
CityList1 (3 5 7 2 1 6 4 8) CityList2 (2 5 7 6 8 1 3 4)
B219 Intelligent Systems
Week 4 Lecture Notes page 9 of 9
§ Crossover combines inversion and recombination: * * Parent1 (3 5 7 2 1 6 4 8) Parent2 (2 5 7 6 8 1 3 4) Child (5 8 7 2 1 6 3 4) § This operator is called the Order 1 crossover. § Mutation involves reordering of the list: * * Before: (5 8 7 2 1 6 3 4) After: (5 8 6 2 1 7 3 4) § Example of 30 cities:
B219 Intelligent Systems
Week 4 Lecture Notes page 10 of 10
§ Solution i (Distance = 941)
§ Solution j (Distance = 800)
B219 Intelligent Systems
Week 4 Lecture Notes page 11 of 11
§ Solution k (Distance = 652)
§ Best solution (Distance = 420)
B219 Intelligent Systems
Week 4 Lecture Notes page 12 of 12
§ Overview of Performance
Benefits of using GA § Concept is easy to understand § Supports multi-objective optimization § Good for “noisy” environments § Always an answer; answer gets better with time § Easy to exploit previous or alternate solutions § 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
B219 Intelligent Systems
Week 4 Lecture Notes page 13 of 13
§ Flexible building blocks for hybrid applications § Substantial history and range of use When GA can be use? § 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 hybridise with an existing solution § Benefits of the GA technology meet key problem
requirements