Giter Club home page Giter Club logo

sudoku_dancing-link's Introduction

Sudoku_Dancing-link

Solve Sudoku Puzzle dancing link

Abstract: The objective of this report is to present detailed algorithm and implementation of sudoku solver..The algorithm solves the sudoku puzzle entered by user of any difficulty level(easy,medium,hard,very hard).Algorithm has been implemented using JAVA ,user can enter the puzzle input using JAVA console ,algorithm process the input and produce output on console itself.

Algorithm:- Algorithm focuses on creating dancing link ,reduce the puzzle in to exact cover form and solve it using algorithm X in a efficient way.To make it efficient,first we implemented rule1 and rule2 ,firstly algorithm try to solve sudoku puzzle using rule1 and rule2 recursively and filled some cells which helps us to reduce no of rows when we convert it in to exact cover form.Applying algorithm X will give us a solution. For easy and medium puzzles ,using only rule1 and rule2 algorithm solved puzzle completely in less than 0.005 seconds. For hard and very hard puzzles ,algorithm first fill some cells using rule1 and rule2 which help us to reduce no of rows when we convert it in to exact cover and then apply algorithm X to solve it.Time taken by the algorithm varies depends on the level of input. I have tried some inputs and algorithm is working for 81*81 , i haven't try the input larger than that. For given n ,we have n^2 rows and n^2 columns ,thus we have n^4 cells. For each cell which is empty ,we have an array of n^2 which keeps track of number of possible elements.

Algorithm is divided in to following modules:- 1.)Pencil-Marks/possible elements of each cell. 2.)Single Candidate/Rule1 3.)Hidden Single/Rule2 4.)Dancing Link/Exact Cover/Algorithm X for backtracking

Please see the code to get the feel of algorithm.

sudoku_dancing-link's People

Contributors

anish841 avatar

Watchers

James Cloos avatar  avatar

Forkers

co1dsama

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.