Anticorner maximal invalid patterns

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

Re: Anticorner maximal invalid patterns

Postby blue » Wed Jun 12, 2024 4:31 am

Hi Serg,

There's a point in the calculation(s), where you have a VPT, g, and a clue count, n, and you need to determine how many n-clue patterns, x, satisfy (g x) = x.
Using JPF's method, it's tedious, but fairly straightforward, as to how to do it in a way that doesn't involve enumerating all such x's.
When the x's need to be restricted to patterns that don't include any full boxes, it seems like it would be much more difficult.

Added: maybe less difficult if you forget about the idea of a fixed 'n', and enumerate "on-off"/"in-out" options for ">= 2 cell cycles" (under 'g'), and work from there, after filtering out cases that already have a full box.

----

P.S.: Your list is missing these three box patterns.

Code: Select all
x . .    x . .    x x .
. . x    . x x    x . x
. x x    . x x    . x x
blue
 
Posts: 1009
Joined: 11 March 2013

Re: Anticorner maximal invalid patterns

Postby Serg » Wed Jun 12, 2024 9:44 am

Hi, Blue!
blue wrote:There's a point in the calculation(s), where you have a VPT, g, and a clue count, n, and you need to determine how many n-clue patterns, x, satisfy (g x) = x.
Using JPF's method, it's tedious, but fairly straightforward, as to how to do it in a way that doesn't involve enumerating all such x's.
When the x's need to be restricted to patterns that don't include any full boxes, it seems like it would be much more difficult.

Yes, that accounting for full boxes looks like very complicated. But I cannot see at the moment another method for anticorner patterns enumeration.
blue wrote:P.S.: Your list is missing these three box patterns.

Code: Select all
x . .    x . .    x x .
. . x    . x x    x . x
. x x    . x x    . x x

You are right, I put "disclaimer" in that post, that method cannot be used for pactical purposes. (I feel not only box patterns list should be corrected.)

I propose to solve an exercise to debug my method - to calculate how many are there two-box ED patterns, don't including full boxes:
Code: Select all
Exercise 1

. . x
x x x
x x x

Boxes with 9 clues marked by "x", boxes with 0-8 clues marked by ".".
All different patterns: 511^2

Permitted VPTs:
1. Swapping stack1/stack2 - 2 ways.
2. Permutting rows in band1 - 6 ways.
3. Permutting columns in stack1 - 6 ways.
4. Permutting columns in stack2 - 6 ways.

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

Re: Anticorner maximal invalid patterns

Postby Serg » Wed Jun 12, 2024 6:44 pm

Hi!
Code: Select all
Exercise 0 (preparatory)

. x x
x x x
x x x

Boxes with 9 clues marked by "x", boxes with 0-8 clues marked by ".".
All different patterns: 511

Permitted VPTs:
1. Permutting rows in band1 - 6 ways.
2. Permutting columns in stack1 - 6 ways.

How many are there essentially different patterns?

Burnside's Lemma gives 36 ED patterns for B1 box (including 9-clue configuration). So, there are 35 ED patterns, having 0-8 clues in B1 box.
Serg wrote:I propose to solve an exercise to debug my method - to calculate how many are there two-box ED patterns, don't including full boxes:
Code: Select all
Exercise 1

. . x
x x x
x x x

Boxes with 9 clues marked by "x", boxes with 0-8 clues marked by ".".
All different patterns: 511^2

Permitted VPTs:
1. Swapping stack1/stack2 - 2 ways.
2. Permutting rows in band1 - 6 ways.
3. Permutting columns in stack1 - 6 ways.
4. Permutting columns in stack2 - 6 ways.

Burnside's Lemma gives 1443 ED patterns for B12 area (including 9-clue configurations for B1 and B2 boxes). We should subtract 36 from 1443 to get answer to Exercise 1: there are 1407 ED two-box patterns without filled B1 and B2 boxes.

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

Re: Anticorner maximal invalid patterns

Postby Serg » Wed Jul 10, 2024 7:58 pm

Hi, Blue!
The task of enumerating essentially different anticorner patterns (using Burnside's Lemma) proved to be too difficult. I decided to postpone it indefinitely. At the moment I should confirm your lists of maximal invalid anticorner patterns and restricted minimal valid anticorner patterns. I have now 12128 minimal valid anticorner patterns. Obviously the list isn't full. I'll try to get full list coming days (weeks).

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

Re: Anticorner maximal invalid patterns

Postby blue » Thu Jul 25, 2024 9:57 pm

Hi Serg,

The task of enumerating essentially different anticorner patterns (using Burnside's Lemma) proved to be too difficult. I decided to postpone it indefinitely.

I meant to reply to this a long time ago. Sorry it took so long.

I was able to do it using the method that you outlined, with the 3 extra patterns and the suggestion from my last post.
The "counting" code took only seconds, to run.
It took my "groups" code took longer to build the groups from a list of generators, and them build the conjugacy classes.

I extended it to do counts for all 26 ED "full box" patterns.
The cases with 3 or more full boxes, went quickly.
"One box", took ~2.5 hours, and the "no box full" case took ~27 hours :(

In the end, summing the results over all 26 cases, produced JPF's (81-cell) results, confirmed by you in this thread.
That can serve as a sort of "proof" that the method is correct, along with the code.

Going through the 26 (minlex, full box) patterns, and summing the "<= 8-clue restricted" numbers over any pattern that can be mapped to a superset of the given pattern, gave the results below. The "anti-corner" shape is #6.

Hidden Text: Show
Code: Select all
Shapes 1-4

   |              . . . |             . . . |          . . . |          . . . |
   |              . . . |             . . . |          . . . |          . . x |
   |              . . . |             . . x |          . x x |          . x . |
---+--------------------+-------------------+----------------+----------------+
 0 |                  1 |                   |                |                |
 1 |                  1 |                   |                |                |
 2 |                  5 |                   |                |                |
 3 |                 21 |                   |                |                |
 4 |                109 |                   |                |                |
 5 |                548 |                   |                |                |
 6 |               3074 |                   |                |                |
 7 |              16847 |                   |                |                |
 8 |              92393 |                   |                |                |
 9 |             489448 |                 1 |                |                |
10 |            2499689 |                 2 |                |                |
11 |           12199113 |                14 |                |                |
12 |           56737622 |                72 |                |                |
13 |          250632745 |               434 |                |                |
14 |         1049547176 |              2396 |                |                |
15 |         4159131734 |             13270 |                |                |
16 |        15578997961 |             69537 |                |                |
17 |        55113078988 |            349866 |                |                |
18 |       184060159680 |           1669434 |              1 |              1 |
19 |       580219975879 |           7566937 |              3 |              3 |
20 |      1726649409444 |          32465832 |             22 |             18 |
21 |      4852092873260 |         131758069 |            110 |             93 |
22 |     12881523178029 |         504941939 |            602 |            505 |
23 |     32326780555962 |        1825697565 |           3009 |           2556 |
24 |     76733980909494 |        6222033103 |          14863 |          12484 |
25 |    172397698733180 |       19976134935 |          69113 |          57361 |
26 |    366849216218909 |       60394840048 |         307373 |         249703 |
27 |    739856554278500 |      171926733822 |        1289738 |        1024970 |
28 |   1415123268225799 |      460853724996 |        5109943 |        3970960 |
29 |   2568609122743361 |     1163466738099 |       19028514 |       14502523 |
30 |   4427035437198339 |     2767337318592 |       66537691 |       49912416 |
31 |   7248951925550465 |     6204041085672 |      218091094 |      161731518 |
32 |  11282386772412398 |    13116075971594 |      669730775 |      493062493 |
33 |  16698823272821708 |    26162400746366 |     1925981288 |     1413173830 |
34 |  23512787678143566 |    49263827853492 |     5187016020 |     3805555744 |
35 |  31507091246915793 |    87616490328245 |    13085057006 |     9624207203 |
36 |  40191031928611303 |   147255646468072 |    30931573352 |    22851492912 |
37 |  48817495062238591 |   233988361339349 |    68549245695 |    50934574660 |
38 |  56472143448081548 |   351676187753227 |   142500942925 |   106578824084 |
39 |  62225821998470051 |   500135823928278 |   278030101093 |   209387127341 |
40 |  65317264463457661 |   673249931976779 |   509414658071 |   386321510081 |
41 |  65317264463457661 |   858085467510687 |   876982868702 |   669561562796 |
42 |  62225821998470051 |  1035731025695161 |  1419288549500 |  1090463216038 |
43 |  56472143448081548 |  1184116898552329 |  2160272386644 |  1669357111070 |
44 |  48817495062238591 |  1282370737382636 |  3093708626557 |  2402917776694 |
45 |  40191031928611303 |  1315571906913963 |  4169950626726 |  3253130158360 |
46 |  31507091246915793 |  1278430551772210 |  5291535308601 |  4143246277918 |
47 |  23512787678143566 |  1176653917616101 |  6322938626684 |  4965221392384 |
48 |  16698823272821708 |  1025518343699461 |  7115361104342 |  5599525542851 |
49 |  11282386772412398 |   846136495715440 |  7541100561950 |  5943006208969 |
50 |   7248951925550465 |   660666849163888 |  7526874112255 |  5936085657186 |
51 |   4427035437198339 |   487949033667648 |  7074246489492 |  5579520690584 |
52 |   2568609122743361 |   340707052574751 |  6259420113139 |  4934299579012 |
53 |   1415123268225799 |   224763459120318 |  5212382524059 |  4104678189585 |
54 |    739856554278500 |   139987026131124 |  4083208532306 |  3210801822969 |
55 |    366849216218909 |    82243536444505 |  3007443105388 |  2360729373332 |
56 |    172397698733180 |    45536049584824 |  2081332476668 |  1630630478094 |
57 |     76733980909494 |    23734991777056 |  1352380846279 |  1057499395200 |
58 |     32326780555962 |    11633129871453 |   824290467580 |   643454868889 |
59 |     12881523178029 |     5354605898382 |   470801860272 |   367051600526 |
60 |      4852092873260 |     2311492383894 |   251689599682 |   196120875726 |
61 |      1726649409444 |      934489895049 |   125774552293 |    98058223455 |
62 |       580219975879 |      353301525122 |    58666167182 |    45829114634 |
63 |       184060159680 |      124737432607 |    25500900188 |    19998080010 |
64 |        55113078988 |       41075097773 |    10311888529 |     8137125645 |
65 |        15578997961 |       12602979781 |     3871935877 |     3083131494 |
66 |         4159131734 |        3601376532 |     1347313062 |     1086174702 |
67 |         1049547176 |         958753583 |      433612961 |      355223344 |
68 |          250632745 |         238101227 |      128817684 |      107658188 |
69 |           56737622 |          55321671 |       35270792 |       30186958 |
70 |           12199113 |          12074627 |        8890094 |        7818233 |
71 |            2499689 |           2491929 |        2064413 |        1869451 |
72 |             489448 |            489126 |         442530 |         412829 |
73 |              92393 |             92393 |          88432 |          84753 |
74 |              16847 |             16847 |          16618 |          16283 |
75 |               3074 |              3074 |           3061 |           3038 |
76 |                548 |               548 |            548 |            548 |
77 |                109 |               109 |            109 |            109 |
78 |                 21 |                21 |             21 |             21 |
79 |                  5 |                 5 |              5 |              5 |
80 |                  1 |                 1 |              1 |              1 |
81 |                  1 |                 1 |              1 |              1 |
---+--------------------+-------------------+----------------+----------------+
   | 746186061249180790 | 14122295116637894 | 77411895509528 | 60725637895344 |


Shapes 5-8

   |        . . . |        . . . |        . . . |       . . x |
   |        . . . |        . . x |        . . x |       . x . |
   |        x x x |        . x x |        x x . |       x . . |
---+--------------+--------------+--------------+-------------+
27 |            1 |            1 |            1 |           1 |
28 |            1 |            4 |            4 |           1 |
29 |            8 |           23 |           26 |           6 |
30 |           30 |          125 |          129 |          21 |
31 |          151 |          630 |          622 |         101 |
32 |          638 |         2970 |         2770 |         396 |
33 |         2918 |        13089 |        11749 |        1642 |
34 |        12168 |        53801 |        46562 |        6117 |
35 |        49664 |       206531 |       173829 |       22184 |
36 |       188848 |       739539 |       607848 |       74944 |
37 |       677647 |      2468229 |      1991941 |      240866 |
38 |      2262557 |      7674347 |      6107424 |      726869 |
39 |      7045245 |     22221385 |     17514503 |     2071031 |
40 |     20359408 |     59916125 |     46942759 |     5538440 |
41 |     54629003 |    150464473 |    117554128 |    13914038 |
42 |    135890798 |    352033927 |    274950927 |    32734846 |
43 |    313518202 |    767683088 |    600554028 |    72100016 |
44 |    670752253 |   1561120202 |   1224863358 |   148419412 |
45 |   1331597002 |   2961837605 |   2332734949 |   285467696 |
46 |   2453894292 |   5245216646 |   4148704815 |   512596808 |
47 |   4200743116 |   8674297755 |   6890947970 |   859266413 |
48 |   6683626907 |  13401236639 |  10691168123 |  1344234253 |
49 |   9890065027 |  19348228004 |  15495880581 |  1962766633 |
50 |  13617417328 |  26112099528 |  20985251699 |  2674716913 |
51 |  17454895689 |  32948357572 |  26556497804 |  3402351726 |
52 |  20835763771 |  38874953598 |  31406676882 |  4039931148 |
53 |  23168773848 |  42890840988 |  34712158957 |  4478457725 |
54 |  24002418721 |  44247666508 |  35853956865 |  4634831983 |
55 |  23168741374 |  42675009706 |  34605426024 |  4478452139 |
56 |  20835682448 |  38467196682 |  31204975596 |  4039918386 |
57 |  17454732393 |  32393841394 |  26281950871 |  3402328606 |
58 |  13617128540 |  25471325435 |  20667338419 |  2674679871 |
59 |   9889604229 |  18687691195 |  15166898688 |  1962712000 |
60 |   6682966687 |  12782123641 |  10380896708 |  1344160786 |
61 |   4199887943 |   8142282288 |   6621880197 |   859175166 |
62 |   2452897573 |   4824527406 |   3933251856 |   512493279 |
63 |   1330546554 |   2655266711 |   2173119413 |   285359309 |
64 |    669755534 |   1355139262 |   1115364856 |   148315750 |
65 |    312663026 |    640103211 |    530977911 |    72008516 |
66 |    135230568 |    279219005 |    234009195 |    32661033 |
67 |     54168155 |    112196123 |     95254377 |    13858995 |
68 |     20070444 |     41408584 |     35709902 |     5500943 |
69 |      6881295 |     13993227 |     12288493 |     2047347 |
70 |      2179206 |      4314111 |      3865687 |      713250 |
71 |       639135 |      1209653 |      1107309 |      233586 |
72 |       172962 |       307419 |       287482 |       71447 |
73 |        43626 |        70934 |        67670 |       20623 |
74 |        10140 |        14873 |        14434 |        5512 |
75 |         2264 |         2929 |         2881 |        1421 |
76 |          462 |          542 |          538 |         333 |
77 |          101 |          109 |          109 |          83 |
78 |           20 |           21 |           21 |          18 |
79 |            5 |            5 |            5 |           5 |
80 |            1 |            1 |            1 |           1 |
81 |            1 |            1 |            1 |           1 |
---+--------------+--------------+--------------+-------------+
   | 225678589927 | 426176577800 | 344429989897 | 44305190635 |


Shapes 9-13

   |      . . . |     . . . |      . . . |     . . x |     . . x |
   |      . . x |     . x x |      . x x |     . . x |     . x . |
   |      x x x |     . x x |      x . x |     x x . |     x . x |
---+------------+-----------+------------+-----------+-----------+
36 |          1 |         1 |          1 |         1 |         1 |
37 |          3 |         2 |          3 |         2 |         3 |
38 |         19 |        10 |         18 |         8 |        16 |
39 |         86 |        40 |         80 |        26 |        72 |
40 |        393 |       160 |        346 |       100 |       300 |
41 |       1626 |       577 |       1355 |       340 |      1144 |
42 |       6433 |      1989 |       4981 |      1201 |      4061 |
43 |      23394 |      6324 |      16721 |      3890 |     13311 |
44 |      79527 |     18882 |      52081 |     12101 |     40630 |
45 |     249606 |     52453 |     149606 |     34683 |    115295 |
46 |     724720 |    135920 |     397931 |     92823 |    304379 |
47 |    1938775 |    327821 |     979505 |    229223 |    747450 |
48 |    4779361 |    735941 |    2234771 |    524919 |   1706687 |
49 |   10841658 |   1535848 |    4725415 |   1111030 |   3621223 |
50 |   22636403 |   2979355 |    9267259 |   2179539 |   7136510 |
51 |   43492847 |   5369738 |   16856798 |   3960776 |  13056238 |
52 |   76928795 |   8991065 |   28446424 |   6677089 |  22164203 |
53 |  125289868 |  13984440 |   44535609 |  10441676 |  34899873 |
54 |  187962240 |  20205565 |   64691435 |  15156098 |  50955000 |
55 |  259818598 |  27119917 |   87180627 |  20417555 |  68963691 |
56 |  331004075 |  33816465 |  108997093 |  25532653 |  86499548 |
57 |  388700577 |  39174715 |  126410030 |  29636165 | 100522436 |
58 |  420749738 |  42163772 |  135974166 |  31929558 | 108204090 |
59 |  419749816 |  42163648 |  135625404 |  31929534 | 107849788 |
60 |  385802348 |  39174246 |  125400727 |  29636086 |  99495484 |
61 |  326515109 |  33815350 |  107437044 |  25532497 |  84913446 |
62 |  254244492 |  27117638 |   85244454 |  20417289 |  66994938 |
63 |  181949078 |  20201441 |   62596462 |  15155687 |  48827241 |
64 |  119507295 |  13977816 |   42504034 |  10441094 |  32838727 |
65 |   71924042 |   8981612 |   26661333 |   6676333 |  20358039 |
66 |   39581332 |   5357756 |   15429076 |   3959875 |  11616282 |
67 |   19873062 |   2965864 |    8225890 |   2178553 |   6092064 |
68 |    9077367 |   1522351 |    4032154 |   1110044 |   2930485 |
69 |    3761936 |    723941 |    1813463 |    524018 |   1291084 |
70 |    1409354 |    318339 |     745850 |    228467 |    519490 |
71 |     476354 |    129259 |     279756 |     92241 |    190839 |
72 |     144658 |     48289 |      95173 |     34272 |     63755 |
73 |      39626 |     16565 |      29306 |     11834 |     19481 |
74 |       9746 |      5175 |       8095 |      3731 |      5402 |
75 |       2228 |      1482 |       2033 |      1114 |      1408 |
76 |        462 |       379 |        455 |       296 |       333 |
77 |        101 |        92 |        100 |        80 |        83 |
78 |         20 |        20 |         21 |        18 |        18 |
79 |          5 |         5 |          5 |         5 |         5 |
80 |          1 |         1 |          1 |         1 |         1 |
81 |          1 |         1 |          1 |         1 |         1 |
---+------------+-----------+------------+-----------+-----------+
   | 3709297176 | 393142270 | 1247053092 | 295874526 | 982964555 |


Shapes 14-18

   |    . . . |   . . x |    . . x |   . . x |   . . x |
   |    . x x |   . . x |    . x . |   . x x |   x x . |
   |    x x x |   x x x |    x x x |   x x . |   x x . |
---+----------+---------+----------+---------+---------+
45 |        1 |       1 |        1 |       1 |       1 |
46 |        3 |       1 |        2 |       3 |       1 |
47 |       16 |       5 |       12 |      12 |       6 |
48 |       64 |      15 |       45 |      45 |      17 |
49 |      234 |      63 |      174 |     151 |      58 |
50 |      782 |     201 |      574 |     468 |     150 |
51 |     2421 |     704 |     1818 |    1332 |     407 |
52 |     6810 |    2124 |     5113 |    3461 |     945 |
53 |    17626 |    6220 |    13415 |    8267 |    2161 |
54 |    41741 |   16196 |    31921 |   18131 |    4474 |
55 |    90393 |   39014 |    69893 |   36521 |    8836 |
56 |   178942 |   84119 |   139330 |   67735 |   16003 |
57 |   323654 |  165072 |   254467 |  115722 |   27221 |
58 |   534478 |  290483 |   423152 |  182141 |   42444 |
59 |   805794 |  462801 |   642895 |  264142 |   61590 |
60 |  1108758 |  662604 |   889096 |  352816 |   81954 |
61 |  1391952 |  857916 |  1121572 |  433758 |  100990 |
62 |  1594115 |  999685 |  1287215 |  490650 |  114083 |
63 |  1664726 | 1053498 |  1346241 |  510355 |  119164 |
64 |  1584391 |  999685 |  1279815 |  487903 |  114083 |
65 |  1373279 |  857916 |  1107384 |  428531 |  100989 |
66 |  1082968 |  662604 |   869532 |  345659 |   81951 |
67 |   775929 |  462801 |   620269 |  255889 |   61584 |
68 |   504333 |  290483 |   400327 |  173758 |   42432 |
69 |   296811 |  165072 |   234131 |  108120 |   27200 |
70 |   157778 |   84119 |   123297 |   61536 |   15973 |
71 |    75587 |   39014 |    58674 |   31971 |    8799 |
72 |    32535 |   16196 |    24968 |   15106 |    4434 |
73 |    12542 |    6220 |     9595 |    6462 |    2124 |
74 |     4308 |    2124 |     3261 |    2482 |     915 |
75 |     1324 |     704 |     1018 |     860 |     386 |
76 |      357 |     201 |      276 |     261 |     138 |
77 |       89 |      63 |       75 |      74 |      52 |
78 |       20 |      15 |       17 |      18 |      14 |
79 |        5 |       5 |        5 |       5 |       5 |
80 |        1 |       1 |        1 |       1 |       1 |
81 |        1 |       1 |        1 |       1 |       1 |
---+----------+---------+----------+---------+---------+
   | 13664768 | 8227946 | 10959582 | 4404348 | 1041586 |


Shapes 19-26

   | . . . |  . . x | . . x | . x x | . . x | x . x | . x x | x x x |
   | x x x |  . x x | x x . | x . x | x x x | . x x | x x x | x x x |
   | x x x |  x x x | x x x | x x . | x x x | x x x | x x x | x x x |
---+-------+--------+-------+-------+-------+-------+-------+-------+
54 |     1 |      1 |     1 |     1 |       |       |       |       |
55 |     1 |      2 |     2 |     1 |       |       |       |       |
56 |     5 |      8 |     9 |     3 |       |       |       |       |
57 |    15 |     28 |    26 |     7 |       |       |       |       |
58 |    43 |     86 |    71 |    15 |       |       |       |       |
59 |   110 |    241 |   170 |    28 |       |       |       |       |
60 |   281 |    614 |   387 |    55 |       |       |       |       |
61 |   606 |   1388 |   769 |    92 |       |       |       |       |
62 |  1219 |   2821 |  1416 |   153 |       |       |       |       |
63 |  2172 |   5117 |  2348 |   232 |     1 |     1 |       |       |
64 |  3457 |   8241 |  3530 |   323 |     1 |     1 |       |       |
65 |  4896 |  11804 |  4795 |   414 |     5 |     3 |       |       |
66 |  6198 |  15003 |  5893 |   494 |    12 |     6 |       |       |
67 |  6952 |  16897 |  6518 |   535 |    31 |    13 |       |       |
68 |  6952 |  16857 |  6496 |   535 |    59 |    20 |       |       |
69 |  6198 |  14896 |  5835 |   494 |   115 |    34 |       |       |
70 |  4896 |  11615 |  4697 |   414 |   163 |    42 |       |       |
71 |  3457 |   8004 |  3409 |   323 |   219 |    55 |       |       |
72 |  2172 |   4846 |  2212 |   232 |   231 |    56 |     1 |       |
73 |  1219 |   2583 |  1294 |   153 |   219 |    55 |     1 |       |
74 |   605 |   1196 |   667 |    92 |   162 |    42 |     2 |       |
75 |   279 |    494 |   317 |    55 |   113 |    34 |     4 |       |
76 |   108 |    172 |   126 |    28 |    57 |    20 |     5 |       |
77 |    41 |     57 |    49 |    15 |    29 |    13 |     5 |       |
78 |    13 |     15 |    14 |     7 |    10 |     6 |     4 |       |
79 |     4 |      5 |     5 |     3 |     4 |     3 |     2 |       |
80 |     1 |      1 |     1 |     1 |     1 |     1 |     1 |       |
81 |     1 |      1 |     1 |     1 |     1 |     1 |     1 |     1 |
---+-------+--------+-------+-------+-------+-------+-------+-------+
   | 51902 | 122993 | 51058 |  4706 |  1433 |   406 |    26 |     1 |
blue
 
Posts: 1009
Joined: 11 March 2013

Re: Anticorner maximal invalid patterns

Postby Serg » Fri Jul 26, 2024 4:53 pm

Hi, Blue!
I am delighted with your results!
blue wrote:... the "no box full" case took ~27 hours

Is it the case, when all 9 boxes must not be full, i.e. they may contain 0-8 clues?

I see you published 26 cases, where "x" symbol denotes full box (9 clues), but "." symbol denotes arbitrary box, containing 0-9 clues, right?
Could you describe your work in more details?

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

Re: Anticorner maximal invalid patterns

Postby blue » Fri Jul 26, 2024 8:49 pm

Hi Serg,

Serg wrote:
blue wrote:... the "no box full" case took ~27 hours

Is it the case, when all 9 boxes must not be full, i.e. they may contain 0-8 clues?

Yes. It takes so long, because there are group elements with large numbers of cell-cycles.
(One with 40 2-cell cycles, one with 39, ...).

Serg wrote:I see you published 26 cases, where "x" symbol denotes full box (9 clues), but "." symbol denotes arbitrary box, containing 0-9 clues, right?

Right.

Serg wrote:Could you describe your work in more details?

Yes, but I'll need a day to get it together properly.

Cheers,
Blue.
blue
 
Posts: 1009
Joined: 11 March 2013

Re: Anticorner maximal invalid patterns

Postby blue » Fri Aug 16, 2024 9:10 pm

One day == 2 weeks :( ... "my bad".
I'ld make excuses, but I wouldn't want to sound like I was making excuses.

Hi Serg,

I'll skip over all of the detail except for how to get the number of grids, x, where (g x) = x ... where 'g' is a member of the transformation group associated with the "full boxes" pattern, and (g x) is the result of applying it to the grid.

First, 'g' is represented as a permutation of the cells in the "." boxes, by a list of "cell cycles" ... similar to what others have done (Russel & Jarvis, JPF, ...).
Here is an example for the anti-corner pattern itself, and the transformation that swaps columns 1&3, and cycles rows, 7->8->9:

Code: Select all
g : (0,2),(9,11),(18,20),(27,29),(33,35),(39,41),(45,50,51,47,48,53),(46,49,52)

+----------+----------+----------+    +----------+----------+----------+
|  0  1  2 |  3  4  5 |  6  7  8 |    | A  .  A  |  .  .  . |  .  .  . |
|  9 10 11 | 12 13 14 | 15 16 17 |    | B  .  B  |  .  .  . |  .  .  . |
| 18 19 20 | 21 22 23 | 24 25 26 |    | C  .  C  |  .  .  . |  .  .  . |
+----------+----------+----------+    +----------+----------+----------+
| 27 28 29 | 30 31 32 |  x  x  x |    | D  .  D  |  .  .  . |  x  x  x |
| 33 34 35 | 36 37 38 |  x  x  x |    | E  .  E  |  .  .  . |  x  x  x |
| 39 40 41 | 42 43 44 |  x  x  x |    | F  .  F  |  .  .  . |  x  x  x |
+----------+----------+----------+    +----------+----------+----------+
| 45 46 47 |  x  x  x |  x  x  x |    | G  H  G  |  x  x  x |  x  x  x |
| 48 49 50 |  x  x  x |  x  x  x |    | G  H  G  |  x  x  x |  x  x  x |
| 51 52 53 |  x  x  x |  x  x  x |    | G  H  G  |  x  x  x |  x  x  x |
+----------+----------+----------+    +----------+----------+----------+

8 cycles, 2^8 possible on/off assignments ... 2*2*2*2*2*2*2*2.

For a pattern to satisfy (g x) = x, it is necessary that all of the the cells in each cycle, have the same on/off ("clue/not a clue") status.
Cells that are not in cycles ... "stationary cells" ... can be set to any state.

If we didn't need to worry about limiting clue counts to "<= 8 per box", then for the sample 'g': with 8 cycles and 33 stationary cells, there would be 2^(8+33) = 2199023255552 patterns with (g x) = x.

To enforce the "<= 8 clues per box" limit, we need to enumerate/"loop over" the different ways of assinging on/off status to the cycles, and total up a "pattern count" for each case.
For the sample 'g' (and "<= 8" limit) ... we need to make sure that:
    1) The 'G" and H cycles are not both "on" ... or else box 7 would have 9 clues.
    2) If cycles A,B and C are all "on", then we have < 3 clues in the statiionary cells in box 1.
    3) If cycles D,E and F are all "on", then we have < 3 clues in the statiionary cells in box 4.
    4) In boxes 2,3 and 5, we have < 9 clues.
More generally:
    1) If the overall cycle on/off state has one or more (".") boxes completely covered by "on"-state cycles, ignore it.
    2) If a (".") box has 'n > 0' stationary cells:
      a) if it overlaps at least one "off" cycle, allow any clue count from 0 to n
      b) otherwise, allow only 0 to (n-1) clues.
For the sample 'g', then, if all we needed was the total number of patterns with (g x) = x, we would loop over the (256) cycle states, and add up counts defined as follows:
  • 0 -- if G,H are both "on"
  • (2^3)*(2^9-1)*(2^9-1)*(2^3)*(2^9-1) -- if at least one cycle is "off" in each of {G,H}, {A,B,C} and {D,E,F}
  • (2^3-1)*(2^9-1)*(2^9-1)*(2^3)*(2^9-1) -- if A,B,C are all "on", and at least one is "off" in each of {G,H} and {D,E,F}
  • (2^3)*(2^9-1)*(2^9-1)*(2^3-1)*(2^9-1) -- if D,E,F are all "on", and at least one is "off" in each of {G,H} and {A,B,C}
  • (2^3-1)*(2^9-1)*(2^9-1)*(2^3-1)*(2^9-1) -- if A-F are all "on", and at least one is "off" in {G,H}

For the end of the story, things get a little more complicated if we want a breakdown of patterns by clue count, N.
For the mathematics end of it, Burnside's lemma applies once to each clue count, but the sums for each N are done in "parallel" -- in a/another set of nested loops, inside the "cycles loop".

The loops are potentially different for each way of assigning "on/off" states to the cell cycles.
Each level of nesting corresponds to a particular pool of cells:
  • There's one pool, for the stationary cells in any/all of the "." boxes that overlap an "off" cycle.
    That one gets a clue count that loops from 0 to the total number of cells.
    (To ensure that at least one loop (level) is present, the "total number of cells" can be zero).
  • Then there is a pool for each "." box that 1) contains at least 2 stationary cells, and 2) doesn't overlap an "off" cycle.
    Those get a clue count that loops from 0 to one less than the number stationary cells in the box.
Inside the loops:
    1) A total clue count, N, is calculated, that is the cell count from "on" cycles, plus the clue counts from each loop level.
    2) A "patterns" count for that N (and loop itteration) is calculated, that is the product of the "choose(n, cc)" values from each loop level, where 'n' is the pool size, 'cc' is the (looping) clue count, and "choose(n,cc)" is n!/cc!/(n-cc)!, the number of ways to choose 'cc' (clue) cells from a pool of 'n'.
    3) (The pattern count is added to an accumulating sum for the particular N).
Something to note: the sum of choose(n,cc) for cc's ranging from 0 to 'n', is 2^n, and the sum from 0 to 'n-1', is (2^n-1).
For the outer loop pool, where 'n' is a sum of stationary cell counts over some set of boxes ... n = n1+n2+...+nk ... and 2^n is (2^n1)*(2^n2)*...*(2^nk).
The 2^ni and (2^n-1) values, are like the values (2^3),(2^3-1) and (2^9-1), from above, for the sample 'g' (and no breakdown by clue count).

I hope that's enough ...

Blue.
blue
 
Posts: 1009
Joined: 11 March 2013

Re: Anticorner maximal invalid patterns

Postby coloin » Sat Aug 17, 2024 5:19 pm

Thats very good ... but way beyond my comprehension of how you did it...and very comprehensive with all the box combinations ....
However the question has always been about the maximal invalid patterns and minimal valid patterns ?
maybe it is too complex ?
Code: Select all
     
+-----+-----+-----+     
|. . .|. . .|. . .|     
|. . .|. . .|. . .|     
|x x x|x x x|x x x|     
+-----+-----+-----+     
|x x x|x x x|c c c|     
|x x x|x x x|c c c|     
|x x x|x x x|c c c|     
+-----+-----+-----+     
|x x x|c c c|c c c|     
|x x x|c c c|c c c|     
|x x x|c c c|c c c|     
+-----+-----+-----+  36C plus corner boxes with no puzzles

+-----+-----+-----+
|. . .|. . .|x x x|
|. . .|. . .|x x x|
|. . .|. . .|x x x|
+-----+-----+-----+
|. . .|x x x|c c c|
|. . .|x x x|c c c|
|. . .|x x x|c c c|
+-----+-----+-----+
|x x x|c c c|c c c|
|x x x|c c c|c c c|
|x x x|c c c|c c c|
+-----+-----+-----+  27C plus corner boxes with no puzzles

+-----+-----+-----+
|. . .|. . .|. . .|
|. . .|. . .|. . .|
|. . .|. . .|x x x|
+-----+-----+-----+
|. . .|x x x|c c c|
|. . .|x x x|c c c|
|. . .|x x x|c c c|
+-----+-----+-----+
|x x x|c c c|c c c|
|x x x|c c c|c c c|
|x x x|c c c|c c c|
+-----+-----+-----+   double counters !

these must account for a lot of the patterns with less clues which are subsets of these well known maximal patterns ...and others
maybe complicated by double counting i guess.

similarly the 322 minimal patterns with puzzles must account for a lot of the patterns with more clues which are supersets of these, maybe making the number of patterns considerably smaller .
coloin
 
Posts: 2449
Joined: 05 May 2005
Location: Devon

Re: Anticorner maximal invalid patterns

Postby Serg » Sun Aug 18, 2024 5:04 pm

Hi, Blue!
Thank you for detailed explanation! But not all details of your method are still understandable for me.

Let's consider simpler task - enumerating ED anticorner patterns - total number only, without distribution by N clues in anticorner area.

We should consider 2^6 = 64 cases like this:
Code: Select all
Case 1

. . .
. . x
. x x

Boxes with 9 clues marked by "x", boxes with 0-8 clues marked by ".".
All different patterns: 511^6

Permitted VPTs:
1. Transposing - 2 ways.
2. Permutting rows in band1 - 6 ways.
3. Permutting rows in band2 - 6 ways.
4. Permutting rows in band3 - 6 ways.
5. Permutting columns in stack1 - 6 ways.
6. Permutting columns in stack2 - 6 ways.
7. Permutting columns in stack3 - 6 ways.

Total number of VPTs: 93312 transformations

We should sum numbers of ED patterns for all 64 cases. Total sum will be the number of ED anticorner patterns.
Really some cases are equivalent, so we need to consider 18 cases only. For example, cases
Code: Select all
. . .   . . .   . . x   . x .
. x x   x x x   . x x   . x x
x x x   . x x   . x x   . x x
are equivalent, so we may consider the case
Code: Select all
. . .
. x x
x x x
only and multiply number of ED patterns by 4 while summing numbers of all cases.
Thus, we must calculate "Case 1" (and some other cases).

You described the calculation of patterns (containing less than 9 clues in "free" boxes) fixed by your example VPT. Do you analyze in such manner each of 93312 VPTs for Case 1?

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

Re: Anticorner maximal invalid patterns

Postby blue » Mon Aug 19, 2024 5:37 am

Hi Colin,

coloin wrote:However the question has always been about the maximal invalid patterns and minimal valid patterns ?
maybe it is too complex ?

Not sure what you're getting at here.

coloin wrote:
Code: Select all
     
+-----+-----+-----+     
|. . .|. . .|. . .|     
|. . .|. . .|. . .|     
|x x x|x x x|x x x|     
+-----+-----+-----+     
|x x x|x x x|c c c|     
|x x x|x x x|c c c|     
|x x x|x x x|c c c|     
+-----+-----+-----+     
|x x x|c c c|c c c|     
|x x x|c c c|c c c|     
|x x x|c c c|c c c|     
+-----+-----+-----+  36C plus corner boxes with no puzzles

+-----+-----+-----+
|. . .|. . .|x x x|
|. . .|. . .|x x x|
|. . .|. . .|x x x|
+-----+-----+-----+
|. . .|x x x|c c c|
|. . .|x x x|c c c|
|. . .|x x x|c c c|
+-----+-----+-----+
|x x x|c c c|c c c|
|x x x|c c c|c c c|
|x x x|c c c|c c c|
+-----+-----+-----+  27C plus corner boxes with no puzzles

+-----+-----+-----+
|. . .|. . .|. . .|
|. . .|. . .|. . .|
|. . .|. . .|x x x|
+-----+-----+-----+
|. . .|x x x|c c c|
|. . .|x x x|c c c|
|. . .|x x x|c c c|
+-----+-----+-----+
|x x x|c c c|c c c|
|x x x|c c c|c c c|
|x x x|c c c|c c c|
+-----+-----+-----+   double counters !

these must account for a lot of the patterns with less clues which are subsets of these well known maximal patterns ...and others
maybe complicated by double counting i guess.

The first one accounts for ~50,000,000 of the 84,460,198 (ED) patterns with no puzzles.
There's a 27+32 and 27+30 clue shapes, that take out another ~25,000,000.
The 3 empty boxes pattern, accounts for under 1 million, even if you extend it to include all 5 (box pattern) cases.

Code: Select all
. . x    . x .    . . x    x . .    x . x
. x c    . x c    x . c    x . c    . . c
x c c    x c c    x c c    x c c    x c c

coloin wrote:similarly the 322 minimal patterns with puzzles must account for a lot of the patterns with more clues which are supersets of these, maybe making the number of patterns considerably smaller .

They account for ~99.4% of the patterns with puzzles, but it still leaves about 2.5 billion unaccounted for.
blue
 
Posts: 1009
Joined: 11 March 2013

Re: Anticorner maximal invalid patterns

Postby blue » Mon Aug 19, 2024 7:15 am

Hi Serg,

Serg wrote:Let's consider simpler task - enumerating ED anticorner patterns - total number only, without distribution by N clues in anticorner area.

We should consider 2^6 = 64 cases like this:

(...)

We should sum numbers of ED patterns for all 64 cases. Total sum will be the number of ED anticorner patterns.
Really some cases are equivalent, so we need to consider 18 cases only. For example, cases
Code: Select all
. . .   . . .   . . x   . x .
. x x   x x x   . x x   . x x
x x x   . x x   . x x   . x x
are equivalent, so we may consider the case
Code: Select all
. . .
. x x
x x x
only and multiply number of ED patterns by 4 while summing numbers of all cases.
Thus, we must calculate "Case 1" (and some other cases).

Multiplying by 4 isn't the right thing to do here.
Given two of the patterns, any extension the first, is isomorphic to (at least) one extension of the other.

This should help clarify things ...

For patterns in general, we can define a canonical form like this:
1) Its full boxes (if any), form a minlex "box pattern".
2) The rest of the pattern is "minlex", with respect to transformations that preserve the box pattern in (1).

Another way of looking it is that we form the pattern's orbit under the full set of (2*6^8) VPTs, and to designate one as "canonical", we toss out all of the cases where the "full boxes" part isn't minlex, and take the "minlex-first" case, from what remains.

With that, the set of canonical forms for all 2^81 patterns, splits into 26 subsets, one for each minlex full box pattern, and/or more generally, one for each "ED" full box pattern.

For ED anti-corner patterns, now, (for example), we just need to total up the counts from each subset where the "full boxes" part, has at least one transformation to a superset of the anti-corner pattern.

Serg wrote:You described the calculation of patterns (containing less than 9 clues in "free" boxes) fixed by your example VPT. Do you analyze in such manner each of 93312 VPTs for Case 1?

No. They split into "conjugacy classes", like the full set of VPT's did in the Russel/Jarvis work on ED grids.
(This isn't new for you, is it ?)
For the full set, it was 275 classes. For the "Case 1" group, there were 405 classes.
The "(g x) = x" count is the same for each member of a given class, even with the 8-clues per box restriction.
I analyzed 405 cases then, and multiplied the counts for each, by the corresponding class size, before summing.
blue
 
Posts: 1009
Joined: 11 March 2013

Re: Anticorner maximal invalid patterns

Postby Serg » Mon Aug 19, 2024 4:33 pm

Hi, Blue!
Here is my "reconstruction" of your method application to ED anticorner patterns enumeration.

1. Determine "core" 26 shapes of full boxes configurations (you published those 26 shapes in your result describing post).
2. For each shape one should specify VPT group, preserving shape (such group may include rows/columns permutations into band/stack and transposing).
3. For each shape VPT group one should calculate conjugacy classes.
4. For each conjugacy class one should analyze sample transformation from this class to determine - how many patterns are fixed by that sample transformation? Patterns (according to selected shape) must have 9 clues in the boxes marked by "x" symbol and 0-8 clues in the boxes marked by "." symbol.
5. For the shape processed one should calculate number of ED patterns, summing numbers of fixed patterns for each conjugacy classes multiplied by number of VPTs in that class and devided by total number of VPTs in shape VPT group.
6. One should determine - what shapes must be used for anticorner patterns enumeration (shapes must be morphed to anticorner shape supersets). (According to your description, anticorner shape has #6.) Analysis gives superset shapes 6, 9-11, 13-26 (18 shapes in total) to be accounted for anticorner shape.
7. One should sum ED patterns numbers for all proper superset shapes. Resulting sum will be the number of ED anticorner patterns.

Right?

Serg

[Edited] I corrected errors in my post pointed by Blue.
Last edited by Serg on Mon Aug 19, 2024 6:06 pm, edited 1 time in total.
Serg
2018 Supporter
 
Posts: 885
Joined: 01 June 2010
Location: Russia

Re: Anticorner maximal invalid patterns

Postby blue » Mon Aug 19, 2024 5:58 pm

Hi Serg,

Right.

In point 6, though, shape 13 should be included, making 18 shapes in all.
In point 7, "proper (superset)" probably isn't the right phrase. It's too close to "proper superset".
blue
 
Posts: 1009
Joined: 11 March 2013

Previous

Return to General