open for debate: how redundant is this function dose it have any applications or merit
{its probably been talked about before but i cannot find much information on AHS and its applications, links & info kindly welcome pls!}
my haphazard guess:
is that since an ahs {size 2+1} < == > Als {size 8+9}, the direct benefit i can foresee from it is application is that it can be used instead of searching for a size 5+ als
for sake of discussion some notes on my approach:
my solver has multiple save locations for a grid, i save sectors in two different fashions:
one that saves all cells for a space by digit => naked sets
one that saves all candidates for a space by cell => hidden sets -{the rules at the end of this post are based on this type of storage system!}
a naked sector (row 1) would save :
cell 1 as: [89], cell 2 [89], cell 3[1..9],cell 4[1..9],cell 5[1..9],cell 6[1..9],cell 7[1..9],cell 8[1..9],cell 9[1..9]
- Code: Select all
.---------------------------------.---------------------------------.---------------------------------.
| 89 89 123456789 | 123456789 123456789 123456789 | 123456789 123456789 123456789 |
| 123456789 123456789 123456789 | 123456789 123456789 123456789 | 123456789 123456789 123456789 |
| 123456789 123456789 123456789 | 123456789 123456789 123456789 | 123456789 123456789 123456789 |
:---------------------------------+---------------------------------+---------------------------------:
| 123456789 123456789 123456789 | 123456789 123456789 123456789 | 123456789 123456789 123456789 |
| 123456789 123456789 123456789 | 123456789 123456789 123456789 | 123456789 123456789 123456789 |
| 123456789 123456789 123456789 | 123456789 123456789 123456789 | 123456789 123456789 123456789 |
:---------------------------------+---------------------------------+---------------------------------:
| 123456789 123456789 123456789 | 123456789 123456789 123456789 | 123456789 123456789 123456789 |
| 123456789 123456789 123456789 | 123456789 123456789 123456789 | 123456789 123456789 123456789 |
| 123456789 123456789 123456789 | 123456789 123456789 123456789 | 123456789 123456789 123456789 |
'---------------------------------'---------------------------------'---------------------------------'
a naked pair function for example checks a size of 2 cells combinations against a combination of 2 digits in a sector
resulting in Sector 1: Cells 1 & 2 = [89] =>> eliminate all candidates [8,9] from all peer cells R1C789, R23C123
this can also be viewed in terms of an als-xz rule
Col 1 searching for n cells, with n+1 candidate resulting in a hit on Cell 1 with [8,9]
Col 2 searching for n cells, with n+1 candidate resulting on a hit with cell 2 with [8,9]
Z = 8 or 9 and x 9 or 8 =>> eliminate all candidates [8,9] from all peer cells R1C789, R23C123
a hidden set:
Sector row 1 digit 1[1,9], digit 2[1..9], digit 3[1..9],digit 4[1..9],digit 5[1..9] ,digit 6[1..9] ,digit 7[1..9] ,digit 8[1..9] ,digit 9[1,9]
- Code: Select all
.---------------------------------.---------------------------------.---------------------------------.
| 123456789 345689 3456789 | 3456789 3456789 3456789 | 3456789 3456789 123456789 |
| 123456789 123456789 123456789 | 123456789 123456789 123456789 | 123456789 123456789 123456789 |
| 123456789 123456789 123456789 | 123456789 123456789 123456789 | 123456789 123456789 123456789 |
:---------------------------------+---------------------------------+---------------------------------:
| 123456789 123456789 123456789 | 123456789 123456789 123456789 | 123456789 123456789 123456789 |
| 123456789 123456789 123456789 | 123456789 123456789 123456789 | 123456789 123456789 123456789 |
| 123456789 123456789 123456789 | 123456789 123456789 123456789 | 123456789 123456789 123456789 |
:---------------------------------+---------------------------------+---------------------------------:
| 123456789 123456789 123456789 | 123456789 123456789 123456789 | 123456789 123456789 123456789 |
| 123456789 123456789 123456789 | 123456789 123456789 123456789 | 123456789 123456789 123456789 |
| 123456789 123456789 123456789 | 123456789 123456789 123456789 | 123456789 123456789 123456789 |
'---------------------------------'---------------------------------'---------------------------------'
a hidden pair functions by searching 2 digits combinations against a combination of 2 cells in a sector.
in Sector 1: resulting in Digits 1 & 2 in cells[1,9] =>> eliminate all candidates not in digits[1,2] from cells[1,9]
this can also be viewed in terms of an ahs-xz rule
Col 1 searching for n+1 digits, in n cells resulting on a hit for digits [8,9] in cell [1]
Col 2 searching for n+1 digits , in n cells resulting on a hit for digits [8,9] in cell [9]
Z = 8 or 9 and x 9 or 8 =>> eliminate all candidates not in digits[1,2] from cells[1,9]
slightly more difficult example:
xyz-wing as an:
Almost Locked Set XZ-Rule: A=r2c2 {13}, B=r15c1 {123}, X=3, Z=1 => r23c1<>1
- Code: Select all
.---------------------------------.---------------------------------.---------------------------------.
| 123 123456789 123456789 | 123456789 123456789 123456789 | 123456789 123456789 123456789 |
| 123456789 13 123456789 | 123456789 123456789 123456789 | 123456789 123456789 123456789 |
| 123456789 123456789 123456789 | 123456789 123456789 123456789 | 123456789 123456789 123456789 |
:---------------------------------+---------------------------------+---------------------------------:
| 123456789 123456789 123456789 | 123456789 123456789 123456789 | 123456789 123456789 123456789 |
| 12 123456789 123456789 | 123456789 123456789 123456789 | 123456789 123456789 123456789 |
| 123456789 123456789 123456789 | 123456789 123456789 123456789 | 123456789 123456789 123456789 |
:---------------------------------+---------------------------------+---------------------------------:
| 123456789 123456789 123456789 | 123456789 123456789 123456789 | 123456789 123456789 123456789 |
| 123456789 123456789 123456789 | 123456789 123456789 123456789 | 123456789 123456789 123456789 |
| 123456789 123456789 123456789 | 123456789 123456789 123456789 | 123456789 123456789 123456789 |
'---------------------------------'---------------------------------'---------------------------------'
AhS- xz
{hidden xy-wing example}
- Code: Select all
.---------------------------------.---------------------------------.---------------------------------.
| 123456789 1456789 1456789 | 1456789 123456789 1456789 | 1456789 1456789 1456789 |
| 2456789 123456789 123456789 | 123456789 123456789 123456789 | 123456789 123456789 123456789 |
| 2456789 123456789 123456789 | 123456789 123456789 123456789 | 123456789 123456789 123456789 |
:---------------------------------+---------------------------------+---------------------------------:
| 2456789 123456789 123456789 | 123456789 123456789 123456789 | 123456789 123456789 123456789 |
| 123456789 123456789 123456789 | 123456789 123456789 123456789 | 123456789 123456789 123456789 |
| 2456789 123456789 123456789 | 123456789 123456789 123456789 | 123456789 123456789 123456789 |
:---------------------------------+---------------------------------+---------------------------------:
| 2456789 123456789 123456789 | 123456789 123456789 123456789 | 123456789 123456789 123456789 |
| 2456789 123456789 123456789 | 123456789 123456789 123456789 | 123456789 123456789 123456789 |
| 2456789 123456789 123456789 | 123456789 123456789 123456789 | 123456789 123456789 123456789 |
'---------------------------------'---------------------------------'---------------------------------'
AHS - xz rule:
set A is comprised of N+1 digits in N cells
set B is comprised of N+1 digits in N cells
Z is a restricted common cell of sets A&B
X is a common cell of sets A&B
if z is a peer of x cell
z = digits of A B || Z <> Digits not in A & B
Doubly linked rule:
when X is also a restricted common of sets A & B
all X cells that are peers of all Z Cells in sets A&B = Digits of A&B
Doubly linked rule example: