Ga Ii
Ga Ii
The process of representing the solution in the form of a string that conveys the
necessary information.
Just as in a chromosome, each gene controls a particular characteristic of the
individual, similarly, each element in the string represents a characteristic of the
solution.
The process can be performed using bits, numbers, trees, arrays, lists or any other
object.
Encoding
Binary Encoding – Most common method of encoding. Chromosomes are strings of 1s and 0s
and each position in the chromosome represents a particular characteristic of the problem.
Chromosome A 1011001011001110010
Chromosome B 1111111000000001111
Permutation Encoding –Every chromosome is a string of numbers, represented in a sequence.
In permutation encoding, every chromosome is a suing of integer/real values, which represents
number in a sequence. Useful in ordering problems such as the Traveling Salesman Problem
(TSP).
Chromosome A 1 5 3 2 6 4 7 9 8
Chromosome B 8 5 6 7 2 3 1 4 9
Encoding
Octal Encoding – This encoding uses string made up of octal numbers (0-7).
Chromosome A 03467216
Chromosome B 15723314
Hexadecimal Encoding –This encoding uses string made up of hexadecimal numbers (0-9, A-F).
Chromosome A 9CE7
Chromosome B 3DBA
Encoding
Tree Encoding – This encoding is used mainly for evolving programs or expressions, i.e. for
Genetic programming. Every chromosome is a tree of some objects, such as values/arithmetic
operators or commands in a programming language.
Proportionate-based selection:
Picks out individuals based upon their fitness values relative to the fitness of the other
individuals in the population.
Ordinal-based selection:
Select individuals not upon their raw fitness, but upon their rank within the population.
This requires that the selection pressure is independent of the fitness distribution of the
population, and is solely based upon the relative ordering (ranking) of the population.
Canonical Selection
In this technique, fitness is defined for the ith individual as follows:
Fitness (i) =
Where fi = evaluation associated with ith individual in the population.
𝐹 = average evaluation of all individuals in the population size N and is defined as
The probability that individuals in the current population are copied and placed in the mating
pool is proportional to their fitness.
Roulette-Wheel Selection
Roulette-Wheel Selection
The probability that individuals is being selected in the mating pool is proportional to its fitness.
The top surface area of the wheel is divided into N parts in proportion to the fitness values f1, f2,
……, fN.
The wheel is rotated in a particular direction and a fixed pointer is used to indicate the winning
area, when it stops rotation.
A particular sub-area representing a GA-solution is selected to be winner probabilistically and
the probability that the iit area will be declared as
pi = ∑
Roulette-Wheel Selection Implementation
Input: A population of size N with their fitness values.
Output: A mating pool of size Np.
Steps:
1. Compute
pi = ∑
2. Calculate the cumulative probability for each of the individual starting from the top of the list, that is
Pi = ∑ 𝑝
3. Generate a random number r between 0 and 1.
4. Select the jth individual such that Pj-1 < r ≤ Pj
5. Repeat step 3-4 to select Np individuals
6. End
Roulette-Wheel Selection Example
Individual pi Pi r T Fitness
1 0.05 0.05 0.26 I
The ith individual in the population represents the cumulative probability from Pi-1 to Pi.
The top most individual represents the cumulative probability value between 0 and p1.
It may be checked that the selection is consistent with the expected count Ei = N × pi
Rank Based Selection
The process in rank selection consists of two steps.
1. Individuals are arranged in an ascending order of their fitness values. The individual, which
has the lowest value of fitness is assigned rank 1, and other individuals are ranked
accordingly.
2. The proportionate based selection scheme is then followed based on the assigned rank.
pi =
∑
4. Stop.
Rank Based Selection Example
Individual pi Pi r T Fitness
1 0.05 0.05 0.26 I
0.08 0.04 I 5 1
6 0.13 20 9
7 0.08 0.21 0.48 2
0.09 0.43 II 3
2 0.30 13
0.13 0.09 I 8 4
3 0.43
5
4 0.17 0.60 0.30 I
8 6
5 0.20 0.80 0.61 I 17 7
8 0.20 1.00 0.89 I
20 8