Pat wrote:doing it on paper, i never know if i found the simplest solution-path.
daj95376, could you please tell us a little about your software -- how does it find the simplest solution-path?? checking all the possible combinations??
~ Pat
interesting
unless the coding specifically avoids it most sudoku algorithms are probably biased to input puzzle permutations
for i 0 .. 80 for i 1 .. 81 etc
in my solver with -S (step) on, it finds 5 box-line, committing each one separately before checking for the next
committing in a different order can give slightly different step results
one way around is to randomize the selection order and do multiple runs
my solver code is riddled with 0..80 0..8 0..27 0..2 loops
randomizing those would be a debugging (and testing) nightmare
an alternnative is to throw a bunch of isomorphic permutations at the solver and select those that minimize/maximize moves
this is how suexrat determines its ratings
you can do this multi-stage with my solver (as always grab the latest version)
for this problem minimizing the default R rating should do
first look at the range of ratings for ~100 permutations
- Code: Select all
g -r1 -J99 -S -f'%v %Q' ...2.8..7.4.....9....5.6...3.7...6...........6.5...1.2...4.5....1.....3.9..7.2..4
-r1 sets the pseudo random seed so that results are reproducable between runs
from this it looks like 30 is the lowest
use that to filter lower ratings from the same sample
- Code: Select all
g -e 'R<30' -r1 -J99 -S -f'%v %Q' ...2.8..7.4.....9....5.6...3.7...6...........6.5...1.2...4.5....1.....3.9..7.2..4
this results in
- Code: Select all
3.7...6..6.5...12..........9..2.7.4....5.4....1......3.4......9...8.2.7....6.5... 29 FNB C22.m/F9.56/N2.3/B4.13.13
.........8.6....252.5....74.9....3..7..2...4....16.....4....1.....57.......63..9. 29 FB C22.m/F9.59/B5.19.19
..........86...25..25...74.9.......3...1.6....7.2..4.....6.39.....5.7...4.......1 29 FB C22.m/F9.59/B5.19.19
so we can get 4 box-line with rating 29
next see if that can be bettered over a larger sample
- Code: Select all
g -e 'R<29&&B<5' -r1 -J9999 -S -f'%v %Q' ...2.8..7.4.....9....5.6...3.7...6...........6.5...1.2...4.5....1.....3.9..7.2..4
and there's one
- Code: Select all
.....6.37...2.1.65..........274...9..54..........3.1......9.4...827......65...... 28 FNB C22.m/F8.56/N2.3/B4.13.13
F8: 8 naked singles, N2: 2 hidden singles, B4: 4 box-line
now the -p cyclic permutation option can be used to map the move
although randomizing the inner loops would be a pain, all of my -v trace output is done in
one place, so, given the cyclic permutations that map one puzzle to another, that permutation
can be used to map the -v output (showing the move trace) relative to another puzzle
first determine the cyclic permutation from the "minimal" puzzle (isomorphic to the original)
- Code: Select all
g -p ...6..3.7...12.6.5.........2.7.4.9.......3.1.5.4...........9.4.6.5......8.2.7....
which produces
- Code: Select all
r(149)(267)(358)c(168259347)
(all of this math keeps the coding chops in shape)
then run the solver on the "minimal" puzzle with the trace output mapped
- Code: Select all
g -S -v2 -p'r(149)(267)(358)c(168259347)' ...6..3.7...12.6.5.........2.7.4.9.......3.1.5.4...........9.4.6.5......8.2.7....
to get
- Code: Select all
[1] F1 [86]=9
box-line 3 b/2 [56][55][54][55][52][53]
B3 [56][55][54]^3
box-line 1 b/2 [56][55][54][57][59][58]
B3 [56][55][54]^1
box-line 4 b/2 [56][55][54][57][59][58]
B4 [56][55][57][58]^4
F1 [56]=7
N2 [68]=7 [48]=4
F3 [46][64]=1 [66]=3
F2 [66]=4 [65]=7
N1 [64]=3
box-line 9 b/2 [45][65][55][95][85][75]
B3 [45][65][55]^9
F5 [65][84]=8 [62]=9 [85]=6 [89]=5
F10 [44]=9 [49][52][97]=8 [42]=2 [54][69]=6 [58][25]=5 [28]=1
F9 [45]=5 [55][78]=2 [98]=6 [93][69]=3 [68]=8 [62]=7 [27]=4
F16 [59][77][63][25]=9 [95][79][65]=1 [92]=5 [87]=7 [75][22]=3
[72][23]=6 [73]=8 [63][67]=2
F9 [57]=3 [55][83][65]=4 [53]=1 [85]=2 [75]=7 [67]=5 [65]=8
S
which shows the original minimal box-line application order from the given sample
are you sorry you asked about someone's solver?