An open API service indexing awesome lists of open source software.

https://github.com/brishikiran/sudoku-solver


https://github.com/brishikiran/sudoku-solver

cpp

Last synced: over 1 year ago
JSON representation

Awesome Lists containing this project

README

          

# SudokuSolver
A Sudoku solver implemented in C++ is a program designed to solve Sudoku puzzles automatically. Here's an overview of its functionalities:

1. **Input**: The solver takes as input an unsolved Sudoku grid, represented as a 9x9 matrix. Each cell may contain a digit from 1 to 9, or it may be empty (represented by 0).

2. **Algorithm**: The solver employs a backtracking algorithm or a combination of strategies such as constraint propagation and depth-first search to find a solution to the Sudoku puzzle.

3. **Constraint Checking**: It ensures that the solution adheres to Sudoku rules:
- Each row must contain all digits from 1 to 9.
- Each column must contain all digits from 1 to 9.
- Each of the nine 3x3 subgrids (or "boxes") must contain all digits from 1 to 9.

4. **Backtracking**: If the solver encounters a dead-end or invalid configuration while attempting to fill a cell, it backtracks to the previous valid configuration and tries alternative values for the current cell.

5. **Output**: Once a valid solution is found, the solver outputs the completed Sudoku grid, showing the solution for each cell.

6. **Optimizations**: Advanced solvers may implement optimizations to improve efficiency, such as:
- Heuristic strategies to prioritize cell filling based on the number of possibilities.
- Constraint propagation techniques to reduce the search space.
- Parallelization for faster computation on multi-core processors.

7. **User Interface**: Depending on the implementation, the solver may provide a command-line interface (CLI) or a graphical user interface (GUI) for inputting Sudoku puzzles and displaying solutions.

Overall, a Sudoku solver in C++ offers a convenient tool for enthusiasts to automatically solve Sudoku puzzles, showcasing the power of algorithms and problem-solving techniques in computational tasks.