Nottingham FP Lab Blog

Solving Sudoku a la Bird

by Graham on December 9, 2005.
Tagged as: Lunches.

I gave an overview of a Haskell approach to solving Sudoku puzzles, based upon lecture notes from Richard Bird. The approach is classic Bird: start with a simple but impractical solver, whose efficiency is then improved in a series of steps. The end result is an elegant program that is able to solve any Sudoku puzzle in an instant. It’s also an excellent example of what has been termed “wholemeal programming” — focusing on entire data structures rather than their elements. I’m planning on teaching this as part of the new Advanced Functional Programming module next semester.


comments powered by Disqus