AI Programming Lecture 9 Genetic Algorithms - PowerPoint PPT Presentation

1 / 20
About This Presentation
Title:

AI Programming Lecture 9 Genetic Algorithms

Description:

Select representation (genotype). Select fitness function (phenotype). Initialise population. ... Genotype performance in environment. E.g: Eye colour, height, ... – PowerPoint PPT presentation

Number of Views:138
Avg rating:3.0/5.0
Slides: 21
Provided by: richar487
Category:

less

Transcript and Presenter's Notes

Title: AI Programming Lecture 9 Genetic Algorithms


1
AI ProgrammingLecture 9Genetic Algorithms
  • Richard Price Simon Worgan
  • School Of Computer Science University Of
    Birmingham
  • msc59rmp, msc74sxw_at_cs.bham.ac.uk

2
Last Week
  • NLP
  • Compositionality.
  • Blocksworld.
  • Semantics.
  • Context.
  • Intentionality.

3
Introduction
  • Nature inspired.
  • Travelling Salesman Problem.
  • Genotype.
  • Phenotype.
  • Selection.
  • Operators.
  • Replacement.
  • Considerations.

4
Nature Inspired
  • Darwins Theory
  • Reproduce offspring.
  • Offspring arent identical.
  • Selection Pressure.
  • Chromosome
  • 0 1 0 1 0 1 1. (an individual).
  • Gene
  • A single bit.

5
Example Problem
  • Travelling Salesman Problem (TSP).
  • Given
  • A number of cities spread across a landscape.
  • Find the shortest complete tour of all cities.

3
5
6
4
2
7
8
1
9
6
Algorithm
  • Select representation (genotype).
  • Select fitness function (phenotype).
  • Initialise population.
  • Select parents.
  • Generate offspring.
  • Form next generation.
  • Until stopping criteria go to 1.

7
Genotype
  • Genotype defines representation.
  • E.g
  • Bits String. 0 1 1 1 0.
  • Real values. 0.5 1.3 26 4.
  • TSP representation.
  • Order of cities in tour.

2
3
2
3
1 2 3 4
1 3 4 2
1
4
1
4
8
Phenotype
  • Phenotype is observed behaviour or fitness.
  • Genotype performance in environment.
  • E.g
  • Eye colour, height, etc.
  • Function values.
  • TSP
  • Total distance travelled in tour.
  • Minimisation problem.

2
4
2
4
1
3
1
3
9
Selection Methods
  • Select individuals according to their fitness.
  • Tournament Selection.
  • Given a subset of individuals.
  • Order these individuals dependent on fitness.
  • Select individuals dependent on position in
    tournament.
  • Either deterministically or stochastically.

10
Selection Methods
  • Roulette Wheel Selection
  • Individuals are given a proportion of the wheel.
  • Size of proportion is dependent upon fitness.
  • Larger proportions are more likely to be
    selected.

11
Generating Successors
  • Improve from one generation to the next.
  • Generate offspring from the selected
  • How?
  • Needs to be legal.
  • Needs to be useful.

12
Mutation
  • Legal
  • Visit all cities only once.
  • Insertion mutation
  • Swap mutation

13
Mutation - Algorithm
  • Insert mutation
  • 1) Copy one of the survivors
  • 2) Select a random city from the chromosome (item
    from list)
  • 3) Insert in new location
  • Swap mutation
  • 1) Copy one of the survivors
  • 2) Remove a sub-list
  • 3) Reverse sub-list
  • - rev(sub-list)
  • 4) Re-insert list

14
Crossover
  • Legal tours

15
Crossover - Algorithm
  • 1) Select two of the winners
  • 2) Take a subset of cities
  • 3) Insert these into a new list, maintaining the
    ordering and location from the first parent
  • 4) Take the missing cities from the second parent
  • 5) Insert into the gaps in the list, maintaining
    the ordering.
  • 6) Make the first parent the second and
    visa-versa
  • 7) Repeat once

16
Useful Pop-11 features
  • Mutation maplist(list1, p) -gt list2
  • maplist(winners, mutate) -gt list2
  • Selection syssort(population, fitter) -gt
    ranking
  • fitter(E1, E2)
  • Selection Mutation random0(population or
    range)
  • Iteration fast_for .... end fast_for
  • Warning, no type checking.
  • Have a look at 'Help Fastprocs' and 'Help
    Efficency' for more advice.

17
Replacement
  • Options
  • Strong replacement
  • Weak replacement
  • Spatial replacement
  • Generational replacement

18
Problems / Considerations
  • Phenotype redundancy
  • Plateaus in the search space
  • Hamming Cliffs
  • Erratic fitness landscape
  • Unreachable solutions
  • Illegal barriers

19
Extensions
  • Species.
  • Male / Female.
  • Co-evolution
  • Predators and Prey
  • Baldwin evolution / Local optimisation
  • REMEMBER
  • Biological analogy Vs. Computational reality

20
Conclusions
  • Representation defines the fitness landscape.
  • Production of offspring defines the search.
  • There are a huge number of different approaches.
Write a Comment
User Comments (0)
About PowerShow.com