Skip to content

Sudoku Solver Python-based using recursion and backtracking to instantly solve Sudoku puzzles with ease.

License

kdqliedo3/Backtracking-Sudoku-Solver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧩 Backtracking Sudoku Solver

A simple yet powerful Sudoku solver built in Python using the backtracking algorithm.
It checks all possible numbers for each empty cell and backtracks when a number leads to a dead end β€” continuing recursively until the puzzle is solved.

πŸš€ How It Works

  1. Row & Column Validation:
    Checks if the chosen number already exists in the same row or column.

  2. 3x3 Subgrid Validation:
    Calculates the top-left corner of each 3x3 box and ensures no duplicates exist.

  3. Backtracking Algorithm:

    • Tries placing numbers 1–9 in each empty cell.
    • If a valid placement leads to a full solution, it returns True.
    • Otherwise, it resets the cell to 0 and tries the next number.

Releases

No releases published

Packages

No packages published

Languages