CI Lecture6
CI Lecture6
After the examples we had covered, the following are the points that must be
addressed when building any GA:
Design a representation (Encoding).
Decide how to initialize a population.
Design a way of evaluating an individual.
Decide how to select individuals to be parents.
Design suitable recombination operator(s).
Design suitable mutation operator(s).
Decide how offspring replace parents.
Decide when to stop the algorithm.
Representation:
We have to come up with a method of representing an individual as a
genotype.
Binary Representations:
Binary Representations:
Gray decoding solves the hamming cliff problem using the following formula:
PL−1 Pj L−j−1
j=0 (( k=0 x[k])mod2) × 2
x = xmin + × (xmax − xmin )
2L
The previous equation guarantees that the Hamming distance between any
two consecutive integers is 1 bit.
Integer 0 1 2 3 4 5 6 7
Standard decoding 000 001 010 011 100 101 110 111
Gray decoding 000 001 011 010 110 111 101 100
Integer Representation:
binary representations may not always be best choice.
another representation may be more natural for a specific problem e.g.
for optimization of a function with integer variables.
values may be unrestricted (all integers), or restricted to a finite set (e.g.,
{0, 1, 2, 3} which can represent categorical data such as
{North, East, South, West}).
Permutation Representations:
deciding on sequence of events.
Most natural representation is permutation of a set of integers (number
may occur more than once in the chromosome).
May include invalid permutations.
Need special variation operators.
Tree-based Representation:
Tree of Functions or Terminals:
Functions: sine, cosine, add, sub, and, If-Then-Else ... etc.
Terminals: X, Y, 0.456, true, false, π, ... etc
For all the next decisions, we need to bear in mind the search explore/exploit
trade-off, which is directly related to diversity and convergence.
Diversity Vs Convergence:
Diversity represents differences of genetic characteristics in the
population.
Convergence means that the search reaches (converges) to a good
solution at its last phases.
Loss of genetic diversity means all individuals in the population look
alike.
High Diversity → Slow Convergence.
Low Diversity → Premature Convergence.
Explore Vs Exploit
Exploration: is to visit unknown search space regions.
Too much Exploration → High diversity → Slow Convergence.
Exploitation: is to improve the best-so-far individuals.
Too much exploitation → Low Diversity → Premature Convergence.
Roulette-Wheel Selection
Fitness proportionate: Expected number of representatives of each individual
is proportional to its fitness in comparison to the total fitness of all the
individuals in the population.
fitnessi
probi = Pj=popSize
j=0 fitnessi
The previous will compute a probability of selection for each individual, and
individuals will be selected randomly according to this probability.
Roulette-Wheel Selection
Tournament Selection
Select individuals by conducting a number of tournaments among them.
It has one parameter: the tournament size.
It selects randomly a number of individuals (equivalent to the tournament
size) from the population. Then conduct a tournament among them and select
the winner (the one with the best fitness among them).
Tournament Selection
Manual Selection:
User assign fitness to solutions based on subjectivity.
Used when it is difficult to design an appropriate fitness function.