The backtracking algorithm and different representations for solving Sudoku Puzzles

University essay from KTH/Skolan för datavetenskap och kommunikation (CSC)

Author: Johan Ekström; Kristofer Pitkäjärvi; [2014]

Keywords: ;

Abstract: Two implementations of the backtracking algorithm for solving Sudoku puzzles as well as their dependence on the representations of the problem have been studied in order to ascertain pros and cons of different approaches. For each backtracking step, empty cells could be assigned numbers sequentially or, by using a greedy heuristic, by the probability that guessed numbers were more likely to be correct. Representations of the Sudoku puzzles varied from a n2 matrix to a n3 matrix, as well as a combination of both. This study shows that (1) a sequential approach has better best case times but poor worst case behaviour, and a n3 representation does not benefit over a n2 representation; (2) a greedy heuristic approach has superior worst case times but worse best case, and n3 representations sees great benefits over n2 representations. A combination of n2 and n3 representations grants the best overall performance with both approaches.

  AT THIS PAGE YOU CAN DOWNLOAD THE WHOLE ESSAY. (follow the link to the next page)