7-cell Unavoidable Sets

Everything about Sudoku that doesn't fit in one of the other sections

Re: 7-cell Unavoidable Sets

Postby eleven » Wed Jan 08, 2025 9:44 pm

dobrichev wrote:I continue to have serious doubts about the practical value of these exotic patterns in vanilla Sudoku.

Oh, you can simply use it.
Code: Select all
+---------------------+-------------------+---------------------+
|   47   a18   *13+8  |   9     47    5   |  *13    2     6     |
|  b349   6   @*12+9  |  @23   b34    8   |  *13    5     7     |
|   37    5    @23    |  @23+7  1     6   |   9     8     4     |
+---------------------+-------------------+---------------------+
|   39    2     6     |   8     39    1   |   4     7     5     |
|   1     7     35    |   35    6     4   |   2     9     8     |
|   8     49    459   |   57    79    2   |   6     1     3     |
+---------------------+-------------------+---------------------+
|   5     14    14    |   6     2     7   |   8     3     9     |
|   6     89    89    |   1     5     3   |   7     4     2     |
|   2     3     7     |   4     8     9   |   5     6     1     |
+---------------------+-------------------+---------------------+

Hidden UR 13 (*) (1r2c3 -> 3r2c7 -> 1r1c7 -> 3r1c3) => -1r2c3
Hidden UR 23 (@) (2r2c3 -> 3r3c3 -> 2r3c4 -> 3r2c4) => -2r2c3, stte

The relation to U4's is, that the moves avoid a 13 or 23 U4 in the solution.

[Added:] btw these patterns with one UR candidate mssing are also called UR1.1, and the eliminations can be made also without the uniqueness assumption (because the placement would force a UR4, but there can't be the other solution for the puzzle, because the other candidate could be eliminated - therefore the elimination is also valid in multi-solution puzzles). This was found by RW in 2006 here (later I had a long discussion with Denis about that topic).
eleven
 
Posts: 3186
Joined: 10 February 2008

Re: 7-cell Unavoidable Sets

Postby nazaz » Thu Jan 09, 2025 8:21 am

dobrichev wrote:
Code: Select all
Canonical form:

.  .  13 |  .  .  .  |  31 .  .
.  .  21 |  32 .  .  |  13 .  .
.  .  32 |  23 .  .  |  .  .  .
As Serg already noted, you can strengthen this DP by adding the candidate 3@r2c3. It seems appropriate to insist that all the solutions admitted by a "canonical" DP share the same footprint, and that the DP's candidates are exactly those that are implied by the common footprint; so Serg's edit should probably be regarded as the correct, canonical form of this DP.

In this particular example, you can add more than just the footprint-implied candidate whilst still leaving the pattern "deadly" (forcing solutions that contain a minimal UA). But you can't make all such additions simultaneously without destroying the "deadly" property. Hence my preference for stopping with the footprint-implied stuff.

The Sudopedia article adds the extra rule that the solutions of the common footprint are disjoint, forcing all solutions to be strongly minimal UAs. Dropping that rule adds eleven patterns on ≤9 cells, namely dobrichev's two 7-cell DPs together with nine 9-cell DPs as follows.

    Valency 3

    Code: Select all
    123 ... ... | .12 ... ... | .13 ... ...
    ... .13 ... | ... ... ... | .13 ... ...
    .12 ... ... | .12 ... ... | ... ... ...
    ------------+-------------+------------
    .13 .13 ... | ... ... ... | ... ... ...

    Code: Select all
    123 .12 ... | ... ... ... | .13 ... ...
    .13 ... ... | ... ... ... | .13 ... ...
    ... ... ... | ... ... ... | ... ... ...
    ------------+-------------+------------
    ... .12 ... | .12 ... ... | ... ... ...
    .12 ... ... | .12 ... ... | ... ... ...

    Code: Select all
    123 .12 ... | ... .13 ... | ... ... ...
    .13 ... ... | .13 ... ... | ... ... ...
    ... ... ... | ... ... ... | ... ... ...
    ------------+-------------+------------
    ... ... ... | .13 .13 ... | ... ... ...
    .12 .12 ... | ... ... ... | ... ... ...

    Code: Select all
    ... ... ... | .12 ... ... | .12 ... ...
    123 .13 ... | ... ... ... | .12 ... ...
    .12 ... ... | .12 ... ... | ... ... ...
    ------------+-------------+------------
    .13 .13 ... | ... ... ... | ... ... ...

    Code: Select all
    123 .12 ... | .14 ... ... | .34 ... ...
    .13 ... ... | .14 ... ... | .34 ... ...
    ... ... ... | ... ... ... | ... ... ...
    ------------+-------------+------------
    .12 .12 ... | ... ... ... | ... ... ...

    Code: Select all
    ... .12 ... | 123 ... ... | .13 ... ...
    ... ... ... | .13 ... ... | .13 ... ...
    .12 ... ... | .12 ... ... | ... ... ...
    ------------+-------------+------------
    .12 .12 ... | ... ... ... | ... ... ...

    Code: Select all
    .12 .34 ... | 123 ... ... | .14 ... ...
    ... .34 ... | .13 ... ... | .14 ... ...
    .12 ... ... | .12 ... ... | ... ... ...

    Code: Select all
    123 .12 ... | .13 ... ... | ... ... ...
    .14 ... ... | .14 ... ... | ... ... ...
    .34 ... ... | .34 ... ... | ... ... ...
    ------------+-------------+------------
    .12 .12 ... | ... ... ... | ... ... ...

    Valency 4

    Code: Select all
    .12 ... ... | 123 ... ... | .13 ... ...
    124 ... ... | .12 ... ... | .14 ... ...
    .14 ... ... | .13 ... ... | 134 ... ...
User avatar
nazaz
 
Posts: 11
Joined: 06 November 2018

Re: 7-cell Unavoidable Sets

Postby blue » Sat Jan 11, 2025 10:47 pm

If the topic is not deadly patterns, but unavoidable sets, and in particular, Sukaku unavoidable sets, then I'm with dobrichev ... the 7-cell patters *do* represent minimal unavoidable sets. Adding any other pencilmarks to his DP-like presentations, would destroy the minimality.

For Sukaku, if you consider that a "solution" is a true/false assignment for each of the 729 candidates, then an unavoidable set, should be a set of candidates where if the assignments were removed, the result would be a probelm with multiple solutions.
With some thought, one comes to the realization that a minimal unavoidable set, should be a set true candidates (taken from cell values in the solution grid), and a set of false candidates for the same cells -- just enough "false" candidates to admit a second solution, and not so many "true" candidates, that the two solutions have values in common, in relevant set of cells.
In a "normal looking" pencilmark grid, clearing those true/false assignments, would produce a "BUG" pattern. The BUG pattern should have exactly two solutions. Any more, and the UA set wouldn't be "minimal".

I see two ways to represent such UA sets.

In dobrichev's representation, whether by intention, or whether he was just imitating Red Ed's presentation of deadly patterns: he has candidates for one solution on the left, and candidates for the other, on the right.

Another representation, would be as two 81 character lines, one for the values in the solution grid, and another for thier alternates.

7-cell #1:
Code: Select all
..1...3....23..1....32...........................................................
..3...1....12..3....23...........................................................

7-cell #2:
Code: Select all
..........1.2.....32.1.....13....................................................
..........2.1.....13.2.....31....................................................

For a canonical form, I would suggest combining the two lines, and minlexing the whole 162-character string.
That would be equivalent to minlexing the first line, applying the same transformation to second line, and in case the first line has more than one automotphism, applying the one (or one of the many) that give(s) the "minlex-smallest" result for the 2nd line.

It should be noted that reversing the order of the lines, produces a second UA set (in a different soluton grid) that is also minimal.
The two orderings don't necessarily have the same canonical form, though.
That isn't a problem, if you consider that the first line is supposed to represent *true* candidates in a solution grid, and the second line, is supposed to represent "false" candidates -- really not the same thing.

For the two size 7 sets, swapping the lines doesn't change the canonical form.
Here is an "size 9" example, where it does.

Original, in minlex form:
Code: Select all
...........................................................1..2..1..3.4...4..2.31
...........................................................2..1..4..1.3...1..3.42

Lines swapped, and re-minlexed.
Code: Select all
...........................................................1..2..1.32..4..3.4...1
...........................................................2..1..3.41..2..1.3...4

These represent two "essentially distinct" (Sukaku) UA sets.
The deadly patterns produced from them, however, are "essentually equivalent".
See this post for related facts, involving deadly patterns produced from minimal Sudoku unavoidable sets.
blue
 
Posts: 1059
Joined: 11 March 2013

Re: 7-cell Unavoidable Sets

Postby Serg » Sun Jan 12, 2025 5:12 pm

Hi, nazaz!
UA sets with valency > 2 you published could be used in "Deadly Patterns style" for Sudoku puzzles solving, but appropriate method will be too complicated for manual solvers.

General idea of UR like methods - potential UA sets must be destroyed to avoid multisolution puzzle. Strongly minimal UA set can be destroyed by choosing extra candidate in some (one) UA set's cell. If we are dealing with not minimal UA set (like UA sets proposed by you) number of cells to hit varies from 1 to several cells. Let's consider your first 3-valent not minimal UA set:
Code: Select all
123 ... ... | .12 ... ... | .13 ... ...
... .13 ... | ... ... ... | .13 ... ...
.12 ... ... | .12 ... ... | ... ... ...
------------+-------------+------------
.13 .13 ... | ... ... ... | ... ... ...

Here are its 3 solutions:
Code: Select all
..1 ... ... | ..2 ... ... | ..3 ... ...
... ..3 ... | ... ... ... | ..1 ... ...
..2 ... ... | ..1 ... ... | ... ... ...
------------+-------------+------------
..3 ..1 ... | ... ... ... | ... ... ...


..2 ... ... | ..1 ... ... | ..3 ... ...
... ..3 ... | ... ... ... | ..1 ... ...
..1 ... ... | ..2 ... ... | ... ... ...
------------+-------------+------------
..3 ..1 ... | ... ... ... | ... ... ...


..3 ... ... | ..2 ... ... | ..1 ... ...
... ..1 ... | ... ... ... | ..3 ... ...
..2 ... ... | ..1 ... ... | ... ... ...
------------+-------------+------------
..1 ..3 ... | ... ... ... | ... ... ...

Each solution contains 1 or 2 unhitted UA set(s). This UA set can be destroyed by requirement to choose extra candidate in r1c1 cell. But for other cells may be not enough one cell to destroy total UA set. For example, let's demand choosing extra candidates in r1c4 cell. It destroys U4 r13c14, but doesn't destroy U6 r124c126. So, we will have to add choosing extra candidates in r1c6, for example. If am not wrong, one should describe 15 cell pairs to specify "UR-like" rule for this UA set. Something like: "r1c1 has extra cadidate" OR ("r1 has extra candidate" AND "r1c6 has extra candidate") OR ...
This procedure is too complicated for manual solvers, therefore, I think, classic Deadly Patterns are limited by strongly minimal UA sets.

Serg
Serg
2018 Supporter
 
Posts: 909
Joined: 01 June 2010
Location: Russia

Re: 7-cell Unavoidable Sets

Postby nazaz » Mon Jan 13, 2025 9:30 pm

Hi Serg. I didn't publish any (sudoku) UAs, you know this ;) They're (sudoku) DPs if you accept the generalised notion that a DP is any set of pencilmarks all of whose solutions is a UA / contains a minimal UA. Maybe they're MUGs (see Andries Brouwer's oracle-based definition), too, since eleven reminded us of their existence on the other thread.

I have no opinion on the difficulty of putting DPs to good use in practice. However, your example only highlights the difficulty of extracting the full power out of a DP. In contrast, it's easy to say something weaker that still, in principle, has non-zero potency: "if, except for the presence of some extra candidates, the candidates are a subset of a DP, then at least one of the extra candidates must be true". But let's be clear; I'm not trying to sell this to solvers.
User avatar
nazaz
 
Posts: 11
Joined: 06 November 2018

Re: 7-cell Unavoidable Sets

Postby dobrichev » Tue Jan 14, 2025 3:16 pm

Hi Blue,

Other options to store deadly patterns include
  • Storing only one of the permutations. From your example
    Code: Select all
    ...........................................................1..2..1..3.4...4..2.31

    The second permutation is achievable after two solver calls - first for obtaining a valid exemplar for non-givens, and second for determining the remote permutation.
    [EDIT 17.1.2024]: This is not a good idea, the list will contain valid supersets.
  • Storing both permutations as different "instances".
    This is the (still unverifyed) count of one-band patterns by number of occupied cells, one record per canonicalized permutation.
    [EDIT 17.1.2024]: This is not a good idea too for the same reasons.
    Code: Select all
       #xUA Size
          1 4
          3 6
          1 7
          2 8
          3 9
          9 10
          9 11
         31 12
         57 13
        111 14
        183 15
        408 16
        739 17
       1142 18
       1782 19
       2667 20
       2953 21
       4046 22
       2608 23
       2199 24
       1964 25
        400 27
  • Storing a 729-bit pencilmarks containing the union of the two permutations. A solver call (or something simpler that understands of direct elimination) splits the candidates to permutations 1 and 2.
    Doing this reduces the list (because the canonical form of the union is the same for a U b and b U a).

    This is the same as above, but storing one record per canonicalized union of the two permutations.
    Code: Select all
       #xUA Size
          1 4
          3 6
          1 7
          2 8
          2 9
          8 10
          5 11
         22 12
         31 13
         70 14
         95 15
        227 16
        381 17
        624 18
        911 19
       1395 20
       1513 21
       2111 22
       1343 23
       1155 24
       1032 25
        400 27

    Also if you match a solution grid to a union of the permutations it is safe to check for either first or second of the cell candidates (sol[i] == perm1[j] || sol[i] == perm2[j]) because the permutations are mutually exclusive.
Last edited by dobrichev on Fri Jan 17, 2025 3:55 pm, edited 1 time in total.
dobrichev
2016 Supporter
 
Posts: 1871
Joined: 24 May 2010

Re: 7-cell Unavoidable Sets

Postby dobrichev » Tue Jan 14, 2025 6:09 pm

Chalenge:

Let permutable set is a set of elements {cell location, value1, value2} so that if all cell locations with corresponding value1 form a subgrid of a valid sudoku grid, then assigning corresponding value2 to same locations forms a valid sudoku subgrid too.
Let irreducible permutable set is a permutable set that has no any other permutable set as a subset.
Let neighbor of a valid solution grid A is any other valid solution grid B composed from A by exchanging values from an irreducible permutable set.
Let move is a transformation of grid A to its neigbor grid B.
Let path is a sequence of moves transforming grid A to grid C.
Let path length is the number of the moves on a particular path.
Let distance is the minimum path length among all paths that transform A to C.

What is the maximal distance between any two grids (out of 6,670,903,752,021,072,936,960)?
dobrichev
2016 Supporter
 
Posts: 1871
Joined: 24 May 2010

Re: 7-cell Unavoidable Sets

Postby Serg » Wed Jan 15, 2025 5:27 pm

Hi, Mladen!
To my mind, your "permutable sets" are no different from strongly minimal UA sets.
Blue solved similar problem in 2010 or 2011 (at Sudoku Programmer Forum). He proved that for any given pair of valid solution grids it's possible to transform one grid to another by strongly minimal UA sets permutations. I remember his didcussion with Red Ed on this theme.

Serg
Serg
2018 Supporter
 
Posts: 909
Joined: 01 June 2010
Location: Russia

Re: 7-cell Unavoidable Sets

Postby dobrichev » Wed Jan 15, 2025 8:12 pm

One difference is that no third option in a cell is allowed.
Average distance between two random grids could be surprising.
dobrichev
2016 Supporter
 
Posts: 1871
Joined: 24 May 2010

Re: 7-cell Unavoidable Sets

Postby blue » Thu Jan 16, 2025 1:29 am

The maximum distance is probably 2, but I don't have a way to prove it.
The average distance is in the range 1.00417-1.00418
blue
 
Posts: 1059
Joined: 11 March 2013

Re: 7-cell Unavoidable Sets

Postby blue » Thu Jan 16, 2025 3:14 am

Hi Mladen,

This is the (still unverifyed) count of one-band patterns by number of occupied cells, one record per canonicalized permutation.

Code: Select all
   #xUA Size
      1 4
      3 6
      1 7
      2 8
      3 9
      9 10
      9 11
     31 12
     57 13
    111 14
    183 15
    408 16
    739 17
   1142 18
   1782 19
   2667 20
   2953 21
   4046 22
   2608 23
   2199 24
   1964 25
    400 27


This is the same as above, but storing one record per canonicalized union of the two permutations.
Code: Select all
   #xUA Size
      1 4
      3 6
      1 7
      2 8
      2 9
      8 10
      5 11
     22 12
     31 13
     70 14
     95 15
    227 16
    381 17
    624 18
    911 19
   1395 20
   1513 21
   2111 22
   1343 23
   1155 24
   1032 25
    400 27

My DP counts match yours.
My UA counts almost match.
I have 1143 size 18's ... one more than you.
I have 680 size 27's ... 280 more than you.

For the size 18 (UAs), I think you probably store only one case for these two items:

Code: Select all
.......................................................12.34.56.35.16.24.46.25.31
.......................................................35.16.24.46.25.31.12.34.56

.......................................................12.34.56.35.16.24.46.25.31
.......................................................46.25.31.12.34.56.35.16.24

The top line is the same for both, and all 4 lines have the same minlex form.

There are 280 cases like that at size 27, too.
The first is:

Code: Select all
......................................................123456789456789123789132564
......................................................456789123789132564123456789

......................................................123456789456789123789132564
......................................................789132564123456789456789123

That seems related to this:
dobrichev wrote:Other options to store deadly patterns include
  • Storing only one of the permutations. From your example
    Code: Select all
    ...........................................................1..2..1..3.4...4..2.31

    The second permutation is achievable after two solver calls - first for obtaining a valid exemplar for non-givens, and second for determining the remote permutation.
blue
 
Posts: 1059
Joined: 11 March 2013

Re: 7-cell Unavoidable Sets

Postby denis_berthier » Thu Jan 16, 2025 3:57 am

dobrichev wrote:Other options to store deadly patterns include
  • Storing only one of the permutations. From your example
    Code: Select all
    ...........................................................1..2..1..3.4...4..2.31

    The second permutation is achievable after two solver calls - first for obtaining a valid exemplar for non-givens, and second for determining the remote permutation.

This may be useful if the goal is to have more compact representations, but it's difficult to use.
I like Blue's representation: two characters per cell. It may require 3 characters per cell in more complex cases. If there were millions of UAs/DPs, there might be a problem of storage, but we are talking only of hundreds/thousands.
.
denis_berthier
2010 Supporter
 
Posts: 4275
Joined: 19 June 2007
Location: Paris

Re: 7-cell Unavoidable Sets

Postby Serg » Thu Jan 16, 2025 11:54 am

Hi, Mladen!
dobrichev wrote:One difference is that no third option in a cell is allowed.
Do you mean that for each cell of permutable set 2 different digits only are allowed?

Serg
Serg
2018 Supporter
 
Posts: 909
Joined: 01 June 2010
Location: Russia

Re: 7-cell Unavoidable Sets

Postby dobrichev » Fri Jan 17, 2025 2:55 pm

Hi Serg,
In the context of the chalenge only 2 different digits are allowed.
Let permutable set is a set of elements {cell location, value1, value2} so that ...
dobrichev
2016 Supporter
 
Posts: 1871
Joined: 24 May 2010

Re: 7-cell Unavoidable Sets

Postby dobrichev » Fri Jan 17, 2025 3:46 pm

blue wrote:My UA counts almost match.

Hi Blue,

After realizing that storing only one of the permutations rezults in non-minimal but valid records, I lose interest in this option.

Here is an example from band 1 where clearly the valid top set (*) has a valid superset (**).
Code: Select all
.2..8..5...........8..5..2....................................................... (*)
129786453753429186486153729214365897365897214897214365531642978642978531978531642
 |  |  |           |  |  |
189756423753429186426183759214365897365897214897214365531642978642978531978531642
.8..5..2...........2..8..5.......................................................

.2..8..5..5..2..8..8..5..2....................................................... (**)
129783456453126789786459123214365897365897214897214365531642978642978531978531642
 |  |  |  |  |  |  |  |  |   
189753426423186759756429183214365897365897214897214365531642978642978531978531642
.8..5..2..2..8..5..5..2..8.......................................................

blue wrote:The maximum distance is probably 2, but I don't have a way to prove it.

I have plans to check whether, for distance 2, one of the moves can always be a blind relabelling, say {1,2,3,4,5,6,7,8,9} to {2,3,4,5,6,7,8,9,1}.

blue wrote:The average distance is in the range 1.00417-1.00418

Once you have the tools, would you please check distance between the morphs of the same ED grid?
For a grid w/o nontrivial automorphism, does the average distance differ from grand average?
Is it similar for all grids?

My assumption is that since the minimal DP are much more numerous than minimal UA, all anomalies in DP statistics may focus attention to something interesting which is hidden in the noice for the similar UA statistics.
dobrichev
2016 Supporter
 
Posts: 1871
Joined: 24 May 2010

PreviousNext

Return to General