coloin wrote:Trying to interpret the tables ....
322 is the number of valid patterns with 6 clues ... { up from 315 posted !]
3627 is the number of potentially valid 7 clue patterns but doesnt include the patterns generated from the 322 plus 1 clue ... is this correct ?
That's the idea, yes.
I think the 7-clue number is at least 3744, though.
coloin wrote:There wont be many 12 clue patterns which arnt valid ...
for other readers.. this [? maximal} pattern takes out many ...
- Code: Select all
+---+---+---+
|...|.6.|...|
|...|.1.|...|
|..1|372|458|
+---+---+---+
|..4|821|635|
|123|456|789|
|..8|793|124|
+---+---+---+
|..9|687|513|
|..7|245|896|
|..6|139|247|
+---+---+---+ invalid pattern
Of course the saving grace is that it gets easier to provide a puzzle once the number of clues increases above 7 ....
So maybe providing valid puzzles is a quicker way to check all the possible valid patterns ... which is the table ? and hence the invalid patterns can be found ?
Right. If you had a table that listed every (ED) "anti-corner" shape, and whether it has puzzles, then to produce the lists of maximal invalid and (restricted) minimal valid shapes, then you could do this:
For maximal invalid shapes:
- For each shape, initialize an "is a proper subset of an invalid shape" flag to 'false'
- Loop the shapes from the largest size to the smallest
- If the shape has puzzles, or it is already flagged as being a proper subset of an invalid shape, then ignore it.
- Otherwise, add it to the list of "maximal invalid" shapes, and see that all of its proper subsets get the flag from (1) set to true.
(Likely, some will already be flagged).
For (restricted) minimal valid shapes:
- For each shape, initialize an "is a proper superset of an valid shape" flag to 'false'
- Loop the shapes from the smallest size to the largest
- If the shape doesn't have puzzle, or it is already flagged as being a proper superset of an valid shape, then ignore it.
- Otherwise, add it to the list of "(restricted) minimal invalid" shapes, and see that all of its proper supersets get the flag from (1) set to true.
(Likely, some will already be flagged).
The main problem with doing all of that, is that as
Serg said, the number of ED shapes, is huge ... on the order of 400,000,000,000.
If you discard the shapes with 8 clues in one of {r7,r8,r9,c7.c8,c9} it's still over 37,000,000,000.
For
Serg: what I did to get started, was generate the ~37e+9 shapes, and filter out cases that were proper subsets of shapes that we had previously verified as being invalid, and filter out shapes that were proper supersets of ~2000 "seed puzzle" shapes that I generated. That brought the count down to around ~47 million. At that level, an 8-byte "shape tag" and a "flags" byte, could fit in RAM.
After a lot of work, I had results summarized like this:
- Code: Select all
Sz | Total | HasPuzzles | NoPuzzles | Questionable |
-----+----------+------------+-----------+--------------+
5 | 32 | 0 | 32 | 0 |
6 | 831 | 322 | 509 | 0 |
7 | 5084 | 3758 | 1326 | 0 |
8 | 28349 | 26564 | 1785 | 0 |
9 | 107902 | 105896 | 2006 | 0 |
10 | 328498 | 326827 | 1671 | 0 |
11 | 809307 | 808115 | 1192 | 0 |
12 | 1650518 | 1649826 | 692 | 0 |
13 | 2831846 | 2831460 | 386 | 0 |
14 | 4151321 | 4151103 | 218 | 0 |
15 | 5281938 | 5281791 | 147 | 0 |
16 | 5925743 | 5925631 | 112 | 0 |
17 | 5953330 | 5953265 | 65 | 0 |
18 | 5431674 | 5431645 | 29 | 0 |
19 | 4554218 | 4554202 | 16 | 0 |
20 | 3540766 | 3540757 | 9 | 0 |
21 | 2568250 | 2568244 | 6 | 0 |
22 | 1744090 | 1744079 | 11 | 0 |
23 | 1110320 | 1110311 | 9 | 0 |
24 | 662319 | 662311 | 8 | 0 |
25 | 368913 | 368910 | 3 | 0 |
26 | 190695 | 190673 | 22 | 0 |
27 | 90302 | 90287 | 15 | 0 |
28 | 38369 | 38369 | 0 | 0 |
29 | 14056 | 14056 | 0 | 0 |
30 | 4139 | 4133 | 6 | 0 |
31 | 839 | 839 | 0 | 0 |
32 | 81 | 78 | 3 | 0 |
36 | 1 | 0 | 1 | 0 |
-----+----------+------------+-----------+--------------+
| 47393731 | 47383452 | 10279 | 0 |
For an arbitrary anti-corner shape, I can do this now, to check whether it has puzzles:
- Expand 8-clue r7,r8,r9,c7,c8,c9's to 9 clues.
- Look for the shape in the list.
- If it's there, check the flags for whether it has or doesn't have puzzles.
- If it isn't there, then check it for being proper subset of one of the original "known to be invalid" shapes.
If that's the case, then and it doesn't have puzzles ... otherwise it's a proper superset of one of the initial puzzle shapes, and it has puzzles.
For what it's worth, right now, I'm doing something similar to what I did to get started: generate the ~400e+9 ED shapes, and filtering out cases that are known to be valid or invalid ... using my lists of 1428 maximal invalids, and 10090 "no-8-clue-r/c" valids. In ~another (8 cores @) 8 hours, I'll have a list of ~3,000,000 shapes (I think) to work with. After flagging the ones that are known (or at least "believed") to be invalid, the rest should have puzzles. I'll run through my list of 10090 puzzles and the 11706 reductions with 8-clue rows/cols, and get thier shapes and thier supersets flagged. At that point, and I'll set my "puzzle finder" code onto anything that still isn't flagged. When the dust clears, I should be able to produce a proper "minimal valid" list, using the method that I outlined for Colin.