Swordfish wrong but why?

Advanced methods and approaches for solving Sudoku puzzles

Swordfish wrong but why?

Postby NixMix » Tue Oct 25, 2005 10:59 am

Hi & hello to all!

I have some problems to understand the swordfish thing.
A description I found on this side:

http://www.su-doku.net/tech2.php
There this solution is given:
Image

But for me this solution seems to be also appropriate:
Image

But obviously the swordfish in the second picture is wrong...but why?:(
NixMix
 
Posts: 2
Joined: 25 October 2005

Postby Nick67 » Tue Oct 25, 2005 12:04 pm

Hi NixMix,

Here is the puzzle in Simple Sudoku format:

Code: Select all
 *--------------------------------------------------------------------*
 | 267    5      2679   | 127    124    247    | 8      1479   3      |
 | 1      378    278    | 237    9      6      | 5      47     24     |
 | 237    379    4      | 1237   8      5      | 1279   6      29     |
 |----------------------+----------------------+----------------------|
 | 9      178    1578   | 4      25     3      | 12     18     6      |
 | 3478   2      178    | 79     6      79     | 139    5      489    |
 | 346    34     56     | 8      25     1      | 239    49     7      |
 |----------------------+----------------------+----------------------|
 | 278    6      12789  | 129    3      289    | 4      789    5      |
 | 248    489    289    | 5      7      2489   | 6      3      1      |
 | 5      14789  3      | 6      14     489    | 79     2      89     |
 *--------------------------------------------------------------------*


I find the swordfish description at the site you mentioned to be somewhat
confusing. There is a nice alternative description here , and let me use that description to describe the problem.
You found 3 columns (3, 4, and 8), each with no more than 3 cells containing the candidate 1. (So far, so good.)
The problem with your pattern is that the cells do not share the same 3 rows. Most of the cells are in rows 1,4 and 7 ...
but in column 3 there is a 1 candidate in row 5, and in column 4
there is a 1 candidate in row 3.

So the pattern is close to a Swordfish ... but not quite.
Nick67
 
Posts: 113
Joined: 24 August 2007

Postby Nick67 » Tue Oct 25, 2005 12:44 pm

Oh, and just as an aside, there is another valid Swordfish here,
based on rows: the 1's in rows 3, 5, and 7 form a Swordfish
(there are no more than 3 1's in each of these rows, and the 1's in these
rows share the same 3 columns).
Nick67
 
Posts: 113
Joined: 24 August 2007

Postby NixMix » Tue Oct 25, 2005 1:10 pm

Ah, thanks a lot for your help. I now get the point I think!:D
NixMix
 
Posts: 2
Joined: 25 October 2005

Postby Kites » Tue Oct 25, 2005 6:45 pm

Nick, referring to your two posting I have two queries:
Row 4 has 4 cells with 1s, how the only three cells in a row with the same candidate comes in to this?
Also, you Swordfish on rows 3, 5, and 7, looks very similar to the one Nix Nix was querying. Can you explain these, please, as I am, too, trying to understand Swordfish technique.
Kites
 
Posts: 48
Joined: 20 May 2005

Postby emm » Tue Oct 25, 2005 7:15 pm

Kites, are you confusing swordfish swimming across the rows with swordfish swimming down the columns?

Nix Mix was looking for one in columns 3, 4, 8 ie three or fewer 1s in those columns in the same 3 rows. Doesn't matter how many candidate 1s are actually in those rows.

Old Nick found a swordfish in rows 3, 5, and 7 ie. three or fewer 1's in those rows sharing the same 3 columns, doesn't matter how many 1s are actually in those columns.
emm
 
Posts: 987
Joined: 02 July 2005

Postby Nick67 » Tue Oct 25, 2005 8:29 pm

Hi Kites,

This is a long answer to some short questions ... sorry about that!

[Just before posting this, I noticed em's reply. As usual,
she has found a much more succinct explanation than mine!
But here is my long version anyway. And I'll get em back
some other time, for calling me Old Nick! ]

Here is the same puzzle with just the candidate 1's showing:

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


Let's do a little swordfish hunting.
Let's start with the columns. We're looking
for columns with 2 or 3 1's. (And we can
ignore the number of 1's in each row, for now).
Well, several columns meet that condition.

We need to find 3 of those columns, such that the 1's
all fall on 3 common rows.

Let's start with column 2. Column 2 and column 3
can't be part of the same swordfish: the 1's share
a total of 4 rows. Similarly for columns 2 and 4.
But next we look at columns 2 and 5. Aha! 3 commmon
rows. So we are almost there ... we need a 3rd column.
Column 7 doesn't work ... but column 8 does.
All the 1's in columns 2, 5, and 8 are confined to
3 rows: 1, 4, and 9. We have found a swordfish.
Now we can apply the swordfish rule: we can remove
all the 1's from each cell of those 3 rows, except
for the swordfish cells, with this result:

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



We were looking for swordfish based on columns ...
but we could have checked the rows instead.

Let's go back to the start:

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


We're looking for rows with 2 or 3 1's.
(We can ignore the number of 1's in the columns.)

There are several, but
we need to find 3 of those rows, such that the 1's
are all in 3 common columns.

Let's start by considering row 1. Imagine sweeping all the 1's in row
1 down through the puzzle, as a way to find other rows with
1's in common columns. Here we strike out. For example, looking
at the 1's in rows 1 and 3, they share 4 columns. And similarly
for the 1's in row 1 and any other row.

We have better luck with row 3. The 1's in rows 3 and 5 share 3 columns.
And then we sweep further down the puzzle and find row 7.
All the 1's in columns 3, 5, and 7 are confined to
3 columns: 3, 4, and 7. We have found a swordfish.

Now we can apply the swordfish rule: we can remove
all the 1's from each cell of those 3 columns, except
for the swordfish cells, with this result:

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


It's the same result as before. (But finally let me end by saying
this won't always happen: finding a swordfish based on columns
does not necessarily mean you will find one based on rows.)
Nick67
 
Posts: 113
Joined: 24 August 2007

Postby emm » Tue Oct 25, 2005 9:04 pm

Younger-than-me-Nick, I suspect your step-by-step answer is clearer than mine. Sorry for butting in - I thought it would be bedtime in Sacramento!
emm
 
Posts: 987
Joined: 02 July 2005

Postby Kites » Tue Oct 25, 2005 9:28 pm

Hi Nick, I really appreciate it you taking the time to explain swordfish in such detail. It is too late in the day for me to study it properly, but will get back to you as soon as I made sense of it.
Many thanks
Kites.
Kites
 
Posts: 48
Joined: 20 May 2005

Postby Kites » Wed Oct 26, 2005 6:25 pm

Hi Nick,
Well, at last 'The penny has dropped!' and thanks to your very clear, step by step guidance. It has also become very clear where I went wrong! I was counting Rows/Columns including the one where there was an established '1'. So when everyone else was counting three row/columns I was counting four and five, and it didn't make sense.
Anyway, I shouldn't get too excited; I was convinced I understood 'Colouring' only to find earlier this week, when I tried to put it into practice, I could not make it work. Some more homework is definitely needed there....
Thank you very much for your trouble and patience.
Kites.
Kites
 
Posts: 48
Joined: 20 May 2005

re: Swordfish

Postby Pat » Thu Nov 30, 2006 1:56 pm

    several Topics have discused Swordfish and the present Topic is not necessarily the most important - still, upon reviewing the above i find it quite distressing that at least one significant Post has evidently vanished
User avatar
Pat
 
Posts: 3645
Joined: 18 July 2005

re: vanished

Postby Pat » Sun Dec 17, 2006 1:46 pm

Pat wrote:
    i find it quite distressing that at least one significant Post has evidently vanished

        -- and Nick67 was a valued regular contributor to the forum,
        definitely not a spammer --
Son of Pappocom (2006.Nov.6) wrote:When removing members from the board (for spam, voluntary deletion, or whatever),
the users' posts are removed correctly
but the count for posts in a given thread is not decremented reliably.
User avatar
Pat
 
Posts: 3645
Joined: 18 July 2005


Return to Advanced solving techniques