go-challenge8

command module
v0.0.0-...-d4d1805 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2015 License: BSD-3-Clause Imports: 5 Imported by: 0

README

This respository is my submission to go-challenge8.

It is efficient sudoku solver based on Dancing Links Algorithm by Donald Knuth.

Running application

go build
go-challenge8 < input/sample

To run your own sudoku please follow the same format as in sample file.

_ 3 6 _ _ _ _ _ 8
2 _ 7 5 _ _ 4 9 _
_ _ 4 _ _ 8 3 6 _
_ 2 _ 6 _ _ _ _ 3
4 9 3 _ _ _ 6 8 5
6 _ _ _ _ 5 _ 2 _
_ 7 9 4 _ _ 1 _ _
_ 6 2 _ _ 1 8 _ 9
3 _ _ _ _ _ 2 5 _

Benchmarking solver

cd sudoku/
go test -test.bench=BenchmarkSolve -test.benchtime 10s -cpuprofile cpu.out

For my Lenovo Yoga (Intel i5-5300U 2.30GHz) results are as follows:

PASS
BenchmarkSolve-2	   30000	    574000 ns/op
ok  	bitbucket.org/jrozansk/go-challenge8/sudoku	23.043s

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
sudoku package implements efficient sudoku solver
sudoku package implements efficient sudoku solver

Jump to

Keyboard shortcuts

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