Sunday, December 27, 2009

Monday, November 9, 2009

Sudoku Instructions: A Program Showing How To Solve Sudoku Puzzles

The graphics used in the previous posts in this blog have been made using the Sudoku Instructions program, which we have developed. You can obtain it from Sudoku Instructions website. The program is very user-friendly. It is designed to assist you in solving any sudoku puzzle by guiding you all the way through the solving process.
We wish you the best of luck in your Sudoku playing! Best regards, ERVICH

Saturday, November 7, 2009

Sudoku: ‘X-Wing’, ‘Swordfish’ and ‘Jellyfish’ Clarified

These more difficult methods for candidate reduction in Sudoku are based on the relationship of a candidate number with both rows and columns. The X-wing is applied for two rows and two columns, the Swordfish for three rows and three columns and the Jellyfish for four rows and four columns. For an X-wing to be present the same candidate number must be present in all four squares where the rows and columns cross each other. For swordfish and jellyfish the candidate number in question need not be present in all the squares where the columns and rows cross each other. The rather odd names of these methods may relate very faintly to the outline of the involved squares with the candidate number in question. We will understand more of these difficult methods if we start with the simplest, namely the X-wing.

Sudoku X-wing – Rows/Columns

If the same candidate number within two rows is limited to the same two columns, then that number must necessarily be in two of the four ‘crossing-squares’ where the rows and columns cross each other. Since that number can only be once in each of the two columns, the candidate number can be removed from the two columns outside the two rows. This method, which focuses on two times two squares, is called an X-wing. We do not know in which two of the four ‘crossing-squares’ the number should be placed. Either the number should be placed as indicated by the \ part of the X or as indicated by the / part of the X. The exact place would become clear later in the solving process.

This board shows an 'X-wing' for candidate number 8 (shown in blue), which forms an X-wing in squares G2, G4, I2 and I4, because in rows 2 and 4 candidate number 8 is only present in columns G and I. So, in these columns candidate number 8 must be in rows 2 and 4. Therefore in these columns candidate number 8 can be removed from the other rows, here row 3 in squares G3 and I3 (shown in red).

In the small picture you can see the final solution for this part of the board. In row 2 number 8 should be in square G2 and in row 4 number 8 should be in square I4.

Sudoku X-wing – Columns/Rows

If the same candidate number within two columns is limited to the same two rows, then that number must necessarily be in two of the four ‘crossing-squares’ (the X-wing) where the columns and rows cross each other. Since that number can only be once in each of the two rows, the candidate number can be removed from the two rows outside the two columns. We do not know in which two of the four ‘crossing-squares’ the number should be placed. Either the number should be placed as indicated by the \ part of the X or as indicated by the / part of the X. The exact place would become clear later in the solving process.

This board shows an 'X-wing' for candidate number 5 (shown in blue), which forms an X-wing in squares H3, I3, H9 and I9, because in columns H and I candidate number 5 is only present in rows 3 and 9. So, in these rows candidate number 5 must be in columns H and I. Therefore in these rows candidate number 5 can be removed from the other columns, here columns D and F in squares D9 and F9 (shown in red).

In the small picture you can see the final solution for this part of the board. In column H number 5 should be in square H3 and in column I number 5 should be in square I9.







Sudoku Swordfish - Rows/Columns

If the same candidate number within three rows is limited to the same three columns, then that number must necessarily be in three of the ‘crossing-squares’ (the ‘swordfish’) where the rows and columns cross each other. Since that number can only be once in each of the three columns, the candidate number can be removed from the three columns outside the three rows. We do not know in which three of the ‘crossing-squares’ the number should be placed, only that it cannot be in the same row or column. Their precise position would become clear later in the solving process.


This board shows a 'Swordfish' for candidate number 2 (shown in blue), which forms a swordfish in squares A5, A8, A9, E5, E8, E9, F5 and F8, because in rows 5, 8 and 9 candidate number 2 is only present in columns A, E and F. So, in these columns candidate number 2 must be in rows 5, 8 and 9. Therefore in these columns candidate number 2 can be removed from the other rows, here row 4 in squares A4 and F4 (shown in red).

In the small picture you can see the final solution for this part of the board. Number 2 should in square A9 in column A, in square E8 in column E and in square F5 in column F.

Sudoku Swordfish – Columns/Rows

If the same candidate number within three columns is limited to the same three rows, then that number must necessarily be in three of the ‘crossing-squares’ (the ‘swordfish’) where the columns and rows cross each other. Since that number can only be once in each of the three rows, the candidate number can be removed from the three rows outside the three columns. We do not know in which three of the ‘crossing-squares’ the number should be placed, only that it cannot be in the same row or column. Their precise position would become clear later in the solving process.

This board shows a 'Swordfish' for candidate number 8 (shown in blue), which forms a swordfish in squares A2, A4, C2, C5, E4 and E5, because in columns A, C and E candidate number 8 is only present in rows 2, 4 and 5. So, in these rows candidate number 8 must be in columns A, C and E. Therefore in these rows candidate number 8 can be removed from the other columns, here column F in squares F4 and F5 (shown in red).

In the small picture you can see the final solution for this part of the board. Number 8 should in square A2 in column A, in square C5 in column C and in square E4 in column E.




Sudoku Jellyfish - Rows/Columns

If the same candidate number within four rows is limited to the same four columns, then that number must necessarily be in four of the ‘crossing-squares’ (the ‘jellyfish’) where the rows and columns cross each other. Since that number can only be once in each of the four columns, the candidate number can be removed from the four columns outside the four rows. We do not know in which four of the ‘crossing-squares’ the number should be placed, only that it cannot be in the same row or column. Their precise position would become clear later in the solving process.

This board shows a 'Jellyfish' for candidate number 2 (shown in blue), which forms a jellyfish in squares D3, D5, E2, E3, E5, G2, G3, G4, H2, H4 and H5, because in rows 2, 3, 4 and 5 candidate number 2 is only present in columns D, E, G and H. So, in these columns candidate number 2 must be in rows 2, 3, 4 and 5. Therefore in these columns candidate number 2 can be removed from the other rows, here row 1 in squares D1, E1 and H1 (shown in red).

In the small picture you can see the final solution for this part of the board. Number 2 should in square D5 in column D, in square E2 in column E, in square G3 in column G and in square H4 in column H.

Sudoku Jellyfish – Columns/Rows

If the same candidate number within four columns is limited to the same four rows, then that number must necessarily be in four of the ‘crossing-squares’ (the ‘jellyfish’) where the columns and rows cross each other. Since that number can only be once in each of the four rows, the candidate number can be removed from the four rows outside the four columns. We do not know in which four of the ‘crossing-squares’ the number should be placed, only that it cannot be in the same row or column. Their precise position would become clear later in the solving process.

This board shows a 'Jellyfish' for candidate number 8 (shown in blue), which forms a jellyfish in squares D2, D3, D8, F2, F7, F8, H2, H3, H7, H8, I2, I7 and I8, because in columns D, F, H, and I candidate number 8 is only present in rows 2, 3, 7 and 8. So, in these rows candidate number 8 must be in columns D, F, H and I. Therefore in these rows candidate number 8 can be removed from the other columns, here column E in squares E2, E3 and E7 (shown in red).

In the small picture you can see the final solution for this part of the board. Number 8 should in square D3 in column D, in square F8 in column F, in square H7 in column H and in square I2 in column I.

As you have seen these methods are not very easy to use. They need access to the candidate table and even then it may be difficult to spot a jellyfish or a swordfish. The X-wing, which is the simplest of these methods, may also be rather difficult to spot. To apply these methods in practice you would have great help of a user-friendly Sudoku program.

Thursday, November 5, 2009

Sudoku: Hidden Candidates Reduction Method Clarified

In Sudoku ‘hidden’ candidates may be present in pairs, triples or quads. The candidates are ‘hidden’ if they are not alone but ‘hidden’ among other candidates in the squares. If ‘hidden’ candidates are present, those numbers must necessarily be in the squares where they are – they are linked to those squares. Therefore, any other candidates present in the squares with ‘hidden’ candidates can be removed from those squares. In the squares with ‘hidden’ candidates we do not yet know where each of the numbers should be placed, only that they collectively should be in those squares. Later in the solving process the unique position of each number will become clear. Now we will go through he method for pairs, triples and quads and give some examples.

Sudoku Hidden Pair

If the same pair of candidates are ‘hidden’ among other candidates in just two squares within a group (row, column or block), then these candidates make up a ‘hidden’ pair. Neither of the candidates must be present in any other square within the group. Thus two numbers are limited and therefore linked to those two squares. Therefore, other candidate numbers can be removed from those two squares within the group.

This board shows a 'hidden' pair (1 and 8, shown in blue) in column A in squares A7 and A9. These candidates are 'hidden' because other candidates are also present in those squares. The numbers 1 and 8 are linked to those squares. Therefore the other candidate numbers, which are present in those squares, can be removed. The candidate numbers, which can be removed (6 and 9), are shown in red.
In the small picture you can see the final solution for this part of the board. In column A number 1 should be in square A7 and number 8 in square A9.

Sudoku Hidden Triples

If the same three candidates are ‘hidden’ among other candidates in just three squares within a group (row, column or block), then these candidates make up ‘hidden’ triples. None of the candidates must be present in any other square within the group. Thus the three candidate numbers are limited to and therefore linked to those three squares. Therefore, other candidate numbers can be removed from those three squares within the group.



This board shows 'hidden' triples (1, 2 and 7, shown in blue) in row 3 in squares A3, C3 and F3. These candidates are 'hidden' because other candidates are also present in those squares. The numbers 1, 2 and 7 are linked to those squares. Therefore other candidate numbers being present in those squares can be removed. The candidate numbers, which can be removed (4 in A3, 6 in C3 and 6 and 9 in F3), are shown in red.
In the small picture you can see the final solution for this part of the board. In row 3 number 1 should be in square A3, number 2 in square C3 and number 7 in square F3.

Sudoku Hidden Quads

If the same four of candidates are ‘hidden’ among other candidates in just four squares within a group (row, column or block), then these candidates make up ‘hidden’ quads. None of the candidates must be present in any other square within the group. The three numbers are limited to and therefore linked to those four squares. Therefore, other candidate numbers can be removed from those four squares within the group.

This board shows 'hidden' quads (2, 3, 4 and 6, shown in blue) in block P in squares B2, C1, C2 and C3. These candidates are 'hidden' because other candidates are also present in those squares. The numbers 2, 3, 4 and 6 are linked to those squares. Therefore other candidate numbers being present in those squares can be removed. The candidate numbers, which can be removed (5 from C1, 7 from B2, C2 and C3 and 8 from B2, C1, C2 and C3), are shown in red.
In the small picture you can see the final solution for this part of the board. In block P number 3 should be in square B2, number 6 in square C1, number 4 in square C2 and number 2 in square C3.

This method of finding ‘hidden’ candidates in a Sudoku puzzle can be used repeatedly for candidate reduction. Thereby, more single candidates may appear making it easier to solve the Sudoku puzzle. In the next post we will go through even more elaborate methods of candidate reduction.

Thursday, October 29, 2009

Sudoku: Naked Candidates Reduction Method Clarified

In Sudoku ‘naked’ candidates may be present in pairs, triples or quads. The candidates are ‘naked’ if they are alone, i.e. not ‘hidden’ among other candidates in the squares. If ‘naked’ candidates are present those numbers must necessarily be in those squares. Therefore, those candidates can be removed the other squares within the group. In the squares with ‘naked’ candidates we do not yet know where each of the numbers should be placed, only that they collectively should be in those squares. Later in the solving process the unique position of each number will become clear. Let us go through the method for pairs, triples and quads and give some examples.

Sudoku Naked Pairs

If two squares in a group (row, column or block) have the same pair of candidate numbers and only these, then these candidates make up a ‘naked’ pair. The two numbers are linked to those two squares. Therefore, those candidate numbers can be removed from the other squares within the group.

This board shows a 'naked' pair (2 and 9, shown in blue) in column B in squares B4 and B8. These candidates are 'naked' because no other candidates are present in those squares. The numbers are therefore linked to those squares. The candidates, which can be removed from the other squares (2 from B2, B3, B6 and B9 and 9 from B2 and B9), are shown in red.
In the small picture you can see the final solution for this part of the board. In column B number 9 should be in square B4 and number 2 in square B8.

Sudoku Naked Triples

If in three squares within a group the candidates are limited to three numbers, those candidates make up ‘naked’ triples. All three candidate numbers need not be present in all three squares, but those numbers are linked to the three squares. Therefore those three candidate numbers can be removed from the other squares within the group.

This board shows 'naked' triples (3, 4, and 6, shown in blue) in block P in squares A8, B8 and C8. These candidates are 'naked' because no other candidates are present in those squares. The numbers are therefore linked to those squares. The candidates, which can be removed from the other squares (3, 4 og 6 from square A7, 3 and 6 from square B7, 4 and 6 from square C7 and 3, 4 and 6 from square A9), are shown in red.
In the small picture you can see the final solution for this part of the board. In block P number 6 should be in square A8, number 3 in square B8 and 4 in square C8.

Sudoku Naked Quads

If in four squares within a group the candidates are limited to four numbers those candidates make up ‘naked’ quads. All four candidate numbers need not be present in all four squares, but those numbers are linked to the four squares. Therefore those four candidate numbers can be removed from the other squares within the group.
This board shows 'naked' quads (2, 5, 7 and 9, shown in blue) in row 2 in squares D2, E2, F2 and H2. These candidates are called 'naked' because no other candidates are present in those squares. The candidates, which can be removed from the other squares (5 and 9 from squares A2 and G2), are shown in red.
In the small picture you can see the final solution for this part of the board. In row 2 number 7 should be in square D2, number 9 in square E2, number 2 in square F2 and number 5 in square H2.

This method of finding ‘naked’ candidates in Sudoku can be used repeatedly for candidate reduction. Thereby the solution of the Sudoku puzzle may be easier to find. Shortly we will go through other effective methods of candidate reduction.

Wednesday, October 28, 2009

Sudoku: ‘Locked’ Candidate Reduction Method Clarified

To solve a sudoku puzzle you need to fill each empty square with one of the numbers 1 to 9. In some squares there may more than one candidate number, and it may be difficult to decide which of these candidate numbers would be the correct one. The number of candidates needs to be reduced. You need to perform a 'candidate reduction’ in the sudoku puzzle. So, you should try to locate candidates, which may safely be removed from the squares. There are various methods for doing just that. A relatively easy method is to locate a ‘locked’ candidate in the sudoku puzzle. It works like this:

Sudoku Locked Candidate: Row - Block

If in a row a candidate number is confined to a single block, it is 'locked' inside the block. Since the block can only have this number once, that candidate number can be removed from the other rows within that block.
Here you can see that within row 3 candidate number 7 only occurs inside block K (blue numbers in squares E3 and F3). So, within block K number 7 is ‘locked’ in row 3. Therefore candidate number 7 can be deleted in other rows within block K, i.e. in squares D1, E1 and F1 (red numbers).
In the small picture you can see the final solution for this part of the board. Within block K number 7 should be in square F3.

Sudoku Locked Candidate: Column - Block

Similarly, if in a column a candidate number is confined to a single block, it is ‘locked’ inside the block. Since the block can only have this number once, that candidate number can be removed from the other columns within that block.

Here you can see that within column C candidate number 1 only occurs inside block P (blue number in squares C8 and C9). So, within block P number 1 is ‘locked’ in column C. Therefore, candidate number 1 can be deleted in other columns within block P, i.e. in squares A9, B7 and B8 (red numbers). In the small picture you can see the final solution for this part of the board. Within block P number 1 should be in square C9.

Sudoku Locked Candidate: Block - Row

Conversely, if within a block a candidate number is confined to one row, it is 'locked' in that row. Since the number can occur only once in the row, that candidate number can be removed from that row outside the block.

Here you can see that within block K candidate number 1 only occurs in row 1 (blue numbers in squares E1 and F1) - it is 'locked' in row 1. Therefore, outside block K candidate number 1 can be deleted in row 1, i.e. in squares G1, H1 and I1 (red numbers).
In the small picture you can see the final solution for this part of the board. Within block K number 1 should be in square E1.

Sudoku Locked Candidate: Block - Column

Similarly, if a candidate number in a block is confined to one column, it is 'locked' in that column. Since the number can occur only once in that column, that candidate number can be removed from the column outside the block.

Here you can see that within block P candidate number 7 only occurs in column A (blue number in squares A7 and A8) - it is 'locked' in column A. Therefore, in column A candidate number 7 can be deleted outside block P, i.e. in squares A4 and A5 (red numbers).
In the small picture you can see the final solution for this part of the board. Within block P number 7 should be in square A8.

By repeating finding ‘locked’ candidates in the sudoku puzzle, the number of candidates can be reduced considerably. Good luck!