https://github.com/code-artist/sudokusolver_csp
C# Sudoku Solver using CSP
https://github.com/code-artist/sudokusolver_csp
Last synced: 10 months ago
JSON representation
C# Sudoku Solver using CSP
- Host: GitHub
- URL: https://github.com/code-artist/sudokusolver_csp
- Owner: Code-Artist
- License: mit
- Created: 2023-08-26T06:20:28.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-01T11:59:03.000Z (over 2 years ago)
- Last Synced: 2023-12-01T13:47:40.729Z (over 2 years ago)
- Language: C#
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SudokuSolver_CSP
## About CSP
A constraint search does not refer to any specific search algorithm but to a layer of complexity added to existing algorithms that limit the possible solution set. A Constraint Search Problem (CSP) is an Artificial Intelligence Algorithm defined by a set of variables and a set of constraints where each variable has a non empty domain of possible values. Each domain in variable is evaluated with defined constraints.
## CSP Sudoku Solver
C# Sudoku Solver is an example implementation using CSP search algorithm. The code is optimized to solve 9 x 9 sudoku in 1ms.

### Forward Checking
A define flag FORWARD_CHECKING in code is used to enable / disable forward checking to eliminate domains in variables which does not comply with defined constraints.
### Animation
To visualize search algorithm execution, subscribe to CellValueChanged event in MainForm constructor to show value change on each iteration. Disable this line to get maximum performance of the algorithm.
### Reference
[Constraint Satisfaction Problems (CSP) in Artificial Intelligence](https://www.geeksforgeeks.org/constraint-satisfaction-problems-csp-in-artificial-intelligence/)