# Genetic Recombination

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

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

92 εμφανίσεις

John Hawkins

Genetic Algorithms

“Genetic Algorithms”

Background

Charles Darwin

1859: Writes
Origin of Species

and
rocks the worlds of science and
philosophy

Nils
Aall

Barricelli

1954: First emulates evolution on
a computer

Ingo
Rechenberg

1960s: Popularizes genetic
algorithms as a tool for
optimization

Evolution as an algorithm

organisms

Evaluate fitness of each organism

Create a new population

Select parents based on fitness

Create new children through
crossovers and mutations of “DNA”

Replace old population

Repeat

An example: Tiddlywinks

Given a set of tiddlywinks in a box, find the location and size
of the largest possible non
-
overlapping tiddlywink

Encoding

We need chromosomes to work with, so we need to encode
our solutions properly.

Most common way is to convert numbers to a binary string,
which acts as the DNA of the organism.

In our case, we have six segments of the DNA: x, y, and r of
the solution, separating the numbers before and after the
decimal.

Fitness Test

In this case, easy. We wish to maximize:

In general can be anything your given problem requires.

Selection of Parents: Roulette

We do
NOT
automatically choose the most fit parents. The
are chosen stochastically to keep the gene pool from getting
trapped easily in a local max of the fitness function.

Any stochastic process favoring fittest will do. Here we use
the roulette wheel algorithm:

Calculate the sum of the fitness of all chromosomes.

Order the chromosomes and weight them by their fitness

Generate a random numbers
r

in (0,sum)

Select the parents represented by the values in
r

Next Generation: Crossover

This and mutation are the most
important steps!

Crossover is simple: take one or more
pieces of two chromosomes and
switch them.

Next Generation: Mutation

Mutation is simply a random change in the chromosome.

In our case, as usual with these algorithms, it is simply
changing a 1 to a 0 or vice
-
versa with some low probability.

Elitism

Yes, elitism is a technical term in this algorithm. In fact, it’s a
very important part!

As presented so far, every generation the algorithm loses the
best solution with no guarantee of getting something as good
back!

The solution is to just select the best solution in every step
and keep it without crossover or mutation. This “sheltering”
of the best solution from selection, crossover, and mutation is
called “elitism”.

Ending the Algorithm

The algorithm is complete when one of the following occurs:

A specified tolerance threshold is achieved

A specified number of generations has passed

A specified amount of computational time has passed

The solution fitness has
plataued

Kinds of Problems using GA [1]

Nonlinear dynamical systems
-

predicting, data analysis

Designing neural networks, both architecture and weights

Robot trajectory

Evolving LISP programs (genetic programming)

Strategy planning

Finding shape of protein molecules

TSP and sequence scheduling

Functions for creating images

Limitations and Criticism

The convergence mechanism is poorly understood. That is,
GAs work empirically, but lack solid convergence theory.

GAs often get caught in local minima.

GAs are often not the fastest available algorithms.

For some problems each call of the fitness function would take
hours or days

GAs do not scale well to problems of excessive complexity.

Works Consulted

[1]
Obitko
,
Marek
.
Genetic Algorithms Tutorial
.
http://www.obitko.com/tutorials/genetic
-
algorithms/index.php

[2]
Genetic Algorithms in Plain English.

http://www.ai
-
junkie.com/ga/intro/gat1.html

[3] Russell,
Norvig
.
Artificial Intelligence: A Modern Approach.