ORk-Forcing-Whips, ORk-Contrad-Whips and ORk-whips

Advanced methods and approaches for solving Sudoku puzzles

Re: ORk-Forcing-Whips, ORk-Contrad-Whips and ORk-whips

Postby denis_berthier » Sun Jan 08, 2023 9:11 am

.
Previously, I have spoken of the ultra-persitency of ORk-relations (see the Augmented User Manual own GitHub or on ResearchGate https://www.researchgate.net/publication/365186265_Augmented_User_Manual_for_CSP-Rules-V21).

This post is about splitting ORk-relations. The idea of doing such things was more or less inspired by solutions proposed by other people in the Puzzles section of this forum. What I've done is find a generic way to express some of the ad hoc arguments made there.

First define a c-chain[n] as a sequence of n+1 different candidates C1... Cn+1 such that for each 1 ≤ i ≤ n, Ci and Ci+1 are related by a (3D) bivalue relation.
It is obvious that, if n is even then C1 and Cn+1 have the same truth value.
This is a generic definition and a generic property.

Theorem (generic): given an ORk relation between candidates Z1, ... Zk, if there is any even c-chain[n] between two of the Zi's, say Za and Zb, then the original ORk-relation can be split into two ORk-1 relations, between k-1 candidates, respectively {Z1, ... Zk}-Za and {Z1, ... Zk}-Zb.
[Edit, added]:Corollary: if k=2, both Z1 and Z2 can be asserted.

Proof: obvious

Note: "between two of the Zi's, say Za and Zb" means that C1 = Za and Cn+1 = Zb

For an example of using the theorem, see second post here: http://forum.enjoysudoku.com/51007-in-63137-t-e-3-min-expands-t40721-3.html and next post.
For an example of using the corollary, see here: http://forum.enjoysudoku.com/other-hard-one-from-mith-s-trivalue-oddagon-list-t40727-4.html.
For an example of using the theorem repeatedly in conjunction with ORk-reduction (ultra-persistency, see here: http://forum.enjoysudoku.com/1182-in-63137-list-of-t-e-3-min-expands-t40739-3.html

Note: the way such splitting is coded in CSP-Rules is still experimental.
denis_berthier
2010 Supporter
 
Posts: 4417
Joined: 19 June 2007
Location: Paris

Re: ORk-Forcing-Whips, ORk-Contrad-Whips and ORk-whips

Postby denis_berthier » Fri Jan 13, 2023 12:21 pm

.
a reader of this thread wrote:How do you know that c-chains of even lengths are the only way ORk-relations can be reduced?


1) ORk relations are reduced when a guardian is eliminated (this is part of their ultra-persistency in CSP-Rules ).
But your question (about my previous post) is about a totally different topic.

2) Indeed, I don't know what you claim. On the contrary, there are probably many kinds of chain patterns that could be used as a basis for reducing ORk-relations.

What I've been looking for is rules that:
- allowed to reduce the number of guardians; it appeared that trying to split ORk-relations (instead of trying to reduce them, i.e. to eliminate guardians from them) was the most natural thing to do;
- involved only generic conditions (with no ad-hoc reasoning);
- were simple enough to be integrated in the hierarchy of resolution rules (though they are not resolution rules).
The last two conditions are trivially satisfied by c-chains (a c-chain[n] being posited at level Ln, just before the ORk-chains[n] that might rely on their results).

Now, can these splitting rules take into account the different ad hoc reductions that have been proposed for anti-tridagon puzzles in the Puzzles section? I haven't checked and it's not that important here for the following reason:
my approach has always been to find universal rules/techniques that can be applied in a systematic way. They may not be the smartest ones for a particular puzzle, but they aim at being the smartest ones in the mean.
.
denis_berthier
2010 Supporter
 
Posts: 4417
Joined: 19 June 2007
Location: Paris

Re: ORk-Forcing-Whips, ORk-Contrad-Whips and ORk-whips

Postby denis_berthier » Fri Jan 10, 2025 1:13 pm

.
ORk-chains are generic and can be used in combination with ORk-relations generated by any type of patterns.
This applies in particular to Deadly Patterns (DPs) if one accepts the assumption of uniqueness.

Out of sheer curiosity about their effectiveness in this con text, I've now coded the 17 Deadly Patterns on 9 or fewer cells defined here: https://www.sudopedia.org/wiki/Deadly_Pattern
The rules are similar to those for eleven 630 impossible 3-digit patterns and they produce similar ORk-relations.
Because Deadly patterns are unstable, I've set their priorities very high, just after whips[1].
The following example illustrates how they can be used. Having very high priorities, they are expected to have many guardians and to be subjected to many ORk-ultra persitency and ORk-splitting rules before becoming applicable.

Here's an example of a puzzle in SFin2+W3 but in SFin2+W2+DP-OR6W2, puzzle #5733 in the cbg-000 controlled-bias collection. The gain (from L3 to l2) is not much in this case, but this is just an illustration of the idea.
Code: Select all
 Puzzle cbg-000 #37
 +-------+-------+-------+
 ! . . 3 ! 4 . . ! . 8 . !
 ! . . 6 ! . 8 . ! . . . !
 ! 7 . . ! . . . ! . . 5 !
 +-------+-------+-------+
 ! 2 3 . ! . 9 . ! 6 . 7 !
 ! . . . ! . 7 4 ! . . 8 !
 ! . . . ! . . 1 ! . . . !
 +-------+-------+-------+
 ! . . . ! . 1 . ! . . . !
 ! . . 8 ! 3 . . ! . 9 . !
 ! . 7 . ! . 6 . ! 5 3 . !
 +-------+-------+-------+
..34...8...6.8....7.......523..9.6.7....74..8.....1.......1......83...9..7..6.53. 136942


Code: Select all
Resolution state after Singles and whips[1]:
    +----------------+----------------+----------------+
    ! 19   129  3    ! 4    5    6    ! 7    8    129  !
    ! 145  1245 6    ! 7    8    9    ! 124  24   3    !
    ! 7    8    49   ! 1    2    3    ! 49   6    5    !
    +----------------+----------------+----------------+
    ! 2    3    145  ! 58   9    58   ! 6    145  7    !
    ! 169  169  159  ! 256  7    4    ! 3    125  8    !
    ! 8    46   7    ! 256  3    1    ! 249  245  29   !
    +----------------+----------------+----------------+
    ! 3    469  249  ! 59   1    25   ! 8    7    46   !
    ! 156  156  8    ! 3    4    7    ! 12   9    126  !
    ! 149  7    1249 ! 89   6    28   ! 5    3    14   !
    +----------------+----------------+----------------+
 98 candidates.


At this point, there are 8 different deadly patterns with 8 or fewer guardians. Only one of them will be useful - and it isn't the one with the minimum number of guardians. In what follows, I keep the 8 DPs, but I keep track only of the useful one. It's interesting to see how the associated ORk-relations is progressively split into ORk-relations with smaller values of k.

The 8 DPs:
Code: Select all
 DP4-2-1s-OR6-relation
    in cells (marked #): (r6c8 r6c7 r2c8 r2c7)
    with 6 guardians (in cells marked @) : n4r6c8 n5r6c8 n4r6c7 n9r6c7 n4r2c8 n4r2c7
    +-------------------+-------------------+-------------------+
    ! 19    129   3     ! 4     5     6     ! 7     8     129   !
    ! 145   1245  6     ! 7     8     9     ! 124#@ 24#@  3     !
    ! 7     8     49    ! 1     2     3     ! 49    6     5     !
    +-------------------+-------------------+-------------------+
    ! 2     3     145   ! 58    9     58    ! 6     145   7     !
    ! 169   169   159   ! 256   7     4     ! 3     125   8     !
    ! 8     46    7     ! 256   3     1     ! 249#@ 245#@ 29    !
    +-------------------+-------------------+-------------------+
    ! 3     469   249   ! 59    1     25    ! 8     7     46    !
    ! 156   156   8     ! 3     4     7     ! 12    9     126   !
    ! 149   7     1249  ! 89    6     28    ! 5     3     14    !
    +-------------------+-------------------+-------------------+

;;; the only one that will be used:
 DP4-2-1s-OR8-relation
    in cells (marked #): (r8c2 r8c1 r2c2 r2c1)
    with 8 guardians (in cells marked @) : n5r8c2 n6r8c2 n5r8c1 n6r8c1 n4r2c2 n5r2c2 n4r2c1 n5r2c1
    +----------------------+----------------------+----------------------+
    ! 19     129    3      ! 4      5      6      ! 7      8      129    !
    ! 145#@  1245#@ 6      ! 7      8      9      ! 124    24     3      !
    ! 7      8      49     ! 1      2      3      ! 49     6      5      !
    +----------------------+----------------------+----------------------+
    ! 2      3      145    ! 58     9      58     ! 6      145    7      !
    ! 169    169    159    ! 256    7      4      ! 3      125    8      !
    ! 8      46     7      ! 256    3      1      ! 249    245    29     !
    +----------------------+----------------------+----------------------+
    ! 3      469    249    ! 59     1      25     ! 8      7      46     !
    ! 156#@  156#@  8      ! 3      4      7      ! 12     9      126    !
    ! 149    7      1249   ! 89     6      28     ! 5      3      14     !
    +----------------------+----------------------+----------------------+

 DP4-2-1s-OR8-relation
    in cells (marked #): (r8c2 r8c1 r5c2 r5c1)
    with 8 guardians (in cells marked @) : n5r8c2 n6r8c2 n5r8c1 n6r8c1 n6r5c2 n9r5c2 n6r5c1 n9r5c1
    +-------------------+-------------------+-------------------+
    ! 19    129   3     ! 4     5     6     ! 7     8     129   !
    ! 145   1245  6     ! 7     8     9     ! 124   24    3     !
    ! 7     8     49    ! 1     2     3     ! 49    6     5     !
    +-------------------+-------------------+-------------------+
    ! 2     3     145   ! 58    9     58    ! 6     145   7     !
    ! 169#@ 169#@ 159   ! 256   7     4     ! 3     125   8     !
    ! 8     46    7     ! 256   3     1     ! 249   245   29    !
    +-------------------+-------------------+-------------------+
    ! 3     469   249   ! 59    1     25    ! 8     7     46    !
    ! 156#@ 156#@ 8     ! 3     4     7     ! 12    9     126   !
    ! 149   7     1249  ! 89    6     28    ! 5     3     14    !
    +-------------------+-------------------+-------------------+

 DP4-2-1s-OR8-relation
    in cells (marked #): (r9c3 r9c1 r5c3 r5c1)
    with 8 guardians (in cells marked @) : n4r9c3 n9r9c3 n4r9c1 n9r9c1 n5r5c3 n9r5c3 n6r5c1 n9r5c1
    +----------------------+----------------------+----------------------+
    ! 19     129    3      ! 4      5      6      ! 7      8      129    !
    ! 145    1245   6      ! 7      8      9      ! 124    24     3      !
    ! 7      8      49     ! 1      2      3      ! 49     6      5      !
    +----------------------+----------------------+----------------------+
    ! 2      3      145    ! 58     9      58     ! 6      145    7      !
    ! 169#@  169    159#@  ! 256    7      4      ! 3      125    8      !
    ! 8      46     7      ! 256    3      1      ! 249    245    29     !
    +----------------------+----------------------+----------------------+
    ! 3      469    249    ! 59     1      25     ! 8      7      46     !
    ! 156    156    8      ! 3      4      7      ! 12     9      126    !
    ! 149#@  7      1249#@ ! 89     6      28     ! 5      3      14     !
    +----------------------+----------------------+----------------------+

 DP4-2-1s-OR6-relation
    in cells (marked #): (r5c2 r5c1 r1c2 r1c1)
    with 6 guardians (in cells marked @) : n6r5c2 n9r5c2 n6r5c1 n9r5c1 n9r1c2 n9r1c1
    +-------------------+-------------------+-------------------+
    ! 19#@  129#@ 3     ! 4     5     6     ! 7     8     129   !
    ! 145   1245  6     ! 7     8     9     ! 124   24    3     !
    ! 7     8     49    ! 1     2     3     ! 49    6     5     !
    +-------------------+-------------------+-------------------+
    ! 2     3     145   ! 58    9     58    ! 6     145   7     !
    ! 169#@ 169#@ 159   ! 256   7     4     ! 3     125   8     !
    ! 8     46    7     ! 256   3     1     ! 249   245   29    !
    +-------------------+-------------------+-------------------+
    ! 3     469   249   ! 59    1     25    ! 8     7     46    !
    ! 156   156   8     ! 3     4     7     ! 12    9     126   !
    ! 149   7     1249  ! 89    6     28    ! 5     3     14    !
    +-------------------+-------------------+-------------------+

 DP4-2-1-OR7-relation
    in cells (marked #): (r6c8 r6c4 r5c8 r5c4)
    with 7 guardians (in cells marked @) : n4r6c8 n5r6c8 n5r6c4 n6r6c4 n5r5c8 n5r5c4 n6r5c4
    +-------------------+-------------------+-------------------+
    ! 19    129   3     ! 4     5     6     ! 7     8     129   !
    ! 145   1245  6     ! 7     8     9     ! 124   24    3     !
    ! 7     8     49    ! 1     2     3     ! 49    6     5     !
    +-------------------+-------------------+-------------------+
    ! 2     3     145   ! 58    9     58    ! 6     145   7     !
    ! 169   169   159   ! 256#@ 7     4     ! 3     125#@ 8     !
    ! 8     46    7     ! 256#@ 3     1     ! 249   245#@ 29    !
    +-------------------+-------------------+-------------------+
    ! 3     469   249   ! 59    1     25    ! 8     7     46    !
    ! 156   156   8     ! 3     4     7     ! 12    9     126   !
    ! 149   7     1249  ! 89    6     28    ! 5     3     14    !
    +-------------------+-------------------+-------------------+

 DP4-2-1-OR7-relation
    in cells (marked #): (r5c8 r5c3 r4c8 r4c3)
    with 7 guardians (in cells marked @) : n5r5c8 n5r5c3 n9r5c3 n4r4c8 n5r4c8 n4r4c3 n5r4c3
    +-------------------+-------------------+-------------------+
    ! 19    129   3     ! 4     5     6     ! 7     8     129   !
    ! 145   1245  6     ! 7     8     9     ! 124   24    3     !
    ! 7     8     49    ! 1     2     3     ! 49    6     5     !
    +-------------------+-------------------+-------------------+
    ! 2     3     145#@ ! 58    9     58    ! 6     145#@ 7     !
    ! 169   169   159#@ ! 256   7     4     ! 3     125#@ 8     !
    ! 8     46    7     ! 256   3     1     ! 249   245   29    !
    +-------------------+-------------------+-------------------+
    ! 3     469   249   ! 59    1     25    ! 8     7     46    !
    ! 156   156   8     ! 3     4     7     ! 12    9     126   !
    ! 149   7     1249  ! 89    6     28    ! 5     3     14    !
    +-------------------+-------------------+-------------------+

 DP6-2-2s-OR6-relation
    in cells (marked #): (r2c2 r2c7 r1c2 r1c9 r8c7 r8c9)
    with 6 guardians (in cells marked @) : n4r2c2 n5r2c2 n4r2c7 n9r1c2 n9r1c9 n6r8c9
    +----------------------+----------------------+----------------------+
    ! 19     129#@  3      ! 4      5      6      ! 7      8      129#@  !
    ! 145    1245#@ 6      ! 7      8      9      ! 124#@  24     3      !
    ! 7      8      49     ! 1      2      3      ! 49     6      5      !
    +----------------------+----------------------+----------------------+
    ! 2      3      145    ! 58     9      58     ! 6      145    7      !
    ! 169    169    159    ! 256    7      4      ! 3      125    8      !
    ! 8      46     7      ! 256    3      1      ! 249    245    29     !
    +----------------------+----------------------+----------------------+
    ! 3      469    249    ! 59     1      25     ! 8      7      46     !
    ! 156    156    8      ! 3      4      7      ! 12#    9      126#@  !
    ! 149    7      1249   ! 89     6      28     ! 5      3      14     !
    +----------------------+----------------------+----------------------+


naked-pairs-in-a-row: r4{c4 c6}{n5 n8} ==> r4c8≠5, r4c3≠5
singles ==> r5c3=5, r6c8=5
finned-x-wing-in-rows: n4{r6 r3}{c7 c2} ==> r2c2≠4

At least one candidate of a previous DP4-2-1s-OR8-relation between candidates n5r8c2 n6r8c2 n5r8c1 n6r8c1 n4r2c2 n5r2c2 n4r2c1 n5r2c1 has just been eliminated.
There remains a DP4-2-1s-OR7-relation between candidates: n5r8c2 n6r8c2 n5r8c1 n6r8c1 n5r2c2 n4r2c1 n5r2c1

finned-x-wing-in-rows: n4{r4 r3}{c3 c8} ==> r2c8≠4
singles ==> r2c8=2, r5c8=1, r4c8=4, r4c3=1, r6c2=4, r6c4=6, r5c4=2, r1c2=2
naked-pairs-in-a-column: c2{r5 r7}{n6 n9} ==> r8c2≠6

Code: Select all
    +-------------+-------------+-------------+
    ! 19  2   3   ! 4   5   6   ! 7   8   19  !
    ! 145 15  6   ! 7   8   9   ! 14  2   3   !
    ! 7   8   49  ! 1   2   3   ! 49  6   5   !
    +-------------+-------------+-------------+
    ! 2   3   1   ! 58  9   58  ! 6   4   7   !
    ! 69  69  5   ! 2   7   4   ! 3   1   8   !
    ! 8   4   7   ! 6   3   1   ! 29  5   29  !
    +-------------+-------------+-------------+
    ! 3   69  249 ! 59  1   25  ! 8   7   46  !
    ! 156 15  8   ! 3   4   7   ! 12  9   126 !
    ! 149 7   249 ! 89  6   28  ! 5   3   14  !
    +-------------+-------------+-------------+

At least one candidate of a previous DP4-2-1s-OR7-relation between candidates n5r8c2 n6r8c2 n5r8c1 n6r8c1 n5r2c2 n4r2c1 n5r2c1 has just been eliminated.
There remains a DP4-2-1s-OR6-relation between candidates: n5r8c2 n5r8c1 n6r8c1 n5r2c2 n4r2c1 n5r2c1

x-wing-in-columns: n1{c2 c7}{r2 r8} ==> r8c9≠1, r8c1≠1, r2c1≠1

DP4-2-1s-OR6-relation between candidates n5r8c2, n5r8c1, n6r8c1, n5r2c2, n4r2c1 and n5r2c1
+ same valence for candidates n6r8c1 and n5r2c1 via c-chain[2]: n6r8c1,n5r8c1,n5r2c1
==> DP4-2-1s-OR6-relation can be split into two DP4-2-1s-OR5-relations with respective lists of guardians:
n5r8c2 n5r8c1 n5r2c2 n4r2c1 n5r2c1 and n5r8c2 n5r8c1 n6r8c1 n5r2c2 n4r2c1 .

DP4-2-1s-OR4-relation between candidates n5r8c2, n5r8c1, n5r2c2 and n4r2c1
+ same valence for candidates n5r8c1 and n5r2c2 via c-chain[2]: n5r8c1,n5r8c2,n5r2c2
==> DP4-2-1s-OR4-relation can be split into two DP4-2-1s-OR3-relations with respective lists of guardians:
n5r8c2 n5r2c2 n4r2c1 and n5r8c2 n5r8c1 n4r2c1 .

DP4-2-1s-OR3-relation between candidates n5r8c2, n5r8c1 and n4r2c1
+ same valence for candidates n5r8c1 and n4r2c1 via c-chain[2]: n5r8c1,n5r2c1,n4r2c1
==> DP4-2-1s-OR3-relation can be split into two DP4-2-1s-OR2-relations with respective lists of guardians:
n5r8c2 n4r2c1 and n5r8c2 n5r8c1 .

DP4-2-1s-OR2-whip[2]: OR2{{n4r2c1 | n5r8c2}} - b7n1{r8c2 .} ==> r9c1≠4
stte

Note: DP4-2-1 is the usual UR2, but with more guardians than usual.
.
denis_berthier
2010 Supporter
 
Posts: 4417
Joined: 19 June 2007
Location: Paris

Re: ORk-Forcing-Whips, ORk-Contrad-Whips and ORk-whips

Postby denis_berthier » Wed Jan 22, 2025 9:57 am

.
As shown in the previous example, there may be many ORk-relations based on deadly patterns, most of which are useless. And the previous example is not the worst.
I haven't yet found the right balance between
- high priorities for DP rules (and generation of many useless ORk-relations, very long resolutions path with useless sequences related to the progressive simplification of these relations (fewer guardians))
- lower priorities (and risk of missing a few ORk-relations, because they have degenerated due to other rules being applied before).
That's why I'm slightly delaying the publication of these rules.
.
denis_berthier
2010 Supporter
 
Posts: 4417
Joined: 19 June 2007
Location: Paris


Return to Advanced solving techniques