-
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
Allow specifying vertex colours in IsDigraphHomomorphism etc. #283
Allow specifying vertex colours in IsDigraphHomomorphism etc. #283
Conversation
2eee70d
to
2389c57
Compare
2389c57
to
6b94e2e
Compare
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 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 |
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.
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: |
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.
"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 |
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.
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, |
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.
Why not make this a documented operation?
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.
No reason, I realised that would be better a few minutes after pushing...
722037c
to
3b52ce2
Compare
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 |
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.
"true" -> "<K>true</K>"
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.
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.
One more trivial change, then I'm happy to merge
This PR adds the ability to specify vertex colours in the operations