Hi, people!
I am sorry for my pollution of this thread, but just another post is coming outside from me...
Just some considerations concerning LS canonicalization algorithm.
Let's define for any pair of LS solution grid's rows Two-Row UA Minimality Index in the following way.
Index = 0 if pair of rows contains U4+U4+U4+U6 UA sets (4 distinct UA sets).
Index = 1 if pair of rows contains U4+U4+U10 UA sets (3 distinct UA sets).
Index = 2 if pair of rows contains U4+U6+U8 UA sets (3 distinct UA sets).
Index = 3 if pair of rows contains U4+U14 UA sets (2 distinct UA sets).
Index = 4 if pair of rows contains U6+U6+U6 UA sets (3 distinct UA sets).
Index = 5 if pair of rows contains U6+U12 UA sets (2 distinct UA sets).
Index = 6 if pair of rows contains U8+U10 UA sets (2 distinct UA sets).
Index = 7 if pair of rows contains no UA sets.
If we consider a pair of LS rows as r1/r2 candidates for LS minlex form, its Minimality Index will determine minlex form of r1/r2 rows.
- Code: Select all
123456789
214365897 Index = 0
123456789
214367895 Index = 1
123456789
214537896 Index = 2
123456789
214567893 Index = 3
123456789
231564897 Index = 4
123456789
231567894 Index = 5
123456789
234167895 Index = 6
123456789
234567891 Index = 7
So, you can see - the higher Index, the greater r1/r2 rows minlex form.
For any given LS solution grid we should calculate Indexes for all its 36 pairs of rows first. Then we should apply other 5 non-trivial paratopic transformations (in turn) and calculate Indexes for all grid's 36 pairs of rows. Now we can calculate minimal Index of the grid, choosing minimal Index value from 6 x 36 = 216 row pairs. During minlex form finding we should consider as r1/r2 rows candidates only row pairs, having minimal Index value of the grid. This trick can significantly reduce number of grid's checks during canonicalization.
Additional optimisation can be achieved by ignoring some paratopic transformation. For example, paratopic transformation No.3 (cd-exchange) leaves cells in their former rows and doesn't destroy two-row UA sets. So, it can be ignored, because this transformation doesn't change row pairs' Indexes. More careful analysis (see my next post) shows that paratopic transformations No.5 and No.6 can be ignored too.
So, typically we should check several row pairs only from 36 x 3 = 108 possible pairs as r1/r2 rows candidates.
Remark. The last LS in minlex form ("Solitary"
Mathimagics' LS grid) has minimal Index value of 6. LS having minimal index of 7 (no two-row/two-column UA sets) are impossible.
Serg
[Edited. I changed part of the post, concerning paratopic transformation ignoring. I need some time to prepare more correct statements on this theme.]
[Edited2. I changed part of the post, concerning paratopic transformation ignoring, one more time. Hope now it's OK.]