A tough one?

Advanced methods and approaches for solving Sudoku puzzles

A tough one?

Postby vidarino » Tue Feb 07, 2006 11:49 pm

Hi all.

I'm trying to extend the arsenal of my solver, and it had to resort to blind guessing on the following one (home-made, by the way):
Code: Select all
+-------+-------+-------+
| . . 5 | 8 3 . | . . . |
| . 1 . | . . . | . 9 8 |
| . . 8 | 9 . . | . 4 . |
+-------+-------+-------+
| . . 9 | . 8 . | 6 . . |
| 7 . . | . . 4 | . . . |
| . 8 . | 1 . . | . 7 5 |
+-------+-------+-------+
| 5 . . | . . . | 2 . . |
| . . 3 | . 7 . | . . . |
| . . . | 6 2 . | . 5 1 |
+-------+-------+-------+


I'd be very interested in seeing how you would solve this one. To finish it off, my solver has to guess a total of 6 times. (It doesn't look for magic cells or anything, though, so it's likely that it could get away with fewer guesses if they were done in the right cells.)

Also, tell me if you like it.:)

Vidar
vidarino
 
Posts: 295
Joined: 02 January 2006

Re: A tough one?

Postby aeb » Wed Feb 08, 2006 12:18 am

vidarino wrote:I'd be very interested in seeing how you would solve this one. To finish it off, my solver has to guess a total of 6 times.

Also, tell me if you like it.:)

Vidar

Yes, we like puzzles, that is why we are here. I have a rather long solution. Can you give the stage where you have to guess for the first time?
aeb
 
Posts: 83
Joined: 29 January 2006

Postby vidarino » Wed Feb 08, 2006 1:27 am

My solver runs into problems almost immediately. The solver log starts:
B: Locked Candidates 4 in R1. Eliminate from rest of B1.
T: Naked subset 1267 in R1
W: Swordfish with 3 in R269C167
G: Guessed that R1C1 should be 9 (only solution of 2).
F: Cell R1C2 can only be 4
G: Guessed that R1C7 should be 1 (only solution of 2).
L: Nice loop: R9C7-8-R9C1=8=R8C1=1=R4C1-1-R4C8=1=R5C8=8=R5C7-8-R9C7
...


The state of the grid at the point of the first guess is:
Code: Select all
     49     49      5 |       8      3   1267 |      17    126    267
    236      1    267 |    2457    456   2567 |     357      9      8
     26   2367      8 |       9    156  12567 |     157      4   2367
----------------------+-----------------------+----------------------
    124   2345      9 |    2357      8    257 |       6    123    234
      7   2356    126 |     235    569      4 |     189   1238    239
   2346      8    246 |       1     69   2369 |     349      7      5
----------------------+-----------------------+----------------------
      5   4679   1467 |      34    149    189 |       2    368  34679
 124689   2469      3 |      45      7   1589 |     489     68    469
    489    479     47 |       6      2    389 |   34789      5      1


Apparently, guessing in R1C1 proved fruitless, so it has to try another one very shortly after. The current guessing strategy is to pick the first encountered cell with the shortest number of candidates.

After this, the solver's solution continues with a varied selection of guesses, nice loops and some basic steps, before finally getting in a final guess that makes the rest of the puzzle solve with singles.

Oh, and pardon the brevity of the log. I'll make it list eliminations and fixed candidates eventually. Alternatively I can post the verbose log with candidate grids for each step, but it's not too interesting, really. I'd much rather see a solution that doesn't rely on constant guessing.:)

Vidar
vidarino
 
Posts: 295
Joined: 02 January 2006

Postby tarek » Wed Feb 08, 2006 1:40 am

hi Vidar,

very nice puzzle,

Comments on puzzle:
Asymmetrical, my solver had to use simple guess once & Nishio 3 times

Comments on your log:
the XYZ wing is missing following the swordfish
Code: Select all
*--------------------------------------------------------------------------*
| 49      49      5      | 8       3       1267   | 17      126     267    |
| 236     1       267    | 2457    456     2567   | 357     9       8      |
| 26      2367    8      | 9       156     12567  | 157     4       2367   |
|------------------------+------------------------+------------------------|
| 124     2345    9      | 2357    8       257    | 6       123     234    |
| 7       2356    126    | 235     569     4      | 189     1238    239    |
| 2346    8       246    | 1       69      2369   | 349     7       5      |
|------------------------+------------------------+------------------------|
| 5       4679    1467   | 34      149     189    | 2       368     34679  |
| 124689  2469    3      | 45      7       1589   | 489     68      469    |
| 489     479     47     | 6       2       389    | 34789   5       1      |
*--------------------------------------------------------------------------*
Eliminating 4 From r7c2 (7 & 9 & 4 in r9c2 form an XYZ wing with r9c3 & r1c2)
Eliminating 4 From r8c2 (7 & 9 & 4 in r9c2 form an XYZ wing with r9c3 & r1c2)


Compared to the puzles posted recently by tso, this is less difficult than #1 puzzle but more difficult than #2

Tarek
User avatar
tarek
 
Posts: 3762
Joined: 05 January 2006

Postby vidarino » Wed Feb 08, 2006 2:14 am

Hi tarek.

tarek wrote:the XYZ wing is missing following the swordfish


OK, we need a blushing emoticon here... ;) I actually forgot all about XYZ-wing, and I'm also constantly mixing it up with XY-wing, so I think I subconsciously assumed that it was covered by the general nice loop routines (which I know XY-wing is). Guess again, eh?:)

But who needs sleep anyway. I have now added support for it, and it's correctly identified just before the swordfish.:) It doesn't seem to have any particular effect on the rest of the solution, though. It still requires 9 nice loops and 6 guesses to solve.

Anyway, glad you liked it. And thanks for your feedback.:)

Vidar
vidarino
 
Posts: 295
Joined: 02 January 2006

Postby aeb » Wed Feb 08, 2006 2:28 am

vidarino wrote:The state of the grid at the point of the first guess is:
Code: Select all
     49     49      5 |       8      3   1267 |      17    126    267
    236      1    267 |    2457    456   2567 |     357      9      8
     26   2367      8 |       9    156  12567 |     157      4   2367
----------------------+-----------------------+----------------------
    124   2345      9 |    2357      8    257 |       6    123    234
      7   2356    126 |     235    569      4 |     189   1238    239
   2346      8    246 |       1     69   2369 |     349      7      5
----------------------+-----------------------+----------------------
      5   4679   1467 |      34    149    189 |       2    368  34679
 124689   2469      3 |      45      7   1589 |     489     68    469
    489    479     47 |       6      2    389 |   34789      5      1

Vidar

After this my first step was noticing that there are no patterns for the digit 2 involving (4,1) or (4,2) or (5,2). (But this is not yet needed for the next step.) Next
(7,9)4 > (9,7)7 > (9,6)3 > (7,4)4 > (7,9)!4 shows that (7,9) is not 4. Next
(8,4)4 > (8,6)5 > (8,1)1 > (4,1)4 > (4,9)!4 > (8,9)4 > (8,4)!4 shows that (8,4) is 5.
Afterwards things get messy. I have several solutions, but none is very short.
One of the reasons is that there is an almost-solution to your puzzle:
Code: Select all
945837126
312456798
678912543
439785612
751264839
286193475
596341287
123578964
847629351

where all rows and all boxes and 7 columns are ok. This is forced by the assumption (7,4)3, so shows after many easy steps that (7,4)4. Alternatively, a possible next step is showing that (7,3) is not 7. If it is, then (7,3)7, (9,3)4, (9,2)9, (9,1)8, (9,6)3, (6,6)!3, (6,3)!4, and there is a triple 269 in r6c356 so that (6,1) is not 2,6. There is also a pair 26 in r27c3 so that (5,3)1, (4,1)4 so that (6,1) is not 4. There is also a pair 26 in box 1, so that (2,1)3 and (6,1) is not 3. That does not leave any value for (6,1) so the assumption was wrong and (7,3)!7.
aeb
 
Posts: 83
Joined: 29 January 2006

Postby Carcul » Wed Feb 08, 2006 3:43 pm

Hi Vidarino.

Vidarino wrote:(home-made, by the way):


I am very impressed by the high quality of this home-made grid: so, I want to congratulate you for this very interesting and challenging puzzle.

Vidarino wrote:I'd be very interested in seeing how you would solve this one.


After the basic eliminations and the Swordfish, here is a possible solution:

1. [r7c3]-7-[r2c3]=7=[r3c2]=3=[r2c1]-3-[r123c7]-7-[r9c7]=7=[r7c9]-7-[r7c3], => r7c3<>7.

2. [r8c1](=1=[r7c3]-1-[r7c5])(=2=[r8c2]-2-[r3c2])-8-[r9c1]=8|7=[r9c2](-7-[r7c2|r3c2])-7-[r9c3](-4-[r6c3|r7c2])-4-[r9c1](-9-[r7c2]-6-[r3c2]-3-[r2c1]=3=[r2c7]-3-[r9c7]=3=[r9c6]-3-[r7c4]-4-[r7c5])-9-[r1c1]-4-[r4c1|r6c1]=4=[r4c2]=5=[r5c2]-5-[r5c5|r6c5]-9-[r7c5], => r8c1<>8.

3. [r9c7](-3-[r2c7]=3=[r3c9]-3-[r5c9]){-3-[r9c6](-9-[r9c23]-4-[r7c3])(=3=[r6c6]-3-[r6c17])=3=[r7c4]-3-[r45c4]}-3-[r78c8]-6,8-[r8c79]-4-[r8c4](=4=[r7c5]-4-[r2c5])-5-[r5c4]{-2-[r5c9]-9-[r6c7]-4-[r6c13]-2,6-[r5c3]-1-[r7c3](-6-[r2c3])-6-[r6c3]-2-[r2c3]-7-[r2c7]}-2-[r4c46]-5-[r56c5]-6-[r2c5]-5-[r2c7], => r9c7<>3.

4. [r6c3]-6-[r6c5]-9-[r7c5]-1-[r7c3]-6-[r6c3], => r6c3<>6.

5. [r5c8|r5c9]-3-[r5c4]=3=[r4c4]=7=[r2c4]-7-[r2c3]=7=[r3c2]=3=[r2c1]-3-[r6c1]=3=[r6c7]-3-[r5c8|r5c9], => r5c8,r5c9<>3.

6. [r4c2]=5=[r4c6]-5-[r2c6]=5=[r2c7]=3=[r6c7]=4=[r4c9]-4-[r4c2], r4c2<>4.

7. [r4c9]=4=[r4c1]=1=[r5c3]-1-[r5c789]-2-[r4c9], => r4c9<>2.

8. [r7c8]=3=[r4c8](-3-[r6c7])-3-[r4c9]-4-[r6c7](-9-[r6c6])-9-[r6c5](-6-[r6c3])-6-[r6c6]-2-[r6c3]-4-[r9c3]-7-[r9c7]=7=[r7c9]=3=[r7c8], => r7c8=3.

9. [r5c7](-1-[r4c8]-2-[r1c8])-1-[r5c3]=1=[r4c1]=4=[r4c9]-4-[r6c7]-3-[r123c7]-1-[r1c8]-6-[r8c8]-8-[r8c7]=8=[r5c7], => r5c7<>1.
10. [r9c3](-7-[r9c7|r7c2])-7-[r19c2](-4,9-[r8c2])-9-[r7c2](-6-[r7c3]-1-[r5c3]=1=[r4c1]-1-[r4c8])(-6-[r8c1])(-6-[r7c3]-1-[r8c1])-6-[r8c2]-2-[r8c1]=2|8={Almost Unique Loop: [r1c12|r8c17|r9c27]}[r8c7]-8-[r8c8]-6-[r1c8]-2-[r4c8], => r9c3<>7 and that solve the puzzle.

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

Postby aeb » Wed Feb 08, 2006 4:16 pm

Carcul wrote:...here is a possible solution:

1. [r7c3]-7-[r2c3]=7=[r3c2]=3=[r2c1]-3-[r123c7]-7-[r9c7]=7=[r7c9]-7-[r7c3], => r7c3<>7.
...

Nice!
aeb
 
Posts: 83
Joined: 29 January 2006


Return to Advanced solving techniques

cron