You mean like this board? >> Hold on, I have to think about this one for a second. Okay, I see that there’s only one current attack on this diagonal. So when I move one of these queens I should be done. >> Sure, why not try it out? >> Okay, well let’s work with … Read more
Let’s be a little more formal about the n-Queens problems. Given a current board we want to make the one move that can most greatly improve the situation. In fact to simplify the discussion let’s constrain ourselves to moving a single queen up or down within its column. Then we keep iterating until we reach … Read more
Here is one possible solution. [BLANK_AUDIO]
Can we solve the 5-queens problem? Check the boxes for spaces that will contain a queen such that no two are attacking each other. There are multiple solutions here, so just put down one.
Can we get an another example of an iterative improvement problem? >> Sure, here’s one we’ll use throughout this lesson. It’s called N Queens. Basically, the puzzles the place N queens, so they cannot attack each other. On an n by n chessboard. >> In other words, no queen can be on the same horizontal … Read more
You’ve heard me say, do the stupid thing first and only add intelligence when necessary. It turns out that there are a whole class of problems where just adding a little bit of intelligence and iteratively improving the solution gets you very close to an optimal solution. >> Like what? >> One of the classic … Read more