Skip to content

This repository contains a Python program that automatically solves Sudoku puzzles. It takes an input grid representing an unsolved puzzle and uses a backtracking algorithm to find the correct solution. A great tool for Sudoku enthusiasts and those learning about algorithms! ๐Ÿง 

Notifications You must be signed in to change notification settings

LakshayD02/Sudoku_Solver_Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Sudoku_Solver_Python

Description

This Python program implements a Sudoku solver using a backtracking algorithm. Sudoku is a logic-based number-placement puzzle where the objective is to fill a 9x9 grid with digits so that each column, each row, and each of the nine 3x3 subgrids that compose the grid (also called "boxes" or "regions") contain all of the digits from 1 to 9 exactly once. This program takes an incomplete Sudoku grid as input and attempts to solve it by systematically trying different numbers in empty cells. If a number leads to a dead end, the algorithm backtracks and tries a different number. Once a solution is found, the program displays the completed Sudoku grid.

Features

  • Input Grid: Takes a 9x9 Sudoku grid as input, represented as a list of lists or a similar data structure. ๐Ÿ”ข

  • Backtracking Algorithm: Implements a backtracking algorithm to explore possible solutions. ๐Ÿ•ต๏ธโ€โ™€๏ธ

  • Constraint Checking: Checks if placing a number in a cell violates Sudoku rules (row, column, and 3x3 box constraints). โœ…

  • Solution Display: Displays the solved Sudoku grid in a clear and readable format. ๐Ÿ‘€

  • Solves Valid Puzzles: Solves any valid Sudoku puzzle. ๐Ÿ’ช

Technologies Used

  • Python: The core programming language for the Sudoku solver logic. ๐Ÿ

Ideal For

  • Sudoku Players: Who want a tool to help them solve challenging puzzles. ๐ŸŽฎ

  • Students: Learning about algorithms, backtracking, and constraint satisfaction problems. ๐Ÿง‘โ€๐ŸŽ“

  • Python Developers: Interested in seeing a practical implementation of a backtracking algorithm. ๐Ÿ‘จโ€๐Ÿ’ป๐Ÿ‘ฉโ€๐Ÿ’ป

About

This repository contains a Python program that automatically solves Sudoku puzzles. It takes an input grid representing an unsolved puzzle and uses a backtracking algorithm to find the correct solution. A great tool for Sudoku enthusiasts and those learning about algorithms! ๐Ÿง 

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages