Skip to content

yojoots/sudoku

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Friendly Neighborhood Sudoku Bot

About

Very simple and minimal 9x9 sudoku solver, designed to work with Web Sudoku puzzles and written mostly as an exercise.

The solver employs an ad hoc algorithm which iteratively:

  1. Fills in all trivially-deducible digits in every row, column, and "quadrant" (square).
  2. Ranks the remaining cells by ascending number of possible digits they could contain (topmost and leftmost taking priority when necessary).
  3. Recursively fills these cells with (ascending-digit) guesses until a valid solution is found.

This is basically what I found my internal thought-process/algorithm to be doing as I tried to solve sudokus by hand.

While this is considerably more efficient than a naive brute-force backtracking algorithm, it is not as elegant or efficient as a properly-implemented Dancing Links / Algorithm X approach would be.[1] [2]

Usage

python3 sudoku.py

About

Simple 9x9 sudoku bot

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages