0

I am trying to write a code to generate unique solutions for N-Queens. I am able to generate correct solution for N = 4 and 6 (but not for other cases of N) and have eliminated the cases of generation of non-distinct solutions due to rotation by 180 and 90 degrees. The problem lies in my understanding of how to eliminate other redundant cases.

For example, for N = 5, I should get 2 unique solutions but I am generating 3. The 2 redundant solutions, out of which one is to be eliminated are (the 3rd solution is correct):

Q---- Q----

--Q-- ---Q-

----Q -Q---

-Q--- ----Q

---Q- --Q--

user1641700
  • 53
  • 3
  • 9

0 Answers0