Sudoku puzzle becomes worldwide popular among many players in different intellectual levels.The task is to devise an algorithm that creates Sudoku puzzles in varying level of difficulty.With the analysis of the game rules,we first define the difficulty level from four aspects as: total given cells,distribution of given cells and complexity of enumerating search.By the guidance from the definition of difficulty level,the algorithm for generating puzzles is developed with the "dig-hole" strategy on a valid grid.Thus,the algorithm developed in two steps: to create a valid grid by Las Vegas algorithm,and then to generating puzzles by erasing some digits using five operators:·Determine a sequence of digging holes according to the desirable difficulty level,·Set two restrictions to guide the distribution of given cells,·Judge whether a puzzle being dug out has a unique solution by a solver built using Depth-First Search,·Add pruning technique to avoid digging an invalid cell,and·Perform propagating at a dug-out puzzle to raise the diversity of the output puzzle.Using our developed algorithm,we generate Sudoku puzzles in any five difficulty levels.The difficulty level of output puzzles can be adjusted by a desirable difficulty value input by players.The complexity of the algorithms in space and time is analyzed to demonstrate the effectiveness of the algorithms.Our main contributions in exploring the "dig-hole" strategy are summarized as following three works: to do a massive research on the sequence of digging holes and how it affects the algorithm to create a evil-level puzzle with minimal given cells,to invent a skill for judging the solution′s uniqueness of a puzzle being dug out by the reduction to absurdity,and to reduce the computational time by avoiding backtracking to an explored cell and refilling an empty cell.
[1]
Muhammad H. Alsuwaiyel,et al.
Algorithms - Design Techniques and Analysis
,
1999,
Lecture Notes Series on Computing.
[2]
T. Moon,et al.
Multiple Constraint Satisfaction by Belief Propagation: An Example Using Sudoku
,
2006,
2006 IEEE Mountain Workshop on Adaptive and Learning Systems.
[3]
Wei-Meng Lee.
Programming Sudoku (Technology in Action)
,
2006
.
[4]
Julian Togelius,et al.
Product Geometric Crossover for the Sudoku Puzzle
,
2006,
2006 IEEE International Conference on Evolutionary Computation.
[5]
Timo Mantere,et al.
Solving, rating and generating Sudoku puzzles with GA
,
2007,
2007 IEEE Congress on Evolutionary Computation.