## 8 – GA Mutation

But there is one problem, what if there’s a critical part of the solution that is none of the parents? >> That could be an issue. Could also imagine that a critical piece might be in a board that never gets selected as a parent. Like poor number 4 here, and that critical piece gets … Read more

## 7 – GA Crossover Quiz Solution

Here’s the answer. Note that the children are worse than some of the parents. In progressive generations, we might continue to see this. But with mutation step, we might get closer to the goal. Without the mutation step, we run the risk of never actually reaching the goal.

## 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

## 2 – 8-Queens Representation

Here’s another example board for 8-Queens. Give us a string that represents the position of each piece on this board.

## 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