0% found this document useful (0 votes)
29 views

Genetic Algorithm

Genetic Algorithm

Uploaded by

RUKESH K
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

Genetic Algorithm

Genetic Algorithm

Uploaded by

RUKESH K
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 29

MACHINE LEARNING

TOPIC:GENETIC
ALGORITHM

PRESENTED BY
K.SURUTHIKA
ME(BDA)
2023188026
What is Genetic Algorithm?
• Genetic Algorithm(GA) is a search-based optimization Technique
based on the principles of Genetic and Darwin’s principle of Natural
Selection.
• It is frequently used find Optimal and real- optimal solutions to
different problems which otherwise would take life time to solve.
• GA’s are a subset of much longer branch of computation Known as
Evolutionary Computation.
• GA’s were developed by John Holland(1975)
BASIC 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.
• Allele: Allele is the value provided to the gene within a particular 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.
• 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.
GA FLOWCHAT
SAMPLE GENETIC ALGORITHM PROGRAM
GA FOR OPERATORS AND PARAMETERS

Encoding:
• The process of representing the solution in the form of string that conveys the
necessary information.
• Just as in a chromosome,each gene controls a particular characteristicsof the
individual similarly,each Bit in a string represents the characteristics of the solution.
Encoding Methods:
1. Binary Encoding
2. Octal Encoding
3. Hexadecimal Encoding
4. Permutation Encoding
5. Value Encoding
6. Tree Encoding
ENCODING METHODS
1.Binary Encoding:
• Most common methods of encoding.
• Chromosomes are string of 1s and 0s and each position in the
chromosome represents a particular characteristics of the solution.

2.Octal Encoding :
• Chromosomes are strings from 0 to 7.
• To convert any individual to an octal,go on dividing the integer by 8.
ENCODING METHODS CONT..
3.Hexa Decimal Encoding:
• Chromosomes are represented in hexadecimal numbers

4.Permutation Encoding:
• Useful in ordering such as the Travelling Salesman Problem (TSP).
• In TSP, every chromosome is a string of numbers, each of which
represents a city to be visited.
ENCODING METHODS CONT..
5.Value Encoding:
• Used in problems where complicated values, such as real numbers,
are used and where binary encoding would not suffice.
• Good for some problems, but often necessary to develop some
specific crossover and mutation techniques for these chromosomes.
ENCODING METHODS CONT..
6.Tree Encoding:
• This is mainly used for Evolving Program Expressions.
• Every chromosome is a tree of some objects such as functions and
commands in a programming Language.
GENETIC ALGORITHM
Foundation of Genetic Algorithms
• Genetic algorithms are based on an analogy with the genetic structure and behavior of
chromosomes of the population. Following is the foundation of GAs based on this
analogy of Individuals in the population compete for resources and mate.
• Those individuals who are successful (fittest) then mate to create more offspring than
others
• Genes from the “fittest” parent propagate throughout the generation, that is sometimes
parents create offspring which is better than either parent.
• Thus each successive generation is more suited for their environment.
Search space
The population of individuals are maintained within search space. Each individual represents a
solution in search space for given problem. Each individual is coded as a finite length vector
(analogous to chromosome) of components. These variable components are analogous to Genes.
Thus a chromosome (individual) is composed of several genes (variable components).
FITNESS SCORE
Fitness Score
A Fitness Score is given to each individual which shows the ability of an individual to
“compete”. The individual having optimal fitness score (or near optimal) are sought.
The GAs maintains the population of an individuals (chromosome/solutions) along with
their fitness scores .. The individuals with better fitness scores are selected who mate and
produce better offspring by combining chromosomes of parents. The population size is
static so the room has to be created for new arrivals. So, some individuals die and get
replaced by new arrivals eventually creating new generation when all the mating
opportunity of the old population is exhausted. It is hoped that over successive generations
better solutions will arrive while least fit die.
Each new generation has on average more “better genes” than the individual (solution) of
previous generations. Thus each new generations have better “partial solutions” than
previous generations. Once the offspring produced having no significant difference from
offspring produced by previous populations, the population is converged. The algorithm is
said to be converged to a set of solutions for the problem.
OPERATORS OF GA
1) Selection Operator: The idea is to give preference to the individuals
with good fitness scores and allow them to pass their genes to
successive generations.
2) Crossover Operator: This represents mating between individuals.
Two individuals are selected using selection operator and crossover
sites are chosen randomly. Then the genes at these crossover sites are
exchanged thus creating a completely new individual (offspring).
OPERATORS OF GA CONT..
3) Mutation Operator: The key idea is to insert random genes in
offspring to maintain the diversity in the population to avoid premature
convergence.
SELECTION OPERATORS
SELECTION OPERATOR CONT..
ADVANTAGES AND APPLICATIONS
Why use Genetic Algorithms ?
• They are Robust
• Provide optimisation over large space state.
• Unlike traditional AI, they do not break on slight change in input or presence
of noise
Application of Genetic Algorithms
• Recurrent Neural Network
• Mutation testing
• Code breaking
• Filtering and signal processing
• Learning fuzzy rule base etc

You might also like