Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I've done combinatorial enumeration but not N queens specifically. Here's what I'd try (but again, as Morawski points out, lower your expectations).</p> <ol> <li><p>Replace <code>availableCols</code> with an array listing the remaining columns. Store the diagonals as bit arrays. If there are too many to fit into one word, it's probably worth it to handle separately the diagonals containing only the first few rows (i.e., the ones that are relevant only near the top of the tree). Ideally testing a new queen would take only a couple of instructions. It helps if N is known to an aggressively optimizing compiler.</p></li> <li><p>Use the available <a href="http://en.wikipedia.org/wiki/Dihedral_group" rel="nofollow">dihedral symmetry</a> to enumerate only the lexicographically least solution in each orbit. Recover the overall count via the <a href="http://www.wikipedia.org/wiki/Burnside%27s_lemma" rel="nofollow">lemma that's not Burnside's</a>. Symmetry breaking is expensive enough that there's an art to when to do it, but there's some low hanging fruit (e.g., don't place the queen in the first row in the upper columns). Placing by rows may not be the optimal strategy.</p></li> <li><p>Test <a href="http://www.constraint-programming.com/people/regin/papers/gcc.ps" rel="nofollow">generalized arc consistency</a> at interior nodes of the search tree. This is probably much too involved for homework, but I'm sure something like this is used in the really efficient computations behind the OEIS sequence.</p></li> </ol>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload