ClassNotes SCT 1 Sept
ClassNotes SCT 1 Sept
ClassNotes SCT 1 Sept
• Genetic Algorithms (GAs) are adaptive heuristic search algorithm based on the
evolutionary ideas of natural selection and genetics.
• Genetic algorithms (GAs) are a part of Evolutionary computing, a rapidly growing area of
artificial intelligence. GAs are inspired by Darwin's theory about evolution - "survival of
the fittest".
• GAs, although randomized, exploit historical information to direct the search into
the region of better performance within the search space.
• In nature, competition among individuals for scanty resources results in the fittest
individuals dominating over the weaker ones.
• Introduction
Solving problems mean looking for solutions, which is best among others. Finding the
− In computer science and AI, as a process of search through the space of possible
solutions. The set of possible solutions defines the search space (also called state space)
for a given problem. Solutions or partial solutions are viewed as points in the search
space.
unlike older AI systems, the GA's do not break easily even if the inputs
"Genetic Algorithms are good at taking large, potentially huge search spaces and
navigating them, looking for optimal combinations of things, the solutions one might not
otherwise find in a lifetime.” Salvatore Mangano Computer Design, May 1995.
■ Biological Background – Basic Genetics
Every organism has a set of rules, describing how that organism is built. All
living organisms consist of cells.
Possible settings for a trait (e.g. blue, brown) are called alleles. Each gene has
The physical expression of the genotype (the organism itself after birth) is called the
phenotype, its physical and mental characteristics, such as eye color, intelligence
etc.
When two organisms mate they share their genes; the resultant offspring may end
up having half the genes from one parent and half from the other. This process is
called recombination (cross over) .
The new created offspring can then be mutated. Mutation means, that the elements
of DNA are a bit changed. This changes are mainly caused by errors in copying genes
from parents.
The fitness of an organism is measured by success of the organism in its life
(survival).
Darwin’s Principle
Millions Of Years
Evolved Species
Nature Computer
Begin
Initialize
population
N
Optim
um
Selection
Mutation
Below shown, the general scheme of evolutionary process in genetic along with pseudo-
code.
Pseudo-Code
BEGIN
■ SELECT parents;
END.
Simple_Genetic_Algorithm()
{
Initialize the Population; Calculate Fitness Function;
In solving problems, some solution will be the best among others. The space of all
feasible solutions (among which the desired solution
− Each possible solution can be "marked" by its value (or fitness) for the problem.
− The GA looks for the best solution among a number of possible solutions
represented by one point in the search space.
− Looking for a solution is then equal to looking for some extreme value (minimum or
maximum) in the search space.
− At times the search space may be well defined, but usually only a few points in the
search space are known.
In using GA, the process of finding solutions generates other points (possible
solutions) as evolution proceeds.
Working Principal
Before getting into GAs, it is necessary to explain few terms.
− Fitness: the value assigned to an individual based on how far or close a individual is
from the solution; greater the fitness value better the solution it contains.
− Fitness function: a function that assigns fitness value to the individual. It is problem
specific.
− Breeding: taking two fit individuals and then intermingling there chromosome to
− Solutions from one population are taken and used to form a new population. This is
motivated by the possibility that the new population will be better than the old one.
− Solutions are selected according to their fitness to form new solutions (offspring);
more suitable they are, more chances they have to reproduce.
[New population] Create a new population by repeating following steps until the
new population is complete.
[Crossover] With a crossover probability, cross over the parents to form new
offspring (children). If no crossover was performed, offspring is the exact copy
of parents.
(position in chromosome).
• [Replace] Use new generated population for a further run of the algorithm
• [Test] If the end condition is satisfied, stop, and return the best solution in
current population
• [Loop] Go to step 2
Note : The genetic algorithm's performance is largely influenced by two operators called
crossover and mutation. These two operators are the most important parts of GA.
Encoding Techniques
Before a genetic algorithm can be put to work on any problem, a method is needed to encode
potential solutions to that problem in a form so that a computer can process.
− One common approach is to encode solutions as binary strings: sequences of 1's and 0's,
where the digit at each position represents the value of some aspect of the solution.
Example :
A Gene represents some data (eye color, hair color, sight, etc.).
Chromosome 1: 1101100100110110
Chromosome 2: 1101111000011110
− There are many other ways of encoding, e.g., encoding values as integer or real numbers
or some permutations and so on.
− The virtue of these encoding method depends on the problem to work on .