Professional Documents
Culture Documents
Sudoku Solving Algorithm: Department of Computer Science and Engineering
Sudoku Solving Algorithm: Department of Computer Science and Engineering
Guided by,
1. Introduction..............................................................................
2. Work Description........................................................................
3. Backtracking Algorithm................................................................
4. Planned project schedule..............................................................
5. Flow chart................................................................................
6. Algorithm.................................................................................
7. Sample output...........................................................................
8. Minimum requirments..................................................................
9. Reference.................................................................................
INTRODUCTION…………………
Objective:
To successfully implement a novel approach to solve memory intensive problem such as
sudoku
to solve the SUDOKU puzzle with backtracking approach
Work Description
Concept
The main concept of our project is solving Sudoku by our software/code.
Sudoku is a popular game and this code make this game more easy and
intresting
Idea
I got the idea of making the software/code to solve the sudoku puzzle after
solving a lot of puzzle in the sem end holidays
logic
The logic of our code is to divide the row and column into two dimensions.
Then find the possible solution using backtracking. Here you implement the final
solution by regular trial and error method and removing the error using backtracking
Work Description
Grid & Dimensions
For the grid we use a 3*3,9*9 grids we use a 2 dimensional array to represent
the sudoku
Partition
We use functions, loop ,conditional operators to seperate the whole code in
some parts this will help to debug the code with ease and modify the code
ROW
COLUMN
BOX
CELL
BACKTRACKING ALGORITHM
Backtracking is a technique to solve the problems where multiple choices are
there and we don’t know the correct choice and hence we solve the problem
with trial and error i.e. trying each option until the goal is reached
we basically check that the same number is not present in current row
current column and the curret 3*3 box subgrid after checking for saftey we
assign the number ,and recursively check weather this assignment leads to a
solution or not. If the assignment doesnot lead to a solution then we try next
number for current empty cell. and if none of the numbers lead to a solution
we return false
when false is returned we come back a cell and increase the already assigned
value , after this assignment the next cell is checked again
this is repeated untill the final cell recieves an appropriate solution
PLANNED WORKFLOW
WEEK WORK
Week 1 Concept , idea
Week 2 Algorithm &flowchart
Week 3-4 logic and logic build up
Week 5 Create function
Week 6 checking the working of the project
and debugging
YES
NO
YES ADD A
SOLVED POSSIBLE
STOP PRINT SOLUNTION NUMBER
ALGORITHM
First checking if the current number is not repeated in rows or
columns through loops.
Then checking if the box has the number already or not.
After a vacant position is found, we will recursively check for
numbers(1 – 9) that fit the position perfectly.
If the number fits perfectly, the recursive call returns true, else it
returns false and recursive calls are terminated.
Further, we will use a backtracking algorithm to continuously look for
the correct number for the current position
Consequently, If the number is found, the recursive call return true,
else returns false and the recursive call is ended stating “no solution
exists”.
SAMPLE OUTPUT
Hardware and software specification
https://youtu.be/JzONv5kaPJM
https://www.javatpoint.com/backtracking-introduction?
msclkid=2334214ec85611ecbabf5bf5936f7452
THANK YOU
.