Search code examples
algorithmpuzzlechess

Algorithm to solve the N Queens Domination puzzle


I have solved the more generic N Queens problem, but now I am looking for an algorithm to solve the N Queens Domination problem.

"Given an n×n board, find the domination number, which is the minimum number of queens (or other pieces) needed to attack or occupy every square. For the 8×8 board, the queen's domination number is 5." - Wikipedia

I have searched extensively and cannot find anything but scholarly papers on this problem, nothing remotely understandable.

My first thoughts are to just place a Queen down and then place the next Queen in the place that can attack the most other squares, and so on. However, while this may generate a solution, I cannot figure out a way to guarantee that that solution is the minimal solution.

Any help would be appreciated, thanks.


Solution

  • Using your algorithm, you can generate all possible combinations and take minimum from it. Hints: Use recursion for this and don't process similar conditions (or cache it) like symmetric placement, the same order and so on.