Skip to content

Latest commit

 

History

History
21 lines (19 loc) · 1.13 KB

README.md

File metadata and controls

21 lines (19 loc) · 1.13 KB

goqueens

Find solutions to n-Queens Constraint Satisfaction Problems via AC-3 and Backtracking search.

MVC pattern implemented in Golang:

  • main.go
    • Controller connecting the web (View) package with the game (Model) package
  • web package
  • game package
    • Model consists of a Constraint Satisfaction Problem (CSP) with a slice of n queens and a map of constraints
      • Each queen tracks its column, row, and valid domain assignments. It also stores a boolean, moveable, indicating whether the user has restricted its location.
    • A Backtracking search is used to find solutions to the CSP
      • The queen with the most constrained domain is selected for assignment by an MRV heuristic.
      • AC-3 is used to maintain consistency and generate inferences.
      • Solutions are returned to the controller as JSON for display.

To Run:

  1. Download Go
  2. cd into goqueens project directory
  3. Execute go run main.go
  4. Browse to localhost:3000