REAL PROJECT REPORT - Merged
REAL PROJECT REPORT - Merged
Aryaman Singh
SHADAAN ALI(23CS2011030)
( 23CS2021068)
Vivek
RAZA Shaw((23CS2011140)
KHAN 23CS2021051 )
SAUMADITYA PANJA
Akshat Kumar ( 23CS2021058 )
(23CS2021004)
UNIVERSITY
School of Engineering
JIS University
CERTIFICATE
This is to clarify that SHADAAN ALI ( 23CS2021068) , RAZA KHAN ( 23CS2021051 )
This work is an authentic record of their own work carried out during the academic
year 2023-24 and to the best of our knowledge,this work has not been submitted
elsewhere as part of the process of obtaining a degree, diploma, fellowship, or any other
similar title.
Signature of HOD
Signature of Supervisor
Project Report :
IMPLEMENTING
A
SUDOKU SOLVER
Abstract
Sudoku is a widely enjoyed puzzle that blends logic, strategy, and pattern recognition,
challenging players to fill a 9x9 grid such that each row, column, and 3x3 subgrid contains all
digits from 1 to 9 exactly once. While solving Sudoku puzzles can be a satisfying mental
exercise, certain puzzles with minimal clues or complex arrangements often exceed manual
solving capabilities. This project addresses the challenge by developing a computational
Sudoku solver using Java programming, showcasing a structured and efficient approach to
solving puzzles of varying difficulty levels.
This project report delves into the theoretical foundation of Sudoku solving, explaining the
principles of the backtracking technique and its application to logical puzzles. It also outlines
the implementation details, including grid representation, validation mechanisms, and
recursive logic. The program has been tested on a variety of puzzles, including those with
unique solutions, multiple solutions, and no solutions, demonstrating its reliability and
efficiency.
The project not only serves as a practical tool for solving Sudoku puzzles but also highlights
the adaptability of algorithmic problem-solving techniques in addressing real-world
challenges. It provides a scalable framework for extending the solver to larger grids or
integrating it into applications such as educational tools, game design, or advanced AI-based
puzzle generators. With robust performance and potential for further enhancement, this
Sudoku solver represents a meaningful contribution to computational puzzle-solving
methodologies.
INTRODUCTION
Sudoku is a logic-based number placement puzzle that requires filling a
9x9 grid such that each column, row, and 3x3 subgrid contains all digits
from 1 to 9 without repetition. The popularity of Sudoku puzzles
demands computational tools to solve them, especially in cases of
complex puzzles. This project addresses this need by implementing a
robust program that can determine the solvability of a puzzle and provide
solutions if solvable.
Project Objectives:
2. Core Functions
3. Backtracking Algorithm
The primary algorithm employs recursive backtracking to
solve the puzzle:
// Entry point
int[][] board = {
{7, 0, 2, 0, 5, 0, 6, 0, 0},
{0, 0, 0, 0, 0, 3, 0, 0, 0},
{1, 0, 0, 0, 0, 9, 5, 0, 0},
{8, 0, 0, 0, 0, 0, 0, 9, 0},
{0, 4, 3, 0, 0, 0, 7, 5, 0},
{0, 9, 0, 0, 0, 0, 0, 0, 8},
{0, 0, 9, 7, 0, 0, 0, 0, 5},
{0, 0, 0, 2, 0, 0, 0, 0, 0},
{0, 0, 7, 0, 4, 0, 2, 0, 3}
};
printBoard(board);
if (solveBoard(board)) {
System.out.println("Solved successfully!");
} else {
}
printBoard(board);
Results
The program successfully solves given Sudoku puzzles or determines if they are
unsolvable. For example:
Challenges
● Designing an algorithm to handle edge cases where multiple solutions or no
solutions exist.
● Optimizing backtracking to minimize runtime for complex puzzles.
Future Enhancements
1. Extend support to larger grid sizes, such as 16x16 or custom dimensions.
2. Develop a graphical user interface (GUI) for better user interaction.
3. Optimize the algorithm for faster solving times.
Conclusion
The project underscores the importance of algorithmic thinking in problem-solving. The use
of recursive logic and constraint-checking functions not only simplifies the complexity of the
Sudoku-solving process but also serves as a blueprint for tackling similar problems in
combinatorial optimization and artificial intelligence. Moreover, the project highlights the
relevance of coding practices such as modularity and readability, which are essential for
building maintainable and scalable solutions.
Through rigorous testing on a variety of puzzles, the solver has proven to be robust and
reliable. It can serve as a standalone utility or be integrated into larger applications such as
puzzle generators, educational software, or gaming platforms. The algorithm’s adaptability
makes it suitable for enhancements, such as expanding to larger grid sizes, optimizing for
performance in solving highly complex puzzles, or adding a user-friendly graphical interface.
Overall, this project bridges the gap between abstract problem-solving techniques and
practical implementation, illustrating the power of programming in automating tasks that are
otherwise time-consuming and error-prone for humans. It serves as a foundational step
towards exploring advanced applications of logic-based problem-solving, fostering
innovation in both academic and recreational contexts. Future advancements can expand its
capabilities and continue to demonstrate the intersection of computational techniques and
everyday challenges, cementing its value as a versatile and impactful tool.