Giter Club home page Giter Club logo

sudokunxm's Introduction

sudokuNxM Solver and Generator

The NxM-Sudoku is a generalization of the standard 3x3 Sudoku with 9 squares of size 3x3 and a total of 81 cells. In the general case we have N*M rectangles of size NxM and a total of (N*M)2 cells.

Though there are standard Sudokus which are almost impossible to solve only with logical reasoning by humans, from a computational point of view solving a standard Sudoku is almost trivial. Since the general problem is NP-complete finding a solution gets more demanding for larger grids.

We choose an approach where we simplify the given NxM-Sudoku as far as possible using "human" methods like hidden and naked singles and tuples, block-line interaction etc. and transform the remaining problem into a boolean satisfiability problem. We then use Sat4J for solving.

Besides solving of Sudokus the program also includes features like generating Sudokus, testing for unique solutions etc.

sudokunxm's People

Contributors

hkociemba avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

sudokunxm's Issues

Boxsize should be locked while working

Hi, cool program, I've recently been fiddling a bit with a grid generator of my own, I based it on this general algorithm you described, but added some heuristics and things to it to make it faster, with... mild success :)

I've been using your tool a bit to reduce the puzzles I generated, and noticed that you can change the grid size while reduction is in progress, with various hilarious results such as:

  • The program freezes completely
  • SAT removes all but 2 givens (they were in the same row... and also the same number somehow)
  • Access violations
  • Otherwise unexpected behavior.

Maybe these buttons should be disabled while work is in progress :)

Cheers and have a good one! And thanks for describing that algorithm in that forum that one time, it clued me in on how to get started! (Though I eventually gave up waiting for the 32x32 boxsize grid to complete and used a shuffled default grid instead, lol)

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.