Skip to content

Python implementation of a sudoku puzzle solver (CSP) using AC3 and backtracking algorithms

License

Notifications You must be signed in to change notification settings

stressGC/Python-AC3-Backtracking-CSP-Sudoku-Solver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sudoku Solver

Backtracking / AC-3 / MRV / Least Containing Value

I] Requirements

  • Git to download the source code

  • python3 to execute the code

  • pip3 to install dependencies

II] Installation

Clone the project to your local machine:

git clone https://github.com/stressGC/python-backtracking-CSP-sudoku-solver.git
cd python-backtracking-CSP-sudoku-solver

You will need to install the following modules :

pip3 install argparse itertool 

III] Execution

The following arguments are available:

  • --help to get some informations about the script
python solver.py --help
  • --string followed by a string representing one or more Sudokus. It will be parsed by the script. Accepted characters : [1,9], "#", "@", "X". A list of 20 sudokus can be found data/20sudokus.txt .
python solver.py --string <my_sudoku(s)_as_string>
  • --level followed by a level for the default sudoku. Accepted values : ["easy", "medium", "hard"], default : "medium".
python solver.py --level <level>

Note : --string and --level can't be specified at the same time as they are concurrent.

IV] Result

All the current computing steps will be printed in console for each one of the sudokus.

Screenshot of a result

About

Python implementation of a sudoku puzzle solver (CSP) using AC3 and backtracking algorithms

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages