-
Notifications
You must be signed in to change notification settings - Fork 46
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
cliques: some perf improvements #635
Conversation
1801b31
to
1d124f0
Compare
59f7be3
to
36be423
Compare
TODO: this means we don't need Orb for Digraphs any more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR looks good, thanks James! Can confirm that the extreme test runs out of memory (and takes way longer) without these changes, much better now.
gap/cliques.gi
Outdated
Add(orbits, orb); | ||
Append(out, orb); | ||
if not c in orbits then | ||
MultiOrbit(G, c, orbits); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is a bit confusing, since MultiOrbit
returns an orbit and its non-obvious that it changes the orbits
hashmap in place (this is what its used here). Would it make sense to just inline the bit of the MultiOrbit
code thats relevant to updating the orbits
hashmap?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure it makes sense to inline the bit of code in MultiOrbit
, it is used elsewhere, and then we'd have duplication of the method. Maybe I can rename the function to AddOrbitToMap
or something?
36be423
to
0f99b3a
Compare
This commit includes some performance improvements for the clique finding code. The example in the newly added extreme/cliques.tst file takes approx. 4s with the modified code, versus at least 3 minutes previously (I never ran it to completion previously because it was taking too long). If we do: List(DigraphCliquesReps(D), x -> Orbit(AutomorphismGroup(D), x, OnSets)); for the same example, then this takes about 12s, doing the same with List(DigraphCliquesReps(D), x -> Orb(AutomorphismGroup(D), x, OnSets)); instead runs out of memory repeatedly (and takes longer than 12s). Note that the automorphism group is of size 16, and so the orbits are relatively small in comparison to the number of cliques.
0f99b3a
to
4318a25
Compare
This commit includes some performance improvements for the clique finding code. The example in the newly added extreme/cliques.tst file takes approx. 4s with the modified code, versus at least 3 minutes previously (I never ran it to completion previously because it was taking too long). If we do:
for the same example, then this takes about 12s, doing the same with
instead runs out of memory repeatedly (and takes longer than 12s). Note that the automorphism group is of size 16, and so the orbits are relatively small in comparison to the number of cliques.