Compresión de Datos usando AGS

Genetic Algorithms as a Tool for
General Optimization
Angel Kuri
2001
Optimization
Genetic Algorithms are meta-heuristics based
on an analogy with evolutionary processes,
where three ideas outstand:
a) That any optimizable problem is amenable to
an (usually digital) encoding process.
b) That a problem thusly encoded is more easily
tackled than its non-encoded couterpart.
c) That genetic operators called natural selection,
crossover and mutation are enough to fully and
efficiently explore the solution landscape.
Optimization
(Any problem is encodable)
For this to be true we have to restrict the
solution landscapes to a finite subset of
the original ones.
This is not a source of serious conceptual
or practical trouble since, in all cases,
the computational solution of any given
problem is digitally encoded.
Optimization
(An encoded problem is more easily tackled)
This dictum is not obvious. However, the ample
evidence supporting it leaves little room for
doubt.
More importantly, theoretical arguments seem
to leave no doubt:
a) Genetic Algorithms always converge to the
best solution
b) Convergence is usually quite efficient
Optimization
(Genetic operators yield efficient performance)
Our aim when designing Gas is to make
the abovementioned convergence as
efficient as possible.
Two sources of inefficiency have been
clearly determined:
a) Deceptive functions
b) Spurious correlation
Optimization
Before discussing how to overcome the
aforementioned limitations we shall
analyze a canonical GA (or SGA).
Then we will describe a non-standard GA
(VGA) which was designed to avoid the
pifalls of the SGA.
The Simple Genetic Algorithm
Although there are many possible variations, the best understood and more
widely treated sort of GA is called
“Simple”.
Simple Genetic Algorithm

It considers:
» Genetic haploid representation
» Proportional selection
» 1-point crossover
» Mutation with low probability
» No elitism
» Binary strings
» Constant sized population
» Bounded number of generations
SGA

The SGA starts from a set of binary
strings
Evaluation

Every candidate solution is evaluated
Evaluation

Strings are sorted best to worst
Selection

Every string is asigned a probability
proportional to its performance
Selection

Probability of Selection
Crossover

A couple of individuals is randomly
chosen; a locus is also randomly chosen
Crossover

Genetic contents are exchanged
Crossover
The process is repeated m/2 times,
yielding m descendants.
 The idea is that best genes survive
giving rise to better fit individuals.

Mutation
Once the new population is set, some
genes are mutated.
 Mutation is effected on a very low
probability basis (typically, from 0.1% to
0.5%).

Population’s Behavior
The number of schemata “m” of a given
schema (H) at time “t” is given by:
m( H , t )  m( H , t  1)
f (H)
_
f
 (H)
[1  p c
 p m o( H )]
l 1
SGA
where:
f ( H )  fitness of H
_
f  average fitness of the population
 ( H )  defining length
o( H )  schema order
pc  crossover probability
pm  mutation probability
SGA




We now illustrate with a simple example.
Keep in mind that the purpose of the example
is to transmit the feeling of how a SGA works.
The point to be stressed is that this Gas solve
equally well trivial problems as well as very
complex ones.
We illustrate both kinds.
Illustrating the SGA

Problem:
What is the largest possible value for the
expression 2 x 2  3 ?
To make the question meaningful we further
impose:
0  x  2 1
10
Encoding
In this case, the GA’s population consists
of a set of binary strings of length 10
which we assume to be encoded in
positional weighted binary.
SGA’s Limitations
The SGA, as described, does not
converge. In fact, if run indefinitely, it will
find and loose the solution an infinite
number of times.
 Furthermore, in some cases it will get
stuck in a local optimum.

Vasconcelos Algorithm
To overcome the limitations of a SGA we
introduced the so called Vasconcelos
GA.
It displays:
a) Deterministic (i -> n-i+1) coupling
b) Annular crossover
c) Uniform mutation
d) Full elitism
Deterministic Coupling
Annular Crossover
Full Elitism
Application Example

Optimization of a function subject to
constraints
» Linear functions
» Linear constraints
» Non-linear functions
» Non-linear constraints
Fitness Function
if all conditions are fulfilled
 6 x1  9 x2
f ( x)  
9
7

10

(
25

10
) s otherwise

where s is the number of constraints which are satisfied
and
0s4
Numerical Representation
Numerical Example
Sample Run
Sample Run
Sample Run
Sample Run
Sample Run
Sample Run
Non-Numerical Example
Traveling Salesman Problem
Non-Numerical Example
In this type of problem it is needed to
repair the solutions, since invalid
proposals arise on two accounts:
a) Because no two cities may be repeated
b) Because not all binary combinations
are necessarily utilized. Hence, some
individuals are unfeasible.
Repair Algorithm
To following individual is unfeasible on two
accounts:
a) One city is off limits (7)
b) One city repeats itself (2)
Repair Algorithm
Step 1:
Identify cities off limits
Repair Algorithm
Step 2:
Identify repeated cities:
Repair Algorithm
Step 3:
Establish a list of candidates for
replacement.
In this case, the list is:
a) 1
b) 2
c) 5
Repair Algorithm
for i=1 to number of cities to repair
a) randomly select a vacant position
b) randomly select a candidate from the
list
c) eliminate the selected candidate from
the list
d) Fill in the selected position
endfor
Repair Algorithm
One possible repaired individual:
Non-Numerical Example
Traveling Salesman Problem
Non-Numerical Example
Non-Numerical Example
Non-Numerical Example
Non-Numerical Example
Traveling Salesman Problem
(Solution)
Non-Numerical Example
Conclusions
In the problems we illustrated there is
essentially no change in the GA itself.
That is, the same algorithm works on
essentially different probems.
The methodology, therefore, is applicable
to a wide range of possible probelms.
Now See the Program!