Topicos i artificial

Uploaded on


More in: Technology , Education
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads


Total Views
On Slideshare
From Embeds
Number of Embeds



Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

    No notes for slide


  • 1. Profr. Rubén Machucho Cadena
  • 2. Edward A. Feigenbaum Padre de los Sistemas Expertos. Desarrolló Dendral, un sistema experto para el análisis de compuestos químicos.
  • 3. 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.
  • 4. “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
  • 5.  Directed search algorithms based on the mechanics of biological evolution  Developed by John Holland, University of Michigan (1970’s) ◦ To understand the adaptive processes of natural systems ◦ To design artificial systems software that retains the robustness of natural systems
  • 6.  Provide efficient, effective techniques for optimization and machine learning applications  Widely-used today in business, scientific and engineering circles
  • 7. Finonacci Newton Direct methods Indirect methods Calculus-based techniques Evolutionary strategies Centralized Distributed Parallel Steady-state Generational Sequential Genetic algorithms Evolutionary algorithms Simulated annealing Guided random search techniques Dynamic programming Enumerative techniques Search techniques
  • 8. 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)
  • 9. { initialize population; evaluate population; while TerminationCriteriaNotSatisfied { select parents for reproduction; perform recombination and mutation; evaluate population; } }
  • 10. reproduction population evaluation modification discard deleted members parents children modified children evaluated children
  • 11. Chromosomes could be: ◦ Bit strings (0101 ... 1100) ◦ Real numbers (43.2 -33.1 ... 0.0 89.2) ◦ Permutations of element (E11 E3 E7 ... E1 E15) ◦ Lists of rules (R1 R2 R3 ... R22 R23) ◦ Program elements (genetic programming) ◦ ... any data structure ... population
  • 12. reproduction population parents children Parents are selected at random with selection chances biased in relation to chromosome evaluations.
  • 13.  Modifications are stochastically triggered  Operator types are: ◦ Mutation ◦ Crossover (recombination) modification children modified children
  • 14.  Causes movement in the search space (local or global)  Restores lost information to the population Before: (1 0 1 1 0 1 1 0) After: (0 1 1 0 0 1 1 0) Before: (1.38 -69.4 326.44 0.1) After: (1.38 -67.5 326.44 0.1)
  • 15. P1 (0 1 1 0 1 0 0 0) (0 1 0 0 1 0 0 0) C1 P2 (1 1 0 1 1 0 1 0) (1 1 1 1 1 0 1 0) 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) *
  • 16.  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 evaluation evaluated children modified children
  • 17.  Generational GA: entire populations replaced with each iteration  Steady-state GA: a few members replaced each generation population discard discarded members
  • 18. Distribution of Individuals in Generation 0 Distribution of Individuals in Generation N
  • 19. 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
  • 20. Representation is an ordered list of city numbers known as an order-based GA. 1) London 3) Dunedin 5) Beijing 7) Tokyo 2) Venice 4) Singapore 6) Phoenix 8) Victoria CityList1 (3 5 7 2 1 6 4 8) CityList2 (2 5 7 6 8 1 3 4)
  • 21. 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.
  • 22. Mutation involves reordering of the list: * * Before: (5 8 7 2 1 6 3 4) After: (5 8 6 2 1 7 3 4)
  • 23. 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
  • 24. 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)
  • 25. Mutation Bit inversion - selected bits are inverted 11001001 => 10001001
  • 26. 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) Permutation Encoding
  • 27. 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
  • 28. 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 . . 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. 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. Chromosome A 101100101100101011100101 Chromosome B 111111100000110000011111
  • 29. 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.
  • 30. Permutation Encoding Chromosome A 1 5 3 2 6 4 7 9 8 Chromosome B 8 5 6 7 2 3 1 4 9 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. 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.
  • 31. 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 1.2324 5.3243 0.4556 2.3293 2.4545 Chromosome B ABDJEIFJDHDIERJFDLDFLFEGT Chromosome C (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.
  • 32. 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.
  • 33.  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)
  • 34.  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
  • 35.  Many ways to speed up and improve a GA- based 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
  • 36.  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
  • 37. Domain Application Types Control gas pipeline, pole balancing, missile evasion, pursuit Design semiconductor layout, aircraft design, keyboard configuration, communication networks Scheduling manufacturing, facility scheduling, resource allocation Robotics trajectory planning Machine Learning designing neural networks, improving classification algorithms, classifier systems Signal Processing filter design Game Playing poker, checkers, prisoner’s dilemma Combinatorial Optimization set covering, travelling salesman, routing, bin packing, graph colouring and partitioning