Skip to content

Lavanyalakhiani/Sudoku-Solver--DSA-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sudoku-Solver--DSA-Project

This project implements a Sudoku solver using the principles of Data Structures and Algorithms (DSA). It employs backtracking and recursion to find the solution to any given Sudoku puzzle. It's a practical demonstration of how these algorithms can be applied to solve complex problems efficiently.

This project is a Sudoku solver that uses backtracking and recursion to solve Sudoku puzzles. Sudoku is a popular puzzle game that involves filling a 9x9 grid with digits so that each column, each row, and each of the nine 3x3 subgrids contain all of the digits from 1 to 9.

The goal of this project is to demonstrate the application of Data Structures and Algorithms (DSA) in solving a real-world problem. By using backtracking and recursion, we can efficiently solve even the most complex Sudoku puzzles.

Features:

-> Solves any valid Sudoku puzzle.
-> Uses backtracking and recursion for an efficient solution.
-> Provides a clear and concise implementation of the algorithm.
-> Easy to understand and extend.

Algorithm:

The Sudoku solver uses a backtracking algorithm, which is a depth-first search algorithm for finding all solutions to a problem by trying out all possible configurations and backtracking as soon as it determines that a configuration is invalid. Here's a high-level overview of the algorithm:

  1. Find an empty cell: Traverse the grid to find an empty cell.
  2. Try possible values: For each empty cell, try all possible values (1 to 9).
  3. Check validity: For each value, check if it is valid under Sudoku rules (no duplicates in the current row, column, or 3x3 subgrid).
  4. Recursion: If a value is valid, place it in the cell and recursively attempt to solve the rest of the grid.
  5. Backtrack: If placing the current value leads to no solution, remove it (backtrack) and try the next value.
  6. Solution found: If the grid is completely filled without conflicts, a solution is found.

Usage:

To use the Sudoku solver, you need to provide a Sudoku puzzle as input. The puzzle should be in the form of a 9x9 grid, with zeros representing empty cells. The solver will fill in the grid with the solution.

image

OUTPUT::::

image

About

This project implements a Sudoku solver using the principles of Data Structures and Algorithms (DSA). It employs backtracking and recursion to find the solution to any given Sudoku puzzle. It's a practical demonstration of how these algorithms can be applied to solve complex problems efficiently.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages