1. Binary Genetic Algorithm
1
Power Point Presentation By:
Shubham Kamble(180020105),
Gourav Tailor (180020032),
Himanshu Sharma (160020057)
Department of Chemical Engineering
I.I.T. Bombay
2. 2
Motivation
Genetic Algorithms have the ability to deliver a “good-
enough” solution “fast-enough”.
➢ Traditional calculus based methods work by starting at a random
point and by moving in the direction of the gradient, till we reach
the top of the hill. This technique is efficient and works very well
for single-peaked objective functions. But most real world
situations have complex problems which causes this method to fail.
➢ Even the most powerful computing systems take a very long time
(even years!) to solve some set of problems. In such a scenario,
GA’s prove to be an efficient tool to provide usable near-optimal
solutions in a short amount of time.
3. 3
Genetic Algorithm
Genetic Algorithm (GA) is a search-based
optimization technique based on the principles of
Genetics and Natural Selection. The working
principle of GA’s is very different from that of
most classical optimization techniques.
In Binary Genetic Algorithm each chromosome of a
population is represented by sequences of zeros
and ones, meaning that a gene can have a value of
either zero ‘0’ or one ‘1’.
5. 5
Genetic Algorithm working
❖ GA have a population of possible solutions to the
given problem.
❖ These solutions undergo recombination and
mutation, producing new children, and the process
is repeated over various generations.
❖ Each individual (solution) is assigned a fitness
value (based on objective function value) and the
fitter individuals are given a higher chance to
mate and yield more “fitter” individuals.
❖ This is similar to the Darwinian Theory of
“Survival of the Fittest”.
7. 7
Genotype
Genotype is the population in the computation space.
In the computation space, the solutions are
represented in a way which can be easily understood
and manipulated using a computing system.
Binary Representation:
8. 8
1. Population Initialization
Population: Set of chromosomes usually defined as a two
dimensional array of (Population size,
Chromosome size)
Types:
● Random Initialization − Populate the initial population with
completely random solutions.
● Heuristic initialization − Populate the initial population using a
known heuristic for the problem.
In steady state GA, generate one or two off-springs in each
iteration and they replace one or two individuals from the
population.
9. 9
2. Fitness Calculation
Fitness function takes a candidate solution to the problem as
input and produces as output how “fit” or how “good” the solution
is.
In most cases the fitness function and the objective function
are the same as the objective is to either maximize or minimize
the given objective function.
Characteristics:
❏ Should be sufficiently fast to compute.
❏ It must quantitatively measure how fit a given solution is
10. 10
3. Selection
Process of selecting parents which mate and recombine to
create off-springs for the next generation.
Maintaining good diversity in the population is extremely
crucial for the success of a GA. This taking up of the
entire population by one extremely fit solution is known as
premature convergence and is an undesirable condition in a
GA.
11. 11
Selection
1. Fitness Proportionate Selection: Every individual can become a
parent with a probability which is proportional to its fitness.
Therefore, fitter individuals have a higher chance of mating and
propagating their features to the next generation.
Roulette Wheel Selection Stochastic Universal Sampling
12. 12
Selection
2. Tournament Selection: In K-Way tournament selection, we select
K individuals from the population at random and select the best out of
these to become a parent. Repeat same for the next parent.
13. 13
Selection
3. Rank Selection: It also works with negative fitness values
and is mostly used when the individuals in the population
have very close fitness values . Every individual in the
population is ranked according to their fitness. The
selection of the parents depends on the rank of each
individual and not the fitness.The higher ranked individuals
are preferred more than the lower ranked ones.
4.Random Selection:
Randomly select parents from the existing population. There is
no selection pressure towards fitter individuals
14. 14
4. Crossover
Crossover operator is analogous to reproduction and
biological crossover. More than one parent is selected and
one or more off-springs are produced using the genetic
material of the parents.
Crossover Operators:
1. One Point Crossover
2. Multi Point Crossover
3. Uniform Crossover
15. 15
Crossover
1. One Point Crossover
A random crossover point is selected and the tails of its two parents
are swapped to get new off-springs.
1. Multi Point Crossover
Alternating segments are swapped to get new off-springs.
17. 17
5. Mutation
Small random tweak in the chromosome, to get a new solution.
Used to maintain and introduce diversity in the genetic
population and is usually applied with a low probability.
Mutation Operators:
1. Bit Flip Mutation
2. Random Resetting
3. Swap Mutation
4. Scramble Mutation
5. Inversion Mutation
18. 18
Mutation
1. Bit Flip Mutation
Select one or more random bits and flip them. Used for binary
encoded GAs.
1. Random Resetting
A random value from the set of permissible values is assigned to a
randomly chosen gene.
1. Swap Mutation
Select two positions on the chromosome at random, and
interchange the values.
19. 19
Mutation
4. Scramble Mutation
From the entire chromosome, a subset of genes is chosen and their
values are scrambled or shuffled randomly.
5. Inversion Mutation
Select a subset of genes like in scramble mutation, but instead of
shuffling the subset, invert the entire string in the subset.
20. 20
6. Termination Condition
The termination condition of a Genetic Algorithm is important in
determining when a GA run will end. Initially GA progresses very fast
with better solutions coming in every few iterations, but this tends to
saturate in the later stages where the improvements are very small.
So, want a termination condition such that solution is close to the
optimal, at the end of the run.
Keep one of the following Termination conditions:
1. There is no improvement in the population for X iterations.
2. Reached an absolute number of generations.
3. Objective function value has reached a certain pre-defined value.
21. 21
Applications of BGA
➢ Travelling Salesman Problem: Main motive of this problem is to
find an optimal way to be covered by the salesman, in a given map
with the routes and distance between two points.
➢ Vehicle Routing Problem: Motive is to find an optimal weight of
goods to be delivered or find an optimal set of delivery routes
when other things like distance, weights, depot points are
constrained or have any kind of restrictions.
➢ Financial Markets: GA can solve a variety of issues because
genetic optimization helps in finding an optimal set or combination
of parameters that can affect the market rules and trades.
22. 22
Applications of BGA
➢ Knapsack Problem: Given a set of items, each with a weight and a
value, determine the number of each item to include in a collection
so that the total weight is less than or equal to a given limit.
➢ Data Clustering: Data clustering is an unsupervised learning
process. Major part of this is to find out the centre point of the
clusters and we know that genetic algorithms have great capability
of searching for an optimal value.
23. 23
Literature Survey
Other Evolutionary algorithms-based algorithms:
● Particle swarm optimization (PSO) - a stochastic optimization
technique based on the movement and intelligence of swarms
it also uses population-based approach, PSO algorithm has ease
of implementation and also has high calculation accuracy
● Ant Colony Optimization (ACO) - is a metaheuristic inspired
by the foraging behavior of ant colonies
Properties-
Population of ants (same as GA)
Length of ants junction (same as GA)
Pheromone coefficient, β
Heuristic coefficient, α
Evaporation rate, ρ
Convergence condition Max-min of pop≤0.001
(same as GA)
Maximum Iteration (same as GA)
24. 24
● Artificial Bee Colony (ABC) - simulates the intelligent foraging
behavior of honey bees. Ease of hybridization with other
optimization algorithms
general scheme
➔ Initialization Phase
➔ REPEAT
➔ Employed Bees Phase
➔ Onlooker Bees Phase
➔ Scout Bees Phase
➔ Memorize the best solution achieved so far
➔ UNTIL(Cycle=Maximum Cycle Number or a Maximum CPU time)
● Bacteriologic algorithms (BA) - based on the foraging behavior
of E. coli bacteria
Literature Survey
30. 30
Remarks and Comments
Implemented this algorithm in Google Colab in
python
Required Computation Time : 0.7235 sec
Compared with Gradient Descent algorithm for
3rd order single variable function took 0.9 sec
31. 31
Advantages and Limitations
Advantages:
❏ Does not require any derivative information
❏ Always gets an answer to the problem, which gets better over the
time.
❏ Is faster and more efficient as compared to the traditional
methods.
Limitations
❏ Fitness value is calculated repeatedly which might be computationally
expensive for some problems
❏ If not implemented properly, the GA may not converge to the optimal
solution.