Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yingjia-z/sudoku-solver
A three-method Sudoku solver using Constraint Satisfaction Problem (CSP) algorithms.
https://github.com/yingjia-z/sudoku-solver
csp jupyter-notebook rl
Last synced: 3 days ago
JSON representation
A three-method Sudoku solver using Constraint Satisfaction Problem (CSP) algorithms.
- Host: GitHub
- URL: https://github.com/yingjia-z/sudoku-solver
- Owner: Yingjia-Z
- Created: 2024-05-12T04:36:42.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-05-12T05:13:11.000Z (6 months ago)
- Last Synced: 2024-05-12T06:22:48.402Z (6 months ago)
- Topics: csp, jupyter-notebook, rl
- Language: Jupyter Notebook
- Homepage:
- Size: 615 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Sudoku Solver
This project uses 3 distinct CSP-based methods to solve Sudoku puzzles efficiently. Each approach incorporates different strategies and heuristics to speed up solving times.
### Overview
In the [`solver`](sudoku.ipynb) Jupyter notebook:#### Part A: CSP Formalization
- **Formal Description**: Provides a formal CSP description of Sudoku, detailing variables, their domains, and the constraints among them.#### Part B: Solver Implementations
- **Version A**: Standard backtracking search (no forward checking, random variable order, random value order).
- **Version B**: Standard backtracking search + forward checking (random variable order, random value order).
- **Version C**: Standard backtracking search + forward checking + three heuristics to order variables and values, using random selection to break ties.
- Three heuristics:
- Most Constrained Variable
- Most Constraining Variable
- Least-Constraining Value#### Part C: Performance Evaluation
- **Testing**: Runs each version on test puzzles of varying difficulty levels (easy, medium, difficult, and evil) to compare performance.
- **Metrics Reported**:
- **Time Performance**: Reports average time and standard deviation to complete each puzzle over 50 trials.
- **Efficiency**: Details the average number of nodes expanded and the standard deviation for each puzzle. Nodes are considered expanded when they are removed from the queue and their children are added.#### Notes
- **Run Feasibility**: For Versions A and B, consider reducing the number of trials from 50 to a more feasible number due to time constraints.
- **High Efficiency**: Version C solves puzzles of all difficulty levels in under 0.136 seconds.