You are on page 1of 21

Genetic algorithm

GENETIC ALGORITHM

INTRODUCTION
SEARCH SPACE
BIOLOGICAL
BACKROUND
OUTLINE OF G.A

G.A STRUCTURE

G.A APPLICATION
G.A SAMPLE PROBLEM

LIMITATIONS
INTRODUCTION

Genetic algorithms are inspired by darwin's theory of


evolution. Simply said, problems are solved by an
evolutionary process resulting in a best (fittest) solution
(survivor) - in other words, the solution is evolved.

Genetic Algorithms (GAs) were invented by John


Holland and developed by him and his students and
colleagues.

Holland method is especially effective because he not


only considered the role of mutation (mutations improve
very seldom the algorithms), but he also utilized genetic
recombination, (crossover) : these are combination, the
crossover of partial solutions greatly improve the
capability of the algorithm to approach, and eventually
find, the optimum.
SEARCH SPACE

The space of all feasible solutions (the set of solutions


among which the desired solution resides) is called
search space (also state space). Each point in the
search space represents one possible solution. Each
possible solution can be "marked" by its value (or fitness)
for the problem.
BIOLOGICAL BACKROUND

Chromosomes are strings of DNA and serve as a model for the whole organism. A
chromosome consists of genes, blocks of DNA. Each gene encodes a particular
protein. Basically, it can be said that each gene encodes a trait, for example color of
eyes. Possible settings for a trait (e.g. blue, brown) are called alleles. Each gene has
its own position in the chromosome. This position is called locus.

Complete set of genetic material (all chromosomes) is called genome. Particular set
of genes in genome is called genotype. The genotype is with later development after
birth base for the organism's phenotype, its physical and mental characteristics, such
as eye color, intelligence etc.

Reproduction
During reproduction, recombination (or crossover) first occurs. Genes from parents
combine to form a whole new chromosome. The newly 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).
OUTLINE OF G.A

[Start]
[Fitness]
[New population]
[Selection]
[Crossover]
[Mutation]
[Replace]
[Test]
[Loop]
G.A STRUCTURE
1. [Start] Generate random population of n chromosomes (suitable
solutions for the problem)

2. [Fitness] Evaluate the fitness of each chromosome x in the population

3. [New population] Create a new population by repeating following steps until


the new population is complete
[Selection] Select two parent chromosomes from a population according
to their fitness (the better fitness, the bigger chance to be selected)
[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.
[Mutation] With a mutation probability mutate new offspring at each
locus (position in chromosome).
[Accepting] Place new offspring in the new population
[Replace] Use new generated population for a further run of the algorithm
4. [Test] If the end condition is satisfied, stop, and return the best solution in
current population
fitness

Evaluate Fitness
A value for fitness is assigned to each solution
(chromosome) depending on how close it actually is to
solving the problem (thus arriving to the answer of the
desired problem).

(These "solutions" are not to be confused with "answers"


to the problem, think of them as possible characteristics
that the system would employ in order to reach the
answer.)
POPULATION & FITNESS

Create a Random Initial State


An initial population is created from a random selection
of solutions (which are analagous to chromosomes).

Population size:
If there are too few chromosomes (POPULATION)
GA have few possibilities to perform crossover and only
a small part of search space is explored. On the other
hand, if there are too many chromosomes, GA slows
down.
CROSSOVER

Crossover operates on selected genes from parent chromosomes


and creates new offspring. The simplest way how to do that is to
choose randomly some crossover point and copy everything before
this point from the first parent and then copy everything after the
crossover point from the other parent.

Crossover can be illustrated as follows: ( | is the crossover point):

Chromosome 111011 | 00100110110


Chromosome 211011 | 11000011110

Offspring 111011 | 11000011110


Offspring 211011 | 00100110110

There are other ways how to make crossover, for example we can
choose more crossover points. Crossover can be quite complicated
and depends mainly on the encoding of chromosomes. Specific
crossover made for a specific problem can improve performance of
the genetic algorithm.
MUTATION

Mutation is intended to prevent falling of all solutions in


the population into a local optimum of the solved
problem. Mutation operation randomly changes the
offspring resulted from crossover. In case of binary
encoding we can switch a few randomly chosen bits from
1 to 0 or from 0 to 1. Mutation can be then illustrated as
follows:

Original offspring 11101111000011110


Original offspring 21101100100110110
Mutated offspring 11100111000011110
Mutated offspring 21101101100110110

The technique of mutation (as well as crossover)


depends mainly on the encoding of chromosomes. For
example when we are encoding permutations, mutation
could be performed as an exchange of two genes.
SELECTION

Parents are selected according to their fitness. The better the chromosomes
are, the more chances to be selected they have. Imagine a roulette wheel
where all the chromosomes in the population are placed.

The size of the section in the roulette wheel is proportional to the value of the
fitness function of every chromosome - the bigger the value is, the larger the
section is. See the following picture for an example.

A marble is thrown in the roulette wheel and the chromosome where it stops is
selected. Clearly, the chromosomes with bigger fitness value will be selected
more times.
APPLICATIONS
Genetic Algorithms to Generate Developable Strips
From Free formed Surfaces
One approach is to analyses the surface regarding
curvature. After running the GA for a total of 1000 individuals
for 200 generations using 1% probability of point mutation and
3 point crossover. A range of strips could be observed. The
lower image shows the below the NURBS surface the
environment is constructed from and in the upper part the strips
mapped from UV space back onto the NURBS surface.

Mesh Thickening
Banside Tower top project. The algorithm attempted
to create thickness / shell a three dimensional mesh object and
satisfy the over-constrained condition of not increasing the
number of vertices and offset in parallel the faces of the
original mesh by a constant amount.
APPLICATION
two senses of community. A community that is formed through visual
connection; when one stands in the landscape and remotely interacts with other
people. The other sense of community is created by the accessibility and the
proximity of ones topographical location to another .

architect used the topographical map of the site to regenerate a landscape


model on the computer and then wrote a script that created visual boundaries from
any point on the site.. Initially went through series of random point analyses in
order to understand its visual boundary characteristics. Eventually, was able to find
places with interesting visual properties for specific program functions. The task of
developing a building-complex configuration was also assisted by this procedural
analysis tool. The initial script was more of a guideline to understand the site and to
organize the intention.
APPLICATION
The Genera House
The idea was to design an architectural form that would correspond
and interact with its complex surrounding. project strived in capturing the
complex relationship between a surrounding light-environment and human
visual perception in a design artifact. The basic conceptual design elements
were structured in the form of algorithms, based on the mechanisms of the eye
functions. These algorithms were used to find desirable light conditions within
a given three-dimensional environment.

The procedure involved sampling light information from a series of


photographic material, populating with light data a three-dimensional
volumetric representation of space based on voxels, processing this data-space
through visual filters and thresholding the information cloud into discrete
areas of interest. Eventually, a formal result emerged out of both the
interpretation of given conditions and iterative refining design process.
Box Search Algorithm
A GA is used to generate boxes of a certain
volume given a choice of x y z dimensions. The target
values are weighted against each other which allows
putting different emphasis on the values according to
user preference. It is an example to illustrate a very
simple case of multiple targets expressed through a
weighted fitness function.

Tower Optimization Algorithm


In this example a GA is used to generate
tower variations based on the 6 control variables.
A possible fitness criteria is volume, surface area
and height. the towers are simply sorted by
volume
applications

Genetic Algorithms can be applied to virtually any problem that has a


large search space. the military uses GAs to evolve equations to
differentiate between different radar returns, stock companies use GA-
powered programs to predict the stock market.

A CAD model of an architectural structure is already given by a series of


operations. A round column, for example, is produced by a series such as
this

1) draw a line defining the profile of the column;


2) rotate this line to yield a surface of revolution;
3) perform a few Boolean subtractions to carve out some detail in the
body of the column.

Some software packages store this sequence and may even make
available the actual computer code corresponding to it,
so that this code now becomes the virtual DNA of the column.
Floor planning application

Bed Bed
room1 room2

Bed
room 3
living

kitchen
hall bath
LIMITATIONS

Drawbacks.
A drawback of any evolutionary algorithm is that a
solution is "better" only in comparison to other, presently
known solutions; such an algorithm actually has no
concept of an "optimal solution," or any way to test
whether a solution is optimal.

(For this reason, evolutionary algorithms are best


employed on problems where it is difficult or impossible to
test for optimality.)

This also means that an evolutionary algorithm never


knows for certain when to stop, aside from the length of
time, or the number of iterations or candidate solutions,
that you wish to allow it to explore.

You might also like