Go Go Gnome
the website of Sander Kooijmans

Sudoku solver

Posted: October 15, 2014


Since 2005 the Sudoku puzzle has become very popular in the Netherlands. Many magazines and newspapers publish a Sudoku to entertain their readers. For the people who do not know what a Sudoku puzzle is I will give a short explanation. A Sudoku puzzle consists of a grid of 9 by 9 squares. Initially, part of these squares contain digits in the range 1 to 9; the other squares are empty. The challenge is to fill all squares with digits (in the range 1 to 9), such that each horizontal line, each vertical line and the pre-defined 3×3 squares contains each digit 1 to 9 exactly once. The 3×3 squares are indicated by the fat lines. Here is an example of a Sudoku puzzle:

Example Sudoku

As a software engineer I accepted the challenge to write a program that could solve a Sudoku puzzle. Since the number of squares to be filled in is rather big to use a brute force approach, my challenge was to come up with an efficient solution.

Sudoku solver

In December 2005 I wrote the Sudoku Solver in 4 evenings. The result is a Java application that has the user interface as shown here:

Sudoku Solver GUI


If anyone wants to use this application for his/her own benefits, please feel free to download the application. Click here to download version 1.0 of the Sudoku Solver.


To run the Sudoku Solver a Java 8 (or higher) Run-Time is required. Here is a link to download Java from the website of Oracle, the owner of Java. Java can be downloaded from other websites too, but then possibly unwanted toolbars for your browser might be installed too.

Running the application

You can run the application by double clicking the downloaded file or by typing the following command on the command prompt:

java -jar sudoku.jar

If you have questions about this application, don’t hesitate to contact me by sending an email to sudodu@gogognome.nl


Release Date Remarks
1.0 October 15, 2014 Improved performance. Even difficult Sudokus are solved quikly.
0.3 December 20, 2005 Resize the SudokuPanel when the parent container is resized.
Replaced jar file by zip file containing the jar file, the sources and the build file for Ant.
0.2 December 19, 2005 Solves puzzles in a separate thread that can be terminated. (not tested, because all puzzles I tried were solved very quickly on my computer!) Improved brute force implementation.
0.1 December 12, 2005 First version of Sudoku Solver. It can solve most (all?) Sudoku Puzzles.