Sudoku Assistant - The Sudoku Trainer and Solver


The Swordfish solving technique is an extension of the X-Wing technique. Where the X-Wing technique looks for two rows (or columns) with two candidate cells for a symbol in the same columns (or rows), the Swordfish looks for three rows (or columns) with candidate values on the same 3 columns (or rows), for a particular digit.

Although Swordfish scenarios can exist where there is no X-Wing, they are often seen as 'additional' hints where an X-Wing hint is available (e.g. in the Sudoku Assistant software).

Rather than look at a specific puzzle to demonstrate this technique, let's look at a very generic layout. Assume that the green cells are the only cells on the rows 2, 5 and 7 that can take a particular symbol value 'x'. Think of the 'a' and 'b' markings as being truth states - we don't know which will become the value x, but one or other of them does:

              x x
  a     b        
      x x     x x
        a   b    
  b         a    
x x x            

As this match is on rows, and (in this case) each row has only two candidate cells for the value x, there is strong linking between the cells on the row, indicated here with the arrows.

Just to be thorough, let's work through the possibilities here (all references to a cell position refer the green cells marked a or b only): If the top-left cell does take value x, then the bottom left cell can not be. As the only other possible location for x on row 7 is the bottom right cell must take the value x (so, is marked with an 'a'). That means the middle-right green cell can't be x, so is marked b, and again the strong-linking on the row means that the central green cell must be x, so it is marked a. All in all, then, the top-right green cell can't be x so it is marked b.
What if the top-left cell is not 'x' though? If the top-left green cell is not x, the only other cell on the row that can take the value is the top-right green cell. Because it is in the same column as the central green cell, the central cell must not be x, so the central-right cell must be x. This then leads to the bottom cell not being able to be x, so the bottom left cell on the same row must be.
Therefore, although the routes we took to prove it were different, we have shown that a and b marked cells are value 'x' and 'not x' or vice versa.

Just as with the X-Wing solution, this really means nothing if we consider the rows, as we already recognised that there were only two possible locations on each row... but when we examine the columns we see that each of the three columns with green cells on (columns 2, 5 and 7) have an 'a' and a 'b' on them. Once again, this means that no other cells in that column can hold the value x, so it can be removed... we've highlighted two cells that could have the 'x' value removed from them.

The example above shows one very specific example of a Swordfish that has two candidate cells on each of three rows, that coincide on the same three columns. But what about the introduction on this page where we said that Swordfish looks for three candidates on three rows (or columns)? Well, we can extend our consideration of the a / b logic to see what happens when we have two or three candidates on each row or column. In the following scenario, the only difference from the example above is that the row 2 has three candidate cells on instead of 2:

              x x
  a     b/c   b/d    
      x x     x x
        a/d   b/c    
  b         a    
x x x            

Because we have three possible locations for x on row 2, we no longer have the strong linkage on the row, so we will need to note a kind of dual possibility on the cell. It's a little bit complicated to go into in detail, but we can start very similarly to our original example and say; if the top-left cell (a) is x then the bottom right green cell must also be x and so must the central green cell; so in this instance all other cells not mentioned here must be b.
But, if we say that the top-left cell a is not x, then the bottom-left green cell must be, and the bottom-right cell can not be. Now, one way we can make a mental leap from this point is to realise that if the top-left and bottom-right cells are not x then we are left with an X-Wing on rows 2 and 5 on columns 5 and 7. We've indicated this connection with c and d markings... where once again c and d are mutually exclusive - one must be x and the other must not be.
So, once again when we look at the columns we see that before the '/' forward slash every column with a green cell in it has an 'a' and a 'b'. If 'a' is not x however, we consider the values after the '/' and see there is a c and d in each of the two applicable columns. Again, this confirms that there is going to be an x in those columns within the green cells, so any other possible location for x on those columns can be removed.

This kind of thinking can be extended even further to match our original description of Swordfish solving techniques (two or three candidate cells on three rows, all in three common columns).

Don't worry too much if your head is spinning by now! This is exactly the sort of thing that Sudoku Assistant was designed to help you spot! It can take quite a while to notice X-Wing and Swordfish type hints... but if you need or want them, Sudoku Assistant will get you on the money!


If you are unsure of any of the terminology we use, you may find it helpful to refer to our Glossary.

Want to Print pages in this section? You may need to select 'Print Background Colours and Images' in your browser's Page Setup dialog before you will see all the images and shading in the example grids.