GENETIC ALGORITHM
Name: Ankita Ghosh
Subject Name: Soft Computing
Subject Code: PGCSE-105C
M.Tech in CSE-1st
sem
Assignment: PPT for CA1
2
Contents
 What is Genetic Algorithm
 Definition
 Search Space
 Genetic Algorithm
Terminologies
 How genetic algorithm works
 Initialization
 Fitness Assignment
 Selection
 Reproduction
 Termination
 Genetic Algorithm Workflow
 Advantages & Disadvantages
 Applications
 Conclusion
 References
-Ankita Ghosh
3
What is GENETIC ALGORITHM
Soft
Computing
Fuzzy
Systems
Neural
Network
Evolutionary
Computation
Genetic
Programming
Genetic
Algorithm
Machine
Learning
-Ankita Ghosh
4
Genetic Algorithm Definition
The genetic algorithm is a probabilistic search algorithm that
iteratively transforms a set(called a population) of mathematical
objects (typically fixed-length binary character strings), each with an
associated fitness value , into a new population of offspring objects
using the Darwinian principle of natural selection and using
operations that are patterned after naturally occurring genetic
operations, such as crossover and mutation.
-Ankita Ghosh
5
SEARCH SPACE IN GA:
If we are solving some problem, we are usually looking for some solution, which
will be the best among others. The space of all feasible solutions (it means objects
among those the desired solution is) is called search space (also state space). Each
point in the search space represents one feasible solution. Each feasible solution
can be "marked" by its value or fitness for the problem. We are looking for our
solution, which is one point (or more) among feasible solutions - that is one point
in the search space.
The problem is that the search can be very complicated. One does not know
where to look for the solution and where to start. There are many methods, how
to find some suitable solution (i.e. not necessarily the best solution), for example
hill climbing, tabu search, simulated annealing and genetic algorithms. The
solution found by these methods is often considered as a good solution, because
it is not often possible to prove what is the real optimum.
-Ankita Ghosh
6
GENETIC ALGORITHM TERMINOLOGIES
•Population: Population is the subset of all possible or probable solutions, which can
solve the given problem.
•Chromosomes: A chromosome is one of the solutions in the population for the given
problem, and the collection of gene generate a chromosome.
•Gene: A chromosome is divided into a different gene, or it is an element of the
chromosome.
•Fitness Function: The fitness function is used to determine the individual's fitness level
in the population. It means the ability of an individual to compete with other
individuals. In every iteration, individuals are evaluated based on their fitness function.
•Genetic Operators: In a genetic algorithm, the best individual mate to regenerate
offspring better than parents. Here genetic operators play a role in changing the genetic
composition of the next generation.
-Ankita Ghosh
7
HOW GENETIC ALGORITHM WORKS?
The genetic algorithm works on the evolutionary generational cycle to generate high-
quality improved fit solutions.
It basically involves five phases to solve the complex optimization problems, which are
given as below:
• Initialization
• Fitness Assignment
• Selection
• Reproduction
• Termination
-Ankita Ghosh
8
INITIALIZATION
• The process of a genetic algorithm starts by
generating the set of individuals, which is
called population.
• Here each individual is the solution for the
given problem.
• An individual contains or is characterized
by a set of parameters called Genes. Genes
are combined into a string and generate
chromosomes, which is the solution to the
problem.
• One of the most popular techniques for
initialization is the use of random binary
strings.
-Ankita Ghosh
9
FITNESS ASSIGNMENT
• It means the ability of an individual to compete with other
individuals.
• In every iteration, individuals are evaluated based on their fitness
function.
• The fitness function provides a fitness score to each individual.
This score further determines the probability of being selected for
reproduction.
• The high the fitness score, the more chances of getting selected for
reproduction.
-Ankita Ghosh
10
SELECTION
After calculating the fitness of every existent in the population, a selection
process is used to determine which of the individualities in the population
will get to reproduce and produce the seed that will form the coming
generation.
Types of selection styles available:
Roulette wheel selection:
Roulette selection is a
stochastic selection method,
where the probability for
selection of an individual is
proportional to its fitness.
The method is inspired by
real-world roulettes but
possesses important
distinctions from them.
Event selection : Tournament
Selection is a Selection Strategy
used for selecting the fittest
candidates from the current
generation in a Genetic
Algorithm. These selected
candidates are then passed on to
the next generation. In a K-way
tournament selection, we select k-
individuals and run a
tournament among them.
Rank Selection: It also works
with negative fitness values
and is mostly used when the
individuals in the population
have very close fitness values
(this happens usually at the
end of the run).
-Ankita Ghosh
11
REPRODUCTION
After the selection process, the creation of a child occurs in the reproduction step. In
this step, the genetic algorithm uses two variation operators that are applied to the
parent population.
Crossover:
• In this process, a crossover point is selected at
random within the genes.
• Then the crossover operator swaps genetic
information of two parents from the current
generation to produce a new individual
representing the offspring.
• Types of crossover styles available:
• One point crossover
• Two-point crossover
• Livery crossover
• Inheritable Algorithms crossover
-Ankita Ghosh
12
CONTD..
Mutation:
• The mutation operator inserts random
genes in the offspring (new child) to
maintain the diversity in the
population.
• It can be done by flipping some bits in
the chromosomes.
• Mutation helps in solving the issue of
premature convergence and enhances
diversification.
• Types of mutation styles available,
• Flip bit mutation
• Gaussian mutation
• Exchange/Swap mutation
-Ankita Ghosh
13
TERMINATION
• The termination condition of a Genetic Algorithm is important in determining when
a GA run will end.
• The 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.
• Usually the termination conditions are −
• When there has been no improvement in the population for X iterations.
• When we reach an absolute number of generations.
• When the objective function value has reached a certain pre-defined value.
-Ankita Ghosh
GENETIC ALGORITHM WORKFLOW
-Ankita Ghosh
14
-Ankita Ghosh 15
SOME MORE ABOUT GENETIC ALGORITHM…
Advantages of Genetic Algorithm:
• The parallel capabilities of genetic
algorithms are best.
• It helps in optimizing various
problems such as discrete functions,
multi-objective problems, and
continuous functions.
• It provides a solution for a problem
that improves over time.
• A genetic algorithm does not need
derivative information.
Limitations of GA:
• Genetic algorithms are not efficient
algorithms for solving simple problems.
• It does not guarantee the quality of the
final solution to a problem.
• Repetitive calculation of fitness values
may generate some computational
challenges.
-Ankita Ghosh 16
APPLICATIONs OF GA
• Optimization problems: GAs excel at solving optimization problems, aiming to
find the best solution among a large set of possibilities including mathematical
function optimization, parameter tuning, portfolio optimization, resource allocation,
and more.
• Combinatorial optimization : GAs effectively solve combinatorial optimization
problems, which involve finding the best arrangement or combination of elements
from a finite set. Like traveling salesman problem (TSP), vehicle routing problem
(VRP), job scheduling, bin packing, and DNA sequence alignment.
• Machine learning : GAs have applications in machine learning, particularly to
optimize the configuration and parameters of machine learning models. GAs can be
used to optimize hyperparameters, such as learning rate, regularization parameters,
and network architectures in neural networks.
-Ankita Ghosh 17
CONTD…
• Evolutionary robotics : GAs find use in evolutionary
robotics, which involves evolving robot behavior and control
strategies.
• Image and signal processing: GAs are applied in image
and signal processing tasks, including image reconstruction,
denoising, feature extraction, and pattern recognition.
• Design and creativity: GAs have been used for design
and creativity tasks, such as generating artistic designs, music
composition, and game design.
• Financial modeling: GAs are applied in financial
modeling for portfolio optimization, algorithmic trading,
and risk management tasks. GAs can optimize the allocation
of assets in an investment portfolio to maximize returns and
minimize risk.
CONCLUSION
Genetic algorithms (GAs) stand out as a powerful and versatile optimization
technique within the realm of soft computing. Inspired by the principles of
natural selection and genetics, GAs excel in exploring solution spaces and
finding near-optimal solutions in complex, non-linear, and high-dimensional
problems. Their adaptability, parallelism, and ability to handle various types of
variables make them suitable for a wide range of applications, including
optimization, machine learning, and search problems. Despite their success,
challenges such as parameter tuning and computational complexity persist,
requiring careful consideration in practical implementations.
-Ankita Ghosh
18
19
REFERENCES
1. https://www.geeksforgeeks.org/genetic-algorithms/
2. https://in.mathworks.com/help/gads/what-is-the-genetic-algorithm.html
3. https://en.wikipedia.org/wiki/Genetic_algorithm
4. https://www.javatpoint.com/genetic-algorithm-in-machine-learning
5. https://www.sciencedirect.com/topics/nursing-and-health-professions/genetic-algorithm
6. https://www.tutorialspoint.com/genetic_algorithms/genetic_algorithms_introduction.htm
7. https://www.upgrad.com/blog/genetic-algorithm-in-ai/
-Ankita Ghosh
20
THANK YOU!
-Ankita Ghosh

Genetic Algorithm Fundamentals and Applications.pptx

  • 1.
    GENETIC ALGORITHM Name: AnkitaGhosh Subject Name: Soft Computing Subject Code: PGCSE-105C M.Tech in CSE-1st sem Assignment: PPT for CA1
  • 2.
    2 Contents  What isGenetic Algorithm  Definition  Search Space  Genetic Algorithm Terminologies  How genetic algorithm works  Initialization  Fitness Assignment  Selection  Reproduction  Termination  Genetic Algorithm Workflow  Advantages & Disadvantages  Applications  Conclusion  References -Ankita Ghosh
  • 3.
    3 What is GENETICALGORITHM Soft Computing Fuzzy Systems Neural Network Evolutionary Computation Genetic Programming Genetic Algorithm Machine Learning -Ankita Ghosh
  • 4.
    4 Genetic Algorithm Definition Thegenetic algorithm is a probabilistic search algorithm that iteratively transforms a set(called a population) of mathematical objects (typically fixed-length binary character strings), each with an associated fitness value , into a new population of offspring objects using the Darwinian principle of natural selection and using operations that are patterned after naturally occurring genetic operations, such as crossover and mutation. -Ankita Ghosh
  • 5.
    5 SEARCH SPACE INGA: If we are solving some problem, we are usually looking for some solution, which will be the best among others. The space of all feasible solutions (it means objects among those the desired solution is) is called search space (also state space). Each point in the search space represents one feasible solution. Each feasible solution can be "marked" by its value or fitness for the problem. We are looking for our solution, which is one point (or more) among feasible solutions - that is one point in the search space. The problem is that the search can be very complicated. One does not know where to look for the solution and where to start. There are many methods, how to find some suitable solution (i.e. not necessarily the best solution), for example hill climbing, tabu search, simulated annealing and genetic algorithms. The solution found by these methods is often considered as a good solution, because it is not often possible to prove what is the real optimum. -Ankita Ghosh
  • 6.
    6 GENETIC ALGORITHM TERMINOLOGIES •Population:Population is the subset of all possible or probable solutions, which can solve the given problem. •Chromosomes: A chromosome is one of the solutions in the population for the given problem, and the collection of gene generate a chromosome. •Gene: A chromosome is divided into a different gene, or it is an element of the chromosome. •Fitness Function: The fitness function is used to determine the individual's fitness level in the population. It means the ability of an individual to compete with other individuals. In every iteration, individuals are evaluated based on their fitness function. •Genetic Operators: In a genetic algorithm, the best individual mate to regenerate offspring better than parents. Here genetic operators play a role in changing the genetic composition of the next generation. -Ankita Ghosh
  • 7.
    7 HOW GENETIC ALGORITHMWORKS? The genetic algorithm works on the evolutionary generational cycle to generate high- quality improved fit solutions. It basically involves five phases to solve the complex optimization problems, which are given as below: • Initialization • Fitness Assignment • Selection • Reproduction • Termination -Ankita Ghosh
  • 8.
    8 INITIALIZATION • The processof a genetic algorithm starts by generating the set of individuals, which is called population. • Here each individual is the solution for the given problem. • An individual contains or is characterized by a set of parameters called Genes. Genes are combined into a string and generate chromosomes, which is the solution to the problem. • One of the most popular techniques for initialization is the use of random binary strings. -Ankita Ghosh
  • 9.
    9 FITNESS ASSIGNMENT • Itmeans the ability of an individual to compete with other individuals. • In every iteration, individuals are evaluated based on their fitness function. • The fitness function provides a fitness score to each individual. This score further determines the probability of being selected for reproduction. • The high the fitness score, the more chances of getting selected for reproduction. -Ankita Ghosh
  • 10.
    10 SELECTION After calculating thefitness of every existent in the population, a selection process is used to determine which of the individualities in the population will get to reproduce and produce the seed that will form the coming generation. Types of selection styles available: Roulette wheel selection: Roulette selection is a stochastic selection method, where the probability for selection of an individual is proportional to its fitness. The method is inspired by real-world roulettes but possesses important distinctions from them. Event selection : Tournament Selection is a Selection Strategy used for selecting the fittest candidates from the current generation in a Genetic Algorithm. These selected candidates are then passed on to the next generation. In a K-way tournament selection, we select k- individuals and run a tournament among them. Rank Selection: It also works with negative fitness values and is mostly used when the individuals in the population have very close fitness values (this happens usually at the end of the run). -Ankita Ghosh
  • 11.
    11 REPRODUCTION After the selectionprocess, the creation of a child occurs in the reproduction step. In this step, the genetic algorithm uses two variation operators that are applied to the parent population. Crossover: • In this process, a crossover point is selected at random within the genes. • Then the crossover operator swaps genetic information of two parents from the current generation to produce a new individual representing the offspring. • Types of crossover styles available: • One point crossover • Two-point crossover • Livery crossover • Inheritable Algorithms crossover -Ankita Ghosh
  • 12.
    12 CONTD.. Mutation: • The mutationoperator inserts random genes in the offspring (new child) to maintain the diversity in the population. • It can be done by flipping some bits in the chromosomes. • Mutation helps in solving the issue of premature convergence and enhances diversification. • Types of mutation styles available, • Flip bit mutation • Gaussian mutation • Exchange/Swap mutation -Ankita Ghosh
  • 13.
    13 TERMINATION • The terminationcondition of a Genetic Algorithm is important in determining when a GA run will end. • The 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. • Usually the termination conditions are − • When there has been no improvement in the population for X iterations. • When we reach an absolute number of generations. • When the objective function value has reached a certain pre-defined value. -Ankita Ghosh
  • 14.
  • 15.
    -Ankita Ghosh 15 SOMEMORE ABOUT GENETIC ALGORITHM… Advantages of Genetic Algorithm: • The parallel capabilities of genetic algorithms are best. • It helps in optimizing various problems such as discrete functions, multi-objective problems, and continuous functions. • It provides a solution for a problem that improves over time. • A genetic algorithm does not need derivative information. Limitations of GA: • Genetic algorithms are not efficient algorithms for solving simple problems. • It does not guarantee the quality of the final solution to a problem. • Repetitive calculation of fitness values may generate some computational challenges.
  • 16.
    -Ankita Ghosh 16 APPLICATIONsOF GA • Optimization problems: GAs excel at solving optimization problems, aiming to find the best solution among a large set of possibilities including mathematical function optimization, parameter tuning, portfolio optimization, resource allocation, and more. • Combinatorial optimization : GAs effectively solve combinatorial optimization problems, which involve finding the best arrangement or combination of elements from a finite set. Like traveling salesman problem (TSP), vehicle routing problem (VRP), job scheduling, bin packing, and DNA sequence alignment. • Machine learning : GAs have applications in machine learning, particularly to optimize the configuration and parameters of machine learning models. GAs can be used to optimize hyperparameters, such as learning rate, regularization parameters, and network architectures in neural networks.
  • 17.
    -Ankita Ghosh 17 CONTD… •Evolutionary robotics : GAs find use in evolutionary robotics, which involves evolving robot behavior and control strategies. • Image and signal processing: GAs are applied in image and signal processing tasks, including image reconstruction, denoising, feature extraction, and pattern recognition. • Design and creativity: GAs have been used for design and creativity tasks, such as generating artistic designs, music composition, and game design. • Financial modeling: GAs are applied in financial modeling for portfolio optimization, algorithmic trading, and risk management tasks. GAs can optimize the allocation of assets in an investment portfolio to maximize returns and minimize risk.
  • 18.
    CONCLUSION Genetic algorithms (GAs)stand out as a powerful and versatile optimization technique within the realm of soft computing. Inspired by the principles of natural selection and genetics, GAs excel in exploring solution spaces and finding near-optimal solutions in complex, non-linear, and high-dimensional problems. Their adaptability, parallelism, and ability to handle various types of variables make them suitable for a wide range of applications, including optimization, machine learning, and search problems. Despite their success, challenges such as parameter tuning and computational complexity persist, requiring careful consideration in practical implementations. -Ankita Ghosh 18
  • 19.
    19 REFERENCES 1. https://www.geeksforgeeks.org/genetic-algorithms/ 2. https://in.mathworks.com/help/gads/what-is-the-genetic-algorithm.html 3.https://en.wikipedia.org/wiki/Genetic_algorithm 4. https://www.javatpoint.com/genetic-algorithm-in-machine-learning 5. https://www.sciencedirect.com/topics/nursing-and-health-professions/genetic-algorithm 6. https://www.tutorialspoint.com/genetic_algorithms/genetic_algorithms_introduction.htm 7. https://www.upgrad.com/blog/genetic-algorithm-in-ai/ -Ankita Ghosh
  • 20.