Strategies for Number Puzzles of all kinds
 
 
Print Version
 
Solvers
Puzzles
Basic Strategies
Tough Strategies
Diabolical Strategies
Extreme Strategies
Depreciated Strategies
Str8ts
Other
The Logic of Sudoku
Order Str8ts Book 1
Order Now!
Order Str8ts Book 2
Order Now!
  Sword-Fish Strategy
With X-Wing we looked at a rectangle formed by four numbers at the corners. This allowed us to exclude other occurrences of that number in either the row or column. We can extend this pattern to nine cells connected by locked pairs. In the example below (concentrating on the number 5) we have three sets of locked pairs at AB, CD and EF.
They are all horizontal pairs but they also lock each vertically in a staircase fashion (I guess this inspired the name).

The vertical pairing is between AF, BD and CE.
Now, in this example we can clearly see that the green horizontal lines connect pairs of 5. Because 5 is also locked vertically the red lines represent columns where if a 5 is not on our grid of nice nodes it can be excluded. There is one such 5 on cell X (E2).

Another way of looking at it is to consider any 5 on the Sword-Fish grid. Pretending for a moment it's a real 5 the others in the row and column are repressed. What we're left with is an X-Wing. X-Wing logic then applies to exclude the 5s it can see.
Classic Sword-Fish
Classic Sword-Fish
Swordfishes come in a number of variations depending on the number of X present in the nine cells that make up a Swordfish. With an X-Wing you need candidate X in all four cells of the 2 by 2 formation, but with the 3 by 3 Swordfish formation you don't need X in every cell. The above example has 5 twice in each row and is called a 2-2-2 Swordfish. 3-3-3 Swordfis would be the fullest kind but it can be as skimpy as 2-1-2 or even 1-2-1 and other variations although 1-1-1 is probably not realistic.


The next example was recently submitted by Stephen Hotchkis and the graphic is from the solver. It is a 3-2-2 Swordfish since you can see Candidate 1 present three times in the top row and twice in rows F and G. The alignment is vertical since the eliminations are in the columns.

The yellow cells are the Swordfish cells. The green cells are those cells where 1 can be removed, which makes this an excellent example since we have six 1s that can go.

The rule for Swordfish is as follows:
When there are 1) only three possible cells for a value in each of three different rows, and 2) these cells also lie in the same columns, then all other candidates for this value in the columns can be eliminated. The reverse is true for columns instead of rows.
Swordfish Example 2
Swordfish Example 2: Load Example
A final way of considering this example is to take some cells in the formation and see what happens if you place a 1 in them. I've done this in the illustration on the right with the top row. I've placed 1 in each of the cells in the top row and because of the locked pairs they force a solution that in no instance requires the 1s in the green cells.

In the first instance a 1 in A3 removes the 1 in F3 which obliges F5 to be 1 and then G4.

In the second instance A4 removes 1 in G4 forcing 1 in F4, which through eliminations makes F3 a 1 also.
Three possible outcomes
Three possible outcomes
Lastly a 1 in A5 sets both F3 and G4 to be 1.

Onc can pick any cell in the Swordfish and trace the chain of consequences round and in no cases does a green cell1 become a required cell. We don't know which of the three instances is correct - that will be revealed later, but it does help us whittle down the candidates.

Here is a very perfect 3-3-3 Swordfish, so called because all three candidates in each column are present (that is, no solved 8s in the pattern).

Provided by Klaus Brenner who found it in the newspaper La Libre Belgique.
Perfect 3-3-3 Swordfish
Perfect 3-3-3 Swordfish: Load Example or : From the Start




 
Comments

Monday 12-Dec-2011

... by: Eric

I think my previous comment was a bit off-topic, since I explained X-Cycle here. This was caused due to the fact that a 2-2-2 swordfish is an X-Cycle as well.

I would like to suggest that this topic starts of with the 3-3-3 Swordfish to fully explain this subject and then focus on 2-2-2, 2-1-2, etc.

I also see great simillarity with naked pairs/triples and quads and wonder if swordfish detection for more than 3 rows or columns is useful.

Friday 2-Dec-2011

... by: Eric

I think the Swordfish pattern becomes visible by connecting cells A-C, B-E and D-F. This shows 3 parallel lines that show some similarity with a Swordfish.

The Swordfish method can be explained as follows:
Statement:
Number 5 is either in the cells B+C+F or in cells A+D+E.
Proof:
- If cell B would contain numer 5, then cells B and D cannot contain 5. Therefore, on row F, cell C must contain a 5 (single candidate), and at row J, cell F must contain a 5 (again: single candidate).
- If cell A would contain number 5 than cell D+E must contain a 5 for same reason.
- At row A, number 5 can only be filled in at cell A or B, and therefore, number 5 must be present in cells B+C+F or in cells A+D+E.

Based on this statement, the pairs CE, AF and BD are locked pairs as well. Since number 5 must be in cell C or E on column 2, cell X cannot contain number 5. In column 5 cell A or F must contain number 5, and at column 9 cell B or D must contain number 5. Number 5 can thus be removed from all other cells at these columns.

Next to pairs CE, AF and BD, the following pairs are also locked pairs: AC, BE, DF.
These locked pairs are not valuable for the Swordfish strategy, but (in my opinion) these locked pairs represent the Swordfish pattern and gave name to this strategy.



Monday 4-Jul-2011

... by: WLP

Re: Swordfish. Are there clues to "find' the Swordfish number? Your top/first example highlights 5 at c1, d4 and h8, and the Swordfish is based on the 5s elsewhere. Is there some significance for this? (Of course, the bottom/last example doesn't follow this approach.) I see the usefullness of this technique but spotting the correct number is difficult. Thanks!

Andrew Stuart writes:

Easiest way it to highlight the each number in the solver and see if you can spot a 3-3-3 pattern in rows or columns. 3-3-3 can mean less than 2 as well, as long as you can spot a 3x3x3 grid overall. You'll also be looking for 2x2 X-Wing and you should use those first. So you're looking for the minimum number of X in one dimension and an excess of X in the other.

Wednesday 20-Apr-2011

... by: Prasolov V.

I've got new ideas for me from this site. Thanks. But you would have more simple methods, and then last example would disappear, such as "Perfect 3-3-3 Swordfish". You have many hard strategies but you have little simple methods. It is not logical.

Wednesday 2-Mar-2011

... by: JK

Very good explanation, but could you add some more examples including the other possible Swordfish formats, 3-2-1 etc?

Monday 28-Feb-2011

... by: lec

Re: Swordfish strategy page formatting - the characters in yellow on print version of web page are printing in a light yellow, making them nearly invisible. They are not formatted the way yellow characters on your other strategy pages are (dark blue with yellow highlighting). Nit-picky, I know. (I'll save the kudo until I've actually read the pages, but predict that you deserve many. Hope this makes sense; I'm wiped at the moment, and apologize for not hunting down appropriate address for this comment.)

Friday 3-Sep-2010

... by: p davis

my comment refers to Jef's mixed Box/Row example:

any wrapped AIC chain eg.
{a = b - c = d - e = f} - a implies a 'fish'. But as far as spotting patterns and associated eliminations (swordfish in rows, eliminations in columns) it doesn't seem particularly useful, except in theory to extend the definition of SwordFish'.
Your example is:
{r9c3 = r9c4 - r78c6 = r23c6 - r1c45 = r1c3} - r9c3.
this wrapped AIC chain eliminates all non-fish candidates in columns 345.
It's just a structural coincidence that the eliminations all occur in those columns here (so I guess you could technically call the pattern a swordfish).

BTW: a Finned X-Wing is a 2 string Kite is a simple AIC chain:
a = b - c = d, where the geometry of the chain is constrained to a rectangle with a 'group' node in one corner.

Thursday 6-May-2010

... by: Trev

If you had a swordfish with a single cell in it's row (i.e. X-X-1), wouldn't that single cell be a hidden single and therefore you wouldn't need to use the swordfish strategy?

Awesome site by the way!

Andrew Stuart writes:

Its not about finding the solution to any one part of the sword-fish itself, its about eliminating candidates outside the swordfish. The '1' in the formation would be a given solution yes, for that cell: we are just reusing it to get something else.

Thursday 25-Feb-2010

... by: CS VIDYASAGAR

An excellent exposition of really advanced and difficult techniqe which many find it difficult to understand. You explained in simple and easily conprehendible manner. Thanks. Now I am confident of solving extremely difficult Sudoku puzzles using sword fish technique.


Thursday 9-Apr-2009

... by: jef

A Swordfish is not limited to rows and columns, also boxes can be involved:

. . x|x x .|. . .
. . .|. . .|. . .
. . .|. . .|. . .
-----+-----+-----
. . .|x . .|. . .
. . .|. x .|. . .
. . .|. . .|. . .
-----+-----+-----
. . .|. . .|. . .
. . .|. . .|. . .
. . x|x . .|. . .

Swordfish row 1, box[2,2] and row 9.
Is your solver finding this pattern?
Have you examples of this pattern?

Kind regards,
Jef

PS I totally agree with your remarks on J.F. Crook's paper, nothing new and not a real solution.

http://users.telenet.be/vandenberghe.jef/sudoku/

Post a Comment using Facebook...
or post a Comment or Question here...
A confirmation email will be sent to you after submitting.

Your Name

Email Address - required for confirmation (it will not be displayed here)

Your comment or question

Please enter the
letters you see:
arrow
Enter these letters
Remember me


Please keep your comments relevant to this article.
Email addresses are never displayed, but they are required to confirm your comments. When you enter your name and email address, you'll be sent a link to confirm your comment. Line breaks and paragraphs are automatically converted — no need to use <p> or <br> tags.


Article created on 11-April-2008. Views: 72939
This page was last modified on 17-August-2009, at 09:09.
All text is copyright and for personal use only but may be reproduced with the permission of the author.
Copyright Andrew Stuart @ Syndicated Puzzles Inc, 2012