You are on page 1of 17

TRIBHUVAN UNIVERSITY

FACULTY OF HUMANITIES AND SOCIAL SCIENCE

A Project Proposal
On
"Sudoku Solver"

Submitted to
Department of Computer Application
National College of Computer Studies

In partial fulfillement of the requriments for Bachelor Degree in Computer


Application

Submitted By:
Rabin Dangol
Chiran Rai
Table of Contents
List of Figures .................................................................................................................................. i
1 Introduction .................................................................................................................................. 1
2 Problem Statement ....................................................................................................................... 1
3 Objectives .................................................................................................................................... 1
4 Methodology ................................................................................................................................ 2
4.1 Requirement Identification ................................................................................................... 3
4.1.1 Study of Existing System ............................................................................................... 3
4.1.2 Literature Review........................................................................................................... 4
4.1.3 Requirement Analysis .................................................................................................... 5
4.2 Feasibility Study ................................................................................................................... 6
4.3 Algorithm Description .......................................................................................................... 7
4.3.1 Backtracking Algorithm ................................................................................................. 7
4.4 Data Collection ..................................................................................................................... 8
4.5 Tools ...................................................................................................................................... 9
4.5.1 Analysis and Design Tools ............................................................................................. 9
4.5.2 Implementation Tools .................................................................................................. 10
5 High Level Design of System .....................................................................................................11
5.1 Flow-Chart ...........................................................................................................................11
5.2 Use-Case Diagram .............................................................................................................. 12
6 Gantt Chart ................................................................................................................................. 13
7 Expected Outcomes ................................................................................................................... 14
8 References .................................................................................................................................. 14
List of Figures
Figure 1 Agile Methodology --------------------------------------------------------------------------------- 2
Figure 2 Sudoku Solver Flowchart ------------------------------------------------------------------------ 11
Figure 3 Sudoku Solver Use-Case Diagram -------------------------------------------------------------- 12
Figure 4 Project Gantt Chart -------------------------------------------------------------------------------- 13

i
1 Introduction
Sudoku is a popular number game that has gained a lot of popularity in recent years. It is a logic-
based game that requires the player to fill a 9x9 grid with digits from 1 to 9, ensuring that each
column, row, and 3x3 sub-grid contains all the digits from 1 to 9. The game has a unique solution,
and the challenge lies in finding it.
The Sudoku Solver will be a Java-based application that aims to solve any Sudoku puzzle within
a reasonable amount of time. The solver will use various algorithms and techniques for solving
Sudoku puzzles and will have an easy-to-use graphical user interface. The Sudoku solver will be
designed to take a partially filled Sudoku grid as input and output the solved grid. The solver will
also be able to generate new Sudoku puzzles and verify the correctness of existing puzzles.
The proposed Sudoku solver will use algorithm, such as backtracking, to solve Sudoku puzzles.
Backtracking is a general algorithmic technique that involves trying out different solutions until a
solution is found.

2 Problem Statement
Sudoku puzzles have gained a lot of popularity in recent years, and many people enjoy solving
them. However, manually solving Sudoku puzzles can be a time-consuming and challenging task,
especially for more complex puzzles. Therefore, developing a Sudoku solver that can solve Sudoku
puzzles automatically can save time and provide a more efficient way of solving Sudoku puzzles.
It can help automate the process of solving Sudoku puzzles, making it more efficient and enjoyable
for Sudoku enthusiasts.

3 Objectives
• To analyze and compare different algorithms and techniques for solving Sudoku puzzles.
• To develop an easy-to-use interface for the Sudoku solver.

1
4 Methodology
For this mini project, Agile Model for System Development Life Cycle will be used. This model
focuses on short term goal or development of project so that everything can be processed smoothly.
In this model, the product is broken down into a set of features/iterations, and hence it is used for
quickly delivering a working product and so can be considered as a very rational development
method for this project. This model generates ongoing releases of this project, each having small
and incremental changes updated from the previous released version. At each cycle, the project is
tested and then released.

Figure 1 Agile Methodology

2
4.1 Requirement Identification
4.1.1 Study of Existing System
A study of the existing Sudoku solving systems showed us that there are numerous Sudoku solver
applications available in the market. These applications use different algorithms and techniques to
solve Sudoku puzzles, and their performance and efficiency vary significantly.

The existing Sudoku solvers can be broadly classified into two categories: desktop applications
and online applications. Desktop applications are standalone applications that run on a user's
computer, while online applications are web-based and run in a web browser.

Some of the popular desktop Sudoku solvers include Simple Sudoku, Sudoku Solver, and Hodoku.
These applications provide a range of features, including the ability to solve Sudoku puzzles,
generate new puzzles, and verify the correctness of existing puzzles. They use different algorithms
and techniques, including backtracking, constraint propagation, and brute-force search, to solve
Sudoku puzzles.

Online Sudoku solvers are also available and can be accessed from anywhere with an internet
connection. Some of the popular online Sudoku solvers include Web Sudoku, Sudoku Kingdom,
and Sudoku Solver. These applications provide similar features as desktop applications, but they
also include features such as online multiplayer Sudoku games and leaderboards [1] [2].

3
4.1.2 Literature Review
Sudoku is a popular logic-based puzzle game that has been studied extensively in the field of
computer science and artificial intelligence. There are many different algorithms and techniques
that have been developed to solve Sudoku puzzles automatically.

One of the most well-known and effective algorithms is based on constraint propagation and
search. This approach was described by Peter Norvig in his paper "Solving Every Sudoku Puzzle"
(2006). Norvig's algorithm starts by creating a set of constraints based on the initial puzzle, then
propagates these constraints to eliminate possible values for each cell. If the puzzle is not solved,
the algorithm uses a depth-first search to find the solution [3].

Another approach that has been proposed is using cascading constraint propagation. This technique
involves propagating constraints from the initial puzzle, then applying the cascading technique to
further reduce the number of possible values for each cell. The solver also uses a heuristic search
technique to choose the next cell to fill. In addition to constraint propagation and search-based
techniques, other approaches have also been explored i.e., backtracking algorithm. The
backtracking algorithm is another popular algorithm used to solve Sudoku puzzles. It involves
trying out different possible values for each empty cell and backtracking when an incorrect value
is chosen. This algorithm can solve Sudoku puzzles quickly and efficiently but may struggle with
more challenging puzzles [4].

Overall, there are many different algorithms and techniques that can be used to solve Sudoku
puzzles automatically, each with its own advantages and disadvantages. The research in this area
shows that Sudoku solvers can be highly effective in solving even the most difficult puzzles, and
there is still room for improvement in terms of speed and efficiency.

4
4.1.3 Requirement Analysis
4.1.3.1 Functional Requirements
i. The system should be able to solve a given Sudoku puzzle.
ii. The system should allow users to input a Sudoku puzzle.
iii. The system should validate the input provided by the user to ensure it is a solvable puzzle.
4.1.3.2 Non-Functional Requirements
i. The system should be able to solve a Sudoku puzzle in a reasonable amount of time, with
minimal delay or lag.
ii. The system should be able to handle various types of inputs without crashing
iii. The system should have a user-friendly interface that is easy to navigate.

5
4.2 Feasibility Study
Feasibility Study is a measure or study of how well the system will function under the given
constraints. It is performed to determine whether the solutions to be considered to accomplish the
requirements is practical and workable in the software. Feasibility Study includes:

i. Technical Feasibility
The technical feasibility of the project relates to the project's technical aspects, such as the
software and hardware requirements, the development tools and technologies, and the expertise
of the development team. The proposed Sudoku Solver project is technically feasible, as it
requires standard programming languages and tools such as Java, Python, or C++, which are
widely used and available. The hardware requirements are also minimal, and the project can
be developed on a standard personal computer. Additionally, there are numerous open-source
libraries and algorithms available for solving Sudoku puzzles, which can be used to develop
the Sudoku Solver application.
ii. Operational Feasibility
The operational feasibility of the project relates to the practicality of implementing the solution
in the real world. The Sudoku Solver project is operationally feasible, as it provides a solution
to a real-world problem (i.e., the need to solve Sudoku puzzles efficiently and accurately). The
project can be used by Sudoku enthusiasts, gamers, or anyone looking for a quick and easy
way to solve Sudoku puzzles. The application can be designed to have a user-friendly interface,
making it easy for users to input the puzzle and view the solution.
iii. Economic Feasibility
The economic feasibility of the project relates to the project's cost and the benefits it provides.
The Sudoku Solver project is economically feasible, as it is small-scale project and it can be
developed using open-source tools and libraries, and the cost of development is relatively low.
Additionally, the application can be monetized through various means such as displaying ads,
offering premium features or subscription services.

6
4.3 Algorithm Description
4.3.1 Backtracking Algorithm
The Backtracking algorithm is a widely used technique for solving Sudoku puzzles. The basic idea
behind the algorithm is to start filling the empty cells of the puzzle, one by one, with numbers that
are allowed according to the rules of the game.

If at any point, there is a conflict (i.e., the same number is already present in the same row, column,
or 3x3 box), the algorithm backtracks to the previous cell and tries the next allowed number. This
process continues until a solution is found or all possibilities have been exhausted.

Here is a step-by-step description of the backtracking algorithm that will be used in a Sudoku
Solver:

1. Find an empty cell in the puzzle.

2. Try filling the cell with each allowed number (i.e., numbers that are not already present in
the same row, column, or 3x3 box).

3. For each number tried, recursively repeat steps 1 and 2 for the next empty cell.

4. If a conflict arises (i.e., the same number is already present in the same row, column, or
3x3 box), backtrack to the previous cell and try the next allowed number.

5. If all possibilities have been exhausted for a given cell, backtrack to the previous cell and
try the next allowed number.

6. Continue this process until a solution is found or all possibilities have been exhausted.

The backtracking algorithm is an effective technique for solving Sudoku puzzles because it is able
to handle the complexity of the game, which can involve multiple possible solutions and requires
careful consideration of each cell's implications on the rest of the puzzle [5].

7
4.4 Data Collection
Data collection is a critical component of any project that involves the use of data A dataset of
Sudoku puzzles will be collected for testing and evaluating the Sudoku solver.
In the case of this project, the following are the ways in which data will be collected:
i. Input from users: The Sudoku solver requires input from users in the form of the initial
puzzle configuration. This can be collected through a graphical user interface (GUI) that
allows users to input the puzzle configuration by clicking on the cells and entering the
numbers.
ii. Sample puzzles: Sample puzzles will be used for testing and validating the Sudoku solver.
There are many online resources available that provide Sudoku puzzles of varying levels of
difficulty. These can be used to test the functionality of the Sudoku solver.
iii. Data on algorithms and techniques: In order to implement the Sudoku solver, it is important
to collect data on the various algorithms and techniques that can be used for solving Sudoku
puzzles. This will be done through a literature review of research papers, articles, and books
on Sudoku solving algorithms and techniques.

8
4.5 Tools
The following tools will be used for the development of the Sudoku solver:

4.5.1 Analysis and Design Tools


Analysis and design tools are used in software development to help with the planning and creation
of a software system. These tools are essential in the initial stages of the software development life
cycle, where requirements and specifications are gathered, and the system is designed.
The following are some of the analysis and design tools that will be utilized during the
development of the project:
i. Unified Modeling Language (UML): UML is a visual modeling language that is used to
describe the structure and behavior of a software system. UML is a standard modeling
language that is used by software developers and designers to create diagrams that represent
the various components of a software system, such as classes, objects, and interactions
between them.
ii. Data Flow Diagrams (DFD): DFD is a graphical representation of the flow of data in a
software system. DFD is used to represent the input, output, and processing of data in a
system. It is a useful tool for software developers and designers to understand how data moves
through a system.
iii. Entity-Relationship Diagram (ERD): ERD is a modeling technique used to represent the
data structure of a software system. ERD is used to describe the relationships between
different entities in a system, such as customers, products, and orders.
iv. Use Case Diagrams: Use case diagrams are used to describe the functionality of a software
system. They are used to represent the different scenarios that a user may encounter when
using a system. Use case diagrams help software developers and designers to understand the
requirements of a system and design the system accordingly.
v. Flowcharts: Flowcharts are used to represent the flow of control in a software system.
Flowcharts are used to describe the different steps in a process and the decision points that
determine the flow of control [6].

9
4.5.2 Implementation Tools
For this project, the following implementation tools will be used:
i. Java Programming Language: Java is a popular programming language widely used for
developing desktop applications, web applications, and mobile apps. It is an object-oriented
language that provides a platform-independent environment, making it a suitable choice for
developing cross-platform applications. The Sudoku solver will be developed using the Java
programming language.
ii. VS Code IDE: Visual Studio Code (VS Code) is a popular code editor that is lightweight,
fast, and extensible. It has a wide range of features that make it a great choice for developing
a Sudoku solver app. It provides a wide range of tools and plugins for coding, debugging,
and testing. VS Code will be used for coding and debugging the Sudoku solver.
iii. JavaFX: JavaFX is a software platform used for developing desktop and mobile applications.
It provides a rich set of user interface controls, graphics, and media components, making it a
suitable choice for developing a graphical user interface (GUI) for the Sudoku solver. JavaFX
will be used for designing the GUI for the Sudoku solver.
iv. Git: Git is a version control system used for managing and tracking changes in the source
code. It provides a way to collaborate with other developers and keep track of the changes
made to the project. Git will be used for version control and collaboration purposes.

10
5 High Level Design of System
5.1 Flow-Chart

Figure 2 Sudoku Solver Flowchart


This flow chart illustrates the sequence of steps that the user takes to interact with the Sudoku
Solver application.
• The flow chart starts with the "Start" node, which represents the beginning of the
application.
• The user then enters a puzzle into the application through the "Enter Puzzle" node.
• The puzzle is solved through the "Solve Puzzle" node, using the Sudoku Solver algorithm.
• The solution is then displayed to the user through the "Display Result" node.
• The user can then choose to reset the puzzle using the "Reset Puzzle" node, which takes
them back to the "Enter Puzzle" node to enter a new puzzle.
• Finally, the user can choose to exit the application through the "End" node.

11
5.2 Use-Case Diagram

Figure 3 Sudoku Solver Use-Case Diagram


In this diagram, we have one actor, the "User", who interacts with the system. The system has
four use cases: " Puzzle Board", "Solve", "Reset Board", and "Exit".
• The "Puzzle Board" is the sudoku board that allows the user to enter the puzzle they want
to solve.
• The "Solve" use case is where the Sudoku Solver algorithm is run to solve the puzzle
entered by the user. Once the puzzle is solved, the solution is displayed on the board.
• The "Reset" use case allows the user to reset the Sudoku board to its initial state,
effectively clearing any puzzles entered by the user.
• The "Exit" use case allows the user to close the application.

12
6 Gantt Chart

Project RoadMap
20-Apr-23 25-Apr-23 30-Apr-23 5-May-23 10-May-23 15-May-23

Requirement Gathering

Planning

Desigining

Coding

Testing and Maintenance

Implementation

Figure 4 Project Gantt Chart

13
7 Expected Outcomes
The expected outcome of this project is a fully functional and efficient Sudoku solver that can
solve any Sudoku puzzle within a reasonable amount of time. The solver should also have an easy-
to-use graphical user interface. The interface should allow users to input Sudoku puzzles easily
and view the solution in a clear and concise manner.

8 References

[1] "Sudoku Solver," [Online]. Available: https://sudokuspoiler.com/sudoku/sudoku9. [Accessed


16 April 2023].
[2] "Sudoku Kingdom," [Online]. Available: https://sudokukingdom.com/. [Accessed 16 April
2023].

[3] P. Norvig, "Solving Every Sudoku Puzzle," [Online]. Available:


http://norvig.com/sudoku.html. [Accessed 14 April 2023].

[4] "Sudoku solving algorithms," [Online]. Available:


https://en.wikipedia.org/wiki/Sudoku_solving_algorithms. [Accessed 15 April 2023].

[5] "Backtracking Algorithm for Sudoku," [Online]. Available:


https://iq.opengenus.org/backtracking-sudoku/. [Accessed 16 April 2023].

[6] "SOFTWARE ANALYSIS AND DESIGN TOOLS - SOFTWARE ENGINEERING,"


[Online]. Available: https://www.wisdomjobs.com/e-university/software-engineering-
tutorial-338/software-analysis-and-design-tools-25973.html. [Accessed 16 April 2023].

[7] D. J. M. Weiss, "Genetic Algorithms and Sudoku," Rapid City, SD 57701-3995, 2009.

[8] "Solving Sudoku with Simulated Annealing," [Online]. Available:


https://blog.revolutionanalytics.com/2010/02/solving-sudoku-with-simulated-
annealing.html. [Accessed 14 April 2023].

[9] "Sudoku," [Online]. Available: https://brilliant.org/wiki/sudoku/. [Accessed 16 April 2023].

14

You might also like