Efficient-Sudoku-MRV-Backtracking is a fast Sudoku solver that uses the Minimum Remaining Values (MRV) heuristic and backtracking algorithm for an optimized solution approach.
- Solves Sudoku puzzles quickly using MRV heuristic and backtracking
- Uses constraint satisfaction techniques for optimization
Simply clone the repository to your local machine:
git clone https://github.com/Mohamad-Jaallouk/Efficient-Sudoku-MRV-Backtracking.git
- Provide a Sudoku puzzle as a 9x9 list of lists, with empty cells represented by 0:
puzzle = [
[4, 0, 0, 0, 0, 0, 8, 0, 5],
[0, 3, 0, 0, 0, 0, 0, 0, 0],
...
]
- Call the
backtrack
function with the puzzle as an argument:
solution = backtrack(puzzle)
- The solved Sudoku puzzle is returned as a 9x9 list of lists.