Tom Kigezi Department of Electrical and Computer Engineering, Makerere University, Kampala, Uganda
Abstract— Sudoku, the logic based combinatorial numberplacement puzzle has gained worldwide fame among mathematicians and scientists alike in the field of Computational Game Theory. Notably, a vast majority of computer-based algorithms available for solving these puzzles try to mimic human logic in their implementation, making them liable to errors from puzzle inconsistencies. This paper presents a straightforward computer-based algorithm for solving Sudoku puzzles, hereafter called the Test Cell algorithm. It utilizes a highly efficient backtracking technique that is easy to implement in most available computer programming languages. Test runs of the algorithm, implemented using the C++ computer programming language, have been successful for essentially all valid puzzle difficulty categories. Keywords— Sudoku puzzle, Sudoku algorithms, Easy Cell method, Test Cell tend to require multiple hand-developed solving strategies that may not be easily integrated into a single logically sound and efficient computer-based algorithm. This is a fundamental challenge in writing Sudoku puzzle solving programs that the Test Cell algorithm overcomes.
2. The Test Cell Algorithm
The Test Cell algorithm developed for solving Sudoku puzzles does not mimic human logic or hand-developed algorithms. It is a straightforward, easy to implement, consistent and efficient computer-based algorithm that employs Test Cells - special testing cells determined by a specific criterion, that guide to the ultimate puzzle solution. While absent in typical easy puzzles (as a solution is reached without a need to identify them), Test Cells begin to appear as the difficulty of the puzzle is raised. Though only tested on 9X9 Sudoku grids, the Test Cell algorithm can ideally be scaled to other puzzle dimensions.
1. Introduction
Introduced
References: [1] Delahaye, Jean-Paul, “The Science Behind Sudoku”, Scientific American magazine, June 2006. [2] J.F. Crook, “A Pencil-and-Paper Algorithm for Solving Sudoku Puzzles” Retrieved December 20, 2010, from the World Wide Web: http://www.ams.org/notices/200904/rtx090400460p.pdf [3] Kim, Scott, “The Science of Sudoku", 2006 In a well-written program, the algorithm exhaustively explores all possible hypotheses and finally determnines the solution, if one indeed exists. Figure 9 shows a challenging puzzle that can be solved with the extended Test Cell algorithm. [4] Mike, Adams, “Sudoku Puzzle Secrets: Learn How to Solve Sudoku Puzzles With Little Effort”, 2007 Author Tom Kigezi is a third-year student of BSc. Electrical Engineering at Makerere University. He is a student researcher with an online laboratories project iLabs@MAK and has a keen interest in robotics, artificial intelligence and automated systems. Figure 9: A challenging puzzle that can be solved with extended Test Cell algorithm