Skip to content

Add EdgesWithRange/Source, PathsWithRange/Source, and Positive/NegativePath for graph inverse semigroups - #1217

Open
joe-dw wants to merge 10 commits into
semigroups:mainfrom
joe-dw:pathsWithSourceRange
Open

Add EdgesWithRange/Source, PathsWithRange/Source, and Positive/NegativePath for graph inverse semigroups#1217
joe-dw wants to merge 10 commits into
semigroups:mainfrom
joe-dw:pathsWithSourceRange

Conversation

@joe-dw

@joe-dw joe-dw commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

This is a smaller version of PR #1204 containing only a few functions and the related documentation and tests.

@joe-dw
joe-dw marked this pull request as ready for review September 3, 2026 16:09
@james-d-mitchell james-d-mitchell changed the title A few GIS related functions Add EdgesWithRange/Source, PathsWithRange/Source, and Positive/NegativePath for graph inverse semigroups Sep 4, 2026

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

Comment thread doc/semigraph.xml Outdated
Comment thread doc/z-chap07.xml
Comment thread gap/semigroups/semigraph.gi
Comment thread gap/semigroups/semigraph.gi Outdated
Comment thread gap/semigroups/semigraph.gi Outdated
Comment thread doc/semigraph.xml
# two graph inverse semigroups are isomorphic if and only if their underlying
# graphs are isomorphic
{G1, G2} -> IsIsomorphicDigraph(GraphOfGraphInverseSemigroup(G1),
GraphOfGraphInverseSemigroup(G2)));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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?

@joe-dw joe-dw Sep 4, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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

Comment thread gap/semigroups/semigraph.gi Outdated
Comment thread gap/semigroups/semigraph.gi Outdated
Comment on lines +442 to +446
counter := 1;
for v in VerticesOfGraphInverseSemigroup(G) do
counter := counter + Length(PathsWithRange(v));
od;
return counter;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
counter := 1;
for v in VerticesOfGraphInverseSemigroup(G) do
counter := counter + Length(PathsWithRange(v));
od;
return counter;
return Sum(VerticesOfGraphInverseSemigroup(G), v -> Length(PathsWithRange(v)));

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Needs one added to the sum for the zero element but otherwise I've changed this as suggested

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

(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);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There should be tests for the errors also, and for the case when the argument is the zero element.

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