[AIM] Evolutionary Algorithms
Day 4
Outline
- Evolutionary Algorithms
- Genetic Algorithms
- Basic Components of Generic GAs
- Representation
- Initialisation
- Fitness evaluation
- Mate Selection
- Crossover
- Mutation
- Replacement
- Termination criteria
Evolutionary Algorithms
- GA simulated natural evolution of individual structures at the genetic level using the idea of survival of the fittest via processes of selection, mutation, and reproduction(recombination)
- An individual(chromosome) represents a candidate solution for the problem at hand
- A collection of individuals currently “alive”, called population is evolved from one generation to another depending on the fitness of individuals in a given environment
- Last generation will contain the final solution
EAs –Features
- Avoid converging to local optima
- Use exploration of the search space and exploitation of promising areas
- Reproduction focuses attention on high fitness individuals, thus exploiting (exploitation) the available fitness information
- Recombination and mutation perturb those individuals, providing general heuristics for exploration. Through recombination operators, reach better solutions by combining already found good solutions
- Be independent of initial starting points
- Conduct search in parallel over the search space
- May be used together with other approaches
Genetic Algorithms
Generic Genetic Algorithm
Basic Components of GAs
- A genetic representation (encoding) for candidate solutions to the problem at hand
- An initialisation scheme to generate the first population of candidate solutions
- A fitness function that plays the role of the environment, rating the solutions in terms of their fitness
- A scheme for selecting mates (parents) for recombination
- Crossover(recombination)
- Mutation
- Replacement strategy to select the surviving individuals for the next generation
- Termination criteria
Representation
- Each individual contains one chromosome
- Each individual is evaluated and has an associated fitness value
- Chromosomes contain a fixed number of genes: chromosome length
- Traditionally binary encoding is used for each gene: Allele value {0.1}
- A population contains a fixed number of individuals: population size
- Each iteration is referred as generation
Initialisation
Random initialisation: population size number of individuals are created randomly.Fitness calculation
Fitness value indicates how fit the individual is to survive and reproduce under the current conditions and how much the current solution meets the requirements of the objective functionGeneric GA - reproduction
Reproduction consists of- selecting individuals: a fitness proportionate selection method used => roulette wheel selection, tournament selection, rank selection, etc.
- copying selected individuals into a mating pool (each individual may be selected more than once)
- pairing individuals in pool for mating: mating pool consists of population size number of elements
Tournament Selection
This method involves running a number of “tournaments” among randomly chosen individuals (of tour size) selecting the one with best fitness at the endRoulette wheel selection
There is a wheel, and the better the individual is, the bigger probability it will be chosen.While candidate solutions with a higher fitness will be less likely to be eliminated, there is still a chance that they may be.
From the graph above, there is a formula for max or min problem.
For example, for a population like this, we can calculate the probability of each individual.
Then, we form a mating pool.. 4 random numbers will be thrown in (0, 1] to select 4 mates. If the random number is between 0 - 0.32, it will chose the second one (because its probability is 0.32)
Recombination/Crossover
- Selected pairs/mates(parents) are recombined to form new individuals (children/offspring) - exchange of genetic material
- crossover is applied with a crossover probability which in general is chosen close to 1.0
One point crossover
Generate a random number in [0, 1), if it is smaller than a crossover probability then- select a random crossover site in [1, chromosome length]
- split individuals at the selected site
- exchange segments between pairs to form two new individuals
There are also other form of crossover:
Mutation
- Loop through all the alleles of all the individuals one by one, and if that allele is selected for mutation with a given probability pm, you can either change it by a small amount or replace it with a new value
- Mutation provides diversity and allows GA to investigate different regions of the search space(escaping)
- Mutation rate is typically chosen to be very small. Choosing pm as 1/chromosome length implies on average a single gene will be mutated for an individual
Replacement Strategy
- There are variety of strategies for replacing the old population by the new offspring population to form the next generation
- (Trans-)Generational GA: N individuals produce aN offspring. So we need to choose N from (N+ aN). e.g.aN replace worst aN of N, sort (N+ aN) and choose N best(elitism)
- Steady-state GA: Two offspring replace two individuals from the old generation. e.g. two offspring replace parents, or worst two of the population(elitism), or best two of parents and offspring replace parents or worst two of the population
Termination criteria
possible termination criteria:- A predefined maximum number of generations is exceeded
- A goal is reached, for example
- Expected fitness is achieved
- Population converges
- Best fitness does not change for a while
- A condition is satisfied depending on a combination of above
Gene convergence: a location on a chromosome is converged when 95% of the individuals have the same gene value for that location
Population convergence: a population is converged when all the genes have converged
Phenotypic convergence: average fitness of the population approaches to the best individual in the population
评论
发表评论