/N-Queens

Solves the N-queens problem using symbolic constraints and backtracking search in a Jupyter notebook

Primary LanguageJupyter NotebookOtherNOASSERTION

N-Queens

Constraint Satisfaction

Constraint Satisfaction is a technique for solving problems by expressing limits on the values of each variable in the solution with mathematical constraints. In this exercise, I used a symbolic math library to explicitly construct binary constraints and then use Backtracking to solve the N-queens problem (which is a generalization 8-queens problem). Using symbolic constraints should make it easier to visualize and reason about the constraints (especially for debugging), but comes with a performance penalty. To launch the notebook, run the following command from a terminal with anaconda3 installed and on the application path:

Getting Started

jupyter notebook AIND-Constraint_Satisfaction.ipynb

Requirements

  • Python 2.7 and above