The newly reborn Sudoku mania is ready to hit us ! A Sudoku puzzle (image hyperlinked to solution)
Sudoku (Japanese: 数独, sūdoku), sometimes spelled Su Doku, is a placement puzzle, also known as Number Place in the United States. The aim of the puzzle is to enter a numeral from 1 through 9 in each cell of a grid, most frequently a 9×9 grid made up of 3×3 subgrids (called "regions"), starting with various numerals given in some cells (the "givens"). Each row, column and region must contain only one instance of each numeral. Completing the puzzle requires patience and logical ability. Its grid layout is reminiscent of other newspaper puzzles like crosswords and chess problems. Sudoku initially became popular in Japan in 1986 and attained international popularity in 2005.
<script type="text/javascript"> // if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } //]]>
Introduction
The word Sudoku means "single number in an alloted place" in Japanese. The numerals in Sudoku puzzles are used for convenience; arithmetic relationships between numerals are absolutely irrelevant. Any set of distinct symbols will do; letters, shapes, or colours may be used without altering the rules (Penny Press' Scramblets and Knight Features Syndicate's Sudoku Word both use letters). Dell Magazines, the puzzle's originator, has been using numerals for Number Place in its magazines since they first published it over 25 years ago. Numerals are used throughout this article.
The attraction of the puzzle is that the completion rules are simple, yet the line of reasoning required to reach the completion may be difficult. Sudoku is recommended by some teachers as an exercise in logical reasoning. The level of difficulty of the puzzles can be selected to suit the audience. The puzzles are often available free from published sources and also may be custom-generated using software.
Rules and terminology
The puzzle is most frequently a 9×9 grid made up of 3×3 subgrids (called "regions"). Some cells already contain numbers, known as "givens". The goal is to fill in the empty cells, one number in each, so that each column, row, and region contains the numbers 1–9 exactly once. Each number in the solution therefore occurs only once in each of three "directions", hence the "single numbers" implied by the puzzle's name.
Solution methods
The 3×3 region in the top-right corner must contain a 5. By hatching across and up from 5s located elsewhere in the grid, the solver can eliminate all of the empty cells in the top-right corner which cannot contain a 5. This leaves only one possible cell (highlighted in green).
The strategy for solving a puzzle may be regarded as comprising a combination of three processes: scanning, marking up, and analysing.
Scanning
Scanning is performed at the outset and periodically throughout the solution. Scans may have to be performed several times in between analysis periods. Two basic techniques comprise scanning:
- Cross-hatching: the scanning of rows (or columns) to identify which
line in a particular region may contain a certain number by a process of elimination. This process is then repeated with the columns (or rows). For fastest results, the numbers are scanned in order of their frequency. It is important to perform this process systematically, checking all of the digits 1–9.
- Counting 1–9 in regions, rows, and columns to identify missing
numbers. Counting based upon the last number discovered may speed up the search. It also can be the case (typically in tougher puzzles) that the value of an individual cell can be determined by counting in reverse — that is, scanning its region, row, and column for values it cannot be to see which is left.
Advanced solvers look for "contingencies" while scanning — that is, narrowing a number's location within a row, column, or region to two or three cells. When those cells all lie within the same row (or column) and region, they can be used for elimination purposes during cross-hatching and counting (Contingency example at Puzzle Japan). Particularly challenging puzzles may require multiple contingencies to be recognized, perhaps in multiple directions or even intersecting — relegating most solvers to marking up (as described below). Puzzles which can be solved by scanning alone without requiring the detection of contingencies are classified as "easy" puzzles; more difficult puzzles, by definition, cannot be solved by basic scanning alone.
Marking up
Scanning comes to a halt when no further numbers can be discovered. From this point, it is necessary to engage in some logical analysis. Many find it useful to guide this analysis by marking candidate numbers in the blank cells. There are two popular notations: subscripts and dots. In the subscript notation the candidate numbers are written in subscript in the cells. The drawback to this is that original puzzles printed in a newspaper usually are too small to accommodate more than a few digits of normal handwriting. If using the subscript notation, solvers often create a larger copy of the puzzle or employ a sharp or mechanical pencil. The second notation is a pattern of dots with a dot in the top left hand corner representing a 1 and a dot in the bottom right hand corner representing a 9. The dot notation has the advantage that it can be used on the original puzzle. Dexterity is required in placing the dots, since misplaced dots or inadvertent marks inevitably lead to confusion and may not be easy to erase without adding to the confusion. Using a pencil would then be recommended.
Analysing
There are two main analysis approaches — elimination and what-if.
- In elimination, progress is made by successively eliminating
candidate numbers from one or more cells to leave just one choice. After each answer has been achieved, another scan may be performed — usually checking to see the effect of the latest number. There are a number of elimination tactics. One of the most common is "unmatched candidate deletion". Cells with identical sets of candidate numbers are said to be matched if the quantity of candidate numbers in each is equal to the number of cells containing them. For example, cells are said to be matched within a particular row, column, or region if two cells contain the same pair of candidate numbers (p,q) and no others, or if three cells contain the same triplet of candidate numbers (p,q,r) and no others. These are essentially coincident contingencies. These numbers (p,q,r) appearing as candidates elsewhere in the same row, column, or region in unmatched cells can be deleted. This also works with subsets -- if three cells have candidates (p,q,r), (p,q) and (q,r), or even (p,r), (q,r) and (p,q), all of the set (p,q,r) in the same row, column or region can be deleted.
- In the what-if approach, a cell with only two candidate numbers is
selected and a guess is made. The steps above are repeated unless a duplication is found, in which case the alternative candidate is the solution. In logical terms, this is known as reductio ad absurdum. Nishio
is a limited form of this approach: for each candidate for a cell, the question is posed: will entering a particular number prevent completion of the other placements of that number? If the answer is yes, then that candidate can be eliminated. The what-if approach requires a pencil and eraser. This approach may be frowned on by logical purists as too much trial and error but it can arrive at solutions fairly rapidly.
Ideally one needs to find a combination of techniques which avoids some of the drawbacks of the above elements. The counting of regions, rows, and columns can feel boring. Writing candidate numbers into empty cells can be time-consuming. The what-if approach can be confusing unless you are well organised. The proverbial Holy Grail is to find a technique which minimises counting, marking up, and rubbing out.
Computer solutions
For computer programmers it is relatively simple to build a backtracking search. Typically this would assign a value (say, 1, or the nearest available number to 1) to the first available cell (say, the top left hand corner) and then move on to assign the next available value (say, 2) to the next available cell. This continues until a duplication is discovered in which case the next alternative value is placed in the last field changed. Although far from computationally efficient, this method will find the solution, given sufficient computation time; a standard 9×9 puzzle can typically be "solved" within minutes on a modern home computer running this algorithm. A more efficient program could keep track of potential values for cells, eliminating impossible values until only one value remains for a cell, then filling that cell in and using that information for more eliminations, and so on until the puzzle is solved. This more closely emulates the way a human would solve the puzzle without resorting to guesses.
Coding the search for impossibilities based on contingencies and even multiple contingencies (as would be required for the hardest of Sudoku) is quite complex to construct by hand. However, such complications are unnecessary if all the programmer wishes to do is find a solution efficiently. A more efficient way to find solutions involves the use of finite domain constraint programming. A constraint program requires the programmer only to specify the constraints on the solution (the fact that every number in each row, each column, and each 3×3 subgrid must be unique, and the provided "givens"); the finite domain solver does all the work of propagating additional information about possible values to narrow down the solution space until a unique solution is found. The self-imposed constraints of most Sudoku puzzle publishers even ensures that the backtracking search capabilities of the finite domain solver are not required.
A highly efficient way of solving such constraint problems is the Dancing Links Algorithm, by Donald Knuth. It can be shown that his method can be directly applied to solving Sudoku problems, and counting all possible solutions for most puzzles in milliseconds. This is the method now preferred by many Sudoku programmers, mainly by virtue of its speed. A very fast solver is usually required for most trial-and-error puzzle-creation algorithms.
Elaborate, hand-crafted solvers have been designed that apply scanning and marking up in a manner similar to human solvers.
Difficulty ratings
Published puzzles often are ranked in terms of difficulty. The difficulty of the puzzle depends upon how easy it is to logically determine subsequent numbers. Perhaps surprisingly, the number of givens has little or no bearing on a puzzle's difficulty. Puzzles with a minimum number of givens can be very easy to solve, and puzzles with more than the average number of givens can still be extremely difficult to solve.
Computer solvers can estimate the difficulty for a human to find the solution, based on the complexity of the rules required by the computer. This estimation is usually accurate, allowing publishers to rate their Sudoku puzzles for the right type of audience. Some online versions, like Goobix.com's Online Sudoku [1], offer up to four difficulty levels.
There are many factors that influence the difficulty of a Sudoku puzzle. A standard formula takes into account four ratings:
- Rating of fillable squares.
- Rating of squares found using the process of elimination.
- Rating of guesses that had to be done to reach the solution.
- Rating of backtraces performed in order to solve the puzzle.
The first two ratings are negative: the higher they are, the lower the difficulty will be. The last two ratings are positive, and they increase the puzzle difficulty.
Construction
It is commonly believed that Dell Number Place puzzles are computer-generated; they typically have over 30 givens placed in an apparently random scatter, some of which can possibly be deduced from other givens. They also have no authoring credits - that is, the name of the constructor is not printed with any puzzle. Wei-Hwa Huang claims that he was commissioned by Dell to write a Number Place puzzle generator in the winter of 2000; prior to that, he was told, the puzzles were hand-made. The puzzle generator was written in Visual C++, and although it had options to generate a more Japanese-style puzzle, with symmetry constraints
and fewer numbers, Dell opted not to use those features. Presumably the puzzles since then still use that program, although it is hard to tell.
Nikoli Sudoku are hand-constructed, with the author being credited beside each puzzle; the givens are always found in a symmetrical pattern. (Building a Sudoku with symmetrical givens can be achieved by determining in advance where the givens will be located, and only assigning an actual number to them as needed.) Dell Number Place Challenger (see Variants below) puzzles also list author credits. The Sudoku puzzles printed in most UK newspapers are apparently computer-generated but employ symmetrical givens, implying a more humanistic algorithm; The Guardian claims its puzzles are hand-constructed "in Japan" (they are, in fact, created by the first Japanese Sudoku
setters at Nikoli) though it does not include authoring credits. The Guardian famously claimed that because they were hand-constructed, their puzzles would contain "imperceptible witticisms" that would be very unlikely in computer-generated sudoku.
It is possible to set starting grids with more than one solution and to set grids with no solution, but such are not considered proper Sudoku puzzles; like most other pure-logic puzzles, a unique solution is expected. Great caution is required in constructing a Sudoku puzzle, as failing to recognize where a number can be logically deduced at any point in construction — regardless of how tortuous that logic may be — can result in an unsolvable puzzle when defining a future given contradicts what has already been built.
If an efficient solver is available, there is a very simple method of automatic construction: randomly add a digit to the grid, and then look for a solution. If no solution is found, remove the digit and try another. If a solution is found, look for a different solution. If there is no other solution, the starting grid is complete; otherwise, repeat this process.
Variants
Although the 9×9 grid with 3×3 regions is by far the most common, numerous variations abound: sample puzzles can be 4×4 grids with 2×2 regions; 5×5 grids with pentomino regions have been published under the name Logi-5; the World Puzzle Championship has previously featured a 6×6 grid with 2×3 regions and a 7×7 grid with six heptomino regions and a disjoint region. Even the 9×9 grid is not always standard, with Ebb regularly publishing some of those with nonomino regions. Larger grids are also possible, with Dell regularly publishing 16×16-grid Number Place Challenger puzzles and Nikoli proffering 25×25 Sudoku the Giant
behemoths. Another common variant is for the numbers in the main diagonals of the grid to also be required to be unique; all Dell Number Place Challenger puzzles are of this variant.
Five 9×9 grids which overlap at the corner regions in the shape of a quincunx is known in Japan as Gattai 5 (five merged) Sudoku. In The Times this form of puzzle is known as Samurai Su Doku. [2]
A three-dimensional Sudoku puzzle was invented by Dion Church and published in the Daily Telegraph in May 2005.
Alphabetical variations, which use letters rather than numbers, have also emerged. The Guardian calls these Godoku and describes them as "devilish". Knight Features uses the term Sudoku Word [3]. In Top Notch's Wordoku [4]
the required letters are given beneath the puzzle - once arranged they spell out a topical word between the top left and bottom right corners. This adds an extra dimension to Sudoku as it may be possible to guess what the word is, indicating what some of the unfilled cells might be.
The Code Doku[5] devised by Steve Schaefer has an entire sentence embedded into the puzzle while the Super Wordoku[6] from Top Notch embeds two 9-letter words, one on each diagonal. It is debatable as to whether the super wordoku and some (but not all) of the code dokus are true sudoku puzzles, because although they have a single valid solution, they cannot be solved entirely by sudoku logic, and the solver must rely on deducing the embedded words. Top Notch claim this as a feature designed to defeat solver programs.
Other variants common in Japanese magazines include, but are not limited to:
- Sequentially connected puzzles: several standard 9×9 puzzles are
solved consecutively. Only the first puzzle has enough givens to be solved on its own; once the first puzzle is solved, one or more numbers are transferred from its solution to the starting grid of the second, etc. In some cases, the solver must work back and forth between partially completed puzzles.
- Very large puzzles made up of multiple overlapping puzzles
(usually, but not always, 9×9s). Puzzles made up of 20 to 50 or more standard grids are not uncommon. The region of overlap varies — two 9×9s may share 9, 18, or 36 cells. Often, there are no givens in overlapped areas.
- Otherwise standard puzzles in which each cell is a member of four
groups rather than the normal three (rows, columns, and regions): digits with the same relative location within their respective regions must not match. Such puzzles are usually printed in colour, with each disjoint group sharing one colour for clarity.
The 2005 U.S. qualifier for the World Puzzle Championship includes a variant called Digital Number Place: rather than givens, most cells contain a partial given — a segment of a number, with the numbers drawn as if part of a seven-segment display.
On 31 August 2005, The Times started publishing what it branded as Killer Su Doku, or Samunamupure (meaning sum number place), where instead of individual starting numbers, squares are grouped and the sum of the values is given, adding an extra layer of complexity and further dependencies to track, although it can also assist, by providing further constraints on the numbers that can be placed. Aside from this the normal Su Doku rules apply. Easy versions have "groups" of one square, which is basically giving the value, as in standard Su Doku.
Mathematics of Sudoku
The general problem of solving Sudoku puzzles on n2 x n2 boards of n x n blocks is known to be NP-complete [7]. This gives some indication of why Sudoku is hard to solve, although on boards of finite size the problem is finite and can be solved by a deterministic finite automaton that knows the entire game tree.
Solving Sudoku puzzles can be expressed as a graph colouring problem. The aim of the puzzle in its standard form is to construct a proper 9-colouring of a particular graph, given a partial 9-colouring. The graph in question has 81 vertices, one vertex for each cell of the grid. The vertices can be labelled with the ordered pairs , where x and y are integers between 1 and 9. In this case, two distinct vertices labelled by and are joined by an edge if and only if:
The puzzle is then completed by assigning an integer between 1 and 9 to each vertex, in such a way that vertices that are joined by an edge do not have the same integer assigned to them.
A valid Sudoku solution grid is also a Latin square. There are significantly fewer valid Sudoku solution grids than Latin squares because Sudoku imposes the additional regional constraint. Nonetheless, the number of valid Sudoku solution grids for the standard 9×9 grid was calculated by Bertram Felgenhauer in 2005 to be 6,670,903,752,021,072,936,960 [8] (sequence A107739 in OEIS). This number is equal to 9! × 722 × 27 × 27,704,267,971, the last factor of which is prime. The result was derived through logic and brute force computation. The derivation of this result was considerably simplified by analysis provided by Frazer Jarvis and the figure has been confirmed independently by Ed Russell. Russell and Jarvis also showed that when symmetries were taken into account, there were 5,472,730,538 solutions [9] (sequence A109741 in OEIS). The number of valid Sudoku solution grids for the 16×16 derivation is not known.
The maximum number of givens that can be provided while still not rendering the solution unique, regardless of variation, is four short of a full grid; if two instances of two numbers each are missing and the cells they are to occupy are the corners of an orthogonal rectangle, and exactly two of these cells are within one region, there are two ways the numbers can be added. The inverse of this — the fewest givens that render a solution unique — is an unsolved problem, although the lowest number yet found for the standard variation without a symmetry constraint is 17, a number of which have been found by Japanese puzzle enthusiasts [10] [11], and 18 with the givens in rotationally symmetric cells.
History
Originally called simply Number Place, the first puzzle was created by Howard Garnes, a freelance puzzle constructor, in 1979. The puzzle was first published in New York in the late 1970s by the specialist puzzle publisher Dell Magazines in its magazine Dell Pencil Puzzles and Word Games, under the title Number Place. The puzzle was introduced in Japan by Nikoli in the paper Monthly Nikolist in April 1984 as "Sūji wa dokushin ni kagiru
(数字は独身に限る)", which can be translated as "the numbers must be single" or "the numbers must occur only once" (独身 literally means "single; celibate; unmarried"). The puzzle was named by Kaji Maki (鍜治 真起), the president of Nikoli. At a later date, the name was abbreviated to Sudoku (数独, pronounced sue-do-koo; sū = number, doku = single); it is a common practice in Japanese to take only the first kanji of compound words to form a shorter version. In 1986, Nikoli introduced two innovations which guaranteed the popularity of the puzzle: the number of givens was restricted to no more than 30 and puzzles became "symmetrical" (meaning the givens were distributed in rotationally symmetric cells). It is now published in mainstream Japanese periodicals, such as the Asahi Shimbun. Within Japan, Nikoli still holds the trademark for the name Sudoku; other publications in Japan use alternative names.
In 1989, Loadstar/Softdisk Publishing published DigitHunt on the Commodore 64, which was apparently the first home computer version of Sudoku. At least one publisher still uses that title.
Yoshimitsu Kanai published his computerized puzzle generator under the name Single Number (the English translation of 'sūdoku') for the Apple Macintosh [12] in 1995 in Japanese and English, and in 1996 for the Palm (PDA) [13].
Bringing the process full-circle, Dell Magazines, which publishes the original Number Place puzzle, now also publishes two Sudoku magazines: Original Sudoku and Extreme Sudoku. Additionally, Kappa reprints Nikoli Sudoku in GAMES Magazine under the name Squared Away; the New York Post, USA Today, and San Francisco Chronicle now also publish the puzzle. It is also often included in puzzle anthologies, such as The Giant 1001 Puzzle Book (under the title Nine Numbers).
Popularity in the media
In 1997, retired Hong Kong judge Wayne Gould, 59, a New Zealander, was enticed by seeing a partly completed puzzle in a Japanese bookshop. He went on to develop a computer program that spontaneously produces puzzles; this took over six years. Knowing that British newspapers have a long history of publishing crosswords and other puzzles, he promoted Sudoku to The Times in Britain, which launched it on 12 November 2004. The puzzles by Pappocom, Gould's software house, have been printed daily in the Times ever since.
Three days later The Daily Mail began to publish the puzzle under the name "Codenumber". The Daily Telegraph introduced its first Sudoku by its puzzle compiler Michael Mepham on 19 January 2005 and other Telegraph Group newspapers took it up very quickly. Nationwide News Pty Ltd began publishing the puzzle in The Daily Telegraph of Sydney on 20 May 2005; five puzzles with solutions were printed that day. The immense surge in popularity of Sudoku in British newspapers and internationally has led to it being dubbed in the world media in 2005 variously as "the Rubik's cube of the 21st century" or the "fastest growing puzzle in the world".
There is no doubt that it was not until The Daily Telegraph introduced the puzzle on a daily basis on 23 February 2005 with the full front-page treatment advertising the fact, that the other UK national newspapers began to take real interest. The Telegraph continued to splash the puzzle on its front page, realizing that it was gaining sales simply by its presence. Until then the Times had kept very quiet about the huge daily interest that its daily Sudoku competition had aroused. That newspaper already had plans for taking advantage of their market lead, and a first Sudoku book was already on the stocks before any of the other national papers had realised just how popular Sudoku might be.
By April and May 2005 the puzzle had become popular in these publications and it was rapidly introduced to several other national British newspapers including The Independent, The Guardian, The Sun (where it was labelled Sun Doku), and The Daily Mirror. As the name Sudoku became well-known in Britain, the Daily Mail adopted it in place of its earlier name "Codenumber". Newspapers competed to promote their Sudoku puzzles, with The Times and the Daily Mail each claiming to have been the first to feature Sudoku, and The Guardian claiming (though perhaps ironically) that its hand-made puzzles, licensed from Nikoli, offered a superior experience (complete with "almost imperceptible witticisms") to the computer-generated grids found in other papers.
The rapid rise of Sudoku from relative obscurity in Britain to a front-page feature in national newspapers attracted commentary in the media (see References below) and parody (such as when The Guardian's G2 section advertised itself as the first newspaper supplement with a Sudoku grid on every page [14]). Sudoku became particularly prominent in newspapers soon after the 2005 general election
leading some commentators to suggest that it was filling the gaps previously occupied by election coverage. A simpler explanation is that the puzzle attracts and retains readers — Sudoku players report an increasing sense of satisfaction as a puzzle approaches completion. Recognizing the different psychological appeals of easy and difficult puzzles The Times introduced both side by side on 20 June 2005. From July 2005 Channel 4 included a daily sudoku game in their Teletext service (at page 142).
The world's first live TV Sudoku show, 1 July 2005, Sky One.
As a one-off, the world's first live TV Sudoku show, Sudoku Live, was broadcast on 1 July 2005 on Sky One. It was presented by the mathematician Carol Vorderman. Nine teams of nine players (with one celebrity
in each team) representing geographical regions competed to solve a puzzle. Each player had a hand-held device for entering numbers corresponding to answers for four cells. Conferring was permitted although the lack of acquaintance of the players with each other inhibited an analytical discussion. The audience at home was in a separate interactive competition. A Sky One publicity stunt to promote the programme with the world's largest Sudoku puzzle went awry when the 275 foot (84 meter) square puzzle, carved into a hillside in Chipping Sodbury, near Bristol, England, in view of the M4 motorway was found to have 1,905 correct solutions.
See also
References
|