A python library for solving sudoku puzzles using artificial neural networks
Project description
ai-Sudoku-Solver
Solving Sudoku Puzzles using Artificial Neural Networks
Table of Contents
Installation
pip install ai-sudoku-solver
Usage
Instantiate a SudokuSolver object
from ai_sudoku_solver import SudokuSolver
solver = SudokuSolver("Ritvik19/sudoku-net-v1")
Call the model on your puzzles
puzzle = np.array([[
[0, 0, 4, 3, 0, 0, 2, 0, 9],
[0, 0, 5, 0, 0, 9, 0, 0, 1],
[0, 7, 0, 0, 6, 0, 0, 4, 3],
[0, 0, 6, 0, 0, 2, 0, 8, 7],
[1, 9, 0, 0, 0, 7, 4, 0, 0],
[0, 5, 0, 0, 8, 3, 0, 0, 0],
[6, 0, 0, 0, 0, 0, 1, 0, 5],
[0, 0, 3, 5, 0, 8, 6, 9, 0],
[0, 4, 2, 9, 1, 0, 3, 0, 0]
]])
solution = solver(puzzle)
# array([[
# [8, 6, 4, 3, 7, 1, 2, 5, 9],
# [3, 2, 5, 8, 4, 9, 7, 6, 1],
# [9, 7, 1, 2, 6, 5, 8, 4, 3],
# [4, 3, 6, 1, 9, 2, 5, 8, 7],
# [1, 9, 8, 6, 5, 7, 4, 3, 2],
# [2, 5, 7, 4, 8, 3, 9, 1, 6],
# [6, 8, 9, 7, 3, 4, 1, 2, 5],
# [7, 1, 3, 5, 2, 8, 6, 9, 4],
# [5, 4, 2, 9, 1, 6, 3, 7, 8]
# ]])
Model Gallery
model | # parameters | trained on | accuracy |
---|---|---|---|
sudoku-net-v1 | 3,784,729 | 1M puzzles | 98.138 |
sudoku-net-v2 | 3,784,729 | 10M puzzles | 98.212 |
References
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ai-Sudoku-Solver-1.0.7.tar.gz
(3.8 kB
view hashes)
Built Distribution
Close
Hashes for ai_Sudoku_Solver-1.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 120c43d097bce58d66544e2d3c50f9ab8fcdd16bb7c2a803e7007c51d3aa7188 |
|
MD5 | 9507e6c21be380d126a8f87e6db8b5be |
|
BLAKE2b-256 | 408696557b7007559ba4596be731a270aab96e7db2183b7effa9925f82a315d5 |