dedoku¶
A pure-Python Sudoku solving library that relies exclusively on human-style logical deduction — 20 named technique families, from naked singles to alternating inference chains, and not a single guess.
pip install dedoku
import dedoku
result = dedoku.solve("530070000600195000098000060800060003400803001"
"700020006060000280000419005000080079")
print(result.solved) # True
print(result.grid) # pretty-printed solved board
for step in result.steps:
print(f"[{step.technique}] {step.description}")
Logic first. Guessing only if you ask for it. By default the solver
never backtracks: if the logical techniques cannot finish a puzzle, it
stops and says so; explicit hybrid and backtracking modes exist for
when you just need the answer. Every deduction the library makes has been
machine-verified against an independent brute-force oracle (1.0.0 release
run: 100,000 puzzles, zero unsound steps).
Contents
- Usage
- Command line
- Techniques
- Naked candidates
- Hidden candidates
- Intersection removal
- Fish (X-Wing, Swordfish, finned variants)
- Chute remote pairs
- Simple colouring
- W-Wing
- Wings (Y-Wing, XYZ-Wing)
- Uniqueness rectangles
- Bivalue universal grave
- Single-digit and bivalue chains
- 3D Medusa
- Almost locked sets
- Alternating inference chains
- Benchmark
- API reference
- Changelog