This Sudoku Solver application allows users to input Sudoku puzzles and find solutions using a Wave Function Collapse (WFC)-inspired algorithm. The web application features a user-friendly interface where users can enter their own puzzles or choose from predefined easy, hard, and expert puzzles.
- Sudoku Puzzle Input: Enter Sudoku puzzles into a 9x9 grid.
- Solve Button: Submit the puzzle to solve it using the WFC-inspired algorithm.
- Clear Button: Reset the grid to start a new puzzle.
- Example Boards: Load predefined Sudoku puzzles of varying difficulty levels.
- Responsive Design: User-friendly interface with a dark theme.
- Python 3.x
- Flask: Web framework for Python
- NumPy: Library for numerical operations
-
Clone the Repository:
git clone https://github.com/prajxwal/sudoku-solver.git cd sudoku-solver
-
Install Dependencies from
requirements.txt
:pip install -r requirements.txt
-
Run the Application:
python app.py
The application will be available at http://127.0.0.1:5000/ by default.
- Input Puzzle: Enter numbers into the Sudoku grid. Empty cells are represented by blank spaces.
- Solve Puzzle: Click the "Solve" button to find the solution. The solution will be displayed in the grid.
- Clear Puzzle: Click the "Clear" button to reset the grid.
- Load Example Boards: Click on the "Easy", "Hard", or "Expert" buttons to load predefined Sudoku puzzles.
The solver uses a WFC-inspired approach:
-
Possible Values Calculation: For each empty cell, calculate the possible values based on Sudoku constraints (row, column, 3x3 subgrid).
-
Entropy Minimization: Select the cell with the fewest possible values to place a number.
-
Backtracking: Place numbers and recursively solve the puzzle, backtracking if necessary.
This project is licensed under the MIT License. See the LICENSE file for details.