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

SC Genetic Algorithm

genetic algorithm in soft computing

Uploaded by

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

SC Genetic Algorithm

genetic algorithm in soft computing

Uploaded by

victorninerzulu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 80

Soft Computing

(AIML- 5th Sem)

ARM-303
SYLLABUS
SYLLABUS
UNIT-IV
Genetic Algorithm
Genetic Algorithm

GAs are adaptive heuristic search algorithms based on the evolutionary


ideas of natural selection and genetics. As such they represent an
intelligent exploitation of a random search used to solve optimization
problems.

Evolutionary computing was introduced in the 1960s by


I. Rechenberg in the work “Evolution Strategies”. This
idea was then developed by other researches.

GAs were invented by John Holland and developed this


idea in his book “Adaptation in Natural and Artificial
Systems” in the year 1975.

Holland proposed GA as a heuristic method based on


“survival of the fittest”. GA was discovered as a useful
tool for search and optimization problems.
Genetic Algorithm

• Genetic algorithms (GAs) are a technique to


solve problems which need optimization.
• GAs are a subclass of Evolutionary Computing and are
random search algorithms.

• GAs are based on


Darwin’s theory of evolution.

• History of GAs:
• Evolutionary computing evolved in the 1960s.
• GAs were created by John Holland in the mid-1970s.
Genetic Algorithm

• Genetic information is stored in the chromosomes.


• Each chromosome is build of DNA (Deoxyribonucleic acid).
• Chromosomes in humans form pairs.
• There are 23 pairs.
• The chromosome is divided in parts: genes.
• Genes code for properties.
• The posibilities of the genes for
one property is called: allele.
• Every gene has an unique position
on the chromosome: locus.
Genetic Algorithm
Genetic Algorithm

• The entire combination of genes is called genotype.


• A genotype develops into a phenotype.
• Alleles can be either dominant or recessive.
• Dominant alleles will always express from the genotype
to the fenotype.
• Recessive alleles can survive in the population for many
generations without being expressed.
Genetic Algorithm

• Starting with a subset of n randomly chosen


solutions from the search space (i.e. chromosomes).
This is the population.

• This population is used to produce a next generation


of individuals by reproduction.

• Individuals with a higher fitness have more chance


to reproduce (i.e. natural selection).
Genetic Algorithm
• Most often one is looking for the best solution
in a specific subset of solutions.
• This subset is called the search space (or state space).
• Every point in the search space is a possible solution.
• Therefore every point has a fitness value, depending on
the problem definition.
2.5

• GAs are used to search the


search space for the best 2

solution, e.g. a minimum. 1.5

• Difficulties are the local 1

minima and the starting


point of the search. 0.5

0
0 100 200 300 400 500 600 700 800 900 1000
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm

Comparison of Natural and GA Terminology

Natural Genetic Algorithm

Chromosome String
Gene Feature or character
Allele Feature value
Locus String position
Genotype Structure
Phenotype Parameter set, a decoded
structure
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Outline of the basic algorithm

0 START : Create random population of n chromosomes


1 FITNESS : Evaluate fitness f(x) of each chromosome in the population
2 NEW POPULATION
1 SELECTION : Based on f(x)
2 CROSS OVER : Cross-over chromosomes
3 MUTATION : Mutate chromosomes

3 REPLACE : Replace old with new population: the new generation


4 TEST : Test problem criterium
5 LOOP : Continue step 1 – 4 untill criterium is satisfied
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm

Encoding:-
Encoding is a process of representing individual genes.
The process can be performed using bits, numbers, trees,
arrays, lists or any other objects. The encoding depends
mainly on solving the problem. For example, one can
encode directly real or integer numbers.
Binary Encoding:-
Genetic Algorithm

Each chromosome encodes a binary (bit) string. Each bit in the string
can represent some characteristics of the solution.

Every bit string therefore is a solution but not necessarily the best
solution. Another possibility is that the whole string can represent a
number. The way bit strings can code differs from problem to problem.

Binary encoding gives many possible chromosomes with a smaller


number of alleles. On the other hand, this encoding is not natural for
many problems and sometimes corrections must be made after
genetic operation is completed.

Binary coded strings with 1s and 0s are mostly used. The length of the
string depends on the accuracy. In such coding :-
1. Integers are represented exactly.
2. Finite number of real numbers can be represented.
3. Number of real numbers represented increases with string length.
Genetic Algorithm
Genetic Algorithm

Selection Operators
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Crossover Operators
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Mutation Operators
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
GA Algorithm revisited
Genetic Algorithm
GA Algorithm revisited

Binary Encoding

• Chromosomes are encoded by bitstrings.


• Every bitstring therefore is a solution but not necessarily
the best solution.
• The way bitstrings can code, differs from problem
to problem.
Genetic Algorithm

Genetic Algorithm to Maximize / Minimize the objective function.


Genetic Algorithm

1. Encoding:- Binary Encoding


Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm

From the tables, it can be observed how GAs combine high-


performance notions to achieve better performance.
In the tables, it can be noted how maximal and average
performances have improved in the new population. The
population average fitness has improved from 288.75 to 636.5
in one generation. The maximum fitness has increased from
625 to 841 during the same period. Although random
processes make this best solution, its improvement can also
be seen successively. The best string of the initial population
(1 1 0 0 1) receives two chances for its existence because of
its high, above-average performance. When this combines at
random with the next highest string (1 0 0 1 1) and is crossed
at crossover point 2 (Table 21-5), one of the resulting strings
(1 1 0 1 1) proves to be a very best solution indeed.

Thus after mutation at random, a new offspring (1 1 1 0 1) is


Genetic Algorithm
Another Example:-
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm
Genetic Algorithm

You might also like