N-Queens Help
Solvers
- Backtracking
- Try placing queens systematically top to bottom and left to right.
- Randomized Backtracking
- Try placing queens systematically top to bottom, but choose order of
columns to try in each row randomly.
- Random Restarts
- Perform randomized backtracking repeatedly until a solution is
found or the user clicks halt.
- Local Search
- Place a queen in a random column in each row. At each step, move a queen
to a different column in its row until no queens attack. Prefer moves
that reduce the number of attacks between queens.
Controls
- Halt
- Immediately halts execution of a solver.
- Clear
- Remove all queens, including fixed queens, from the board. Note that when a solver
is started, it begins by removing all non-fixed queens from the board.
- N - Resize
- N is the size of the chess board. After changing N, click Resize to redraw the board.
- Cutoff
- The maximum number of backtracks to perform or local search moves to make.
- Fixed
- The number of queens that have been pre-fixed into place before search begins.
The user can place or remove a queen by clicking on the board. The color of
fixed queens is inverted.
- Place Fixed
-
The user can increase the value of Fixed to a larger number than the number
of fixed queens visible on the board. Clicking on Place Fixed tells the
system to try to randomly fix additional queens in place up to the specified
number. Any previously fixed queens are not changed. This operation can
fail if it is difficult or impossible to find non-attacking positions
for the fixed queens.
- Steps/Backtracks, Restarts
- Displays value of these variables during search.
- Color-code attacks
- If checked, then during local search the color of a queen indicates
the number of other queens that attack it.
- Message Box
- Displays information about the progress of the solvers.
Return to Demo