ronk wrote:gsf wrote: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)
Does that mean r1 is replaced by r4, etc. ... or is r4 replaced by r1, etc.Given that mathematical assignment is almost unversally expressed ... assign right-side-value to left-side-variable, I would hope it's ...
tmp = r1; r1 = r4; r4 = r9; r9 = tmp;
... not that it makes any difference if your program is the only one to "read" the output.
good question ronk
first, the parenthesized parts are not my notation: wiki (so it does make a difference)
that's a beautiful concise notation, and the best part is someone else did the hard part (defining it in mathematic terms)
the sudokuized parts (r c v i x a) are mine:
r: row permutations
c: colum permutations
v: cell value permutations
i: identity (when all permutations are the identity)
x: transpose (row-col transposition)
a: number of non-trivial automorphisms (fallout from the underlying algorithm)
so its implemented equivalent to the assignment with the tmp var
note on the solver: for -p it now requires at least two input puzzles
its also possible that that post referred to the old canonical form
here is an updated example
- Code: Select all
sudoku -p 100406700050000030000207000000904600000802000070000010306000008000000000802000405 ...6..3.7...12.6.5.........2.7.4.9.......3.1.5.4...........9.4.6.5......8.2.7....
which results in these permutations
- Code: Select all
v(19867425)r(149258367)c(175286394)
you can then apply the permutation to map the first puzzle to the second
- Code: Select all
sudoku -p'v(19867425)r(149258367)c(175286394)' 100406700050000030000207000000904600000802000070000010306000008000000000802000405
not very useful in this example
but you may have a collection of equivalent puzzles or templates/exemplars that need to be transformed using the same permutation