how to spot this pattern?

Advanced methods and approaches for solving Sudoku puzzles

how to spot this pattern?

Postby MikeF » Sat Nov 26, 2005 3:27 am

In this puzzle:

*-----------*
|...|34.|..6|
|.6.|78.|1..|
|...|.65|.72|
|---+---+---|
|.48|52.|361|
|615|.3.|72.|
|23.|61.|.8.|
|---+---+---|
|12.|47.|6..|
|..6|.9.|...|
|8..|.56|...|
*-----------*


*-----------*
|...|34.|..6|
|.6.|78.|1..|
|...|.65|.72|
|---+---+---|
|.48|52.|361|
|615|.3.|72.|
|23.|61.|.8.|
|---+---+---|
|12.|47.|6..|
|..6|.9.|...|
|8..|.56|...|
*-----------*


{579} {5789} {12} {3} {4} {12} {589} {59} {6}
{459} {6} {249} {7} {8} {29} {1} {3459} {3459}
{34} {89} {1349} {19} {6} {5} {489} {7} {2}
{79} {4} {8} {5} {2} {79} {3} {6} {1}
{6} {1} {5} {89} {3} {489} {7} {2} {49}
{2} {3} {79} {6} {1} {479} {459} {8} {459}
{1} {2} {39} {4} {7} {38} {6} {359} {3589}
{3457} {57} {6} {128} {9} {138} {24} {134} {3478}
{8} {79} {3479} {12} {5} {6} {249} {1349} {3479}

The candidate 4 in (9,8) can be eliminated. Assume it is 4. Then (9,4) is 1, and (9,7) is 2, and (8,7) is 4 -- which is impossible because there is already a 4 in that box.

Rubylips' solver program revealed this to me. Until then I was stuck.

But this should be easy to find, no? How does one spot such a pattern?
MikeF
 
Posts: 11
Joined: 07 September 2005

Re: how to spot this pattern?

Postby ronk » Sat Nov 26, 2005 5:54 am

MikeF wrote:The candidate 4 in (9,8) can be eliminated. Assume it is 4. Then (9,4) is 1, and (9,7) is 2, and (8,7) is 4 -- which is impossible because there is already a 4 in that box.

Rubylips' solver program revealed this to me. Until then I was stuck.

Something must have been lost during transcription. If r9c8=4, then r8c7=2.

[edit: Oh, it must be ...Assume it is 4. Then (9,4) is 1, and (9,7) is 2 -- which is impossible because there is already a 2 in that box at (8,7).

But to answer the question, I think it's trial and error. Focusing on grid areas with conjugate pairs and bivalued cells helps speed it up a little. Good luck speeds it up even more.:) ]
ronk
2012 Supporter
 
Posts: 4764
Joined: 02 November 2005
Location: Southeastern USA

Re: how to spot this pattern?

Postby Jeff » Sat Nov 26, 2005 7:00 am

ronk wrote:But to answer the question, I think it's trial and error. Focusing on grid areas with conjugate pairs and bivalued cells helps speed it up a little. Good luck speeds it up even more.:) ]

It can be T&E only if you want it to be. Bilocation/bivalue plot can help you to identify these types of double implication chains in a non-T&E and human executable manner.:D
Jeff
 
Posts: 708
Joined: 01 August 2005

another way to look at it

Postby bennys » Sat Nov 26, 2005 10:14 am

Code: Select all
+----------------+----------------+----------------+
| 579  5789 12   | 3    4    12   | 589  59   6    |
| 459  6    249  | 7    8    29   | 1    3459 3459 |
| 34   89   1349 | 19   6    5    | 489  7    2    |
+----------------+----------------+----------------+
| 79   4    8    | 5    2    79   | 3    6    1    |
| 6    1    5    | 89   3    489  | 7    2    49   |
| 2    3    79   | 6    1    479  | 459  8    459  |
+----------------+----------------+----------------+
| 1    2    39   | 4    7    38   | 6    359  3589 |
| 3457 57   6    | 128  9    138  |*24   134  3478 |
| 8   *79  *3479 | 12   5    6    | 249  1349*3479 |
+----------------+----------------+----------------+

I dont know if you prefer to see it that way but here it is using the almost locked sets.
A={R9C2,R9C3,R9C9}
B={R8C7}
LETS LOOK NOW ON R9C8 AND R9C7
They cant be 4,9 because of A and the cant be 4,2 because of B.
bennys
 
Posts: 156
Joined: 28 September 2005

Postby rubylips » Sat Nov 26, 2005 11:05 am

bennys,
I have nearly finished work on an artificial brain that will replicate you perfectly! Here's the output from the latest version of my solver:

Code: Select all
Consider the cell r9c7.
When it contains the value 9, the values 3, 4 and 7 in Row 9 must occupy the cells r9c2, r9c3 and r9c9 in some order.
When it contains the value 2, the value 4 in Box 9 must occupy the cell r8c7.
Whichever value it contains, the cell r9c8 cannot contain the value 4.


Unfortunately, even after this elimination the puzzle is still hard to to solve.
Just to clarify, my solver first attempts to build chains from strong links only (i.e. bilocation links - though it will connect such links at cells that have more than two values). When this fails, it will incorporate weak links. The first chain found is reported, which is generally the shortest, though this isn't necessarily the chain that leads to the most rapid solution. I quite like this method, however, as I think it replicates human techniques to a reasonable degree.
rubylips
 
Posts: 149
Joined: 01 November 2005

Re: how to spot this pattern?

Postby ronk » Sat Nov 26, 2005 12:27 pm

Jeff wrote:
ronk wrote:But to answer the question, I think it's trial and error. Focusing on grid areas with conjugate pairs and bivalued cells helps speed it up a little. Good luck speeds it up even more.:) ]

It can be T&E only if you want it to be. Bilocation/bivalue plot can help you to identify these types of double implication chains in a non-T&E and human executable manner.:D

I didn't mean "trial and error" in the sense that you're taking it. I meant that one locates a double implication chain (or whatever) at one grid location ... and if that chain doesn't result in a pin or an elimination ... then one tries a different value at that location or tries another location.
ronk
2012 Supporter
 
Posts: 4764
Joined: 02 November 2005
Location: Southeastern USA

Postby Carcul » Sat Nov 26, 2005 12:34 pm

MikeF,

You can also prove that r9c8 cannot be 4 through the following chain:

Chain 1: [r9c8]=1=[r9c4]=2=[r8c4]-2-[r8c7]-4-[r9c8].

It is also possible to perform several eliminations with the following continuous nice loop:

Chain 2: [r9c9]=7=[r8c9]=8=[r7c9]-8-[r7c6]-3-[r7c3]-9-[r9c2]-7-[r9c9],

which implies that

r8c9<>3,4;
r7c9<>3;
r7c8<>3;
r9c3<>9.

Regards, Carcul
Carcul
 
Posts: 724
Joined: 04 November 2005

Postby ronk » Sat Nov 26, 2005 12:40 pm

rubylips wrote:
Code: Select all
Consider the cell r9c7.
When it contains the value 9, the values 3, 4 and 7 in Row 9 must occupy the cells r9c2, r9c3 and r9c9 in some order.
When it contains the value 2, the value 4 in Box 9 must occupy the cell r8c7.
Whichever value it contains, the cell r9c8 cannot contain the value 4.

At the risk of sounding pedantic and suggesting verbose output for your solver ... since r9c7 is a tri-valued, for completeness sake shouldn't you include the trivial ...When it contains the value 4, ... in the report?
ronk
2012 Supporter
 
Posts: 4764
Joined: 02 November 2005
Location: Southeastern USA

Postby ronk » Sat Nov 26, 2005 12:53 pm

Carcul wrote:You can also prove that r9c8 cannot be 4 through the following chain:

Chain 1: [r9c8]=1=[r9c4]=2=[r8c4]-2-[r8c7]-4-[r9c8]


Would someone please explain that notation ... or point me to a topic that does?

I understand equals (=), not equals (<>) and implies (=>), so translate to ...
r9c8=1 => r9c4=2 => r8c4<>2 => r8c7=2
... but then I'm lost.

TIA, Ron
ronk
2012 Supporter
 
Posts: 4764
Joined: 02 November 2005
Location: Southeastern USA

Postby Jeff » Sat Nov 26, 2005 1:04 pm

ronk wrote:Would someone please explain that notation ... or point me to a topic that does?

Try here.
Jeff
 
Posts: 708
Joined: 01 August 2005

Postby Carcul » Sat Nov 26, 2005 4:53 pm

MikeF, ronk, Jeff, bennys, and rubylips:

Have someone of you found the solution to this puzzle in a straightforward way?
I found it, but, as usual, my method was too lengthy.
Could someone give me a hint?


Thanks, Carcul
Carcul
 
Posts: 724
Joined: 04 November 2005

Postby MikeF » Sat Nov 26, 2005 7:58 pm

If there is a more straighforward solution, I don't know it. I'm still pondering the very interesting replies above. Thanks for all the input.

Mike
MikeF
 
Posts: 11
Joined: 07 September 2005

Postby Jeff » Sun Nov 27, 2005 8:45 am

Carcul wrote:Could someone give me a hint?

All logical solutions are good solutions. This is not a contest. Please list your chains.:D
Jeff
 
Posts: 708
Joined: 01 August 2005

Postby rubylips » Sun Nov 27, 2005 10:59 am

ronk wrote:At the risk of sounding pedantic and suggesting verbose output for your solver ... since r9c7 is a tri-valued, for completeness sake shouldn't you include the trivial ...When it contains the value 4, ... in the report?

That's right! ... and I'd fully intended to make that change, except the opportunity to use the new bit of code cropped up before I'd fully completed development.
rubylips
 
Posts: 149
Joined: 01 November 2005

Postby Carcul » Sun Nov 27, 2005 11:22 am

Thanks Jeff. When I asked to someone give me a hint my purpose was to learn with your solutions. Nevertheless, here's how I reached the solution.
My first two chains are the ones posted above:

Chain 1: [r9c8]=1=[r9c4]=2=[r8c4]-2-[r8c7]-4-[r9c8] => r9c8<>4

Chain 2: [r9c9]=7=[r8c9]=8=[r7c9]-8-[r7c6]-3-[r7c3]-9-[r9c2]-7-[r9c9],
=> r8c9<>3,4;
r7c9<>3;
r7c8<>3;
r9c3<>9.

Now we have two Turbot Fishes:

Turbot Fish 1 (Chain3): [r1c2]-9-[r9c2]=9=[r7c3]-9-[r7c8]=9=[r1c8]-9-
[r1c2] => r1c2<>9.

Turbot Fish 2 (Chain 4): [r2c3]-4-[r9c3]=4=[r8c1]-4-[r8c8]=4=[r2c8]-4-
[r2c3] => r2c3<>4.

To complete the puzzle, I have used the following three nice loops:

Chain 5: [r9c3]=4=[r3c3]=1=[r3c4]=9=[r5c4]=8=[r5c6]-8-[r7c6]-3-
[r7c3]-9-[r9c2]-7-[r9c3] => r9c3<>7.

Chain 6: [r1c2]=8=[r3c2]=9=[r9c2]=7=[r9c9]=3=[r2c9]=5=[r2c1]-5-
[r1c2] => r1c2<>5.

Chain 7: [r7c3]=9=[r9c2]=7=[r9c9]=3=[r2c9]=5=[r2c1]-5-[r1c1]-7-
[r1c2]-8-[r3c2]-9-[r3c4]=9=[r5c4]=8=[r5c6]-8-[r7c6]-3-[r7c3]
=> r7c3<>3.

With this last conclusion, the remaining puzzle is easily solved. Although not necessary, we could also make the following deductions:

Chain 8: [r7c6]=3=[r8c6]=1=[r1c6]=2=[r2c6]=9=[r3c4]-9-[r3c2]=9=
[r9c2]-9-[r7c3]-3-[r7c6] => r8c6<>8.

Chain 9: [r3c3]=1=[r3c4]=9=[r5c4]=8=[r5c6]-8-[r7c6]-3-[r7c3]-9-[r3c3]
=> r3c3<>9.

Now, can you, Jeff and others, please post your solutions?:D

Regards, Carcul
Carcul
 
Posts: 724
Joined: 04 November 2005

Next

Return to Advanced solving techniques