Genetic Algorithm: N-Queens
Objective
Place n queens on an n sized board such that no queen intersects
with another.
Procedure
- 1. Create a population of random board states.
- 2. Pick survivors from the population.
- 3. Crossover survivors' genes to make child states.
- 4. Children have a random chance for mutation.
- 5. Generate a new population from those child states.
Repeat steps 2 - 5 until one of child states is a goal state.
Description
This GA in particular uses the Adam & Eve approach for the survival function.
It picks the best two board states from the current population.
From there, those two board states will crossover and make exactly the same amount of children as the previous generation.
Finally, there is a fifty percent chance of gene mutation per child.
If a mutation occurs, two genes are chosen at random and swap places.
Analysis
Tbd...