-
Notifications
You must be signed in to change notification settings - Fork 66
Implement IsJoinIrreducible and IsMeetIrreducible #910
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
base: main
Are you sure you want to change the base?
Changes from 7 commits
46836b9
3bb2bb8
7b7d883
6c07453
8cf99ca
2c37a4b
8ae6cba
d2fd4fe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2720,6 +2720,38 @@ function(D, i, j) | |
| return fail; | ||
| end); | ||
|
|
||
| InstallMethod(IsJoinIrreducible, | ||
| "for a digraph and a positive integer", | ||
| [IsDigraph, IsPosInt], | ||
| function(D, v) | ||
| local hasse; | ||
| if not IsPartialOrderDigraph(D) then | ||
| ErrorNoReturn("the 1st argument <D> must satisfy IsPartialOrderDigraph,"); | ||
| elif not v in DigraphVertices(D) then | ||
| ErrorNoReturn("the 2nd argument <v> must be a vertex of the ", | ||
| "1st argument <D>,"); | ||
| fi; | ||
| hasse := DigraphReflexiveTransitiveReduction(DigraphMutableCopyIfMutable(D)); | ||
| # join-irreducible iff at most one lower cover in the Hasse diagram | ||
| return InDegreeOfVertexNC(hasse, v) <= 1; | ||
|
ThatOtherAndrew marked this conversation as resolved.
Outdated
|
||
| end); | ||
|
|
||
| InstallMethod(IsMeetIrreducible, | ||
| "for a digraph and a positive integer", | ||
| [IsDigraph, IsPosInt], | ||
| function(D, v) | ||
| local hasse; | ||
| if not IsPartialOrderDigraph(D) then | ||
| ErrorNoReturn("the 1st argument <D> must satisfy IsPartialOrderDigraph,"); | ||
| elif not v in DigraphVertices(D) then | ||
| ErrorNoReturn("the 2nd argument <v> must be a vertex of the ", | ||
| "1st argument <D>,"); | ||
| fi; | ||
| hasse := DigraphReflexiveTransitiveReduction(DigraphMutableCopyIfMutable(D)); | ||
| # meet-irreducible iff at most one upper cover in the Hasse diagram | ||
| return OutDegreeOfVertexNC(hasse, v) <= 1; | ||
|
ThatOtherAndrew marked this conversation as resolved.
Comment on lines
+2744
to
+2752
|
||
| end); | ||
|
|
||
| InstallMethod(DigraphKings, "for a digraph and a positive integer", | ||
| [IsDigraph, IsPosInt], | ||
| function(D, n) | ||
|
|
||
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.
The only explicit precondition checked is
IsPartialOrderDigraph(D), butIsPartialOrderDigraphdoes not exclude multidigraphs. IfDhas multiple edges,DigraphReflexiveTransitiveReductionwill throw a different error (“must be a digraph with no multiple edges”) from inside this method. Consider either rejecting multidigraphs up front with a clear error, or normalizing the copied digraph by removing multiple edges before computing the reduction.