项目作者: paccionesawyer

项目描述 :
Sudoku Solver GUI based as a Constraint Satisfaction Problem
高级语言: Python
项目地址: git://github.com/paccionesawyer/sodokuSolver-CSP.git
创建时间: 2020-10-30T02:38:37Z
项目社区:https://github.com/paccionesawyer/sodokuSolver-CSP

开源协议:

下载


Automatic Sudoku Puzzle Solver

Sudoku Puzzle posed as a CSP (Constraint Satisfaction Problem). There are three options available to solve a puzzle, Backtracking, Forward Checking, and BackJumping. You can also check the Search Heuristic, Basic and Minimum Reamaining Value.

Authors

Demo

Demo

Run Locally

Clone the project

  1. git clone https://github.com/paccionesawyer/sodokuSolver-CSP.git

Go to the project directory

  1. cd sodokuSolver-CSP

Install dependencies

Run Terminal Based:

  1. python3 solver.py [--board board_file.txt]

Run GUI Sudoku:

  1. python3 sudoku.py [--board board_file.txt]

Examples:

  1. python3 solver.py --board easy_puzzle.txt
  2. python3 sudoku.py --board evil_puzzle.txt

If the —board flag is not provided the program is run with easy_puzzle

Notes: I can’t get conflict-directed back-jumping to work with find_empty_basic sorry

Acknowledgements

License

MIT

Appendix

SudokuBoard.py: The representation of the Sudoku by a 2D array of int, where 0 represents an empty cell

solver.py: Holds the various search algorithms for solving the sudoku CSP

sudoku.py: Program that runs the program UI

SudokuUI.py: The Graphical User Interface (GUI) representation of a Sudoku Board. It can be played simply or it can be solved with a combination of Algorithms and Search Heuristics. The Tkinter UI, responsible for drawing the board and accepting user input.

SudokuError.py: Throw exceptions when there is an error input

RadioBar.py: A collection of Radio Buttons all indicating various options for the same value

evil_puzzle.txt: Text file representation of the evil puzzle given in class

easy_puzzle.txt: Text file representation of the easy puzzle given in class

blank_puzzle.txt: Text file representation of an empty board with all blanks spaces