Thanks, Red Ed, for evaluating the methods, and for instructive examples!
Also interesting that our methods are principially different.
Red Ed wrote:There's a subtle problem in the recursive formulae that you're using, Ocean. The formulae themselves are correct, but they rely upon values r(C) and m(C) that are harder to estimate than I had initially appreciated.
Here's a simplified example in a grid with just 7 puzzles
, and where the directed acyclic graph that describes which clue removal has been replaced with a tree.
The example in your first post illustrates a possible methodological problem.
The example itself is not a valid case though, since it violates some of the fundamental properties for sudoku "graphs". (In order to reach puzzle D, three clues are removed from the original grid A. The order of removal is not important, so there has to be three different subgraphs starting from A and ending in D. Similar for the other minimals).
So, the sudoku graphs are
not trees.
I found it hard to evaluate the combined effects of 1) removing the (82-C) factor, and 2) using an invalid graph. Instead, better to test the methods on real cases, like the 2x2 case, or for valid subgraphs. The cases below are 'hand calculated' on sheets of paper. (If conclusions are questioned, I can supply more details).
- Code: Select all
Subgraph 1 (two levels):
c=81 A
/|\
c=80 B C E
\|
c=79 D
# This is a real case:
100000002020030040000105000006000300030010070008000900000608000070040020300000008 #A:21
000000002020030040000105000006000300030010070008000900000608000070040020300000008 #B:20
100000002020030040000105000006000300030010070008000900000608000070000020300000008 #C:20
000000002020030040000105000006000300030010070008000900000608000070000020300000008 #D:19
100000002020030040000105000006000300030010070008000900000608000070040020000000008 #E:20
#
In this case (subgraph 1 - two levels) the found average values for
r and
m are correct.
- Code: Select all
Subgraph 2 (three levels):
c=81 A ---
/ \ \
/ \ \
/|\ /\ \
c=80 B C D I J L
|X X| \ /
c=79 E F G K
\|/
H
Subgraph 2 (three levels): Still calculating/finding correct averages for
r and
m, when using the
modified method (when averages are calculated for the
non-minimal sets, and the recursive formulas are adjusted accordingly.)
Subgraph 3 (four levels). Adding a fourth level (a parallell uncoupled subgraph with 4+6+4+1 nodes) results in incorrect average values when the method is applied:
correct r=105/63 versus found r=93/63; (average for the non-minimal set, c='79')
correct m=7/21 versus found m=9/21;
Preliminary conclusions: 1. the "found"
r seems to be (always?) equal or lower than the correct
r. This tends to underestimate
N. Can possibly explain the divergence between my estimates and JFK's values for number of grids - where my estimates were generally at the same order of magnitude, but mostly outside the 95% confidence interval (at the lower side).
2. The "found"
m is either equal or higher than the correct
m. This tends to overestimate the
ratio M/N.
3. Combined effects (guessing here): This may result in bias of the distribution of minimals, reporting too many for 'high number of clues', and losing some minimals for low number of clues.
How would you assess your method for finding minimals, given the cases above?
The 2x2 case is also interesting. Not quite sure about the details. The result is not too unlikely. The errors will be different if
r and
m averages are for
all subgrids, compared to only for
non-minimal subgrids (and adjusted recursion formulas). (In order to run this case myself some modifications in the program logic must be done. Not sure how much work that is. But the idea of testing 'everything new' for the 2x2 case is good.)
JPF wrote:Number of valid puzzles* with c clues. (3)
* minimal & non minimals
Here is an improvement of the previous numbers given in (2)
(...)
Total number of valid puzzles*
With 10^6 simulations, I got a proportion P of valid puzzles equal to 0.378
It gives a standard deviation s = sqrt( 0.378 x 0.622 / 10^6 ) ~ 5E-4
and a confidence interval (95%) of [0.377 ; 0.379]
The resulting number of puzzles N = P x 2^81 x Ng is therefore such that : 6.08E+45 < N < 6.11E+45
JPF
Thanks. Useful for calibration of other methods also.
Comparing calculated total number of valid puzzles:
5.63691E+45 (mine) vs. 6.08E+45 < N < 6.11E+45 (JPF; all grids)
(Ref. also: 8,45e23 (mine) vs. 2^81/2.74 = 8,82e23 (Red Ed; per grid))
Same order of magnitude, but clearly below the 95% confidence interval, which worries me a bit.