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

add method IsDigraphAutomorphism #106

Merged
merged 2 commits into from
Jan 24, 2018

Conversation

ChristopherRussell
Copy link
Collaborator

@ChristopherRussell ChristopherRussell commented Jan 24, 2018

This operation takes a digraph and a permutation and returns true if the
permutation is an automorphism of the digraph. See also #105.

Copy link
Collaborator

@wilfwilson wilfwilson left a 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).

gap/isomorph.gi Outdated
"for a digraph and a permutation",
[IsDigraph, IsPerm],
function(gr, x)
return OnDigraph(gr, x) = gr;
Copy link
Collaborator

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" />.
Copy link
Collaborator

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)

@ChristopherRussell ChristopherRussell force-pushed the automorphism branch 3 times, most recently from 1cb3fb7 to be912f9 Compare January 24, 2018 16:03
This operation takes a digraph and a permutation and returns true if the
permutation is an automorphism of the digraph.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants