sudokusolver

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const BIMANDER_FACTOR = 2
View Source
const COMMANDER_FACTOR = 3

Variables

This section is empty.

Functions

func ExplainUnsat

func ExplainUnsat(pb *solver.Problem)

func SolveManyGini

func SolveManyGini(in io.Reader, out io.Writer)

func SolveManyGophersat

func SolveManyGophersat(in io.Reader, out io.Writer)

only support gophersat since otherwise it has the overhead of spawning subproc

func SolveWithCustomSolver

func SolveWithCustomSolver(board *sudoku.Board, solver string)

func SolveWithGini

func SolveWithGini(board *sudoku.Board)

func SolveWithGophersat

func SolveWithGophersat(board *sudoku.Board)

func SolveWithGophersatAndBase

func SolveWithGophersatAndBase(board *sudoku.Board, base *CNF)

Types

type CNF

type CNF struct {
	CNFInterface
	Board   *sudoku.Board
	Clauses [][]int
	// contains filtered or unexported fields
}

func GetBase9x9Clauses

func GetBase9x9Clauses() *CNF

func (*CNF) Print

func (c *CNF) Print(w io.Writer)

func (*CNF) Simplify

func (c *CNF) Simplify(options SimplifyOptions)

type CNFBuilder

type CNFBuilder = func(c CNFInterface, lits []int) [][]int

type CNFInterface

type CNFInterface interface {
	Simplify(SimplifyOptions)
	Print(w io.Writer)
	// contains filtered or unexported methods
}

func GenerateCNFConstraints

func GenerateCNFConstraints(s *sudoku.Board) CNFInterface

type CNFParallel

type CNFParallel struct {
	CNFInterface
	*CNF
	// contains filtered or unexported fields
}

func (*CNFParallel) Print

func (c *CNFParallel) Print(w io.Writer)

func (*CNFParallel) Simplify

func (c *CNFParallel) Simplify(options SimplifyOptions)

type SimplifyOptions

type SimplifyOptions struct {
	// contains filtered or unexported fields
}

type WorkRequest

type WorkRequest struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL