Skip to content
/ sudoku Public

Different algorithms to solve sudoku puzzles witten in Go

Notifications You must be signed in to change notification settings

vpmv/sudoku

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sudoku solvers

Exploring different Sudoku puzzle solving algorithms, using Go.

Techniques

Backtracking / Bruteforce

A brute force algorithm visits the empty cells in some order, filling in digits sequentially, or backtracking when the number is found to be not valid.
Wikipedia

Backtracking is one of the first solutions you'd think of, but it's highly inefficient. As long as the puzzle is valid, a solution will be found. Even complex puzzles are solved within seconds using modern day technology. The algorithm is fairly simple as you just look up collisions for a single cell at a time, iterating over the possibilities until progressing.

Build / Use

Requirements

  • Docker

Execute build.sh to build the binaries for Linux & Mac. They will be placed in the project's ./bin directory.

Usage

Write your Sudoku input in a JSON file following the default example. Empty cells must be filled by a zero (0). Input sanitation hasn't been implemented!

./bin/bruteforce -input examples/default.json

About

Different algorithms to solve sudoku puzzles witten in Go

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published