Docsity

Genetic Algorithms-Computational Physics-Lecture Slides, Slides of Computational Physics

Partial preview of the text

Download Genetic Algorithms-Computational Physics-Lecture Slides and more Slides Computational Physics in PDF only on Docsity!

Evolutionary Computation: Genetic algorithms

Introduction, or can evolution be intelligent?Simulation of natural evolutionGenetic algorithmsCase study: maintenance scheduling with genetic algorithmsSummary

Can evolution be intelligent?

 Intelligence can be defined as the capability of a system to adapt its behavior to ever-changing environment. According to Alan Turing, the form or appearance of a system is irrelevant to its intelligence.  Evolutionary computation simulates evolution on a computer. The result of such a simulation is a series of optimization algorithms, usually based on a simple set of rules. Optimization iteratively improves the quality of solutions until an optimal, or at least feasible, solution is found.

Simulation of natural evolution

 On 1 July 1858, Charles Darwin presented his

theory of evolution before the Linnean Society of

London. This day marks the beginning of a

revolution in biology.

 Darwin’s classical theory of evolution , together

with Weismann’s theory of natural selection and

Mendel’s concept of genetics , now represent the

neo-Darwinian paradigm.

 Neo-Darwinism is based on processes of

reproduction, mutation, competition and selection.

The power to reproduce appears to be an essential

property of life. The power to mutate is also

guaranteed in any living organism that reproduces

itself in a continuously changing environment.

Processes of competition and selection normally

take place in the natural world, where expanding

populations of different species are limited by a

finite space.

 Let us consider a population of rabbits. Some rabbits are faster than others, and we may say that these rabbits possess superior fitness, because they have a greater chance of avoiding foxes, surviving and then breeding.

 If two parents have superior fitness, there is a good chance that a combination of their genes will produce an offspring with even higher fitness. Over time the entire population of rabbits becomes faster to meet their environmental challenges in the face of foxes.

How is a population with increasing fitness generated?

Simulation of natural evolution

 All methods of evolutionary computation simulate natural evolution by creating a population of individuals, evaluating their fitness, generating a new population through genetic operations, and repeating this process a number of times.

 We will start with Genetic Algorithms (GAs) as most of the other evolutionary algorithms can be viewed as variations of genetic algorithms.

Genetic Algorithms

 In the early 1970s, John Holland introduced the concept of genetic algorithms.

 His aim was to make computers do what nature does. Holland was concerned with algorithms that manipulate strings of binary digits.

 Each artificial “chromosomes” consists of a number of “genes”, and each gene is represented by 0 or 1:

Phenotype space Genotype space = {0,1}L Encoding (representation)

Decoding (inverse representation)

011101001

010001001

10010010

10010001

Representation

Basic genetic algorithms

Step 1: Represent the problem variable domain as

a chromosome of a fixed length, choose the size

of a chromosome population N , the crossover

probability pc and the mutation probability pm.

Step 2: Define a fitness function to measure the

performance, or fitness, of an individual

chromosome in the problem domain. The fitness

function establishes the basis for selecting

chromosomes that will be mated during

reproduction.

Step 3: Randomly generate an initial population of chromosomes of size N : x 1 , x 2 ,... , xN

Step 4: Calculate the fitness of each individual chromosome: f ( x 1 ), f ( x 2 ),... , f ( xN )

Step 5: Select a pair of chromosomes for mating from the current population. Parent chromosomes are selected with a probability related to their fitness.

Genetic algorithms

 GA represents an iterative process. Each iteration is called a generation. A typical number of generations for a simple GA can range from 50 to over 500. The entire set of generations is called a run.

 A common practice is to terminate a GA after a specified number of generations and then examine the best chromosomes in the population. If no satisfactory solution is found, the GA is restarted.

 Because GAs use a stochastic search method, the fitness of a population may remain stable for a number of generations before a superior chromosome appears.

Genetic algorithms: case study

A simple example will help us to understand how a GA works. Let us find the maximum value of the function (15 x

  • x^2 ) where parameter x varies between 0 and 15. For simplicity, we may assume that x takes only integer values. Thus, chromosomes can be built with only four genes:

Integer Binary code Integer Binary code Integer Binary code 1 11 2 7 12 3 8 13 4 9 14 5 10 15

(^6) 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1

0 1 1 0 0 1 1 1 1 0 0 0 1 0 0 1 1 0 1 0

0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1

The fitness function and chromosome locations

Chromosome label

Chromosome string

Decoded integer

Chromosome fitness

Fitness ratio, % X1 1 1 0 0 12 36 16. X2 0 1 0 0 4 44 20. X3 0 0 0 1 1 14 6. X4 1 1 1 0 14 14 6. X5 0 1 1 1 7 56 25. X6 1 0 0 1 9 54 24.

x

50 40 30 20

60

10 (^00 5 10 )

f ( x )

( a ) Chromosome initial locations.

x

50 40 30 20

60

10 (^00 5 10 ) ( b ) Chromosome final locations.

 In natural selection, only the fittest species can survive, breed, and thereby pass their genes on to the next generation. GAs use a similar approach, but unlike nature, the size of the chromosome population remains unchanged from one generation to the next.

 The last column in Table shows the ratio of the individual chromosome’s fitness to the population’s total fitness. This ratio determines the chromosome’s chance of being selected for mating. The chromosome’s average fitness improves from one generation to the next.