Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 15

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

TITLE OF MINI PROJECT: SUDOKU SOLVING ALGORITHM


MINI PROJECT REVIEW-1

Student Name : KIRAN RAGHAV S REDDY USN: 1NH20CS111

Semester /Sec : 4th SEM (B SEC)

Guided by,

Guide Name : MAHANTESH KODABAGI


Assistant professor
SUDOKU SOLVING
ALGORITHM

KIRAN RAGHAV S REDDY


1NH20CS111
CONTENTS

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…………………

PROBLEM STATEMENT :Our job is to place a number into every


empty box so that each row across,each column down and each 9 square boxes are
formed with numbers from 1-9 without repetation in the column, row, box

numbers will be filled through the backtracking process

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

Week 7 Create menu and adding the


decorations

Week 8 adding coments and doing regular test


with the code
DESIGN (FLOW CHART)
EXECUTE
BACKTRACKING
NO

READING SUDOKU SEARCH


START FOUND
FROM A FILE PATTERNS

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

 Software: java compiler.


 Hardware:2/4 GB ram, intel Pentium/ryzen.
REFERENCE

 https://youtu.be/JzONv5kaPJM
 https://www.javatpoint.com/backtracking-introduction?
msclkid=2334214ec85611ecbabf5bf5936f7452
THANK YOU
.

You might also like