Skip to main content

A python library for solving sudoku puzzles using artificial neural networks

Project description

ai-Sudoku-Solver

Solving Sudoku Puzzles using Artificial Neural Networks

Downloads Downloads Downloads


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

  1. 1 million Sudoku games
  2. 9 Million Sudoku Puzzles and Solutions

Project details


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 details)

Uploaded Source

Built Distribution

ai_Sudoku_Solver-1.0.7-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file ai-Sudoku-Solver-1.0.7.tar.gz.

File metadata

  • Download URL: ai-Sudoku-Solver-1.0.7.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.4 tqdm/4.59.0 importlib-metadata/4.10.0 keyring/22.3.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.8

File hashes

Hashes for ai-Sudoku-Solver-1.0.7.tar.gz
Algorithm Hash digest
SHA256 59905f63d087a4538de84a9c839bea585c93025cd9bd6c595fd5cef6a0487ec4
MD5 c1c2c029768f8ba830681371d0e2ed10
BLAKE2b-256 ee79e97d8a660f35fa217022730d1ea38f479a15ab821d4c08f6c02116b9f978

See more details on using hashes here.

File details

Details for the file ai_Sudoku_Solver-1.0.7-py3-none-any.whl.

File metadata

  • Download URL: ai_Sudoku_Solver-1.0.7-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.4 tqdm/4.59.0 importlib-metadata/4.10.0 keyring/22.3.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.8

File hashes

Hashes for ai_Sudoku_Solver-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 120c43d097bce58d66544e2d3c50f9ab8fcdd16bb7c2a803e7007c51d3aa7188
MD5 9507e6c21be380d126a8f87e6db8b5be
BLAKE2b-256 408696557b7007559ba4596be731a270aab96e7db2183b7effa9925f82a315d5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page