170 likes | 424 Views
How does a Genetic Algorithm Work?. Luis Tijerina. What is a Genetic Algorithm?. Genetic algorithms are defined as: “A form of evolution that occurs on a computer.” –S. Forrest.
E N D
How does a Genetic Algorithm Work? Luis Tijerina
What is a Genetic Algorithm? • Genetic algorithms are defined as: • “A form of evolution that occurs on a computer.” –S. Forrest. • “Computer programs that "evolve" in ways that resemble natural selection (which) can solve complex problems even their creators do not fully understand.” –J.H. Holland. • “A family of computational models inspired by evolution. These algorithms encode a potential solution to a specific problem (…) and apply recombination operators (…) to preserve critical information. –D. Whitley.
Why use a Genetic Algorithm? • Evolutionary process outperforms human design in some cases. • Eliminates details of problem and solution specification. • Explore a greater range of potential solutions. • Gain insight on how life and intelligence evolve in the natural world. • Develop solutions to problems too complex for human design.
Brief History • Evolution strategies –Rechenberg(1965, 1973) and Schwefel (1975, 1977). • Evolutionary programming –Fogel, Owens and Walsh (1966). • Genetic Algorithms, invented by John Holland, 1960s. • Intended for study of evolution and adaptation. • Develop ways in which these mechanisms might work in computer systems.
Definition • GeneticAlgorithm • Algorithm: a set of steps that are followed in order to solve a mathematical problem or to complete a computer process. • Genetic: • Selection • Inheritance • Genetic Operators • Mutation • Crossover
Selection • Based on biological natural selection. • Determines which members of population survive and reproduce. • Select chromosomes in the population for reproduction. The fitter the chromosome, the more times it is likely to be selected to reproduce.
Selection Methods • Fitness−proportionate selection: The "expected value" of an individual is that individual's fitness divided by the average fitness of the population. • Roulette wheel sampling. • Scaling: Mapping "raw" fitness values to expected values. • Elitism: Added to other methods, forces the GA to retain some number of the best individuals at each generation. • Boltzmann selection: Varying "temperature" controls the rate of selection. • Rank selection: Individuals in the population are ranked according to fitness. Its expected value depends on the rank rather than on its absolute fitness.
Inheritance • Ability of modelled objects to mate, mutate and propagate their problem solving genes to the next generation. • Implemented by eliminating low-fitness individuals and making copies of high-fitness individuals.
Genetic Operators: Crossover • Crossover: Exchanging substrings of two individuals to obtain offspring. • The major instrument of variation and innovation in GAs.
Genetic Operators: Mutation • Consists of flipping the bit at a randomly chosen point in the string or chromosome. • GAs are usually implemented with a low probability of mutation. • Mutation alone does not generally advance the search for a solution, but it does provide insurance against the development of a uniform population incapable of further evolution.
A Simple Genetic Algorithm • Start with a randomly generated population of n l−bit chromosomes (candidate solutions to a problem). • Calculate the fitness ƒ(x) of each chromosome x in the population. • Repeat until n offspring have been created: • According to fitness, select a pair of chromosomes. • Cross over the pair at a randomly chosen point to generate two offspring. • Mutate the two offspring with a certain probability. • Replace the current population with the new population. • Go to step 2.
GA Demonstration • Genetic Cars 2, by Rafael Matsunaga • Based on BoxCar2d. • Simple genetic algorithm to evolve random two-wheeled shapes into cars over generations. • Terrain gets more complex with distance. • http://rednuht.org/genetic_cars_2/
Conclusions • GAs are promising methods for solving difficult technological problems, and for machine learning. • GAs are part of a new movement in computer science that is exploring biologically inspired approaches to computation. • Genetic algorithms are also promising approaches for modeling the natural systems that inspired their design. • Evolutionary computation is still a “work in progress”.
Sources • J. H. Holland, “Genetic Algorithms”, in Scientific American, vol. 267, num. 1. Nature Publishing Group, 1992, pp. 66-72. • M. Mitchell, An Introduction to Genetic Algorithms, 5th printing. Cambridge, MA: MIT press 1999. • D. Whitley, “A Genetic Algorithm Tutorial”, in Statistics and Computing, vol. 4, num. 2. Springer, 1994, pp. 65-85. • S. Forrest, “Genetic Algorithms: Principles of Natural Selection Applied to Computation”. in Science, vol. 261, num. 5123. American Association for the Advancement of Science, 1993, pp. 872-878.