# Presenting the Test Cell Algorithm for Solving Sudoku Puzzles

Topics: Sudoku, Puzzle, Algorithmics of sudoku Pages: 7 (2204 words) Published: April 19, 2013
Presenting the Test Cell Algorithm for Solving Sudoku Puzzles 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 in Japan in 1984 and made world popular by British newspaper London Times in 2005[1]-[2], the Sudoku puzzle has become the passion of many people the world over in the past few years. Sudoku is a logic-based, combinatorial number-placement puzzle whose objective is to fill a 9×9 grid with digits so that each column, each row, and each of the nine 3×3 sub-grids that compose the grid (also called "boxes", "blocks", "regions", or "sub-squares") contains all of the digits from 1 to 9. The puzzle is a partially completed grid and does not necessarily have a single legitimate solution. Ironically, despite being a game of numbers, Sudoku doesn‟t demand an iota of mathematics of its solvers. In fact, no operation—including addition or multiplication helps in completing a grid, which in theory could be filled with any set of nine different symbols. Nevertheless, Sudoku presents mathematicians and computer scientists a host of challenging issues viz. the choice of the number of Sudoku grids that can be constructed, the minimal number of starting clues that yield a unique solution, and, whether Sudoku belongs to the N-P complete class of problems[2][3]. Unlike manually solving the puzzle with hand-developed algorithms or natural methods[4], computer-based algorithms offer quick solutions to Sudoku puzzles, even with rigorous backtracking - a systematic form of trial and error in which partial solutions are proposed and slightly modified if proved wrong. Challenging puzzles however

2.1

Algorithm Terminology

The Test Cell algorithm is better explained by a preliminary description of all terms pertaining to it in an intended logical order. These are: Lists- An empty cell has a set of numbers that cannot occupy it (Impossibility List) and consequently, a corresponding set of those that can occupy it (Possibility List). These lists are developed for every empty cell according to the Sudoku game rules. Invalid Puzzle Configuration- A puzzle configuration in which there is...