Sie sind auf Seite 1von 46

Profr.

Rubn Machucho Cadena

Edward A. Feigenbaum Padre de los Sistemas Expertos. Desarroll Dendral, un sistema experto para el anlisis de compuestos qumicos.

Genetic algorithms are a class of heuristic search methods and computational models of adaptation and evolution based on natural selection. In nature, the search for beneficial adaptations to a continually changing environment (i.e. evolution) is fostered by the cumulative evolutionary knowledge that each species possesses of its forebears. This knowledge, which is encoded in the chromosomes of each member of a species, is passed from one generation to the next by a mating process in which the chromosomes of "parents" produce "offspring" chromosomes.

Genetic Algorithms are good at taking large, potentially huge search spaces and navigating them, looking for optimal combinations of things, solutions you might not otherwise find in a lifetime.
- Salvatore Mangano Computer Design, May 1995

Directed search algorithms based on the mechanics of biological evolution Developed by John Holland, University of Michigan (1970s)
To understand the adaptive processes of natural systems To design artificial systems software that retains the robustness of natural systems

Provide efficient, effective techniques for optimization and machine learning applications Widely-used today in business, scientific and engineering circles

Search techniques
Calculus-based techniques Direct methods Indirect methods Guided random search techniques Evolutionary algorithms Simulated annealing Enumerative techniques Dynamic programming

Finonacci

Newton

Evolutionary strategies

Genetic algorithms

Parallel
Centralized Distributed

Sequential
Steady-state Generational

A problem to solve, and ... Encoding technique (gene, chromosome) Initialization procedure (creation) Evaluation function (environment) Selection of parents (reproduction) Genetic operators (mutation, recombination) Parameter settings (practice and art)

initialize population; evaluate population; while TerminationCriteriaNotSatisfied


{

select parents for reproduction; perform recombination and mutation; evaluate population;
}

reproduction
parents

children

modification
modified children

population
deleted members

evaluation
evaluated children

discard

population Chromosomes could be:


Bit strings Real numbers Permutations of element Lists of rules Program elements ... any data structure ... (0101 ... 1100) (43.2 -33.1 ... 0.0 89.2) (E11 E3 E7 ... E1 E15) (R1 R2 R3 ... R22 R23) (genetic programming)

reproduction
parents

children

population

Parents are selected at random with selection chances biased in relation to chromosome evaluations.

children

modification
modified children

Modifications are stochastically triggered Operator types are:


Mutation Crossover (recombination)

Before: After: Before: After:

(1 0 1 1 0 1 1 0) (0 1 1 0 0 1 1 0) (1.38 -69.4 326.44 0.1) (1.38 -67.5 326.44 0.1)

Causes movement in the search space (local or global) Restores lost information to the population

P1
P2

(0 1 1 0 1 0 0 0) (1 1 0 1 1 0 1 0)

(0 1 0 0 1 0 0 0) (1 1 1 1 1 0 1 0)

C1
C2

Crossover is a critical feature of genetic algorithms:


It greatly accelerates search early in evolution of a population It leads to effective combination of schemata (subsolutions on different chromosomes)

evaluated children

modified children

evaluation

The evaluator decodes a chromosome and assigns it a fitness measure The evaluator is the only link between a classical GA and the problem it is solving

population
discarded members

discard

Generational GA:

entire populations replaced with each iteration Steady-state GA: a few members replaced each generation

Distribution of Individuals in Generation 0

Distribution of Individuals in Generation N

The Traveling Salesman Problem: Find a tour of a given set of cities so that
each city is visited only once the total distance traveled is minimized

Representation is an ordered list of city numbers known as an order-based GA.


1) London 2) Venice CityList1 CityList2 3) Dunedin 4) Singapore 5) Beijing 7) Tokyo 6) Phoenix 8) Victoria

(3 5 7 2 1 6 4 8) (2 5 7 6 8 1 3 4)

Crossover combines inversion and recombination: * * Parent1 (3 5 7 2 1 6 4 8) Parent2 (2 5 7 6 8 1 3 4)


Child

(5 8 7 2 1 6 3 4)

This operator is called the Order1 crossover.

Mutation involves reordering of the list:

Before:
After:

* * (5 8 7 2 1 6 3 4) (5 8 6 2 1 7 3 4)

Crossover and Mutation


Introduction
Crossover and mutation are two basic operators of GA. Performance of GA very depends on them. Type and implementation of operators depends on encoding and also on a problem.

Binary Encoding
Crossover Single point crossover - one crossover point is selected, binary string from beginning of chromosome to the crossover point is copied from one parent, the rest is copied from the second parent

11001011+11011111 = 11001111

Two point crossover - two crossover point are selected, binary string from beginning of chromosome to the first crossover point is copied from one parent, the part from the first to the second crossover point is copied from the second parent and the rest is copied from the first parent

11001011 + 11011111 = 11011111 Uniform crossover - bits are randomly copied from the first or from the second parent

11001011 + 11011101 = 11011111


Arithmetic crossover - some arithmetic operation is performed to make a new offspring

11001011 + 11011111 = 11001001 (AND)

Mutation
Bit inversion - selected bits are inverted

11001001 => 10001001

Permutation Encoding
Crossover
Single point crossover - one crossover point is selected, till this point the permutation is copied from the first parent, then the second parent is scanned and if the number is not yet in the offspring it is added Note: there are more ways how to produce the rest after crossover point (1 2 3 4 5 6 7 8 9) + (4 5 3 6 8 9 7 2 1) = (1 2 3 4 5 6 8 9 7) Mutation Order changing - two numbers are selected and exchanged (1 2 3 4 5 6 8 9 7) => (1 8 3 4 5 6 2 9 7)

Value Encoding
Crossover

All crossovers from binary encoding can be used

Mutation
Adding a small number (for real value encoding) - to selected values is added (or subtracted) a small number (1.29 5.68 2.86 4.11 5.55) => (1.29 5.68 2.73 4.22 5.55)

Tree Encoding
Crossover

Tree crossover - in both parent one crossover point is selected, parents are divided in that point and exchange part below crossover point to produce new offspring

Mutation Changing operator, number - selected nodes are changed

Encoding
Introduction Encoding of chromosomes is one of the problems, when you are starting to solve problem with GA. Encoding very depends on the problem. In this chapter will be introduced some encodings, which have been already used with some success.

Binary Encoding Binary encoding is the most common, mainly because first works about GA used this type of encoding In binary encoding every chromosome is a string of bits, 0 or 1

Chromosome A
.

101100101100101011100101 111111100000110000011111

Chromosome B

Example of chromosomes with binary encoding


Binary encoding gives many possible chromosomes even with a small number of alleles. On the other hand, this encoding is often not natural for many problems and sometimes corrections must be made after crossover and/or mutation.

Example of Problem: Knapsack problem The problem: There are things with given value and size. The knapsack has given capacity. Select things to maximize the value of things in knapsack, but do not extend knapsack capacity. Encoding: Each bit says, if the corresponding thing is in knapsack.

Permutation Encoding
Permutation encoding can be used in ordering problems, such as travelling salesman problem or task ordering problem. In permutation encoding, every chromosome is a string of numbers, which represents number in a sequence.

Chromosome A Chromosome B

1 5 3 2 6 4 7 9 8 8 5 6 7 2 3 1 4 9

Example of chromosomes with permutation encoding

Permutation encoding is only useful for ordering problems. Even for this problems for some types of crossover and mutation corrections must be made to leave the chromosome consistent (i.e. have real sequence in it).
Example of Problem: Travelling salesman problem (TSP) The problem: There are cities and given distances between them.Travelling salesman has to visit all of them, but he does not to travel very much. Find a sequence of cities to minimize travelled distance. Encoding: Chromosome says order of cities, in which salesman will visit them.

Value Encoding
Direct value encoding can be used in problems, where some complicated value, such as real numbers, are used. Use of binary encoding for this type of problems would be very difficult. In value encoding, every chromosome is a string of some values. Values can be anything connected to problem, form numbers, real numbers or chars to some complicated objects.

Chromosome A Chromosome B Chromosome C

1.2324 5.3243 0.4556 2.3293 2.4545 ABDJEIFJDHDIERJFDLDFLFEGT (back), (back), (right), (forward), (left)

Example of chromosomes with value encoding Value encoding is very good for some special problems. On the other hand, for this encoding is often necessary to develop some new crossover and mutation specific for the problem.
Example of Problem: Finding weights for neural network The problem: There is some neural network with given architecture. Find weights for inputs of neurons to train the network for wanted output. Encoding: Real values in chromosomes represent corresponding weights for inputs.

Tree Encoding
Tree encoding is used mainly for evolving programs or expressions, for genetic programming. In tree encoding every chromosome is a tree of some objects, such as functions or commands in programming language. Chromosome A Chromosome B

(+ x (/ 5 y))

( do_until step wall )

Example of chromosomes with tree encoding Tree encoding is good for evolving programs. Programing language LISP is often used to this, because programs in it are represented in this form and can be easily parsed as a tree, so the crossover and mutation can be done relatively easily.
Example of Problem: Finding a function from given values The problem: Some input and output values are given. Task is to find a function, which will give the best (closest to wanted) output to all inputs. Encoding: Chromosome are functions represented in a tree.

Choosing basic implementation issues:


representation population size, mutation rate, ... selection, deletion policies crossover, mutation operators

Termination Criteria Performance, scalability Solution is only as good as the evaluation function (often hardest part)

Concept is easy to understand Modular, separate from application Supports multi-objective optimization Good for noisy environments Always an answer; answer gets better with time Inherently parallel; easily distributed

Many ways to speed up and improve a GAbased application as knowledge about problem domain is gained Easy to exploit previous or alternate solutions Flexible building blocks for hybrid applications Substantial history and range of use

Alternate solutions are too slow or overly complicated Need an exploratory tool to examine new approaches Problem is similar to one that has already been successfully solved by using a GA Want to hybridize with an existing solution Benefits of the GA technology meet key problem requirements

Domain
Control Design Scheduling Robotics Machine Learning Signal Processing Game Playing Combinatorial Optimization

Application Types
gas pipeline, pole balancing, missile evasion, pursuit semiconductor layout, aircraft design, keyboard configuration, communication networks manufacturing, facility scheduling, resource allocation trajectory planning designing neural networks, improving classification algorithms, classifier systems filter design poker, checkers, prisoners dilemma set covering, travelling salesman, routing, bin packing, graph colouring and partitioning

Das könnte Ihnen auch gefallen