My Profile Photo

Sheogorath's Blog

Depending on the time of the day a friend, a colleague, a wise guy. The beauty of the world is its sense of humor to show humans their way by letting them search their own.

Cover image for this blog post

Event-based Sudoku

Today I learned that one can write an event-based Sudoku solver. Means a solver that selectively re-evaluates the state of the Sudoku based on changed fields rather than iterating over the whole Sudoku over an over again to solve it.

I came across this because it bothered me the whole week. I’m solving Sudoku in a rather boring way, that has a kind of programmatic ritual to it. Therefore I wondered if I could implement it pretty much as I do it. And it turned out yes. It might not be as efficient and as practical as other solvers, but it works. And if you want to check it out, feel free to see the GitLab project I created for it. The original idea to do all this came from a blog post I read weeks ago about solving a Sudoku with Graph theory, I also highly recommend this read.