Code rewrite for AIC Chains

Programs which generate, solve, and analyze Sudoku puzzles

Re: Code rewrite for AIC Chains

Postby Hajime » Mon Jan 26, 2026 10:20 am

That is a miracle solution path, StrmCkr
But....
It started with a single cell of the X-chain in r5c5.
What about this:
Code: Select all
  / 5 / . . . . / .
  5 . 5 . . . . 5 .
  / 5 / . . . . / .
  . . . . . . . / .
  . . . . . . . / .
  . . . . . . . / .
  . 5 . . . . . 5 .
  5 / 5 / / / 5 / 5
  . 5 . . . . . 5 .
All 5's are candidates. A / means: no candidate 5 in this cell. A dot is undetermined.
Start the grouped X-chain in r8c13 not being a 5. Follow the chain until r13c2=5.
(5)r8c13=r8c79-r79c8=r2c8-r2c13=r13c2 => r79c2<>5
Does your solver detect starting and ending with a grouped couple?

PS. You can start in r2c8<>5 and may end up with r2 or c8 has no 5's left. Not sure. But that is a Forcing Chain, is it?
User avatar
Hajime
 
Posts: 1416
Joined: 20 April 2018
Location: Fryslân

Re: Code rewrite for AIC Chains

Postby StrmCkr » Tue Jan 27, 2026 4:20 pm

Code: Select all
.---------------------------------.---------------------------------.---------------------------------.
| 12346789   123456789  12346789  | 123456789  123456789  123456789 | 123456789  12346789   123456789 |
| 123456789  123456789  123456789 | 123456789  123456789  123456789 | 123456789  123456789  123456789 |
| 12346789   123456789  12346789  | 123456789  123456789  123456789 | 123456789  12346789   123456789 |
:---------------------------------+---------------------------------+---------------------------------:
| 123456789  123456789  123456789 | 123456789  123456789  123456789 | 123456789  12346789   123456789 |
| 123456789  123456789  123456789 | 123456789  123456789  123456789 | 123456789  12346789   123456789 |
| 123456789  123456789  123456789 | 123456789  123456789  123456789 | 123456789  12346789   123456789 |
:---------------------------------+---------------------------------+---------------------------------:
| 123456789  123456789  123456789 | 123456789  123456789  123456789 | 123456789  123456789  123456789 |
| 123456789  12346789   123456789 | 12346789   12346789   12346789  | 123456789  12346789   123456789 |
| 123456789  123456789  123456789 | 123456789  123456789  123456789 | 123456789  123456789  123456789 |
'---------------------------------'---------------------------------'---------------------------------'


all applicable single digit xor gates for the digit 5 on the exemplar above:

Code: Select all
Type: BILOCAL
Type: CELL_TO_GROUP
   Link Type:1,originSector:{16},startDigits:{4},activeCells:{16},linkedCells:{61, 79},linkDigits:{4},startSector:{4={1, 16, 20}},linkSector:{4={16, 26}},startSwap:{0, 1, 2, 3, 5, 6, 7, 8},endSwap:{},PE Start:{4={6, 8, 9, 10, 11, 12, 13, 14, 15, 17, 24, 26, 61, 79}},PE End:{4={16, 60, 62, 69, 71, 78, 80}},
Type: GROUP_TO_GROUP
   Link Type:2,originSector:{23},startDigits:{4},activeCells:{33, 42, 51},linkedCells:{35, 44, 53},linkDigits:{4},startSector:{4={15, 23}},linkSector:{4={17, 23}},startSwap:{},endSwap:{},PE Start:{4={6, 15, 24, 35, 44, 53, 60, 69, 78}},PE End:{4={8, 17, 26, 33, 42, 51, 62, 71, 80}},
   Link Type:2,originSector:{7},startDigits:{4},activeCells:{63, 65},linkedCells:{69, 71},linkDigits:{4},startSector:{4={7, 24}},linkSector:{4={7, 26}},startSwap:{},endSwap:{},PE Start:{4={54, 55, 56, 69, 71, 72, 73, 74}},PE End:{4={60, 61, 62, 63, 65, 78, 79, 80}},
   Link Type:2,originSector:{25},startDigits:{4},activeCells:{57, 58, 59},linkedCells:{75, 76, 77},linkDigits:{4},startSector:{4={6, 25}},linkSector:{4={8, 25}},startSwap:{},endSwap:{},PE Start:{4={54, 55, 56, 60, 61, 62, 75, 76, 77}},PE End:{4={57, 58, 59, 72, 73, 74, 78, 79, 80}},
Type: ERI
   Link Type:3,originSector:{18},startDigits:{4},activeCells:{9, 10, 11},linkedCells:{1, 10, 19},linkDigits:{4},startSector:{4={1, 18}},linkSector:{4={10, 18}},startSwap:{},endSwap:{},PE Start:{4={1, 12, 13, 14, 15, 16, 17, 19}},PE End:{4={9, 11, 28, 37, 46, 55, 73}},

Code: Select all

my chain walk taking the "5" links above and walking  LEFT | Right edges and lists what each can add. {debugging code}
=== StrongLink: ({4})r2c8=({4})r79c8{CELL_TO_GROUP}Link ID =3
  RIGHT -> target: ({4})r8c13=({4})r8c79{GROUP_TO_GROUP} dir=false wt=1 digit?=Target Link id =2
  LEFT  -> target: ({4})r2c123=({4})r123c2{ERI} dir=true wt=1 digit?=Target Link id =0
=== StrongLink: ({4})r456c7=({4})r456c9{GROUP_TO_GROUP}Link ID =1
=== StrongLink: ({4})r8c13=({4})r8c79{GROUP_TO_GROUP}Link ID =2
  RIGHT -> target: ({4})r2c8=({4})r79c8{CELL_TO_GROUP} dir=false wt=1 digit?=Target Link id =3
=== StrongLink: ({4})r7c456=({4})r9c456{GROUP_TO_GROUP}Link ID =4
=== StrongLink: ({4})r2c123=({4})r123c2{ERI}Link ID =0
  LEFT  -> target: ({4})r2c8=({4})r79c8{CELL_TO_GROUP} dir=true wt=1 digit?=Target Link id =3

Starting BFS from: ({4})r2c8=({4})r79c8{CELL_TO_GROUP}
Starting BFS from: ({4})r456c7=({4})r456c9{GROUP_TO_GROUP}
Starting BFS from: ({4})r8c13=({4})r8c79{GROUP_TO_GROUP}
Starting BFS from: ({4})r7c456=({4})r9c456{GROUP_TO_GROUP}
Starting BFS from: ({4})r2c123=({4})r123c2{ERI}
Total start nodes = 5


reports chains that have eliminations and remove duplicates {reversible}
Normal chains count:2 Unique chains retained = 1
Code: Select all
AIC: (5)(r8c13 = r8c79)(5) - (5)(r79c8 = r2c8)(5) - (5)(r2c123 = r123c2)(5) => r79c2 <> 5


previous post did the same thing for the last example: and listed all the chain it can build.

a.i.c doesn't start on a Cell. { that's nice-loops aka forcing chains}, so yes starting as r2c8 as "on" that would be the forcing chain logic.
a.i.c walks digit based XOR gates{strong link} a node connected by Nand edges{weak inference} to another node.
i have all the math and foundations in place on reddit, i should probably write a dissertation paper on it and publish it.

nice-loops:
OR gates as strong links {cells based} !A=b. { where at least 1 must be true}
Nand A=!b as cellular weak links. { one or none, and never both}

Typically:
1st generation of nice-loops started on Nand and propagated forward on implication,
2nd generation nice-loops often mislabelled as A.I.C could start on OR gates !A=b { off implies on} and propagates forward on implication,

you can see this on scanraid,hodoku and several other sources : some of this stems from Myths a.i.c documentation that ties its definitions back into nice-loops definitions as they where established back then instead of a stand alone concept.

I am not saying the "or" logic doesn't work so don't get me wrong on that. the version I'm alluding to here is Acyclic and has deterministic outcomes, without requiring a union effect for final outcome.

hope that answers the question.
Some do, some teach, the rest look it up.
stormdoku
User avatar
StrmCkr
 
Posts: 1510
Joined: 05 September 2006

Re: Code rewrite for AIC Chains

Postby Hajime » Tue Jan 27, 2026 6:28 pm

hope that answers the question.

Sure...
Now to program this for all variants like SudokuX, Windoku, Asterisk and all valid jigsaw sudoku's.
My solver requires all of this :(
User avatar
Hajime
 
Posts: 1416
Joined: 20 April 2018
Location: Fryslân

Re: Code rewrite for AIC Chains

Postby StrmCkr » Tue Jan 27, 2026 9:26 pm

variations:
have a list of extra constraints already defined yes?

standard 4 Windoku xor slice theory still holds. as these 4 operate as additional boxes.
derived 5 windows xor slice theory would also work

Standard 4 windows also get Eri

sudoku x: diagonal : xor box 1,5,9 | anti diagonal xor box 3,5,7

jigsaws replace box for no nets : slicing still holds for this to

Edit
Astrid ~ addition sectors, this works as well.

The main concept is a sector is comprised of intersections of other sectors.
Then we can say
sector a =( a *b, a*c, a*d)
When one of the intersections is off. We have 2 options remaining.
Some do, some teach, the rest look it up.
stormdoku
User avatar
StrmCkr
 
Posts: 1510
Joined: 05 September 2006

Previous

Return to Software