kishorepv / Sudoku

Sudoku Solver - Batch puzzle solver and command line tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sudoku puzzle solver

demo.gif

Files

  • sudoku.py - Main script invoked by the user.

  • strategies.py - Strategies used to reduce the search space of the solution.

    The implemented strategies are:

    1. Single Possibility Rule
    2. Only Choice Rule
    3. Naked Twins Elimination Rule
    4. Sub-Group Exclusion Rule
    5. Hidden Twins Elimination Rule
    6. Naked Triplets Elimination Rule
    7. Generalized version of "Hidden Twins Elimination" rule to eliminate singlets/twins/.../nounplets
    8. Generalization of "Naked Twins Elimination" rule to eliminate singlets/twins/.../nounplets
  • utils.py - Helper functions for computation and visualization.

  • puzzles.txt - Sample input file for batch solving

  • solutions.txt - Sample output file after batch solving

Usage

Solve a puzzle from cmdline

  • $ python sudoku.py --puzzle 2.............62....1....7...6..8...3...9...7...6..4...4....8....52............42

Batch solve puzzles read from text file

  • $ python sudoku.py -f puzzles.txt

Minimal output (-m) without slowmotion puzzle solving

  • $ python sudoku.py -m --puzzle 2.............62....1....7...6..8...3...9...7...6..4...4....8....52............42

Help

  • $ python sudoku.py --help

About

Sudoku Solver - Batch puzzle solver and command line tool


Languages

Language:Python 100.0%