-
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
add method IsDigraphAutomorphism #106
Conversation
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.
Hi Chris, it's a nice idea to have this function.
This currently only works for digraphs without multiple edges. It returns the wrong answer sometimes for multidigraphs. The plan is to remove multidigraphs at some point in the future, but for now we should support them I think.
For example:
<multidigraph with 3 vertices, 3 edges>
gap> IsDigraphAutomorphism(gr, (2, 3));
true
Vertices 2 and 3 are not equivalent, since they have different numbers of out-neighbours. So (2, 3)
should not be an automorphism. Also, somewhat related, (2, 3)
is not in the automorphism group of the multidigraph, i.e. if you do (2, 3) in AutomorphismGroup(gr);
then the answer is false
.
Remember that automorphism groups for digraphs and multidigraphs are different (see the doc of AutomorphismGroup
).
For non-multidigraphs, I reckon the best method would be to do return OnDigraphs(gr, p) = gr;
rather than what you're doing now, which involves constructing the list of edges and repeated searching in the list of edges.
For multidigraphs, I'm not sure. Perhaps require the automorphism to consist of two perms (one of the vertices, one of the edges?) and then run OnMultiDigraphs
rather than OnDigraphs
? Something for you to think about.
I also think the documentation for IsDigraphAutomorphism
could maybe explain what an automorphism is (or at least provide a reference toAutomorphismGroup
if you think that's sufficient).
0e5ecc1
to
23a859a
Compare
gap/isomorph.gi
Outdated
"for a digraph and a permutation", | ||
[IsDigraph, IsPerm], | ||
function(gr, x) | ||
return OnDigraph(gr, x) = gr; |
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.
Please first add a check for whether gr
is a multidigraph, if so, then have an error message saying it doesn't work for digraphs with multiple edges.
doc/isomorph.xml
Outdated
of the digraph <A>digraph</A>. An permutation <C>g</C> on the vertices of a | ||
digraph <C>gr</C> is an automorphism if it satisfies: <C>(u, v)</C> is an | ||
edge of <C>gr</C> if and only if <C>(g(u), g(v))</C> is an edge of | ||
<C>gr</C>. See also <Ref Attr="AutomorphismGroup" Label="for a digraph" />. |
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.
Please change it to:
...of <C>gr</C>
for all vertices u and v in digraph. (To quantify the vertices)
1cb3fb7
to
be912f9
Compare
This operation takes a digraph and a permutation and returns true if the permutation is an automorphism of the digraph.
be912f9
to
ec5fccc
Compare
This operation takes a digraph and a permutation and returns true if the
permutation is an automorphism of the digraph. See also #105.