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

Allow specifying vertex colours in IsDigraphHomomorphism etc. #283

Merged
merged 6 commits into from
Jan 24, 2020

Conversation

flsmith
Copy link
Collaborator

@flsmith flsmith commented Jan 20, 2020

This PR adds the ability to specify vertex colours in the operations

IsDigraphHomomorphism
IsDigraphEpimorphism
IsDigraphMonomorphism
IsDigraphEndomorphism
IsDigraphAutomorphism

@flsmith flsmith force-pushed the coloured-homomorphisms branch 2 times, most recently from 2eee70d to 2389c57 Compare January 21, 2020 18:03
Copy link
Member

@james-d-mitchell james-d-mitchell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm basically happy with this, but suggest adding an operation RespectsColouring and then using this repeatedly in the new methods that you've given.

doc/isomorph.xml Outdated
@@ -783,6 +785,21 @@ gap> OutNeighbours(canon);
</List>
See also <Ref Attr="AutomorphismGroup" Label="for a digraph"
/>.<P/>


If <A>col1</A> and <A>col2</A>, or <A>col</A>, are given then they must
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing comma before "then"

doc/isomorph.xml Outdated
If <A>col1</A> and <A>col2</A>, or <A>col</A>, are given then they must
represent vertex colourings; see <Ref Oper="AutomorphismGroup" Label="for a
digraph and a homogeneous list"/> for details of the permissible values for
these argument. The homomorphism must then also have the property:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"argument" should be "arguments"

gap/grahom.gi Outdated
[IsDigraph, IsDigraphByOutNeighboursRep, IsTransformation, IsList, IsList],
function(src, ran, x, c1, c2)
local y, induced, i, j;
if not IsDigraphMonomorphism(src, ran, x, c1, c2) then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there some reason to not make the method for IsDigraphEmbedding analogous to the ones for IsDigraphMonomorphism? Or perhaps write a single function RespectsColouring so that all of these methods become:


function(src, ran, x, c1, c2)
return IsDigraphHomomorphism(src, ran, x) and RespectsColouring(src, ran, x);
end;

where IsDigraphHomomorphism is replaced with IsDigraphMonomorphism or IsDigraphEmbedding as appropriate?

gap/grahom.gi Outdated
# this global function tests whether <x> respects the colouring, i.e. whether
# for all vertices i in <src>, cols[i] = cols[i ^ x].

InstallGlobalFunction(DIGRAPHS_RespectsColouring,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not make this a documented operation?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason, I realised that would be better a few minutes after pushing...

doc/grahom.xml Outdated
The operation <C>DigraphsRespectsColouring</C> verifies whether or not
the permutation or transformation <A>x</A> respects the vertex colourings
<A>col1</A> and <A>col2</A> of the digraphs <A>src</A> and <A>range</A>.
That is, <C>DigraphsRespectsColouring</C> returns true if and only if for
Copy link
Member

@james-d-mitchell james-d-mitchell Jan 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"true" -> "<K>true</K>"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@james-d-mitchell james-d-mitchell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more trivial change, then I'm happy to merge

@james-d-mitchell james-d-mitchell merged commit 61585fc into digraphs:master Jan 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature A label for new features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants