6 – GA Crossover Quiz

Try to apply what you’ve learned so far to complete this iteration of the genetic algorithm. First, fill in the fitness value or the number of non attacking pairs of queens for each board state in the initial population. Then, choose parents according to their fitness score and fill them in this column. Order them … Read more

5 – GA Crossover

Okay, let me handle this one. Given a parent 32752411. Which corresponds to a board that looks like this. We’ve randomly selected the spot between the third and fourth column. To be the crossover point. For the first child, we’ll take the first part of the first parent. Which we’ll mark in blue. Looking at … Read more

4 – Genetic Algorithms

Another specific we need to know before doing our genetic algorithms’ example is that there are 28 possible pairs of attacking queens on this eight by eight board. >> How did you figure that out? >> Well, we have eight queens, and we want to examine every possible pair that could attack each other. So … Read more

1 – Representing n-Queens

We’re going to use the n-Queens problem again to talk about genetic algorithms, but before we do that, we need to create a convention to represent a given board. >> We’ll use the one in the book. Since there can only be one queen in each column, we can encode a board with the number … Read more