• 沒有找到結果。

Future Work

在文檔中 2008mcmsolutions (頁 158-164)

values that we use; they were empirically generated. We maintain that they are informative but acknowledge that they could be changed to yield different outcomes.

Table 2.

Parameter values chosen for our metric. The first three represent the difficulty of the puzzle, and the last four are scaling and shift parameters.

Parameter α β γ δ σ A B

Value 0.1 0.5 15 0.5 1 0.25 10

In analyzing our metric, we found some puzzles that are scored reason-ably and some that are scored outrageously. Our generator gave us a puzzle rated .85 that had no oracle visits. Suspicious of our metric, one member of our team tried solving the puzzle. He did so in less than 7.5 min, even though a photographer interrupted him to take pictures of the team. This discovery caused us to realize that perhaps our parameters do not mean what we thought they did. Our intent in weighting naked singles posi-tively was to make our metric say that nearly-completely-filled-in puzzles are easier than sparsely-filled-in puzzles. We considered the average num-ber of singles per scan rather than the total numnum-ber because we wanted to somehow include the number of iterations in our metric. However, with our current parameter values, our metric says that a puzzle with a high number of singles per scan is easier than a puzzle with a low number of singles per scan, which is wrong and not what we intended. Parametersα andβ should probably be negative, or else we should change whatN and H mean.

mine better parameter values for our scoring function and the best places to insert difficulty breaks. A slightly different scoring function, perhaps one that directly considers the number of iterations needed to solve the Sudoku puzzle, could be a more accurate measure.

Alternatively, we would like to devise a scoring function that distin-guishes puzzles that can be solved using only the singles techniques vs.

others.

There is a much larger set of techniques that Sudopedia refers to as the Simple Sudoku Technique Set (SSTS) that advanced solvers consider triv-ial. If we were to add another layer to our model, so that we first did as much as possible with singles, then applied the rest of the SSTS and only went to the oracle when those techniques had been exhausted, it could give a better delineation of “medium-level” puzzles. If there were a threshold score dividing puzzles solvable by SSTS and puzzles requiring the oracle, it would allow advanced solvers to determine which puzzles they would find interesting.

Another extension would be altering the oracle to eliminate possible cell candidate(s) rather than reveal a new cell. This alteration could potentially allow for greater differentiation among the hardest puzzles.

Conclusion

We devised a metric which uses an oracle to model techniques em-ployed by the Sudoku community. This approach has the advantage of not depending on a specific set of techniques or any particular hierarchy of them. The large number of parameters in our scoring function leaves it open to adjustment and improvement.

In addition, we developed an algorithm to generate puzzles with unique solutions across a wide range of difficulties. It tends towards creating easier puzzles.

There is an increasing demand for more Sudoku puzzles, different puz-zles, and harder puzzles. We hope that we have contributed insights into its levels of difficulty.

References

Ajanki, Antti. 2006. Dancing links Sudoku solver. Source code available online athttp://users.tkk.fi/~aajanki/sudoku/index.html. Eppstein, David. 2005. Nonrepetitive paths and cycles in graphs with

ap-plication to sudoku. http://arxiv.org/abs/cs/0507053v1.

Felgenhauer, Frazer, and B. Jarvis. 2006. Mathematics of Sudoku I.

http://www.afjarvis.staff.shef.ac.uk/sudoku/.

Knuth, Donald E. 2000. Dancing links. In Millenial Perspectives in Com-puter Science, 187–214.http://www-cs-faculty.stanford.edu/~uno/

preprints.html.

Simonis, Helmut. 2005. Sudoku as a constraint problem. In Mod-elling and Reformulating Constraint Satisfaction, edited by Brahim Hnich, Patrick Prosser, and Barbara Smith, 13–27.http://homes.ieu.edu.tr/

~bhnich/mod-proc.pdf#page=21.

Solving technique. http://www.sudopedia.org. Accessed 16 Feb 2008, then last modified 11 Jan 2008.

van der Werf, Ruud. 2007. SudoCue—home of the Sudoku addict.

http://www.sudocue.net.

Wikipedia. 2008a. Mathematics of Sudoku. http://en.wikipedia.org/

wiki/Mathematics_of_Sudoku.

. 2008b. Sudoku. http://en.wikipedia.org/wiki/Sudoku.

Frederick Johnson, Sarah Fletcher, David Morrison, and advisor Jon Jacobsen.

Difficulty-Driven Sudoku Puzzle Generation

Martin Hunt Christopher Pong George Tucker

Harvey Mudd College Claremont, CA

Advisor: Zach Dodds

Summary

Many existing Sudoku puzzle generators create puzzles randomly by starting with either a blank grid or a filled-in grid. To generate a puzzle of a desired difficulty level, puzzles are made, graded, and discarded until one meets the required difficulty level, as evaluated by a predetermined difficulty metric. The efficiency of this process relies on randomness to span all difficulty levels.

We describe generation and evaluation methods that accurately model human Sudoku-playing. Instead of a completely random puzzle genera-tor, we propose a new algorithm, Difficulty-Driven Generation, that guides the generation process by adding cells to an empty grid that maintain the desired difficulty.

We encapsulate the most difficult technique required to solve the puzzle and number of available moves at any given time into a rounds metric. A round is a single stage in the puzzle-solving process, consisting of a single high-level move or a maximal series of low-level moves. Our metric counts the numbers of each type of rounds.

Implementing our generator algorithm requires using an existing met-ric, which assigns a puzzle a difficulty corresponding to the most difficult technique required to solve it. We propose using our rounds metric as a method to further simplify our generator.

Figure 1. A blank Sudoku grid.

Introduction

Sudoku first appeared in 1979 in Dell Pencil Puzzles & Word Games under the name “Number Place” [Garns 1979]. In 1984, the puzzle migrated to Japan where the Monthly Nikolist began printing its own puzzles entitled

“Suuji Wa Dokushin Ni Kagiru” or “the numbers must be single”—later shortened to Sudoku [Pegg Jr. 2005]. It was not until 2005, however, that this puzzle gained international fame.

We propose an algorithm to generate Sudoku puzzles at specified diffi-culty levels. This algorithm is based on a modified solver, which checks to ensure one solution to all generated puzzles and uses metrics to quantify the difficulty of the puzzle. Our algorithm differs from existing algorithms in using human-technique-based modeling to guide puzzle construction.

In addition, we offer a new grading algorithm that measures both the most difficult moves and the number of available moves at each stage of the solving process. We ran basic tests on both algorithms to demonstrate their feasibility. Our work leads us to believe that combining our generation algorithm and metrics would result in a generation algorithm that creates puzzles on a scale of difficulty corresponding to actual perceived difficulty.

Terminology

Figure 1 shows a blank 9× 9 cell Sudoku grid. In this grid, there are nine rows, nine columns, and nine blocks (3×3 disjoint cell groups defined by the thicker black lines). We use the terms:

Cell: A single unit square in the Sudoku grid that can contain exactly one digit between 1 and 9 inclusive.

Adjacent Cell: A cell that is in the same row, column or block as some other cell(s).

Hint: One of the digits initially in a Sudoku puzzle.

Puzzle: The 9×9 cell Sudoku grid with some cells containing digits (hints). The remaining cells are intentionally left empty.

Completed puzzle: The 9×9 cell Sudoku grid with all cells containing digits.

Well-posed puzzle: A Sudoku puzzle with exactly one solution (a unique completed puzzle). A Sudoku puzzle that is not well-posed either has no solutions or has multiple solutions (different completed puzzles can be obtained from the same initial puzzle).

Proper puzzle: A Sudoku puzzle that can be solved using only logical moves—guessing and checking is not necessary. All proper puzzles are well-posed. Some newspaper or magazine problems are proper puzzles We concern ourselves with proper Sudoku puzzles only.

Candidate: A number that can potentially be placed in a given cell. A cell typically has multiple candidates. A cell with only one candidate, for example, can simply be assigned the value of the candidate.

在文檔中 2008mcmsolutions (頁 158-164)

相關文件