Walk the orbit instead of searching it when it is short - #38
Open
fingolfin wants to merge 1 commit into
Open
Conversation
For transformations, permutations and partial permutations the image search runs in the row-column action on mMax^2 encoded pairs, where mMax is the degree of the input. Lifting a single generator of G into that action, or allocating one table indexed by it, already costs mMax^2 operations, so the search has a floor quadratic in the degree no matter how short the orbit of the object happens to be. When the orbit is shorter than that floor, walk it in full instead. That costs one group element application per coset of the stabilizer, which this code path has computed anyway. The images are compared as padded image lists, which is the same comparison the search performs on the encoded pair sets, so the minimum found is the same one. Timings in ms on the example from issue #27, a group of order 2704 and degree 2808 with a conjugacy class of length 52: search orbit MinimalImage 613 14 IsMinimalImage 645 14 MinimalImagePerm 677 14 CanonicalImage 679 13 For reference Minimum(Orbit(C, pt, OnPoints)) takes 1 ms; nearly all of what is left is the Centralizer and RightTransversal calls. MinimalImage and IsMinimalImage return exactly what they returned before. MinimalImagePerm may return a different element of the same coset, which maps to the same minimal image. CanonicalImage picks a different representative, which it is free to do. The new 'bruteForce' option selects between the two ("auto" by default); tst/test_bruteforce.tst uses it to check them against each other. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Member
Author
|
@ChrisJefferson assuming this passes, time for a new release? |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #38 +/- ##
==========================================
+ Coverage 89.58% 89.69% +0.11%
==========================================
Files 13 13
Lines 2572 2610 +38
==========================================
+ Hits 2304 2341 +37
- Misses 268 269 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For transformations, permutations and partial permutations the image
search runs in the row-column action on mMax^2 encoded pairs, where mMax
is the degree of the input. Lifting a single generator of G into that
action, or allocating one table indexed by it, already costs mMax^2
operations, so the search has a floor quadratic in the degree no matter
how short the orbit of the object happens to be.
When the orbit is shorter than that floor, walk it in full instead. That
costs one group element application per coset of the stabilizer, which
this code path has computed anyway. The images are compared as padded
image lists, which is the same comparison the search performs on the
encoded pair sets, so the minimum found is the same one.
Timings in ms on the example from issue #27, a group of order 2704 and
degree 2808 with a conjugacy class of length 52:
For reference Minimum(Orbit(C, pt, OnPoints)) takes 1 ms; nearly all of
what is left is the Centralizer and RightTransversal calls.
MinimalImage and IsMinimalImage return exactly what they returned before.
MinimalImagePerm may return a different element of the same coset, which
maps to the same minimal image. CanonicalImage picks a different
representative, which it is free to do.
The new 'bruteForce' option selects between the two ("auto" by default);
tst/test_bruteforce.tst uses it to check them against each other.
Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com