GithubHelp home page GithubHelp logo

sudokusolver's Introduction

SAT-based Sudoku Solver

University of Victoria

CSC 320: Foundations of Computer Science

Members Student Number
Rahat Mahbub V00790465
Rafat Mahmud V00808906

Files

* Sud2sat.java - reads a Sudoku puzzle (in some specified text format) and converts it to a CNF formula suitable for input to the miniSAT SAT solver.

* Sud2SatExtended.java - Same as above but uses extended encoding, in addition to minimal encoding.

* sat2sud.py - reads the output produced by miniSAT for a given puzzle instance and converts it back into a solved Sudoku puzzle (suitable for printing)

* extractor.py - Takes in a file with many sudoku puzzles, cleans them and uses Sud2Sat, minisat and sat2sud to produce a final solved board for each.

* fiftygrids.sudoku - https://projecteuler.net/project/resources/p096_sudoku.txt
* top95.sudoku - http://magictour.free.fr/top95
* hexa*.sudoku - 16X16 sudoku puzzles

* outputformatter.py - Formats a solved board to be checked by: www.sudoku-solutions.com

Program Requirements

* Java
* Python
* minisat

Usage

* extractor.py - Use this to solve many puzzles at once.
	$ python extractor.py top95.sudoku
	To use extended encoding:
	$ python extractor.py fiftygrids.sudoku extended

* Sud2sat -
	Compile with:
	$ javac Sud2sat.java
	Run with:
	$ java Sud2sat <sudoku-filename> <dimacs-output-file-name>

* Sud2SatExtended -
	Compile with:
	$ javac Sud2SatExtended.java
	Run with:
	$ java Sud2SatExtended <sudoku-filename> <dimacs-output-filename>

* sat2sud.py -
	$ python sat2sud.py <minisat-output> <solved-board-output-filename>

sudokusolver's People

Watchers

James Cloos avatar Rahat Mahbub avatar

Forkers

therafatm

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.