# Genetic Algorithms - Studium

Τεχνίτη Νοημοσύνη και Ρομποτική

24 Οκτ 2013 (πριν από 4 χρόνια και 6 μήνες)

71 εμφανίσεις

Genetic A
l
gorithms

Overview of Genetic Algorithms

Genetic algorithms (GAs) are stochastic, population
-
based search and optimization

algorithms
inspired by the process of

natural selection and genetics
.
A major characteristic of GAs is that they
work
with a population,

unlike other classical approaches which operate on a single solution at a
time. Hence,
they can explore different regions of the solution space

(i.e., search space)
concurrently, thereby exhibiting enhanced performance. The pseudo
-
code o
f GAs is shown in Fig.
1
.

Essential Components

GAs are powerful search mechanisms: traverse the solution space in search of optimal solutions.
GAs encode the decision variables (or input parameters) of the underlying problem into (solution)
strings.
Each string, called
individual

or

chromosome
, represents a candidate solution
.
Characters of
the string are called
genes
.

The position and the value in the string of a gene are called
locus

and
allele
, respectively
.
There are two encoding classes:
genotype

and
phenotype
. The former denotes
the codings of the variables and the latter represents the variables themselves.

A
fitness function

is
needed for differentiating between good and bad solutions
. Unlike classical optimization
techniques, the fitness f
unct
ion of GA
s may be presented in a mathematical terms, or as a complex
computer simulation,

or even in terms of subjective human evaluation. Fitness generates a

differential signal in accordance with which GAs guide the evolution of solutions

to the prob
lem
.

The initial population is created at random or with prior knowledge about

the problem
. The
individuals are evaluated to measure the quality of candidate

solutions with a fitness function.
In
order to generate or evolve the

offspring (i.e., new solutions),

genetic operators are applied to the
current

population. The genetic operators are: selection (or reproduction), crossover (or
recombination), and mutation.

Genetic Operators

Selection chooses the individuals with higher fitness as parents of the next
generation
. In other
words,
selection operator

is intended to improve average quality of the population by giving
superior individuals a better chance to get copied into the next generation
. There is a selection
pressure that characterizes the selection sc
hemes. It is defined as the ratio of the probability of
selection of the best individual in the population to that

of an average individual
.
There are two
basic types

of selection scheme in common usage:
proportionate and ordinal selection
.
Proportionate
s
election picks
out individuals based on their fitness values

relative to the fitness of
the other individuals in the population. Examples of such a selection type
include r
oulette
-
wheel
selection
, sto
chastic remainder selection
, and sto
chastic universal
selection
.
Ordinal selection
selects individuals based not upon their fitness, but upon their rank within the population
.
The
individual are ranked according to their fitness v
alues.

Fig. 2a
. Proportionate selection

output
.

Fig.2b
. Ordinal
selection

output
.

Tournament selection
, (
μ
,
λ
) selecti
on, linear ranking selection, and truncation selection

are
included in the ordinal selection type.

Crossover

exchanges and combines partial solutions from
two or more parental individuals according to
a crossover probability, p
c
, in order to create
offspring.

That is, the crossover operator exploits the current solutions with a view to finding better
ones. Two popular crossover operators, from among many variants, are presented:
one
-
point and
uniform
cross
over

(position
-
based crossover

for combinatorial problems
)
. One point crossover

randomly chooses a crossover point (i.e., crossing site) in the two individuals and then exchanges
all the genes behind the crossover point (see Fig.
3
(a)). Uniform crosso
ver

exchanges each gene
with probability 0.5 (see Fig.
3
(b)), hence achieving the maximum allele
-
wise mixing rate.

Mutation

acts by altering a small percentage of genes in the list of individuals to slightly perturbs
the recombined solutions. One classical

mutation opera
tor is bit
-
wise mutation

in which each gene
whose allele is binary is complemented with a mutation probability p
m
.

For instance, a binary
individual A = 1 1 1 1 1 1 might become A_ = 1 1 0 1 1 1 when the third gene is chosen (randomly)
for m
utation
.
In general, the mutation probability is taken to be low.

By striking a balance between
exploitation

(of selection) and
exploration

(of crossover and mutation), GAs can effectively search
the solution space.

Fig.1

Fig.
3

Fig. 4.

P
osition
-
based crossover

Step 5b.
Elitism

Idea of elitism has been already introduced. When creating new population by crossover and
m
utation, we have a big chance, that we will loose the best chromosome.

Elitism is name of method, which first copies the best chromosome (or a few best chromosomes) to
new population. The rest is done in classical way. Elitism can very rapidly increase performance of
GA, because it prevents losing the best found solution.

Fig.
4