A Genetic Algorithm Approach to the Prisoners - PowerPoint PPT Presentation

1 / 24
About This Presentation
Title:

A Genetic Algorithm Approach to the Prisoners

Description:

A Genetic Algorithm Approach to the Prisoners & Guards Puzzle ... For even n, goose pattern yields. A Better 6x6. P. G. P. P. G. P. P. G. G. P. G. P. P. G. P. P. G. P ... – PowerPoint PPT presentation

Number of Views:50
Avg rating:3.0/5.0
Slides: 25
Provided by: timh168
Category:

less

Transcript and Presenter's Notes

Title: A Genetic Algorithm Approach to the Prisoners


1
A Genetic Algorithm Approach to the Prisoners
Guards Puzzle
  • CPSC 5185 Intro to Artificial Intelligence
  • April 6, 2004

2
Description of Prisoners Guards Puzzle
3
Adjacent Squares
4
Sample 3x3 Board
  • 5 prisoners can we do better?

5
A Better 3x3 Board
  • 6 prisoners this is the maximum

6
Some 4x4 Boards
7
An Optimal 4x4 Board
8
Finding Maximum No. Prisoners
  • Characterize p(n), the max. no. prisoners on a
    valid n? n board.

9
Larger Values of n
  • Brute force doesnt work
  • Trying an evolutionary approach

10
Genetic Algorithm Overview
  • Each generation has 500 chromosomes
  • Spawn offspring through crossover and mutation
    operations
  • 100 most fit in a generation retained in next
    generation

11
GA Overview, continued
  • Parents selected randomly, selection
    probabilities are proportional to fitness vals
  • Two parents always produce two offspring
  • Cataclysm prevents stagnation

12
Converting Boards to Chromosomes
  • Treat each board configuration as a chromosome
    (ignore placement rule)

13
The Crossover Operation
  • Crossover probability 0.7.

Parents
Children
14
Mutation
  • Mutation probability 0.001 for each board square
  • Toggle value if mutation occurs

15
Survival of the fittest
  • Fitness function 1
    fitness total number of prisoners
  • Fitness function 2
    fitness (no. pris.) x (validity)
    validity ( valid sqrs) / (total sqrs)

16
Fitness Comp. Example
F1 6
F2 6 ( 5 / 9 ) 30 / 9
17
Outline of the Algorithm
  • See handout sheet

18
Comparing Performances Using Two Fitness Functions
  • See Excel printout

19
My Best 5x5 Example
20
A 6x6 Example
21
Lower Bounds for p(n)
  • For odd n, striping pattern yields
  • For even n, goose pattern yields

22
A Better 6x6
23
Striping Not Best for 9x9
24
Questions
  • Is there a better lower bound for p(n)?
  • What is a good upper bound for p(n)?
Write a Comment
User Comments (0)
About PowerShow.com