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.