Sudoku Explainer: Bugs, Quirks and Other Remarks...

Programs which generate, solve, and analyze Sudoku puzzles

Re: Sudoku Explainer: Bugs, Quirks and Other Remarks...

Postby daj95376 » Mon Nov 15, 2010 4:55 pm

[Withdrawn and replaced with a later message.]
Last edited by daj95376 on Tue Nov 16, 2010 11:55 am, edited 1 time in total.
daj95376
2014 Supporter
 
Posts: 2624
Joined: 15 May 2006

Postby ronk » Mon Nov 15, 2010 7:36 pm

daj95376 wrote:Boy, the terminology is definitely varied on describing an APE. I might as well throw in my two cents.
...
No constraint on where the APE cells exist. If they exist in different chutes, then it's equivalent to an XY-Wing. If they exist in the same chute, then APE includes XY/XYZ/WXYZ/VWXYZ/UVWXYZ-Wing, but is not limited to them. Finally, if they exist in the intersection of a box and a line (row/col), then we have the most fundamental definition of an APE.

Then you must understand why the "pivot cell" term applies, correct?

daj95376 wrote:As for the NL notation, I'll go with the following use of the five cells:

Code: Select all
(9=6)r1c2 - (6=5)r1c8 - (5=19)r14c1  =>  r2c1<>9

It doesn't describe an APE, but I couldn't identify an APE from the NL chain, either -- even after compensating for the typo.

My NL net expression is for the "cell forcing chain" that Explainer found. I see no typo.
ronk
2012 Supporter
 
Posts: 4764
Joined: 02 November 2005
Location: Southeastern USA

Re:

Postby daj95376 » Mon Nov 15, 2010 10:40 pm

ronk wrote:Then you must understand why the "pivot cell" term applies, correct?

See my message after Paul's message!

ronk wrote:My NL net expression is for the "cell forcing chain" that Explainer found. I see no typo.

I'd like to know how you explain the dark red part of the chain.

r2c1 -9- r4c1 -1- r1c1( -9- r2c1) -5- r1c8 -6- r1c2 -9- r2c1 ==> r2c1<>9

Since the chain is trying to describe a network, the following would do a better job of showing secondary effects in r1c1:

r2c1 -9- r1c1,r4c1 -1- r1c1 -5- r1c8 -6- r1c2 -9- r2c1 ==> r2c1<>9
Last edited by daj95376 on Tue Nov 16, 2010 11:56 am, edited 1 time in total.
daj95376
2014 Supporter
 
Posts: 2624
Joined: 15 May 2006

Re: Why is this not an Aligned Pair Exclusion ??

Postby PIsaacson » Tue Nov 16, 2010 10:47 am

ronk wrote:Why is this not an Aligned Pair Exclusion ("APE") for ER=6.2? Does Sudoku Explainer restrict the cells of an APE to a box and a line (row or column)? If "yes", is this restriction commonly applied by others?

Code: Select all
..4..2..3....4..8.8..3..1....3.7...6.5.9...7.6.....5....9..7..8.1..9....2..4..6..

At the point of the "Cell Forcing Chain (ER=8.3)" move:
*159  *69    4     | 15678 1568  2     | 79   *56    3
 135-9 2369  125   | 167   4     156   | 279   8     259
 8     267   257   | 3     56    9     | 1     2456  245
-------------------+-------------------+------------------
*19    289   3     | 158   7     1458  | 2489  24    6
 4     5     28    | 9     2368  36    | 38    7     1
 6     2789  1278  | 128   1238  134   | 5     234   29
-------------------+-------------------+------------------
 35    4     9     | 256   2356  7     | 23    1     8
 7     1     6     | 28    9     38    | 234   2345  245
 2     38    58    | 4     135   135   | 6     9     7

r2c1 -9- r4c1 -1- r1c1( -9- r2c1) -5- r1c8 -6- r1c2 -9- r2c1 ==> r2c1<>9

Ron,

Upon reflection, I would call it an ALS-XZ chain with als 1 r1c28.<569> -5- als 2 r14c1.<159> => r2c1 <> 9. I think I read somewhere that all APEs could be described by ALS chains??? But, almost all APE descriptions imply that the eliminations occur within one of the APE core cells, so I'm not sure how this particular set of 4 cells would qualify as an APE.

I'm surprised that there were objections to defining this as an ATE with the core triplet cells r1c1 r1c2 and r2c1. The exclusion cells r1c8 and r4c1 by themselves reduce the candidate combinations of the core cells to produce the r2c1 <> 9 elimination. SE incorrectly enforces bi-values to see all three core cells for an Aligned Triple, if I'm reading the code correctly at lines 115-123 of AlignedExclusion.java. It is sufficient to be a peer to any 2 of the three core cells of an Aligned Triple in order for a bi-value exclusion cell to eliminate combinations. Only a tri-value exclusion cell needs to see all 3 core cells in ATE. I've experimented with Stuart's Type 2 eliminations, and two-cell triple value ALSs do indeed act as 3 pseudo-cell bi-values. If the ALS candidates are ABC, then the 3 pseudo-cells produced are AB, AC, and BC exactly as Stuart described them. All the cells describing the ALS must be peers to both core cells of an APE, or any 2 cells of an Aligned Triple. By extension, a 3 cell 4 candidate ALS with values ABCD can act as 4 pseudo-cell tri-values: ABC, ABD, ACD, and BCD provided all 3 ALS cells are peers of all 3 core cells of the Aligned Triple. As it turns out, for APE the 2 core cells can be positioned anywhere in the grid as there are always a minimum of 2 cells that qualify as exclusion cell positions, although such a setup probably overlaps UR tremendously. I currently limit my ATE processing to enforce sharing a chute between any 2 core cells, but this was done mostly to speed-up the processing since the algorithm is painfully slow, but it seems likely that any 3 cells could potentially define the core cells.

If anyone has algorithms that they are willing to share for APE/ATE processing, I would be grateful to exchange ideas/code/concepts.

Cheers,
Paul

P.S. I'd rather code a really fast subset counting algorithm if anyone has such a beast. I've got one, but it's painfully slow once the permitted cell count goes over 8 cells.
PIsaacson
 
Posts: 249
Joined: 02 July 2008

Re: Why is this not an Aligned Pair Exclusion ??

Postby daj95376 » Tue Nov 16, 2010 12:05 pm

PIsaacson wrote:If anyone has algorithms that they are willing to share for APE/ATE processing, I would be grateful to exchange ideas/code/concepts.

To me, an APE is just another way of presenting Kraken Cell logic where the streams from the Kraken Cell contain either one/three inferences; i.e., WI -or- WI-SI-WI. This works for the APE Type 1 and the APE Type 2 at Stuart's website.

In Ron's grid, he needs five inferences for one of the streams.

Code: Select all
(1)r1c1 - (1=9)r4c1             - (9)r2c1
(5)r1c1 - (5=6)r1c8 - (6=9)r1c2 - (9)r2c1
(9)r1c1                         - (9)r2c1


What Ron calls a "pivot/vertex cell" is (probably) what I call the kraken cell.

Regards, Danny


Stuart APE Type 2: cells r2c6 and r3c6

Code: Select all
 Kraken Cell                 Elimination Cell
 -----------                 ----------------
 (1)r2c6 -     (1=4 )r5 c6 - (4)r3c6
 (4)r2c6                   - (4)r3c6
 (6)r2c6 -     (6=45)r13c5 - (4)r3c6
 *-----------------------------------------------------------*
 | 7     1256  1245  | 158  #456   3     | 2468  46    9     |
 | 8     136   14    | 9     2    *146   | 5     346   7     |
 | 3456  2356  9     | 7    #456  *68-4  | 2468  1     38    |
 |-------------------+-------------------+-------------------|
 | 9     7     145   | 2     3     468   | 46    456   158   |
 | 45    8     6     | 15    7    #14    | 3     9     2     |
 | 345   1235  125   | 58    456   9     | 468   7     18    |
 |-------------------+-------------------+-------------------|
 | 2     4     8     | 6     9     7     | 1     35    35    |
 | 1     9     3     | 4     8     5     | 7     2     6     |
 | 56    56    7     | 3     1     2     | 9     8     4     |
 *-----------------------------------------------------------*

What's (apparently) not acceptable: after altering r1c5 & r3c5

Code: Select all
 (1)r2c6 -     (1=4)r5c6             - (4)r3c6
 (4)r2c6                             - (4)r3c6
 (6)r2c6 -     (6=5)r3c5 - (5=4)r1c5 - (4)r3c6
 *-----------------------------------------------------------*
 | 7     1256  1245  | 158  #45    3     | 2468  46    9     |
 | 8     136   14    | 9     2    *146   | 5     346   7     |
 | 3456  2356  9     | 7    #56   *468   | 2468  1     38    |
 |-------------------+-------------------+-------------------|
 | 9     7     145   | 2     3     468   | 46    456   158   |
 | 45    8     6     | 15    7    #14    | 3     9     2     |
 | 345   1235  125   | 58    456   9     | 468   7     18    |
 |-------------------+-------------------+-------------------|
 | 2     4     8     | 6     9     7     | 1     35    35    |
 | 1     9     3     | 4     8     5     | 7     2     6     |
 | 56    56    7     | 3     1     2     | 9     8     4     |
 *-----------------------------------------------------------*
daj95376
2014 Supporter
 
Posts: 2624
Joined: 15 May 2006

Re: Why is this not an Aligned Pair Exclusion ??

Postby ronk » Tue Nov 16, 2010 1:55 pm

PIsaacson wrote:
ronk wrote:Why is this not an Aligned Pair Exclusion ("APE") for ER=6.2? Does Sudoku Explainer restrict the cells of an APE to a box and a line (row or column)? If "yes", is this restriction commonly applied by others?

Upon reflection, I would call it an ALS-XZ chain with als 1 r1c28.<569> -5- als 2 r14c1.<159> => r2c1 <> 9.

I think we can put that one aside. I didn't realize each path between the "pivot cell" and the "elimination cell" of an APE was restricted to one bivalue (or none, meaning directly linked). I erroneously thought a chain of two bivalues was OK too. (daj95376, I wrote "pivot", not "vertex.")

PIsaacson wrote:I think I read somewhere that all APEs could be described by ALS chains???

I may have helped start and/or propagate that idea. I'm no longer convinced that it's true.

PIsaacson wrote:If anyone has algorithms that they are willing to share for APE/ATE processing, I would be grateful to exchange ideas/code/concepts.

I think APE/ATE are fundamentally enumeration techniques and brute force enumeration, with the appropriate rule sets, may be required to clone SE's APE/ATE performance. That said, I don't know whether SE uses enumeration.

However, how efficient is your ALS-xz? For APE, you might try it with the results filtered to those with N-1 of the ALS-xz cells bivalued and containing the elimination digit. Would this be exensible to ATE? Probably not.
ronk
2012 Supporter
 
Posts: 4764
Joined: 02 November 2005
Location: Southeastern USA

Previous

Return to Software