Add EdgesWithRange/Source, PathsWithRange/Source, and Positive/NegativePath for graph inverse semigroups - #1217
Add EdgesWithRange/Source, PathsWithRange/Source, and Positive/NegativePath for graph inverse semigroups#1217joe-dw wants to merge 10 commits into
EdgesWithRange/Source, PathsWithRange/Source, and Positive/NegativePath for graph inverse semigroups#1217Conversation
…ed docs and tests
EdgesWithRange/Source, PathsWithRange/Source, and Positive/NegativePath for graph inverse semigroups
james-d-mitchell
left a comment
There was a problem hiding this comment.
Thanks @joe-dw, this is better, but still needs some improvements, and corrections. Please also try to have meaningful names for PRs in future, I edited this PR title to be more accurate, and possibly meaningful for future readers.
| # two graph inverse semigroups are isomorphic if and only if their underlying | ||
| # graphs are isomorphic | ||
| {G1, G2} -> IsIsomorphicDigraph(GraphOfGraphInverseSemigroup(G1), | ||
| GraphOfGraphInverseSemigroup(G2))); |
There was a problem hiding this comment.
For future PRs, it'd be best to subdivide things a bit further, i.e. including the EdgesWithRange/Source, PathsWithRange/Source and Positive/NegativePath in one PR is okay, but IsIsomorphicSemigroup
would fit better in a separate PR. I'm not saying change this PR now it's made, just for the future. Also what about IsomorphismSemigroup? If I want an explicit map from G1 to G2? How do I get that?
There was a problem hiding this comment.
The semigroup isomorphism may be more complicated, but I can look into writing that. The main issue would be converting the isomorphism between digraphs to convert edges but this is almost certainly doable
| counter := 1; | ||
| for v in VerticesOfGraphInverseSemigroup(G) do | ||
| counter := counter + Length(PathsWithRange(v)); | ||
| od; | ||
| return counter; |
There was a problem hiding this comment.
| counter := 1; | |
| for v in VerticesOfGraphInverseSemigroup(G) do | |
| counter := counter + Length(PathsWithRange(v)); | |
| od; | |
| return counter; | |
| return Sum(VerticesOfGraphInverseSemigroup(G), v -> Length(PathsWithRange(v))); |
There was a problem hiding this comment.
Needs one added to the sum for the zero element but otherwise I've changed this as suggested
There was a problem hiding this comment.
Having looked further into this, these methods don't really make sense until PR #1216 is merged, since as long as issue #1211 remains, they would imply
G := GraphInverseSemigroup(Digraph([ [] ]));;
NrIdempotents(G) > Size(G);
true
I'll remove them from this PR for now, and once that's been merged I'll add them to another one, which also means this PR is just the paths/edges functions and addresses your other comment
There was a problem hiding this comment.
(This is the reason the tests failed on this PR)
| [ v_4, v_4, v_2, v_1, v_2, v_1, v_1, v_2, v_1, v_3, v_4, v_2, v_1, v_5, v_4, | ||
| v_2, v_1, v_3, v_4, v_2, v_1, v_5, v_4, v_2, v_1, v_3, v_4, v_2, v_1, v_5, | ||
| v_4, v_2, v_1, v_1, v_2, v_3, v_4, v_5 ] | ||
| gap> List(x, PositivePath); |
There was a problem hiding this comment.
There should be tests for the errors also, and for the case when the argument is the zero element.
… behaviour of Paths/Edges with Source/Range to now return [] when given a non-vertex element
This is a smaller version of PR #1204 containing only a few functions and the related documentation and tests.