Sudoku Programmers Forum Index

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log inLog in          Games  Calendar

Log in to check your private messagesLog in to check your private messages   

help with Nice Loop

 
Post new topic   Reply to topic    Sudoku Programmers Forum Index -> Solving sudoku
View previous topic :: View next topic  
Author Message
mumdigau

Joined: 07 Jun 2008
Posts: 3
:

Items
PostPosted: Sat Jun 07, 2008 9:53 am    Post subject: help with Nice Loop Reply with quote

Hi,

I just started to work with Nice Loops. Here is an example, I want to ask your help. After some elimination I reached this grid:

Code:

*--------------------------------------------------------------------*
 | 459    1      249    | 8      45     3      | 7      6      2459   |
 | 456    8      246    | 9      457    457    | 1      3      245    |
 | 7      359    349    | 2      1      6      | 59     459    8      |
 |----------------------+----------------------+----------------------|
 | 2349   239    5      | 347    8      79     | 239    1      6      |
 | 8      239    7      | 6      59     1      | 4      259    359    |
 | 1      6      349    | 34     2      459    | 8      579    3579   |
 |----------------------+----------------------+----------------------|
 | 269    279    8      | 5      3      479    | 269    2479   1      |
 | 3569   4      369    | 1      679    2      | 3569   8      3579   |
 | 23569  23579  1      | 47     4679   8      | 23569  2479   3479   |
 *--------------------------------------------------------------------*


I found a discontinuous Nice Loop at R4C1 which can be closed with a weak link either on 3 or 9:

[R4C1]=4=[R4C4]=3=[R6C4]-3-[R3C3]-3/9-[R4C1] ==> R4C1<>3, R4C1<>9

I'd like to ask you if loop and conclusion are correct.

Many thanks for your feedback.

Best regards

mumdigau
Back to top
View user's profile Send private message
hobiwan

Joined: 11 Feb 2008
Posts: 83
:

Items
PostPosted: Sat Jun 07, 2008 1:24 pm    Post subject: Reply with quote

Hello mumdigau, welcome to the forums!

As for your question: Two consecutive cells in a Nice Loop must see each other (be in the same row, column or block). Therefore

[R6C4]-3-[R3C3]

cannot be right (r6c4 and r3c3 are in different rows, columns and blocks).

You could go r6c4 -3- r6c3, but from there you don't have a strong link to continue.

A possible short Discontinous nice Loop starts with r2c5 -5- r5c5 ..., another one with r6c8 -5- r6c6 ...

Perhaps you can complete them?
Back to top
View user's profile Send private message
mumdigau

Joined: 07 Jun 2008
Posts: 3
:

Items
PostPosted: Sat Jun 07, 2008 3:03 pm    Post subject: Reply with quote

Hi hobiwan,

Of course, you're right. Was a typo, and I solved the grid by means of your proposals. Thanks!

In the mean time I think I've understood the basics of Nice Loops (rather errorprone on manual work, though). But there is one situation left I can't figure out. Have a look on this grid:

Code:

.------------------.------------------.------------------.
| 67    8     5    | 379   139   4    | 36    2     19   |
| 1     29    4    | 359   2389  6    | 58    358   7    |
| 3     2679  679  | 579   1289  129  | 4     568   19   |
:------------------+------------------+------------------:
| 4     35    2    | 39    6     139  | 159   7     8    |
| 67    3567  367  | 2     139   8    | 159   15    4    |
| 9     1     8    | 4     5     7    | 36    36    2    |
:------------------+------------------+------------------:
| 5     79    1    | 6     2479  29   | 78    48    3    |
| 2     3679  3679 | 8     3479  39   | 17    14    5    |
| 8     4     37   | 1     37    5    | 2     9     6    |
'------------------'------------------'------------------'


One continuous Nice Loop I discovered (hopefully correct) is

-[R3C3]=9=[R8C3]-9-[R8C6]=3=[R4C6]=1=[R3C6]-1-[R3C9]-9-[R3C3]=

The conclusions then should be (but aren't):

R4C6=13
R8C2<>9, R8C5<>9
R3C5<>1
R3C2<>9, R3C4<>9, R3C6<>9

Questions:

1. Why is R3C2<>9 wrong (sees both R3C3 and R3C9)?
2. Can R3C6 be included when 9's are discarded even though R3C6 belongs to the loop?

Thanks for your help.

Best regards

mumdigau
Back to top
View user's profile Send private message
hobiwan

Joined: 11 Feb 2008
Posts: 83
:

Items
PostPosted: Sat Jun 07, 2008 10:54 pm    Post subject: Reply with quote

mumdigau wrote:
-[R3C3]=9=[R8C3]-9-[R8C6]=3=[R4C6]=1=[R3C6]-1-[R3C9]-9-[R3C3]=

Unfortunately you have an error here too:

r8c6 =3= r4c6

should be

r8c6 -3- r4c6

(r8c3 -9- r8c6 means, that r8c6<>9, therefore r8c6=3 => r4c6<>3). You are stuck again at this state, because you don't have a strong link to continue.

My solver can find only two continuous nice loops, both not very effective:

Continuous Nice Loop r3c8 =5= r3c4 =7= r1c4 -7- r1c1 -6- r1c7 =6= r3c8 => r3c4<>9
Continuous Nice Loop r3c4 =5= r3c8 =6= r1c7 -6- r1c1 -7- r1c4 =7= r3c4 => r3c8<>8

plus a couple of discontinuous nice loops.

mumdigau wrote:
2. Can R3C6 be included when 9's are discarded even though R3C6 belongs to the loop?

I don't know, I am afraid. Somebody else will have to answer this.
Back to top
View user's profile Send private message
mumdigau

Joined: 07 Jun 2008
Posts: 3
:

Items
PostPosted: Sat Jun 07, 2008 11:49 pm    Post subject: Reply with quote

hobiwan wrote:
mumdigau wrote:
-[R3C3]=9=[R8C3]-9-[R8C6]=3=[R4C6]=1=[R3C6]-1-[R3C9]-9-[R3C3]=

Unfortunately you have an error here too:

r8c6 =3= r4c6

should be

r8c6 -3- r4c.


Yeah, you're right again. Thanks for help. Still have to practice. As I said Nice Loops are very strong, but errorprone (at least for me).

You mentioned your solver. Can it check for correctness of Nice Loops? (Just to verify if one doesn't spoil the grid. I wouldn't use it to search for Loops.) Any link?

Best regards

mumdigau
Back to top
View user's profile Send private message
hobiwan

Joined: 11 Feb 2008
Posts: 83
:

Items
PostPosted: Sun Jun 08, 2008 7:29 pm    Post subject: Reply with quote

mumdigau wrote:
You mentioned your solver. Can it check for correctness of Nice Loops? (Just to verify if one doesn't spoil the grid. I wouldn't use it to search for Loops.) Any link?

Best regards

mumdigau


It can show you when you remove a candidate that belongs to the solution or when you try to set a wrong value in a cell. Unfortunately it's still work in progress so I have not released it yet (and I am not sure if I ever will). Plus the UI is in german. But there should be a lot of free sudoku programs available with the same feature, perhaps somebody else can provide a link.
Back to top
View user's profile Send private message
kyriako

Joined: 12 Jun 2008
Posts: 16
:
Location: Germany

Items
PostPosted: Tue Jul 08, 2008 7:40 pm    Post subject: Nice Loops software Reply with quote

Hello mumdigau, hello hobiwan,

I have been working with nice loops recently and implemented the method.
Download here:
http://homepages.compuserve.de/meinelg

My question:
how do you produce these nicely formatted sudoku examples? Is it the output of a program or do type them manually?

Kyriakos.
Back to top
View user's profile Send private message
hobiwan

Joined: 11 Feb 2008
Posts: 83
:

Items
PostPosted: Tue Jul 08, 2008 8:05 pm    Post subject: Re: Nice Loops software Reply with quote

kyriako wrote:
My question:
how do you produce these nicely formatted sudoku examples? Is it the output of a program or do type them manually?

Most sudoku programs can copy candidate grids of the current state in text format to the clipboard. As for possible steps, I copy them directly from my own solver. I cannot produce candidate grids with cells marked according to a step, but I suspect that some users here have done this with their solvers too (in my solver its one of those "not yet implemented" menu items Very Happy).

Solutions that my solver cant produce I have to type manually.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Sudoku Programmers Forum Index -> Solving sudoku All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Sudoku Programmers topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group

Igloo Theme Version 1.0 :: Created By: Andrew Charron