0% found this document useful (0 votes)
14 views11 pages

REAL PROJECT REPORT - Merged

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views11 pages

REAL PROJECT REPORT - Merged

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

RISK AND VULNERABILITY

WEATHER FORECAST APP

Project Submitted in Partial Fulfillment of the Requirements for the Degree of

Bachelor of Technology in the field of Computer Science and Engineering


BY

Aryaman Singh
SHADAAN ALI(23CS2011030)
( 23CS2021068)
Vivek
RAZA Shaw((23CS2011140)
KHAN 23CS2021051 )

RAHUL KUMAR THAKUR


Piyush Gupta ( 23CS2021048 )
(23CS2011071)
SAKILBikash
AHAMEDKumar((23CS2021018)
23CS2021057 )

SAUMADITYA PANJA
Akshat Kumar ( 23CS2021058 )
(23CS2021004)

UNIVERSITY

School of Engineering
JIS University

81, Nilgunj Rd, Jagrata Pally, Deshpriya nagar, Agarpara


Kolkata, West Bengal 700109.
UNIVERSITY

CERTIFICATE
This is to clarify that SHADAAN ALI ( 23CS2021068) , RAZA KHAN ( 23CS2021051 )

, RAHUL KUMAR THANKUR ( 23CS2021048 ) , SAKIL AHAMED ( 23CS2021057 ),


This is to clarify
and SAUMADITYA PANJA that Aryaman Singh (23CS2011030), Vivek Shaw (23CS2011140), Piyush
( 23CS2021058)
have comnpleted
Gupta (23CS2011071), Bikash'Quantrive:
their project entitled A Website for and Akshat Kumar (23CS2021004)
Kumar (23CS2021018),
Exploring Quantum Computing', under the guidance of Debmitra Ghosh, in partial
havecomnpleted their project entitled 'Quantrive: AWebsite for Exploring Quantum
Computing',under the guidance of Debmitra Ghosh, in partial fulfillment of the
fulfillment of the
requirements for the award of the Bachelor of Technology in the
requirements for the award of the Bachelor of Technology in the department of School
department of School of Engineering of JIS University, Agarpara.
of Engineering of JIS University, Agarpara.

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.

Date: 21/05/24 Place: JIS University, Kolkata

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.

The solution employs a backtracking algorithm, a recursive problem-solving method


well-suited for combinatorial challenges like Sudoku. By iteratively attempting to place
numbers in empty cells and validating placements against Sudoku rules, the algorithm
identifies a correct solution or concludes that the puzzle is unsolvable. Supporting functions
ensure adherence to constraints, such as verifying rows, columns, and 3x3 subgrids for
duplicate entries. Additionally, the code incorporates features for displaying the grid before
and after solving, enhancing the user experience and facilitating debugging.

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:

1. Implement a Sudoku-solving algorithm


capable of handling any valid 9x9 grid.

2. Validate the correctness of the solution.

3. Ensure the algorithm adheres to the


constraints of Sudoku.

4. Demonstrate program functionality with


example input grids.
Methodology
1. Grid Representation

The Sudoku grid is represented as a 2D integer array of


size 9x9, where:

● 0 indicates an empty cell.


● Non-zero values represent fixed numbers on the
Sudoku board.

2. Core Functions

The solver comprises several helper functions to check and


place numbers according to Sudoku rules:

● isNumberInRow: Verifies if a number exists in a


specified row.
● isNumberInColumn: Checks for the presence of a
number in a specified column.
● isNumberInBox: Ensures a number does not exist in
the local 3x3 box.
● isValidPlacement: Combines the above checks to
confirm valid placement of a number at a given cell.

3. Backtracking Algorithm
The primary algorithm employs recursive backtracking to
solve the puzzle:

1. Identify an empty cell.


2. Attempt to place numbers (1 through 9) in the cell.
3. Check validity using helper functions.
4. Recursively solve the next cell.
5. Backtrack by resetting the cell to 0 if no number fits.
4. Output and Visualization

● A function, printBoard, displays the Sudoku grid in a


formatted manner before and after solving.
Code Implementation
Below is an outline of the core implementation:

private static final int GRID_SIZE = 9;

// Entry point

public static void main(String[] args) {

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 {

System.out.println("Unsolvable board :(");

}
printBoard(board);

Results
The program successfully solves given Sudoku puzzles or determines if they are
unsolvable. For example:

● Input Grid: (Refer to the initial grid above)


● Output Grid: Completed with numbers satisfying Sudoku constraints.

Testing and Validation


Multiple test cases with varying levels of difficulty were run to validate the
correctness and efficiency of the program. All test cases adhered to the following
scenarios:

1. Fully solvable puzzles.


2. Unsolvable puzzles with conflicts.
3. Edge cases (e.g., grids with minimal starting clues).

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 Sudoku solver project successfully demonstrates the application of computational


algorithms to solve logical puzzles efficiently and systematically. By leveraging a
backtracking approach, the program is capable of navigating the constraints of the Sudoku
puzzle to identify valid solutions or determine unsolvability. The modular design of the
implementation ensures flexibility, allowing the code to handle any 9x9 grid configuration,
including puzzles with minimal starting clues or high difficulty levels.

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.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy