Packages

p

root package

package root

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. All

Value Members

  1. object Main

    Command-line driver of NQueens problem.

  2. object NQueens

    Problem: Place N queens on a board so no queen threatens another.

    Problem: Place N queens on a board so no queen threatens another.

    _|_|_|_|_|Q|_|_
    _|_|_|Q|_|_|_|_
    _|_|_|_|_|_|Q|_
    Q|_|_|_|_|_|_|_
    _|_|_|_|_|_|_|Q
    _|Q|_|_|_|_|_|_
    _|_|_|_|Q|_|_|_
    _|_|Q|_|_|_|_|_
    

    The queens can't occupy the same row, column or diagonal.

    Example:

    NQueens.solve(8)

    A brute-force heuristic is used to search the possibilities. Complexity severely limits the capability to solve bases larger than 13.

Ungrouped