Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've done the code that generates all the solutions. But know I am suppose to filter out any redundant solutions based on symmetry and rotations. I have code for vertical symmetry, horizontal symmetry, rotation $90$, $180$ and $270$. The bit that remains is removing symmetry about the the diagonals. / and \ of the board. I guess I can rotate it $90^\circ$ instead of making code for both diagonals. I want to implement the diagonal "\". I drew up some points.
From bottom part to the upper part.
$(1, 3)$-> $(6, 8)

$(2, 1)$ -> $(8, 7)$

From top part to bottom part.
$(4, 6)$->$(3, 5)$
$(5, 6)$->$(3, 4)$

I'm not sure what formulas would do this for me. And what about chess pieces on the diagonal it self, they would just stay put I guess?

share|cite|improve this question
My code gives 23 "unique" answers without filtering for the diagonal ones. – Algific Sep 11 '11 at 12:43
I need it to work with a n*n board. – Algific Sep 11 '11 at 13:50
It would be better if this question describes the "eight queens problem" in more detail, or at least contains a link to a description of the problem elsewhere. At least one reason for this is that readers of this question want to know what you're asking about. – Quinn Culver Jun 20 '15 at 6:36
up vote 2 down vote accepted


share|cite|improve this answer
Now I just feel stupid haha. How would it be if the diagonal went the other way? "/"? – Algific Sep 11 '11 at 13:50
@Algific: for the diagonal "/" it is (a, b) -> (b, a). – Jiri Sep 11 '11 at 14:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.