Nice Loops: some exercises

Advanced methods and approaches for solving Sudoku puzzles

Postby Jeff » Sun Dec 25, 2005 8:17 pm

Carcul, I have finally completed exercise 6 with 25 nice loops and picked up a few tricks along the way. Thanks for the wonderful experience and opportunity in the exploration of these advanced nice loops.
Jeff
 
Posts: 708
Joined: 01 August 2005

Postby Bob Hanson » Mon Dec 26, 2005 12:11 am

regarding Example 6:

Code: Select all
 +-------------------+-------------------+-------------------+
 | 7    *16    45    | 2     8     16    | 3     45    9     |
 |*19    3     45    | 45    7     19    | 2     8     6     |
 |*269   29    8     | 3     45    69    | 14    7     15    |
 +-------------------+-------------------+-------------------+
 | 3     2678  267   | 17    9     4     | 5     26    128   |
 |-689   4     679   | 157   25    27    | 169   3     18    |
 |*29    5     1     | 8     6     3     | 49    249   7     |
 +-------------------+-------------------+-------------------+
 |-1689  189   269   | 49    24    5     | 7     1269  3     |
 | 4     679   3     | 69    1     27    | 8     59    25    |
 | 5     12679 2679  | 679   3     8     | 69    1269  4     |
 +-------------------+-------------------+-------------------+


An alternative analysis is by using almost-locked sets:

r5c1 ISN'T 9: weak link to almost-locked sets r1c2 and r2c1 r3c1 r6c1 mutually doubly-linked by 1,6
r7c1 ISN'T 9: weak link to almost-locked sets r1c2 and r2c1 r3c1 r6c1 mutually doubly-linked by 1,6

that is,
Code: Select all
        .1
       .  \
      1    6
      |   .
  2---+--6
      |
      9....9*

  9* may be eliminated


But now I have a different problem.
I've added "strong sets" to Sudoku Assistant to advance Exercise 6.
This involves recognizing that strong chains might have "nodes" that
involve more than one mark. But now it's stuck at:
Code: Select all
  |---c1--|---c2--|---c3--||---c4--|---c5--|---c6--||---c7--|---c8--|---c9--
-----------------------------------------------------------------------------
r1 |     7 |   156 |   456 ||     2 |    48 |    16 ||     3 |   458 |     9
---+-------+-------+-------||-------+-------+-------||-------+-------+-------
r2 |    19 |     3 |    45 ||  1458 |     7 |   149 ||     2 |    58 |     6
---+-------+-------+-------||-------+-------+-------||-------+-------+-------
r3 |   269 |   269 |     8 ||     3 |    45 |    69 ||    14 |     7 |    15
===========================||=======================||=======================
r4 |     3 |  2678 |   267 ||  1478 |     9 |  1247 ||     5 |   126 |   128
---+-------+-------+-------||-------+-------+-------||-------+-------+-------
r5 |  2689 |     4 | 25679 ||  1578 |   258 |   127 ||   169 |     3 |   128
---+-------+-------+-------||-------+-------+-------||-------+-------+-------
r6 |   289 |   258 |     1 ||    58 |     6 |     3 ||    49 |   249 |     7
===========================||=======================||=======================
r7 |  1689 |  1689 |   269 ||   469 |    24 |     5 ||     7 |  1269 |     3
---+-------+-------+-------||-------+-------+-------||-------+-------+-------
r8 |     4 |   679 |     3 ||   679 |     1 |    27 ||     8 |  2569 |    25
---+-------+-------+-------||-------+-------+-------||-------+-------+-------
r9 |     5 | 12679 |  2679 ||   679 |     3 |     8 ||   169 |  1269 |     4
-----------------------------------------------------------------------------
...............................................................................................

I think I've only partially impemented "strong sets".
So what is the next "nice loop" here? Does a nice loop, for example,
take out r2c4#8 due to a problem then with the placement of 2 in row 5?


Thanks.
Bob Hanson
 
Posts: 75
Joined: 04 December 2005

Postby Jeff » Mon Dec 26, 2005 4:07 am

Bob Hanson wrote:So what is the next "nice loop" here? Does a nice loop, for example, take out r2c4#8 due to a problem then with the placement of 2 in row 5?

Hi Bob, A strong grouped nice loop is next:

[r4c6]-2-[r8c6]=2=[r7c5]=4=[r7c4]-4-[r6c4|r4c4]=4=[r4c6] =>r4c6<>2

According to my solution sequence, 6 more loop deductions after this, a nice loop implies that r6c4<>4, then r2c4<>8.
Jeff
 
Posts: 708
Joined: 01 August 2005

Postby Bob Hanson » Mon Dec 26, 2005 7:21 am

OK, so that was a bug in the Sudoku Assistant implementation of
these "strong chain sets"

Now I'm where you left off, Jeff. What next?

Code: Select all
   |---c1--|---c2--|---c3--||---c4--|---c5--|---c6--||---c7--|---c8--|---c9--
-----------------------------------------------------------------------------
r1 |     7 |    16 |    45 ||     2 |     8 |    16 ||     3 |    45 |     9
---+-------+-------+-------||-------+-------+-------||-------+-------+-------
r2 |    19 |     3 |    45 ||    45 |     7 |    19 ||     2 |     8 |     6
---+-------+-------+-------||-------+-------+-------||-------+-------+-------
r3 |   269 |    29 |     8 ||     3 |    45 |    69 ||    14 |     7 |    15
===========================||=======================||=======================
r4 |     3 |  2678 |   267 ||    17 |     9 |     4 ||     5 |    26 |   128
---+-------+-------+-------||-------+-------+-------||-------+-------+-------
r5 |    68 |     4 |   679 ||   157 |    25 |    27 ||   169 |     3 |    18
---+-------+-------+-------||-------+-------+-------||-------+-------+-------
r6 |    29 |     5 |     1 ||     8 |     6 |     3 ||    49 |   249 |     7
===========================||=======================||=======================
r7 |   168 |   189 |   269 ||    49 |    24 |     5 ||     7 |  1269 |     3
---+-------+-------+-------||-------+-------+-------||-------+-------+-------
r8 |     4 |   679 |     3 ||    69 |     1 |    27 ||     8 |    59 |    25
---+-------+-------+-------||-------+-------+-------||-------+-------+-------
r9 |     5 | 12679 |  2679 ||   679 |     3 |     8 ||    69 |  1269 |     4
.............................................................................
Bob Hanson
 
Posts: 75
Joined: 04 December 2005

Postby Jeff » Mon Dec 26, 2005 7:54 am

post cancelled due to error.
Last edited by Jeff on Wed Dec 28, 2005 4:32 am, edited 1 time in total.
Jeff
 
Posts: 708
Joined: 01 August 2005

Postby Carcul » Tue Dec 27, 2005 1:07 pm

Hi Jeff.

Jeff wrote:Carcul, I have finally completed exercise 6 with 25 nice loops and picked up a few tricks along the way.


Good work Jeff. I have used a similar number of chains. What were those "tricks"?

Jeff wrote:Hi Bob, The next one in my solution sequence is a multiple implication nice loop of continuous type:

-2-[r8c9]=2=[r8c6]-2-([r7c5]=2=[r5c5]=5=[r3c5]-5-[r3c9]-1-[r5c9]-8-[r4c9])[r5c6]-7-[r4c4]-1-[r4c9]-2-[r8c9] =>r5c4<>7


This multiple loop is very interesting, but I don't understand it. Tipically, in a continuous loop, if a candidate "x" in cell A is eliminated by the loop, that means that making A = x will lead to some contradiction among the cells included in the loop. However, in your multiple nice loop, if you make r5c4 = 7 you will get no contradiction in all cells included in the loop, and as such there is no relation between your loop and the elimination r5c4<>7. In fact, a contradiction is only found further way in the solving process. So my question is: am I missing something, or can a multiple nice loop be more powerfull than usual?

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

Postby Jeff » Tue Dec 27, 2005 1:54 pm

Carcul wrote:What were those "tricks"?

Identification of continuous multiple nice loop, my first.

Jeff wrote:-2-[r8c9]=2=[r8c6]-2-([r7c5]=2=[r5c5]=5=[r3c5]-5-[r3c9]-1-[r5c9]-8-[r4c9])[r5c6]-7-[r4c4]-1-[r4c9]-2-[r8c9] =>r5c4<>7

r5c4=7 => r5c6<>7 and r4c4<>7. This is a contradiction for the unconditional link [r5c6]-7-[r4c4] in the loop.:D
Jeff
 
Posts: 708
Joined: 01 August 2005

Postby Carcul » Tue Dec 27, 2005 3:08 pm

Jeff wrote:This is a contradiction for the unconditional link [r5c6]-7-[r4c4] in the loop.


How can that be a contradiction if the link is precisely unconditional?
I think the problem in your loop is in cell r4c9.

Carcul
Carcul
 
Posts: 724
Joined: 04 November 2005

Postby Jeff » Tue Dec 27, 2005 3:47 pm

Carcul wrote:How can that be a contradiction if the link is precisely unconditional?
I think the problem in your loop is in cell r4c9.

Why can't there be a contradiction if the link is unconditional? Once the nice loop is formed, the label 7 of this unconditional link must be either in r4c4 or r5c6. This implies that r5c4<>7.

What's the problem with r4c9, trivalue?
Jeff
 
Posts: 708
Joined: 01 August 2005

Postby Carcul » Tue Dec 27, 2005 4:44 pm

Jeff wrote:Once the nice loop is formed, the label 7 of this unconditional link must be either in r4c4 or r5c6.


In a typical nice loop, this would mean that if 7 is not in the cells r4c4 and r5c6, then "following" the loop we would find a contradiction in the cells belonging to the loop: however, this doesn't happen with your loop.
Jeff, I might be wrong, but try the following: make r5c4=7, and you will find no contradiction in the cells that you have used in the loop - now, do you find it legitimate to use a loop to eliminate a candidate, if this candidate don't lead to any contradiction implied by the loop?

Carcul
Carcul
 
Posts: 724
Joined: 04 November 2005

Postby Jeff » Tue Dec 27, 2005 6:24 pm

Hi carcul, I don't know why there is no contradiction in the loop. Let me have another look.
Jeff
 
Posts: 708
Joined: 01 August 2005

Postby Jeff » Wed Dec 28, 2005 6:18 am

Hi Carcul, Thanks for pointing out the inconsistency. Apparently, there are additional rules governing these continuous triple chains and closer examination is required.
Jeff
 
Posts: 708
Joined: 01 August 2005

Postby Carcul » Wed Dec 28, 2005 2:05 pm

Hi Jeff.

Why did you "erased" the continuous multiple nice loop with which you have expressed the Sue de Coq? Your continuous multiple loop

[r6c1](-9-[r3c1])-9-[r2c1]-1-[r1c2]-6-[r3c1]-2-[r6c1]

(forgive me if this is not the correct notation) is, from my point of view, perfectly correct: if a "9" is in column 1, then according to the loop r3c1<>2,6,9, which is a contradiction.

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

Postby Jeff » Wed Dec 28, 2005 6:03 pm

Hi Carcul, You are right, it is correct because the additional implication is simple, ie. it has only one single link. I am putting it back.
Jeff
 
Posts: 708
Joined: 01 August 2005

Postby Bob Hanson » Thu Dec 29, 2005 5:23 pm

Well, I'm glad I'm not the only one who doesn't understand this. So what IS the next "nice loop" for that configuration, then?

But I have a fundamental question about nice loops.
Can one distinguish this from trial and error -- where you
set some value or eliminate some value and then follow
the logical implications of that? Perhaps the answer is in this
looping nature -- that trial and error could find a logical inconsistency
anywhere, possibly not in the "loop."

I don't have access to FTP right now, but when I do I'll be updating the
Sudoku Assistant to do something like nice loops. I've now come up with
a simple way to integrate all (almost)1-locked set, strong chain,
weak link, and what I'm going to call "conjugate set" analysis into one
fairly straightforward analysis that I think I'll call "3D Medusa+". This should
deliver all sorts of "nice loops" in quite understandable language.
Interestingly (I think), the analysis considers the implications of SETS
rather than the implication of CELLS or individual MARKS. So we will
see something like:

r4c3=5 ==>!A0
r4c3=5 ==>!B2 ==> !A1 ==> A0
therefore r4c3<>5

where "A0" "A1" and the like refer to possibilities for the strong chains
and almost-locked sets. What's nice, I think, is that this will be quite
readable, and a simple listing of A0, A1, B2, etc. will provide the
details. (! here will mean "not." If I MUST use ~, tell me....)

An additional benefit is that in many cases significant numbers of
marks will be indicated for elimination all in one go. This is because
A0, A1, etc., may involve many marks.

Stay tuned!





This turns out to be quite
Bob Hanson
 
Posts: 75
Joined: 04 December 2005

PreviousNext

Return to Advanced solving techniques