Swordfish--Please explain

Advanced methods and approaches for solving Sudoku puzzles

Re: Swordfish--Please explain

Postby Kibitzer » Mon Dec 19, 2005 11:27 am

QBasicMac wrote:OK, having found a swordfish, you can now eliminate all other 5's in the columns involved.

xx5 x5x 5xx < row of swordfish
xxx xxx xxx
xx5 x5x xxx < row of swordfish

xxx xxx xxx
xx5 xxx 5xx < row of swordfish
xx5 xxx xxx <----Can eliminate that 5.

xxx xxx xxx
xxx x5x xxx <----Can eliminate that 5.
xxx xxx xxx


It seems to me that in the above example, all the true/false defining points of the swordfish for digit 5 are indeed true, except of cell r1c3. in which the candidate 5 can be eliminated in the same way as those in rows 6 and 8.
Kibitzer
 
Posts: 25
Joined: 17 September 2005

Postby Shazbot » Mon Dec 19, 2005 12:04 pm

I don't know - r1c3 could BE a 5 - they could be in r1c3, r3c5 and r5c7. I can only see that the candidates Mac has indicated can be eliminated here, without seeing the remaining candidates/filled cells.
Shazbot
 
Posts: 220
Joined: 24 September 2005

Angus' example

Postby sheila08 » Mon Dec 19, 2005 5:52 pm

Angus--

In your Swordfish example, what are the blue 5's?

Sheila
sheila08
 
Posts: 27
Joined: 08 July 2005

Re: Angus' example

Postby ronk » Mon Dec 19, 2005 7:03 pm

sheila08 wrote:Angus--

In your Swordfish example, what are the blue 5's?

Sheila

Those blue 5's are the swordfish pattern ... three rows whose candidate 5s (in combination) are located in exactly three columns.
ronk
2012 Supporter
 
Posts: 4764
Joined: 02 November 2005
Location: Southeastern USA

Postby Kibitzer » Wed Dec 21, 2005 3:49 pm

Shazbot wrote:I don't know - r1c3 could BE a 5 - they could be in r1c3, r3c5 and r5c7. I can only see that the candidates Mac has indicated can be eliminated here, without seeing the remaining candidates/filled cells.


Hi Shazbot,

Sorry I've been absent for a couple of days.

Please have a look again at Mac's above example. What you say actually is that candidates r1c3, r3c5, r5c7 and the other 4 candidates r1c5, r1c7, r3c3, r5c3, are all valid defining points of the Swordfish pattern. Is that correct?:)

Kibitzer
Kibitzer
 
Posts: 25
Joined: 17 September 2005

Postby ronk » Wed Dec 21, 2005 5:05 pm

Kibitzer wrote:Please have a look again at Mac's above example. What you say actually is that candidates r1c3, r3c5, r5c7 and the other 4 candidates r1c5, r1c7, r3c3, r5c3, are all valid defining points of the Swordfish pattern. Is that correct?

Yes.

A (non-degenerative) swordfish pattern has either two or three candidates in each row. Ignoring permutations, there are four different patterns possible :
1) all three rows have three candidates, or
2) two rows have three candidates and one row has two candidates, or
3) one row has three candidates and two rows have two candidates, or
4) all three rows have two candidates.

[edit: deleted an erroneous comment about columns]

A row/column illustration for each of the four cases:
Code: Select all

- - x | - x - | x - -         - - x | - x - | x - -   <<<<
. . * | . * . | * . .         . . * | . * . | * . .
- - x | - x - | x - -         - - x | - x - | x - -   <<<<
------+-------+-------        ------+-------+-------
. . * | . * . | * . .         . . * | . * . | * . .
- - x | - x - | x - -         - - - | - x - | x - -   <<<<
. . * | . * . | * . .         . . * | . * . | * . .
------+-------+-------        ------+-------+-------
. . * | . * . | * . .         . . * | . * . | * . .
. . * | . * . | * . .         . . * | . * . | * . .
. . * | . * . | * . .         . . * | . * . | * . .

Case 1:                       Case 2:



- - x | - x - | x - -         - - x | - x - | - - -   <<<<
. . * | . * . | * . .         . . * | . * . | * . .
- - x | - - - | x - -         - - x | - - - | x - -   <<<<
------+-------+-------        ------+-------+-------
. . * | . * . | * . .         . . * | . * . | * . .
- - - | - x - | x - -         - - - | - x - | x - -   <<<<
. . * | . * . | * . .         . . * | . * . | * . .
------+-------+-------        ------+-------+-------
. . * | . * . | * . .         . . * | . * . | * . .
. . * | . * . | * . .         . . * | . * . | * . .
. . * | . * . | * . .         . . * | . * . | * . .

Case 3:                       Case 4:

where 'x' <=> Cells of the swordfish with candidate x
      '-' <=> Cells without candidate x
      '*' <=> Cells where candidate x eliminations may be safely made
Last edited by ronk on Thu Dec 22, 2005 7:55 am, edited 5 times in total.
ronk
2012 Supporter
 
Posts: 4764
Joined: 02 November 2005
Location: Southeastern USA

Postby Animator » Thu Dec 22, 2005 12:57 am

(Perhaps this creates more confusion, perhaps not... I'll post it anyway. For simplicity I explain it using rows. It (obviously) applies to columns aswell)


Let's take a closer look at X-Wings: when do you have an X-wing? When you find 2 rows that look identical for number X. (and where there are only 2 possible cells for X on each row)

Now, the most general Swordfish would be: 3 rows that look identical for number X (and where three are 3 possible cells on each row). But that's not the correct definition.

In an attempt to explain it I'll go back to naked pairs and naked triplets.

With naked pairs you need to find 2 cell that looks exactly the same. (and have only 2 candidates.) The total number of candidates has to be 4.

But for a naked triplet you do NOT need to find 3 cells that look exactly the same (and have only 3 candidates).

You can have a naked triplet when you have a total number of 6, 7, 8 or 9 candidates. Why? Because based on other logic you can eliminate some candidates. (For example you have a naked triplet when cell 1 has candidates 4, 6 ; cell 2 has candidates: 3, 4, 6 ; and cell 3 has candidates: 3, 6. (The total number of candidates is 7 = 2 + 3 + 2).)

The same logic applies to Swordfish. Based on other logic you eliminated X as a candidate from a cell.

The easiest way out would be to (temporarily) ignore the logic that caused the elimination.

An example of doing that: the second case of ronk:

ronk wrote:--x -x- x--
..* .*. *..
--x -x- x--

..* .*. *..
--- -x- x--
..* .*. *..

..* .*. *..
..* .*. *..
..* .*. *..


How is it different from the first case? In the first case r5c3 has X as a candidate.

Why isn't it a candidate in the second case? Because some other (not given) logic made us decide that r5c3 can never be X. But is this relevant for the Swordfish?

What if we missed that particular logic? Would it invalidate the Swordfish? Ofcourse it wouldn't.

The bottom line of this post really is: if you are not sure that you found a swordfish then you should add candidates to see if you can create 3 rows that have exactly 3 candidate cells and are exactly the same (limited to number X ofcourse). (note: It's always safe to add candidates)
Animator
 
Posts: 469
Joined: 08 April 2005

Postby Kibitzer » Thu Dec 22, 2005 8:15 am

Animator,

I'm aware of your post, but can't refer to it as yet because of a former commitment to Ronk. Maybe it's a way out of the confusion, I don't know, because I have to have a closer look at it.

Anyway, for the time being, thanks a lot:D

Kibitzer
Kibitzer
 
Posts: 25
Joined: 17 September 2005

Re: Swordfish--Please explain

Postby Kibitzer » Thu Dec 22, 2005 11:58 am

Hi Ronk,

Thanks for your excellent enumeration of swordfish pattern possibilities. They all of course correspond to the known SF definition of “2 and no more than 3 candidates in a row (or if slanted 90 deg. – in a column)". Hence our fuzzy fish under consideration fits your Case No. 3.

[Edit:my mistake]
Last edited by Kibitzer on Fri Dec 23, 2005 2:14 pm, edited 4 times in total.
Kibitzer
 
Posts: 25
Joined: 17 September 2005

Re: Swordfish--Please explain

Postby Animator » Thu Dec 22, 2005 2:41 pm

Well, your previous post is wrong.

If you take this grid:

Code: Select all
xx5 x5x 5xx
xxx xxx xxx
xx5 x5x xxx

xxx xxx xxx
xx5 xxx 5xx
xxx xxx xxx

...


Then you can NOT eliminate 5 as a candidate for r1c3.

You might fail to see the logic so let's take another approach: if based on that information you decide that 5 cannot be in r1c3 then you should fill it in and see if all 3 rows can have the number 5. If they can then you can not eliminate the number 5 as candidate from r1c3.

r1c3 = 5 leads us to this grid:
Code: Select all
xx5 xxx xxx
xxx xxx xxx
xxx x5x xxx

xxx xxx xxx
xxx xxx 5xx
xxx xxx xxx


In it you see that row 1, row 3, and row 5 have the number 5. So you can not eliminate the possibility of a number 5 in r1c3. (Or atleast not by using the information the Swordfish gives you.)
Last edited by Animator on Thu Dec 22, 2005 12:12 pm, edited 1 time in total.
Animator
 
Posts: 469
Joined: 08 April 2005

Postby Kibitzer » Thu Dec 22, 2005 3:10 pm

Thanks Animator for illuminating the point.
Kibitzer
 
Posts: 25
Joined: 17 September 2005

Swordfish explanation in simple English

Postby sheila08 » Thu Dec 22, 2005 6:48 pm

Hmm--Simple English?

How do you learn to spot these fish??

Sheila

Merry Christmas to all...
sheila08
 
Posts: 27
Joined: 08 July 2005

Re: Swordfish explanation in simple English

Postby QBasicMac » Thu Dec 22, 2005 7:17 pm

sheila08 wrote:Simple English


Practice

Mac
QBasicMac
 
Posts: 441
Joined: 13 July 2005

Re: Swordfish explanation in simple English

Postby tso » Thu Dec 22, 2005 8:22 pm

sheila08 wrote:Hmm--Simple English?

How do you learn to spot these fish??

Sheila

Merry Christmas to all...


They're not usually easy to spot, especially if you don't know one is there and if you're not filtering. Puzzles that requires finding a swordfish to solve are rated "invalid" by Pappocom software.

One way to look for them is to start from the top, look for a row that has exactly two or three of the candidate in question. When you find one, look for another row below it that also has 2 or 3 of the candidate. If all these cells are in the same three columns, look for a third row below these two. (Of course, repeat using columns.)

The swordfish concept is not quite as complex as all these posts with differing ascii styles would imply. They're just hard to spot. It's a good idea to practice on puzzles that are known to contain a swordfish. They can be hard to spot at first even when you know that it is the very next logical step.


Here are three practice puzzles containing Swordfish (when solved by typical, standard methods):

ONE
This puzzle requires only simple tactics -- and one swordfish:

Code: Select all
 . . . | . 6 . | . . 3
 . . 3 | . . 9 | . 8 7
 2 . . | 5 . . | . 6 .
-------+-------+------
 6 . . | . 3 . | . 1 .
 9 3 . | . . . | . 2 6
 . 7 . | . 9 . | . . 4
-------+-------+------
 . 1 . | . . 8 | . . 5
 5 4 . | 6 . . | 8 . .
 3 . . | . 5 . | . . .


Here's where the swordfish comes in:

Code: Select all
 . . . | . 6 . | 2 . 3
 . 6 3 | . . 9 | 5 8 7
 2 . . | 5 . 3 | . 6 .
-------+-------+------
 6 . . | . 3 . | 9 1 8
 9 3 . | . . . | 7 2 6
 . 7 . | . 9 6 | 3 5 4
-------+-------+------
 7 1 . | 3 . 8 | . . 5
 5 4 . | 6 . . | 8 3 .
 3 . . | 9 5 . | . 7 .



Here are the candidate lists where the swordfish is swimming:

Code: Select all
  148   589   1578  | 1478  6     147   | 2     49    3     
  14    6     3     | 124   124   9     | 5     8     7     
  2     89    78    | 5     478   3     | 14    6     19   
 -------------------+-------------------+-------------------
  6     25    245   | 247   3     2457  | 9     1     8     
  9     3     1458  | 148   148   145   | 7     2     6     
  18    7     128   | 128   9     6     | 3     5     4     
 -------------------+-------------------+-------------------
  7     1     269   | 3     24    8     | 46    49    5     
  5     4     29    | 6     127   127   | 8     3     129   
  3     28    268   | 9     5     124   | 146   7     12   


Additional hints are at the bottom of this post.


===========================================================================

TWO

This puzzle requires some more harder tactics before the one swordfish:

Code: Select all
 . . . | 2 3 1 | . 5 .
 . 1 . | . 8 . | . 3 .
 9 . . | . . . | . . 7
-------+-------+------
 . . 9 | 4 . . | 5 . .
 . . 3 | 1 9 8 | 4 . .
 . . 6 | . . 3 | 8 . .
-------+-------+------
 4 . . | . . . | . . 5
 . 9 . | . 1 . | . 4 .
 . 8 . | 3 4 2 | . . .



Here's where the swordfish comes in:

Code: Select all
 . . . | 2 3 1 | 9 5 .
 . 1 . | . 8 . | . 3 .
 9 3 . | . . 4 | 1 . 7
-------+-------+------
 8 . 9 | 4 . . | 5 1 3
 . 5 3 | 1 9 8 | 4 . .
 1 4 6 | . . 3 | 8 . 9
-------+-------+------
 4 . 1 | . . . | 3 . 5
 3 9 . | . 1 5 | . 4 .
 . 8 . | 3 4 2 | . 9 1



Here are the candidate lists where the swordfish is swimming:

Code: Select all
  67    67    48    | 2     3     1     | 9     5     48   
  25    1     245   | 79    8     79    | 26    3     246   
  9     3     28    | 56    56    4     | 1     28    7     
 -------------------+-------------------+-------------------
  8     27    9     | 4     267   67    | 5     1     3     
  27    5     3     | 1     9     8     | 4     267   26   
  1     4     6     | 57    257   3     | 8     27    9     
 -------------------+-------------------+-------------------
  4     26    1     | 6789  67    679   | 3     268   5     
  3     9     27    | 68    1     5     | 267   4     268   
  56    8     57    | 3     4     2     | 67    9     1     


Additional hints are at the bottom of this post.


===========================================================================

THREE
This puzzle requires some more harder tactics after the one swordfish:

Code: Select all
 8 . . | . 3 . | 9 2 .
 . . . | . . 1 | . . 6
 . 2 . | 7 . . | . . 3
-------+-------+------
 . . . | . . . | 1 . 8
 5 . . | 8 . 7 | . . 2
 2 . 9 | . . . | . . .
-------+-------+------
 1 . . | . . 3 | . 7 .
 9 . . | 6 . . | . . .
 . 3 7 | . 1 . | . . 4



Here's where the swordfish comes in:

Code: Select all
 8 7 . | . 3 . | 9 2 .
 3 9 5 | 2 8 1 | 7 4 6
 4 2 . | 7 . 9 | . . 3
-------+-------+------
 7 6 4 | 3 . 2 | 1 . 8
 5 1 3 | 8 . 7 | 4 . 2
 2 8 9 | 1 4 . | . . 7
-------+-------+------
 1 . 8 | . 2 3 | 6 7 9
 9 . 2 | 6 7 . | . . .
 6 3 7 | 9 1 . | 2 . 4



Here are the candidate lists where the swordfish is swimming:

Code: Select all
  8     7     16    | 45    3     456   | 9     2     15   
  3     9     5     | 2     8     1     | 7     4     6     
  4     2     16    | 7     56    9     | 58    158   3     
 -------------------+-------------------+-------------------
  7     6     4     | 3     59    2     | 1     59    8     
  5     1     3     | 8     69    7     | 4     69    2     
  2     8     9     | 1     4     56    | 35    356   7     
 -------------------+-------------------+-------------------
  1     45    8     | 45    2     3     | 6     7     9     
  9     45    2     | 6     7     458   | 358   1358  15   
  6     3     7     | 9     1     58    | 2     58    4     


Additional hints are at the bottom of this post.

=================================================================
HINTS -- scroll down slowly so you can see just one clue at a time.

Hints for puzzle ONE:


a) The swordfish is in 2s.




b) The swordfish is in rows, eliminations in columns.




c) The swordfish is in rows 2, 6 and 7.




d) Just the 2s:

Code: Select all
  .     .     .     | .     .     .     | 2     .     .     
  .     .     .     | 2     2     .     | .     .     .     
  2     .     .     | .     .     .     | .     .     .     
 -------------------+-------------------+-------------------
  .     2     2     | 2     .     2     | .     .     .     
  .     .     .     | .     .     .     | .     2     .     
  .     .     2     | 2     .     .     | .     .     .     
 -------------------+-------------------+-------------------
  .     .     2     | .     2     .     | .     .     .     
  .     .     2     | .     2     2     | .     .     2     
  .     2     2     | .     .     2     | .     .     2   



e) The swordfish marked with '+', the eliminations marked with '-':

[EDIT: nasty typo fixed. Sorry about that.]

Code: Select all
  .     .     .     | .     .     .     | 2     .     .     
  .     .     .     |+2    +2     .     | .     .     .     
  2     .     .     | .     .     .     | .     .     .     
 -------------------+-------------------+-------------------
  .     2    -2     |-2     .     2     | .     .     .     
  .     .     .     | .     .     .     | .     2     .     
  .     .    +2     |+2     .     .     | .     .     .     
 -------------------+-------------------+-------------------
  .     .    +2     | .    +2     .     | .     .     .     
  .     .    -2     | .    -2     2     | .     .     2     
  .     2    -2     | .     .     2     | .     .     2     






Hints for puzzle TWO:


a) The swordfish is in 2s.




b) The swordfish is in rows, eliminations in columns.




c) The swordfish is in rows 4, 6 and 7.





Hints for puzzle THREE:


a) The swordfish is in 5s.




b) The swordfish is in columns, eliminations in rows.




c) The swordfish is in columns 2, 4 and 9.
Last edited by tso on Fri Dec 23, 2005 10:14 pm, edited 4 times in total.
tso
 
Posts: 798
Joined: 22 June 2005

Postby sweetbix » Fri Dec 23, 2005 11:16 am

tso wrote:Hints for puzzle ONE:

e) The swordfish marked with '+', the eliminations marked with '-':

Code: Select all
  .     .     .     | .     .     .     | 2     .     .     
  .     .     .     |+2    +2     .     | .     .     .     
  2     .     .     | .     .     .     | .     .     .     
 -------------------+-------------------+-------------------
  .     2    -2     |-2     .    -2     | .     .     .     
  .     .     .     | .     .     .     | .     2     .     
  .     .    +2     |+2     .     .     | .     .     .     
 -------------------+-------------------+-------------------
  .     .    -2     | .     2     .     | .     .     .     
  .     .    +2     | .    +2    +2     | .     .     2     
  .     2    -2     | .     .    -2     | .     .     2     


You have marked the swordfish in 4 columns instead of 3 and so the eliminations aren't quite right.

I think it should be
Code: Select all
  .     .     .     | .     .     .     | 2     .     .     
  .     .     .     |+2    +2     .     | .     .     .     
  2     .     .     | .     .     .     | .     .     .     
 -------------------+-------------------+-------------------
  .     2    -2     |-2     .     2     | .     .     .     
  .     .     .     | .     .     .     | .     2     .     
  .     .    +2     |+2     .     .     | .     .     .     
 -------------------+-------------------+-------------------
  .     .    +2     | .    +2     .     | .     .     .     
  .     .    -2     | .    -2     2     | .     .     2     
  .     2    -2     | .     .     2     | .     .     2     
sweetbix
 
Posts: 58
Joined: 10 December 2005

PreviousNext

Return to Advanced solving techniques