Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected slowness when computing NormalSubgroups(SymmetricGroup(n)) for some n #2683

Closed
markuspf opened this issue Aug 6, 2018 · 3 comments
Labels
kind: discussion discussions, questions, requests for comments, and so on topic: library topic: performance bugs or enhancements related to performance (improvements or regressions)

Comments

@markuspf
Copy link
Member

markuspf commented Aug 6, 2018

@mtorpey and I just happened upon the following unexpected behaviour:

gap> for i in [1..1000] do S := SymmetricGroup(40); NormalSubgroups(S);  Print("hi\n"); od;

Now sometimes GAP computes the normal subgroups of Sym(40) quite quickly (1-2 seconds), sometimes it takes a minute or (on @mtorpey's computer) seems to get stuck (in partition backtrack).

Maybe @hulpke can shine some light on where randomisation (pointing fingers randomly at reasons why this should even happen) is involved in this computation.

Of course for symmetric and alternating groups we can just install methods that give us the normal subgroups (@mtorpey is working on this) in basically no time at all, but there might be an underlying issue that makes this computation sometimes slower than it needs to be, and I'd like to know what it is.

@markuspf markuspf added question topic: performance bugs or enhancements related to performance (improvements or regressions) topic: library labels Aug 6, 2018
@markuspf markuspf changed the title Bug when computing NormalSubgroups(SymmetricGroup(n)) for some n Unexpected slowness when computing NormalSubgroups(SymmetricGroup(n)) for some n Aug 6, 2018
@markuspf
Copy link
Member Author

markuspf commented Aug 7, 2018

Update: The code seems to never get stuck, it just has very large variations in runtime: from 1.2 seconds all the way to one hour and 20 minutes letting it run over night.

@hulpke
Copy link
Contributor

hulpke commented Aug 7, 2018

What happens is that the code of a centralizer of a random element is computed. In permutation groups probably a subgroup centralizer could be faster.

In any case, this should be faster, better etc. with proper recognition.

If this is a shopwstopper, I'd be happy to look at the normal subgroups code to avoid this particular issue.

hulpke added a commit to hulpke/gap that referenced this issue Aug 7, 2018
as this makes a Core computation quicker. This avoids slowdowns in
particular cases such as gap-system#2683
@hulpke
Copy link
Contributor

hulpke commented Aug 7, 2018

Looking at the example, the problem seems to be in Core(G,C) when C is a transitive subgroup of G. If G is the full symmetric group there is no quick reduction, so this takes a bit of time. I have added a silly heuristic (prefer intransitive centralizers) that avoids this bad case.

hulpke added a commit to hulpke/gap that referenced this issue Aug 10, 2018
as this makes a Core computation quicker. This avoids slowdowns in
particular cases such as gap-system#2683
hulpke added a commit to hulpke/gap that referenced this issue Aug 10, 2018
as this makes a Core computation quicker. This avoids slowdowns in
particular cases such as gap-system#2683
hulpke added a commit to hulpke/gap that referenced this issue Aug 23, 2018
as this makes a Core computation quicker. This avoids slowdowns in
particular cases such as gap-system#2683
hulpke added a commit to hulpke/gap that referenced this issue Aug 23, 2018
as this makes a Core computation quicker. This avoids slowdowns in
particular cases such as gap-system#2683

This fixes gap-system#2683
hulpke added a commit to hulpke/gap that referenced this issue Aug 23, 2018
as this makes a Core computation quicker. This avoids slowdowns in
particular cases such as gap-system#2683
hulpke added a commit to hulpke/gap that referenced this issue Aug 23, 2018
as this makes a Core computation quicker. This avoids slowdowns in
particular cases such as gap-system#2683

This fixes gap-system#2683

Includes necessary manual example changes.
hulpke added a commit to hulpke/gap that referenced this issue Aug 31, 2018
as this makes a Core computation quicker. This avoids slowdowns in
particular cases such as gap-system#2683

This fixes gap-system#2683

Includes necessary manual example changes.
hulpke added a commit to hulpke/gap that referenced this issue Aug 31, 2018
as this makes a Core computation quicker. This avoids slowdowns in
particular cases such as gap-system#2683

This fixes gap-system#2683

Includes necessary manual example changes.
hulpke added a commit to hulpke/gap that referenced this issue Sep 3, 2018
as this makes a Core computation quicker. This avoids slowdowns in
particular cases such as gap-system#2683

This fixes gap-system#2683

Includes necessary manual example changes.
hulpke added a commit to hulpke/gap that referenced this issue Sep 6, 2018
as this makes a Core computation quicker. This avoids slowdowns in
particular cases such as gap-system#2683

This fixes gap-system#2683

Includes necessary manual example changes.
@fingolfin fingolfin added kind: discussion discussions, questions, requests for comments, and so on and removed kind: discussion discussions, questions, requests for comments, and so on kind: question labels Mar 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: discussion discussions, questions, requests for comments, and so on topic: library topic: performance bugs or enhancements related to performance (improvements or regressions)
Projects
None yet
Development

No branches or pull requests

3 participants