This is a sudoku solver that uses backtracking algorithm to reach the correct solution. In a standard Sudoku puzzle (9x9 grid), there are 81 variables/tiles in total. Each variable is named by its row and its column, and must be assigned a value from 1 to 9, subject to the constraint that no two cells in the same row, column, or box may contain the same value. The initial configuration of sudoku is a partially filled board. The objective is to solve the puzzle such that all the constraints are satisfied.
The sudoku grid is represented by a nested list in this program. We input a sample sudoku puzzle where 0 would indicate an empty square and the program takes care of the rest of it :)
The output is a series of grids where you can see the algorithm solving the puzzle square by square. Feel free to add in your own puzzle to check for different outputs!
Coded this as a project for my 1st sem in Engineering.