![]() |
![]() |
|
Sudoku Puzzle IntroductionHere's a page from the extensive help system for SudokuDragon. It is displayed as a help screen when running the program. To get the full picture Download our Sudoku Dragon and see the screen in its full context. Sudoku is not a numerical puzzle, as you might suppose. Sudoku consists of a square grid to be filled in with numbers 1 to 9. Actually though, these need not be numbers and could just as well be letters or colours or shapes or whatever - as long as they are distinct things. The puzzle is simply to place these symbols in the correct place to complete the grid. There is just one simple rule controlling where you can place numbers in the grid. A symbol must occur once and only once in each group of nine grid squares. The groups of nine squares include the rows, columns and regions within the grid. Such a simple rule leads to all the amazing variability of the Sudoku puzzles. We have comprehensive information on the origins of Sudoku, Sudoku solution strategy and theory on other pages in this section.
Sudoku TerminologyFirst let's introduce the terms we will use on this web site, as not everyone uses the same convention. The whole puzzle area is called the grid, it is divided into rows (horizontal lines) and columns (vertical lines) made up of individual Sudoku squares. Rows To save confusion we use letters rather than numbers
to refer to rows and columns. The names are shown in the heading of the grid.
In this example Sudoku grid row C (capital C) is highlighted. If we used numbers
we would end up having to say things like in row 3 there is only one place for a 5 while in column 2 there are 3. Confusing isn't it?
Using letters for grid references makes it easier to follow.Columns Sudoku columns are given a lower case letter.Column e (small e) is highlighted. Using row and column letters lets us unambiguously refer to squares. For example He is row H column e, there is a 2 allocated in this Sudoku square. Regions
A region is a set of nine adjacent Sudoku squares, in this example the top left region Aa is highlighted.
The whole grid has nine regions. Some Sudoku sites use the term 'mini-grid'; 'box' or 'subgrid' for 'region' . but we think region is simpler. A region is referenced by the top-left square, so Dd is the central region. A symbol must occur once and once only in each of the regions within the grid as well as each row and column. This was one of the innovations that made Sudoku such an interesting puzzle to solve.GroupsAny one row, column or region is called a group. RulesThere is only one simple rule in Sudoku: each Sudoku group of nine squares must have a unique occurrence of each of the numbers 1 through 9.
How to Play SudokuThe process of solving a Sudoku puzzle is to fill in all the empty squares. However each square has only one solution as it must obey the Sudoku rule. Sometimes it is obvious what must go in a square while for others a great deal of mental torture is involved in working through the possibilities (it can take half an hour to solve one square!). Much like placing a single piece in a jigsaw, there must be a place to fit it in somewhere but finding the place is sometimes easy to spot and sometimes takes an age. There is no correct sequence of square allocations to make, different people have their own techniques for solving the Sudoku puzzle and will solve the squares in a different order. However, the end result is always the same, there is only one unique solution - but many ways of getting there. A number of standard 'rules' are used to solve a Sudoku puzzle. There are tutorials built into our Sudoku Dragon program demonstrating these rules. We have a whole page dedicated to Sudoku strategy containing a description of all the commonly used strategies : only choice, only square, single possibility, excluded twins, naked twins, excluded subgroup; X-Wing, X-Y Wing and even Alternate Pairs. There is a page on Sudoku theory too. You can visit our online discussion forums. Sudoku Dragon comes with tutorials that take you through the most useful solution strategies step by step. Making mistakesIf you make a mistaken allocation of a number for a Sudoku square this will make the puzzle unsolvable. At some later stage you will find an insurmountable contradiction, a symbol would have to be placed in two squares in the same row, column or region violating the Sudoku rule or else you'll find a square that can take no number at all according to the rule. To correct the mistake you need to backtrack through the allocations that you have made until you find the one in error. Often it's because you overlooked another possibility for a square and thought it was the only choice. Sudoku Dragon helps with this as it immediately alerts you when a puzzle becomes unsolvable or you make an allocation that breaks the Sudoku rule. The program lets you backtrack easily to a solvable state again.
Creating PuzzlesSkill is required to create a challenging Sudoku puzzle. It is not just a matter of randomly allocating numbers to squares. Firstly, to ensure that there is only one unique solution requires that there are quite a number of initial 'exposed' squares to begin with. If there were only a handful there would be many ways to allocate all the squares - but all Sudoku puzzles can have only one, unique solution. The challenge is to reveal just enough Sudoku squares to make the solution unique and an adequate challenge. The pattern of squares can make a pleasing arrangement too, and this is taken into account when devising a puzzle. In general the more squares initially revealed the easier the puzzle will be but it is crucial to reveal just the right ones. If the revealed squares are distributed evenly the puzzle will be generally easier than if there are regions with very few filled squares. Some of the toughest puzzles have a couple of regions with no squares revealed at all, or when a number does not occur at all in the whole Sudoku grid. Solution strategies are discussed in our online forums and strategy page. When Sudoku was taken on by the Nikoli magazine in Japan they decided to add some extra spice to the original puzzle to form true Sudoku puzzles. They stipulated that the pattern of revealed squares should be symmetric. Most puzzles that you come across will have be symmetric. If you turn the puzzle on its side or upside down the pattern of initial squares is repeated (but not the numbers). Sudoku Dragon supports both symmetric and random patterns of initial squares. The random pattern can often make the games more challenging to solve though it is aesthetically appealing to look at. Sudoku Puzzle DifficultySomeone setting a Sudoku puzzle has to judge how easy it is to solve. This decision is tricky because there are so many solution strategies and different people will find puzzles more challenging thatn others. Difficulty is in the eye of the beholder - at least to some extent. The vital measure in establishing the level of puzzle difficulty is working out which Sudoku strategies need to be employed in order to solve it. The easier puzzles tend to require only the more basic only square; single possibility and only choice rules. Moderate puzzles require some application of the twin and excluded choice rules. Truly challenging puzzles require the discovery of X-Wings, X-Y Wings, alternate pairs or may be some degree of trial and error - backtracking after following a blind alley or two before the correct solution is attained. Sudoku and JigsawsThe closest puzzle to compare to Sudoku is perhaps the humble jigsaw. There are similarities both in the way it works and the pleasure gained by solving it. In a jigsaw there are lots of pieces to fit in a particular grid, there is only one solution and each piece can only go in one place. Sudoku is similar in that is a matter of putting things in the right place. If you like doing jigsaws you'll probably enjoy Sudoku too. To solve a jigsaw everyone has their own personal strategy. Most people will hunt and separate the edge pieces and then join these up before tackling pieces with distinct markings and then join these up. When nearing the completion of a jigsaw, particularly with problem areas like large expanses of clear blue sky, you may look out for pieces of a particular shape and size. There are different strategies to apply depending on the completeness of the picture and that makes jigsaws interesting. In Sudoku there are also strategies that you use at different stages of solving the puzzle. Some of these can become a tough trial and error process just like a jigsaw. The joy of successfully completing a jigsaw is akin to that of solving a Sudoku puzzle, when the final square has been filled in, the satisfaction of correct completion is like stepping back to enjoy the whole picture when the final piece has been placed in a jigsaw. Everything is in its proper place.
Varieties of SudokuWith such a simple rule you can apply the same idea in lots of different ways. First of all you can change the size of the grid. Using the standard 9x9 grid is only one option. The simpler 4x4 grid is useful for learning the basics of Sudoku and we use it in our tutorials within Sudoku Dragon. There are only four symbols and four regions to consider, but 4x4 never makes a hard puzzle. Stepping up the other way 16x16 makes a big challenge, because there are 16 squares and 16 possibilities for each square. It is not possible to use just digits but the letters 'A' through 'I' or hexadecimal digits will do admirably. Sudoku Dragon supports puzzles of this size. It's of course possible to increase the sudoku grid size further to 25x25 and then 36x36 and so on, but 16x16 with a total of 256 squares to complete is challenging enough. After that the level of complexity the puzzle has too many possibilities to carry around in the average sized head. You can also make the regions making up the grid rectangular rather than square. The Sudoku Dragon supports seven rectangular grids including: 2x3 grid (about the most common rectangular size you will find) and the 4x5 monster sized grid. Our Theme and Variations describes a number of different forms of Sudokus with example grids. Some newspapers print super-sudokus with overlapping 3x3 puzzles so that one region of the grid is shared by a central 3x3 grid. These are time consuming but rewarding when solved. Here's an example of 2x5 rectangles making up a 10x10 puzzle.
How many possible puzzles?As there are so many Sudokus printed these days, surely all the possible grids have now been solved? Well you may think so. After a little thought it is clear there are quite a few new puzzles left and we are unlikely to run out in the near future. For each row in isolation there are 9! (shorthand for nine factorial) possible permutations of numbers to Sudoku squares which gives 362,880 possible orderings just for one row. Each of these rows can be combined with 8 other rows, and temporarily ignoring the Sudoku rule for columns there would be 9! to the power 9 which works out to be about 10 to the power 50 possible grids (that's 10 with 50 noughts after it). 109,110,688,415,571,316,480,344,899,355,894,085,582,848,000,000,000 However applying the Sudoku rule for columns reduces this substantially. Just considering unique solutions for rows and columns and not regions knocks this down as there are now having assigned the first row only 8 options to choose from for each square in the 2nd row and 7 for the second etc. so this gives a much smaller number. Taking into account regions will also knock out possibilities in a more complicated way. Fortunately some clever people have used super sized calculators to do the maths and claim there are 6,670,903,752,021,072,936,960 unique Sudoku grids of size 9x9. That's plenty to be getting on with. But if you then start determining symmetries including rotations and swaps then the number of 'effectively different' puzzles
reduces to 5,472,730,538. These puzzles would show up as requiring different strategies to be used for their solution. Solution StrategiesThere are very few strategies that you need to know in order to solve Sudoku puzzles. Take a look at our sudoku introduction page for background on terminology and also our theory page. SudokuDragon comes with a range of tutorials that take you through these strategies step by step. We also have a discussion area on our strategy message board. Only choice ruleThere may be only one possible choice for a particular Sudoku square. In the simplest case you have a group (row, column or region) that has eight squares allocated leaving only one remaining choice available. So this number must go in that empty square.
Single possibility ruleWhen you look at individual squares you will often find that there is only one possiblity left for the square. If there eight squares solved in the group then this is just the same as the only choice rule. However because of the way that groups intersect you may have a group with more than one unallocated square and yet only one possibility exists for one of the squares. So there is no choice, the number must go in that square.
Only square ruleOften you will find a group of Sudoku squares where only one of the squares can take a particular number. For example if a group has seven squares allocated with only two numbers left to allocate it is often the case that an intersecting (or shared) group will mean that a number can not go in one of these two squares and so it must go in the other one. You are left with an 'only square' for a number to go in.
You will often find that the same square can be solved by the 'single possibility' rule as well as the 'only square' rule. It doesn't matter which rule you choose, it depends which one you find easiest. Note: Whenever there are eight allocated in a group with only one remaining empty you can assign a symbol by applying either the 'only choice', 'single possibility' or 'only square' rules as all of them imply the same thing. It is a key feature of Sudoku that it can be solved in several ways using different strategies. Two out of three ruleOne of the most useful solution strategies involves a special form of the Only Square rule. Some Sudoku authors refer to it as 'slicing and slotting'. It is a quick way of spotting squares to solve as it can be easily done in your head by scanning the puzzle grid. It almost always finds a square or two you can immediately solve. At the heart of the technique is to take groups of three rows and columns in turn, working methodically through the whole grid. First look for all the 1s then all the 2s, 3s etc. all the way through to 9. Here's an example of how it works, for more details look at our 2 out of 3 strategy page or download our puzzle solver and take the free tutorial for this topic.
You can then look at the 2s in these three sets of three rows. In rows A; B; C there are '2's in Ai and Cb so there is a '2' missing in row B, but in this case there are three unallocated squares Bd; Be and Bf so it can't be quickly decided in which one the '2' should go. The same happens in rows D; E; F there are two '2's but both Ed and Ef are possible. Finally in G; H; I there are two '2's Gg and Hc and so there is a '2' missing in row I. The existing '2's mean there is only one place it can go - square Id. You can then continue this scan through all rows then all columns in groups of three and then through all the numbers '1' to '9' whenever you find a square you can allocate this may unlock other squares so it is usually worth starting again for the whole grid.
To download this puzzle
The general strategy is to scan rows and columns in groups of three and look to see where if anywhere the number being scanned has been allocated. If you find two out of the three then you know that the missing number can only go in only one of three squares in this row (or column), and more often than not only one of these is possible and must be allocated there. It will find some squares that you could also have found using the only choice, only square and single possibility rules. When using the Sudoku Dragon software you can use the automatic allocation feature to automatically find and solve squares that can be solved with the 'only choice', 'single possibility' and 'only square' rules, leaving you free to concentrate on solving the harder squares. Sub-group exclusion ruleMore rarely needed in Sudoku, but exceptionally useful is the sub-group exclusion rule. This takes more explanation as instead of 'forcing' an allocation of a number to a particular square, it is an application of logic that 'excludes' possibilities that at first sight look possible. By excluding one possibility for a square may mean another possibility can then be safely assigned there as it was the only other alternative. Here's an example of the use of the sub-group rule.
A sub-group is a term used here to describe three squares in a row or column that intersect a Sudoku region. Every row and column has three sub-groups in the three regions it crosses. In this example the region Aa has been color coded to show the three subgroups it forms with columns a; b and c. The three pink squares are the sub-group intersecting region Aa and column a; the yellow squares the sub-group with column b and the green ones the sub-group with column c. The region also has three sub-groups with the rows A; B and C. Every square in the grid belongs to two sub-groups - one for the column it is in and one for the row it is in. This strategy comes into play when you can prove that a number must only occur somewhere in a sub-group and not elsewhere in a group but it can't be directly deduced which of the three sub-group squares it must go in. The number must be placed in only within a sub-group but not elsewhere even though it may not lead to solving a specific square. It's all about narrowing down the possibilities a little. Having established an allocation can only be made within a sub-group then all other squares in the rest of that region can have this number safely excluded. Our Sudoku Dragon has a free tutorial that explains what is going on step by step.
First look at column d, you'll see that the '1' must go in the square Cd and that's the only place it can go in the region Cc. Applying the subgroup rule for the subgroup shared between column d and region Cc (highlighted in blue) means that '1' can only occur in this subgroup and can not go in any other square in the region, in this case squares Cc or Dc, so that is why '1' is shown as excluded with a dark background by the SudokuDragon puzzle solver. Moreover because Dc could only take a '1' or '4' it's now certain that '4' must be allocated here. The other subgroup we could have used in this Sudoku puzzle example is the one shared between column a and region Cb (highlighted in red). Here we can tell that '4' must be allocated in Ca as that is the only place in column a that can take it. So using the subgroup rule '4' can not go in Cb or Db, and so we can safely assign '1' to Db. Note that these 4x4 Sudoku examples do not really show the full impact of the scheme as it's impossible to have many solution strategies so the simpler rules could have been used to solve these squares much more easily.
Sudoku Dragon has highlighted quite a few possibilities in other squares that can be safely excluded using the same rule - for example the '8's in Ce and Cf and the '4's in Eg and Eh. This last example is particularly useful since square Eg is left with only one possibility with the '4' excluded, '7' must go there. Hidden Twin exclusion ruleOccasionally you may find you need to use the twin (or triplet) exclusion rule in order to solve some of the more difficult Sudoku puzzles. It is the strategy to use when simpler strategies have been applied and they don't solve any more squares. In essence it is about spotting matching patterns of possibilities in a group (row, column or region). Spotting these groups takes time and it is quite easy to make mistakes, so this is where you need pencil and paper (or the SudokuDragon puzzle solver software). In its simplest case there are two or more unallocated squares in a region and there are two numbers that can only go in the same two squares and no others. This does not help with allocating the numbers directly as the number could go in either square. However, if there is another possible number in either of the two squares then this number can be discounted as it is excluded because of the presence of a twin elsewhere in the group. It all stems from the presence of a twin. An example is the best way to get your mind around this rule.
Our Sudoku Dragon software has a free tutorial that explains twins in more detail with an animated guide. Note: The rule for twins extends to triplets too. If you find that three symbols have only three shared possible squares in a group (row, column or region) then all other possibilities in these three squares can be discounted too. And on it goes, the same sort of rule applies to quadruplets, quintuplets etc. but these are very rarely found in actual puzzles. This rule is sometimes called the hidden twin rule as the twins are not immediately evident and discovering the twin is the challenge. Naked Twin exclusion rule
The 4x4 grid has the region Ca highlighted. The 'naked twins' are located in Ca and Cb. Because these two squares have no other possibilities we know that a '2' must go in Ca and '3' in Cb or else '3' in Ca and '2' in Cb, no other valid possibility exists. So looking at square Da the naked twin rule excludes '2' from occurring here, '1' must be allocated there. For the same reason the naked twin also eliminates '2' from square Cc. General permutation ruleThe 'twin' rules are examples of a general logical property of Sudoku puzzles. To follow this you may need to look at the theory of permutations. Each group is just a permutation of the numbers 1 to 9 (for a 9x9 grid). If you can identify a group within this permutation that is restricted to the same number of squares then you have a Sudoku permutation rule. [Note: In fact the 'only square'; 'single possibility' and 'only choice' are just special cases of this general rule - the subset size is one in this case.] There are more exotic situations for application of this general rule. The twin, triplet, quadruplet rules are stated in terms of the size of the sub-group (2,3,4...) but a chain is also possible. A chain can take in any number of squares, for example if the first three squares in a group allow possibilities {1,7}; {4,7} and {1,4} we have a closed chain group of three symbols {1,4,7} this is not a twin or a triplet but the general permutation rule means that if you can spot it then 1, 4 and 7 elsewhere in the same group can be safely excluded as possibilities. X-Wing and SwordfishOne of the more complicated Sudoku strategies is the 'X-Wing' and its variant the 'Swordfish'. These rules are useful for solving the really difficult Sudoku puzzles when everything else has been tried. In looking for twins and permutations we have restricted ourselves to look at possibilities within a single group. The shared sub-group rule is an example of a rule where more than one intersecting group is used to determine possibilities. The X-Wing is similar in that it requires looking at multiple groups at once. A better name for this strategy might be 'Box' as the key feature is four squares forming the corners of a box. These squares must be the only permitted squares for that symbol in that row for one symbol (or column). This box arrangement now forms a two dimensional pairing. If the symbol spotted occurs in the top left of the box it must then occur in the bottom right square of the box. The only other alternative is if it occurs in the top right square in which case it must then occur in the bottom left square. No other option is possible for these squares and this symbol. The usefulness of this rule is that both the possible allocations put the symbol in the same two columns (or rows) involved and so knocks out possibilities anywhere else in the column (or row).
To download this puzzle
Note: The term X-Wing is probably derived from the name of Star Wars fighter which had an X shaped cross-section.
To download this puzzle
Of course, the Swordfish is not the end of the matter we can extend the logic to four interlinking pairs of possibilities and then five etc.. You'll feel a real sense of achievement if you locate a Swordfish and use it to solve a Sudoku puzzle! Further strategies are also available for fiendishly difficult puzzles. These require a lot more thought and analysis to use in 'real' rather than 'theoretical' puzzles. These are the X-Y Wing and Alternate Pair techniques, they are explained in full on our separate Advanced Strategy page. Backtracking or Trial and ErrorWhen all else fails, there is one technique that is guaranteed to always work, indeed you can solve any Sudoku puzzle just using this strategy and nothing else. It's simply a matter of working logically through all the alternatives in each square until the puzzle is solved. Because there are so many alternatives (billions) you won't want to use it too often. You start with a square and choose arbitrarily one number from the available alternative possibilities. This is a completely different type of strategy as it uses 'brute force' rather than 'logic'. It is the most contentious Sudoku solving technique and so we have a full description of it with examples on our separate guessing page. Copyright © 2005-2009 Sudoku Dragon |