logoalt Hacker News

fyredge • today at 4:49 AM • 2 replies • view on HN

Interesting, I've built up an intuition on sudoku over the years but have never used such a rule. Intuitively, I understand that sudokus must be unique (so that it's solvable without guessing), but how does one utilize this rule to solve puzzles?


Replies

shagie • today at 5:26 AM

In my own "writing a Sudoku solver" explorations, I've used https://www.sudokuwiki.org/ for guides for the algorithms.

https://www.sudokuwiki.org/Unique_Rectangles is the one that covers the unique solution rectangles with examples.

https://www.sudokuwiki.org/sudoku.htm?bd=0008060002000100740...

    ... 8.6 ... 
    2.. .1. .74
    ..9 7.. .1.
    
    ..6 ... 2.1
    3.. ... 6.. 
    .2. ... ...
    
    .3. ..5 ...
    ..2 ... .8.
    81. ..2 953
This is one such puzzle. Clicking on the 'Solve Path', you'll see the path with it. It is possible to still solve it with some more advanced techniques if rules 8 and 21 are unselected ... being able to solve it with the 'WXYZ-Wing'.

It gets to the situation where box 9 has a [[14],[14]] pair and box 8 has a [[14],[1439]] pair. That forces box 8 to not have [[14], [14]], and so the second cell in question must be a [39] because a 1 or a 4 will cause it to fail uniqueness.

This happens again with boxes 4 and 6 with a box 4 having [[158],[158]] and box 6 having [[15],[15]] forcing a 1 into one of those two cells and removing 1 from the other cells in box 4.

johnea • today at 5:31 AM

I found this image from when I was emailing a friend about this.

This is how I've typically used this rule:

https://nullimage.org/6xvubQNs7D4zMteBvDRBGm#k=KACWzJ3qsPnoY...

Sorry it's a pastebin'd image, re-creating it in text seemed, tedious 8-)

Also, I also didn't find this rule to be intuitive. I just happened to stumble across a few instances where the conclusion was made obvious to me, and so I started using it when necessary.