Thursday, February 15, 2007

Advanced-Death Blossom

Death Blossom (a.k.a. Aligned ALS Exclusion)
This strategy is based on extending Aligned Pair Exclusion but uses Almost Locked Sets to make some clever reductions. From the components used it could be named Aligned ALS Exclusion but Mike Barker, who formulated it first in this thread, hit on "Death Blossom" because it starts with a cell designated as the "stem" which points to Almost Locked Sets, or the "petals", and is a great deal more flowery.


An Almost Locked Set is any group of N cells (that can all see each other) with N+1 candidates between them . This includes bi-value cells. A Locked Set, by contrast, contains exactly the right number of canidates for the group, examples of which are Naked Pairs and Triples.
To get a feel for what’s going it worth working backwards from the elimination of 1 in E1 in this first example. We have two Almost Locked Sets {D2,F2,H2} and {E5,E8,E9} and they both have 1 as a common number between them. If E1 did have 1 as a solution it would reduce the first Almost Locked Set to a Naked Pair with 2/4 forcing H2 to be 8. The second ALS would also reduce to a Naked Pair of 7/9 forcing E9 to be 2. If E9 is 2 and H2 is 8 then the stem cell (coloured green) H9 is left with nothing. This confirms that E1 is not 1.
If we work forwards from the “stem” cell we’ll get closer to a formula for finding this formation. H9 with {2/8} must be able to see at least two ALSs which contain all its candidates. It is important that the 2 in H9 can see all of the 2’s in the brown coloured ALS (one instance in this case) and 8 in H9 can see all of the 8’s in the yellow coloured ALS (also one in this instance). But H9 overall does not have to see every single cell in all the ALSs, just the cells it shares candidates with.


Now, the two ALSs must have a candidate Z in common which the "stem" cell does not have. Because ALSs contain exactly one extra candidate for the number of cells they occupy (the N+1 candidates for N cells rule), we can assert that ANY cell that can see all the Zs in both ALS but is not part of those ALSs or the stem cell can be removed. Such a cell is E1.
Death Blossom was discovered by extending Aligned Pair Exclusion (APE) and asking if there was generalization beyond the pairs and triples discussed in Aligned Pair Exclusion. With Almost Locked Sets there is. The stem cell H9 and the elimination cell E1 can’t see each other – they not aligned, but the pairs they can make do affect the board. In our example, consider the pairs that can be made between the 1 in E1 and the 2/8 in H9. These are 1/2 and 1/8 in E1 and H9 respectively. Both these turn out to be illegal since they would reduce our ALSs to having less candidates than cells. So whatever the solutions to the two disparate cells E1 and H9, E1 will never contain a 1.

In Figure 2 quite a different arrangement is apparent but the logic is identical. The two yellow coloured cells form a two-cell ALS with the values {1/2/8}. At the bottom there is a four-cell ALS with {3/4/7/8/9}. Our stem cell again contains only two candidates {1/4} (coloured green) but don't think this is a restriction. There could be five or six numbers in the stem cell. As long as there are sufficient Almost Locked Sets that the candidates can see then the pattern can be made to work.
There is another way to look at this example which mirrors some strategies already covered. Starting in H8
If H8 is 1 -> B8=2 -> B2=8 therefore A3,B3,C3,J2 <> 8
If H8 is 4 -> H1=7 -> H2=9 -> H3=3 -> J3=8 therefore A3,B3,C3,J2 <> 8


When traced through in this manner Death Blossom doesn’t seem so daunting.



Go To : Basic Fishy Advanced


Go To : Sudoku solving techniques

Advanced-Guardians




This strategy works with single numbers. We've already used closed loops of conjugate pairs to find things like X-Wings and Sword-Fish. X-Wings contains 4 cells in a perfect rectangle. Sword-Fish requires 6 or 9 cells in a grid. This strategy works with odd numbers of pairs in a loop starting with 5. There are several varieties depending on how 'perfect' the loop is.
Let us use the words perfect pair instead of conjugate pair to mean any number that exists only twice in one unit (row, column or box). This means we can use imperfect to mean a number that occurs three or more times in a unit. (Obviously if it only occurred once it would solve that cell).


In Figure 1 we have highlighted the number 3. Amongst all the candidate threes is a loop of five 3's. They form four perfect pairs:R5C7 - R5C5 - along the rowR5C5 - R7C5 - along the columnR7C5 - R7C9 - along the rowR7C9 - R4C9 - along the columnTo close the loop we have an imperfect triplet in the sixth box. The question is: can a closed loop of five candidate cells be constructed with each cell perfectly-paired in two ways with the next linking cells in the loop? The answer is no. Such a formation is impossible in a Sudoku puzzle. In such a loop, if you "placed" a candidate in any one of the cells and followed the consequences around the loop, you'd generate an automatic contradiction - forcing the number to disappear entirely from a row, cell or block, or to appear twice in a single line or block, depending on how you proceed.

To repeat, In an actual Sudoku there can never be a closed loop of five perfectly paired cells. And that is exactly where the solving technique lies. Any such structure must have one or more cells that disrupt the perfect pairings. We can refer to the cells which prevent one of the pairings from being perfect as guardians. Here's the trick: logically, one or more of the guardians must contain the candidate number. If none of the guardian cells were real, then the pairings would all be perfect and, as was already noted, that is flat-out impossible in a valid Sudoku. Accordingly, we can make the following assertions:
If there is only one guardian cell, the candidate number can be installed in that cell.
If there is more than one guardian, any cell that is seen by all the guardian cells cannot contain the candidate number; hence
If all the guardian cells are in a single column, row or block of the Broken Wing, the candidate can be erased from both the Broken Wing cells in that column, row or block. Type 1 - Single Guardians The variants of this strategy depend on how many Imperfect connections there are in the loop. To achieve one guardian there must be four perfect pairs and one Imperfect connection. Figure 1 illustrates this. That one guardian is the cell that disrupts the 5-loop from being perfect.


Type 2 - Double Guardians




In Figure 2 we have highlighted the number 7. Amongst all the candidate 7's is a loop of five 7's. There are two imperfect connections in the loop:R8C3 - R8C9 - along the rowR8C3 - R7C2 - within the boxThis gives us two guardian 7's in R7C1 and R8C7 marked in red squares. Whatever cells these two can both 'see' we can eliminate the 7 from them. Since in this example they form the opposite corners of a rectangle we can safely remove the 7 from R7C7 marked in a red circle. The other corner, R8C1, contains a solved square. Solving R7C7 allows us to complete the puzzle using other strategies.


Type 3 - Disruptive Guardians

In Figure 3 we have highlighted the number 1. Amongst all the candidate 1's is a loop of five 1's. There are two imperfect connections in the loop:R2C4 - R7C4 - along the columnR7C4 - R7C7 - along the rowThis gives us two guardian 1's in R3C4 and R7C6 marked in red squares. Whatever cells these two can both 'see' we can eliminate the 1 from them. Like in the example above, they form the opposite corners of a rectangle but the difference is that we're eliminating a 1 that's actually part of the loop. This is perfectly legitimate and follows from Rule 3 described above. The elimination occurs because R7C4 can be seen by both guardians.



Go To : Basic ||Fishy || Advanced


Go To : Sudoku solving techniques

Sunday, February 11, 2007

Advanced- Unique Rectangles

Unique Rectangles
Unique Rectangles takes advantage of the fact that published Sudokus have only one solution. If your Sudoku source does not guarantee this then this strategy will not work. But it is very powerful and there are quite a few interesting variants.

Noticing the 'Deadly Pattern'
In Figure 1 we have two example rectangles formed by four cells each. The pattern in red marked A consists of four conjugate pairs of 4/5. They reside on two rows, two columns and two blocks. Such a group of four pairs is impossible in a Sudoku with one solution. The reason? Pick any cell with 4/5. If the cell solution was 4 then we quickly know what the other three cells are. But it would be equally possible to have 5 in that cell and the others would be the reverse. There are two solutions to any Sudoku with this deadly pattern. If you have achieved this state in your solution something has gone wrong. The pattern ringed in green looks like a deadly pattern but there is a crucial difference. The 7/9 still resides on two rows and two columns, but instead if two boxes it is spread over four boxes. Now, such a situation is fine since you can't guarantee that swapping the 7 and 9 in an alternate manner will produce two valid Sudokus. One of them is the real solution, the other a mess. Why? Swapping the 7 and 9 around places them in different boxes and 1 to 9 must exist in each box only once. In the red example, swapping within the box does not change the content of that box.



Type 1 Unique Rectangles
Figure 1
For all Unique Rectangles we are going to look for potential deadly patterns and take advantage of them. A Type 1 Unique Rectangle is illustrated in Figure 2. The three circles marked in green rings contain 5/7. The fourth corner marked with a red square also contains 5/7 and two other candidates. If the 3/6 were removed from that cell we would have a Deadly Pattern. This cannot be allowed to happen so its safe to remove 5 and 7 from that cell. The proof is pretty straightforward once you get your head around the basic idea. Assume R5C6 is 5. That forces R5C4 to be 7, R2C6 to be 7, and R2C4 to be 5. That's the deadly pattern; you can swap the 5's and 7's and the puzzle still can be filled in. So if the Sudoku is valid, R5C6 cannot be 5. The exact same logic applies if you assume R5C6 is 7. So R5C6 can't be a 5, and can't be a 7 - it must be either 3 or 6.



Type 2 Unique Rectangles
In Figure 3 we have a similar pattern, but this time, R2C4 and R2C6 (green circles at the top), the squares which share the same block have a single extra possibility - in this case, 8. To make subsequent discussion easier to follow, we will refer to the two squares that only have two possibilities as the floor squares (because they form the foundation of the Unique Rectangle); the other two squares, with extra possibilities shall be called the roof squares.
In this "Type-2 Unique Rectangle", one of the blocks contains the floor squares, and the other contains the roof squares. In order to avoid the deadly pattern, 8 must appear in either R2C4 or R2C6 (the roof squares). Therefore, it can be removed from all other squares in the units (row, column and box) that contain both of the roof squares (in this case, row 2 and block 2). Now that you've gotten your head around the basic unique rectangle concept, the proof should be pretty obvious:
If neither R2C4 or R2C6 contains an 8, then they both become squares with possibilities 2/9. This results in the deadly pattern - so one of those squares must be the 8, and none of the other squares in the intersecting units can contain the 8. So R2C3, R3C4 and R3C6 can have 8 removed. This cracks the Sudoku.


Type 2B Unique Rectangles

There is a second variant of Type-2 Unique Rectangles as illustrated In Figure 4. In this puzzle, we have the same pattern of 4 squares in 2 blocks, 2 rows and 2 columns. The floor squares are R1C1 and R1C9, and the roof squares are R2C1 and R2C9. However, in this Unique Rectangle, each of the blocks contains one floor and one roof square. This is perfectly fine, but it means that the only unit (row/column/box) that contains both of the roof squares is row 2, so that is the only unit that you can attempt to reduce; in this case, R2C7 cannot contain a 8. This is called at "Type-2B Unique Rectangle".

Type 3 Unique Rectangles - Cracking the Rectangle with Conjugate Pairs
An interesting observation is that it is sometimes possible to remove one of the original pair of possibilities from the roof squares. Consider the following puzzle in Figure 5.
Look closely at the roof squares, R3C1 and R3C3, but this time, don't look at their extra possibilities; look at the possibilities they share with the floor squares. If you look carefully, you'll see that in box 1, the roof squares are the only squares that can contain a 5. This means that, no matter what, one of those squares must be 5 - and from this you can conclude that neither of the squares can contain a 1, since this would create the "deadly pattern"! So you can remove 1 from R3C1 and R3C3.
Nomenclature: When two squares are the only two squares in a unit that can have a particular value, they are referred to as a conjugate pair on that value.
This is an example of a "Type-3 Unique Rectangle". As you have probably realized, since the roof squares are in the same block, you can search for conjugate pairs in both of their common units (the row and the block, in this case).


Type 3B Unique Rectangles
And, as you might expect, there is a Type-3B Unique Rectangle variant, in which the floor squares are not in the same block, and you can only look for the conjugate pair in their common row or column. For example: In this case, since 7 can only appear in row 4 in the roof squares, 5 can be removed from both of them.
As Type-4 Unique Rectangle solutions "destroy" the Unique Rectangle, it is usually best to look for them only after you've done any other possible Unique Rectangle reductions.





Go To : Basic ||Fishy || Advanced
Go To : Sudoku solving techniques