Skip to content

An Elixir implementation of Peter Norvig's Sudoku solver.

Notifications You must be signed in to change notification settings

adriankumpf/sudoku-solver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sudoku Solver

Yet another implementation of Peter Norvig's Sudoku solver / constraint propagation and search algorithm. Created for learning purposes.

To run the benchmark call

$ mix run examples/benchmark.exs

Solved 50 of 50 easy puzzles (avg 0.01s, max 0.01s)
Solved 95 of 95 hard puzzles (avg 0.02s, max 0.05s)
Solved 11 of 11 hardest puzzles (avg 0.01s, max 0.03s)
Solved 1000 of 1000 random puzzles (avg 0.01s, max 0.01s)

You can also solve your own puzzles using

$ iex -S mix

spec = '85...24..72......9..4.........1.7..23.5...9...4...........8..7..17..........36.4.'
{:ok, grid} = Sudoku.solve(spec)
Sudoku.display(grid)

About

An Elixir implementation of Peter Norvig's Sudoku solver.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages