Code Monkey home page Code Monkey logo

sudoku-cp's Introduction

Sudoku Constraint Programming with Choco-Solver

Status: Complete, verson 1.0.0.

This is an implementation, in Java 10, of a Sudoku solver using constraint programming. The intention of this project was to play around with constraint programming using Choco-Solver (http://www.choco-solver.org).

The program supports fully generic Sudoku boards (i.e. n^2 x n^2 boards over n^2 arbitrary symbols), but has an easy-to-use implementation of the standard 9x9 Sudoku board over the digits 1 through 9.

The main classes as are follows:

  • GenSudokuBoard: The generic implementation of an arbitrary Sudoku board.

  • GenSudokuCP: The solver, which takes a GenSudokuBoard, creates a constraint program from it, and then determines if there is a unique solution and, if so, what that solution is.

  • SudokuBoard: Represents a standard 9x9 Sudoku board: it is a subclass of GenSudokuBoard but handles most of the details so that the interface is simple to use.

  • SudokuCP: The solver for SudokuBoard, and a subclass of GenSudokuCP.

Examples of how to use these classes can be found in the test cases, which are designed specifically for SudokuBoard and SudokuCP:

  • TestSudokuBoard: Tests for SudokuBoard, which provide examples as to how to use the functionality of SudokuBoard.

  • TestSudokuCP: Tests for SudokuCP, which show how to invoke the constraint programming solving algorithm on a board.

sudoku-cp's People

Contributors

sraaphorst avatar

Watchers

 avatar  avatar

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.