# Puzzle 5: Keep Those Queens Apart | Summary and Q&A

15.3K views
May 10, 2018
by
MIT OpenCourseWare
Puzzle 5: Keep Those Queens Apart

## TL;DR

The eight queens problem involves placing eight queens on an 8x8 chessboard in such a way that no queen can attack any other queen. This problem can be solved using an exhaustive enumeration algorithm and a matrix data structure.

## Install to Summarize YouTube Videos and Get Transcripts

### Q: What is the eight queens problem?

The eight queens problem involves placing eight queens on a chessboard in a way that no queen can attack another queen.

### Q: What programming paradigm is used to solve the eight queens problem?

The programming paradigm used is exhaustive enumeration, where all possible combinations are explored to determine if there is a solution.

### Q: How can the size of the board be varied?

The size of the board can be varied by changing the number of rows and columns, allowing for different variations of the problem.

### Q: Can the eight queens problem be solved using a different data structure?

Yes, while a matrix data structure is commonly used, other data structures can be employed to solve the problem more efficiently.

### Q: How many solutions are there to the eight queens problem?

There are multiple solutions to the eight queens problem, and the exact number depends on factors such as symmetries and rotations that are considered.

## Summary & Key Takeaways

• The eight queens problem requires placing eight queens on a chessboard in such a way that they can't attack each other.

• The problem can be solved using an exhaustive enumeration algorithm that looks at all possible combinations.

• The solution involves using a matrix data structure to represent the chessboard and checking for conflicts using three rules: no two queens in the same column, row, or diagonal.