Академический Документы
Профессиональный Документы
Культура Документы
Outline
Introduction Project Description Back Tracking Algorithm Graph Coloring Brute Force Algorithm Demo Results
Sudoku
Sudoku is a logic-based, number-placement puzzle consisting of a n-by-n grid of n2 squares, each of which is similarly divided into smaller squares, some containing numbers.
Rules
Cannot write the same digit in two or more cells of the same row. Cannot write the same digit in two or more cells of the same column. Cannot write the same digit in two or more cells of the same block. For a Sudoku to be solvable to unique solution there should be at least 17 given numbers in puzzle.
Generation of Sudoku
Create fast, short and reliable Sudoku using known algorithms. Using two different algorithms 1) Backtracking algorithm 2) Graph coloring Sudoku generated have unique solution. Contains five levels of difficulty. Validates the value entered by user by solving Sudoku using Backtracking algorithm. Show all possible values that might go in grid.
Continued...
Sudoku Solver
Solves partially filled grid following the rules of puzzle. Brute force algorithm is used to solve the puzzle. Calculating time to solve different levels of puzzle.
Backtracking
dead end ? dead end start ? ? ? dead end dead end ? success! dead end
Graph Coloring
Graph coloring is a problem in which each vertex or edge is colored in such a way that no two neighboring vertex or edge are of same color.
Application in Sudoku
Placing the digit "1" in the first cell. Check for row, column and box constraint. NO violations moves to next cell and places 1. 1 is not allowed so the value is advanced to a "2". If a cell is discovered where none of the 9 digits is allowed, then the algorithm leaves that cell blank and moves back to the previous cell. The value in that cell is then incremented by one. The algorithm is repeated until the allowed value in the 81st cell is discovered.
First of all it checks from number 1 to 9 and checks for possible values that go in grid. Then if cell has 1 possible value then it is hit and get points added to difficulty. If more than 1 value goes in grid then 3 points are added for each value.
0... 515 = very easy 515... 570 = easy 570... 960 = normal 960... 1200 = hard 1200... above = very hard
Thank you