Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
ABSTRACT
Genetic algorithms are a part of evolutionary computing, which is a rapidly growing area
of artificial intelligence. Genetic algorithms are inspired by Darwin's theory of evolution.
Problems are solved by an evolutionary process resulting in a best (fittest) solution (survivor) - in
other words, the solution is evolved.
All living organisms consist of cells. In each cell there is the same set of chromosomes.
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. 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). If
we are solving a problem, we are usually looking for some solution which will be the best among
others. 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. With GA we look for the best solution among a number of possible solutions -
represented by one point in the search space.
Evolution and optimization
We are now 45 millions years ago examining a Basilosaurus :
Basilosaurus
The Basilosaurus was quite a prototype of a whale. It was about 15 meters long for 5
tons. It still had a quasi-independent head and posterior paws. He moved using undulatory
movements and hunted small preys. Its anterior members were reduced to small flippers with an
elbow articulation.
Movements in such a viscous element (water) are very hard and require big efforts. The
anterior members of basilosaurus were not really adapted to swimming. To adapt them, a double
phenomenon must occur : the shortening of the "arm" with the locking of the elbow articulation
and the extension of the fingers which will constitute the base structure of the flipper.
Tursiops flipper
The image shows that two fingers of the common dolphin are hypertrophied to the
detriment of the rest of the member.
The basilosaurus was a hunter, he had to be fast and precise. Through time, subjects
appeared with longer fingers and short arms. They could move faster and more precisely than
before, and therefore, live longer and have many descendants.
Darwinian mechanism hence generate an optimization process, Hydrodynamic
optimization for fishes and others marine animals, aerodynamic for pterodactyls, birds or bats.
This observation is the basis of genetic algorithms.
Evolution and Genetic Algorithms
Genetic algorithms are inspired by Darwin's theory of evolution. Solution to a problem
solved by genetic algorithms uses an evolutionary process (it is evolved). Algorithm begins with
a set of solutions (represented by chromosomes) called population. Solutions from one
population are taken and used to form a new population. This is motivated by a hope, that the
new population will be better than the old one. Solutions that are then selected to form new
solutions (offspring) are selected according to their fitness - the more suitable they are the more
chances they have to reproduce. This is repeated until some condition (for example number of
populations or improvement of the best solution) is satisfied.
3. [New population] Create a new population by repeating following steps until the new
population is complete
2. [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.
4. [Replace] Use new generated population for a further run of the algorithm
5. [Test] If the end condition is satisfied, stop, and return the best solution in current
population
6. [Loop] Go to step 2
The crossover and mutation are the most important parts of the genetic algorithm. Mainly these
two operators influence the performance. Before we can explain more about crossover and
mutation, some information about chromosomes will be given.
ENCODING:
A chromosome should in some way contain information about solution that it represents. The
most used way of encoding is a binary string. A chromosome then could look like this:
Chromosome 1 1101100100110110
Chromosome 2 1101111000011110
A binary string represents each chromosome. Each bit in the string can represent some
characteristics of the solution. Another possibility is that the whole string can represent a number
- this has been used in the basic GA applet.
Of course, there are many other ways of encoding. The encoding depends mainly on the solved
problem. For example, one can encode directly integer or real numbers, sometimes it is useful to
encode some permutations and so on.
CROSSOVER:
After we have decided what encoding we will use, we can proceed to crossover operation.
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.
After a crossover is performed, mutation takes place. 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:
We can notice that A and B are the closest to their ancestors ; they've got quite long paws
and short fingers. On the contrary, D is close to the optimum, he just needs a small lengthening
of his fingers.
This is such a peculiar world that the ability to move is the main criteria of survival and
reproduction. No female would easily accept to marry basilosaurus whose paws would look like
A's. But they all dream to meet D one day.
The fitness is easy to compute: we just have to give one point to each gene corresponding
to the ideal. The perfect genome will then get four points. The probability of reproduction of a
given subject will directly depend on this value. In our case, we'll get the following results :
We'll consider a cycle of reproduction with for descendants, i.e. four mating
concerning height subjects. D will be selected four times and will then get four descendants. C
will be selected twice and will get two descendants. Finally A and B will only be selected once.
The reproduction pattern is the following :
Total - - 10 10/10=1
During reproduction crossovers occur at a random place (center of the genome for A', B'
and C', just after the first gene for D'). The link existing between the degree of adaptation and the
probability of reproduction leads to a trend to the rise of the average fitness of the population. In
our case, it jumps from 7 to 10.
During the following cycle of reproduction, C' and D' will have a common descendant :
D' : + C' : =
The new subject has inherited the intended genome : his paws have become flippers.
Crossover is the basis of genetic algorithms, there is nevertheless other operators like
mutation. In fact, the desired solution may happen not to be present inside a given genetic pool,
even a large one.
Mutations allow the emergence of new genetic configurations which, by widening the
pool improve the chances to find the optimal solution. Other operators like inversion are also
possible, but we won't deal with them here.
In order to palliate these problems, it's possible to transform the fitness values. Here are
the four main methods:
1- Windowing: For each subject, reduce its fitness by the fitness of the worse subject.
2- Exponential: This method, proposed by S.R. Ladd, consists in taking the square roots of the
fitness plus one. This permits to reduce the influence of the strongest subjects.
3- Linear Transformation: Apply a linear transformation to each fitness, i.e. f ' = a.f + b. The
strongest subjects are once again reduced.
4- Linear normalization: Fitness is linearized. For example over a population of 10 subjects,
the first will get 100, the second 90, 80 ... The last will get 10.
To illustrate these methods, let's consider a population of four subjects to check the effect
of scaling. For each subject, we give the fitness and the corresponding selection probability.
Subjects 1 2 3 4
Rough Fitness 50/50% 25/25% 15/15% 10/10%
Windowing 40/66.7% 15/25% 5/8.3% 0/0%
Exponential 7.14/36.5% 5.1/26.1% 4.0/20.5% 3.32/16.9%
Linear 53.3/44.4% 33.3/27.8% 20/16.7 13.3/11.1%
Transfo.
Linear 40/40% 30/30% 20/20% 10/10%
normalization
Windowing eliminates the weakest subject - the probability comes to zero - and
stimulates the strongest ones (the best one jumps from 50 % to 67 %).
Exponential flattens the distribution. It's very useful when a super-subject induces an
excessively fast convergence.
Linear transformation plays slightly the same role than exponential.
At last, linear normalization is neutral towards the distribution of the fitness and only
depends on the ranking. It avoids as well super-subjects as a too homogeneous distribution.
Genetic Programming
• “black art” problems, such as the automated synthesis of analog electrical circuits,
controllers, antennas, networks of chemical reactions, and other areas of design,
• “commercially usable new inventions” (CUNI) involving the use of genetic programming
as an automated "invention machine" for creating commercially usable new inventions.
• We are constantly looking for new domain areas in which to apply the techniques of
genetic programming to achieve human-competitive machine intelligence.
Genetic algorithms are original systems based on the supposed functioning of the Living.
The method is very different from classical optimization algorithms.
1. Use of the encoding of the parameters, not the parameters themselves.
2. Work on a population of points, not a unique one.
3. Use the only values of the function to optimize, not their derived function or other
auxiliary knowledge.
4. Use probabilistic transition function not determinist ones.
It's important to understand that the functioning of such an algorithm does
not guarantee success. We are in a stochastic system and a genetic pool may be too far from the
solution, or for example, a too fast convergence may halt the process of evolution. These
algorithms are nevertheless extremely efficient, and are used in fields as diverse as stock
exchange, production scheduling or programming of assembly robots in the automotive industry.
REFERENCES: