-
Notifications
You must be signed in to change notification settings - Fork 47
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
Implement DigraphIsKing and Digraph2Kings #521
base: main
Are you sure you want to change the base?
Changes from all commits
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 |
---|---|---|
|
@@ -2399,3 +2399,29 @@ gap> Length(M); | |
</Description> | ||
</ManSection> | ||
<#/GAPDoc> | ||
|
||
<#GAPDoc Label="Digraph2Kings"> | ||
<ManSection> | ||
<Oper Name="Digraph2Kings" Arg="D"/> | ||
<Returns>A list.</Returns> | ||
<Description> | ||
If <A>D</A> is a tournament then this operation returns a list of the | ||
2-kings in the tournament. If the tournament contains a source, then the | ||
source is the only 2-king (see <Ref Attr="DigraphSources"/>). The number | ||
of 2-kings in a tournament without a source is at least three. A tournament | ||
cannot have exactly two 2-kings. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could also please provide a cross reference in this manual entry to |
||
|
||
<Example><![CDATA[ | ||
gap> gr := Digraph([[2, 3, 4], [3, 5], [5], [2, 3], [1, 4]]); | ||
<immutable digraph with 5 vertices, 10 edges> | ||
gap> Digraph2Kings(gr); | ||
[ 1, 2, 5 ] | ||
gap> gr := Digraph([[2, 3, 4, 5], [3, 5], [5], [2, 3], [4]]); | ||
<immutable digraph with 5 vertices, 10 edges> | ||
gap> DigraphSources(gr); | ||
[ 1 ] | ||
gap> Digraph2Kings(gr); | ||
[ 1 ]]]></Example> | ||
</Description> | ||
</ManSection> | ||
<#/GAPDoc> |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -8,6 +8,37 @@ | |||||
############################################################################# | ||||||
## | ||||||
|
||||||
<#GAPDoc Label="DigraphIsKing"> | ||||||
<ManSection> | ||||||
<Oper Name="DigraphIsKing" Arg="D, v, k"/> | ||||||
<Returns><K>true</K> or <K>false</K>.</Returns> | ||||||
<Description> | ||||||
If <A>D</A> is a tournament and <A>v</A> is a vertex in the tournament, | ||||||
then this operation returns <K>true</K> if every other vertex of <A>D</A> | ||||||
is reachable from <A>v</A> by a path of length at most <A>k</A>. Else, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The documentation doesn't correspond to the method implemented at present, it gives an error if |
||||||
<K>false</K> is returned. <P/> | ||||||
|
||||||
If <K>true</K> is returned, then the vertex, <A>v</A>, is a k-king. <P/> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
<Example><![CDATA[ | ||||||
gap> gr := Digraph([[2, 3, 4], [3, 5], [5], [2, 3], [1, 4]]); | ||||||
<immutable digraph with 5 vertices, 10 edges> | ||||||
gap> DigraphIsKing(gr, 2, 2); | ||||||
true | ||||||
gap> DigraphIsKing(gr, 3, 2); | ||||||
false | ||||||
gap> OutNeighboursOfVertex(gr, 3); | ||||||
[ 5 ] | ||||||
gap> OutNeighboursOfVertex(gr, 5); | ||||||
[ 1, 4 ] | ||||||
gap> Union(last, last2); | ||||||
[ 1, 4, 5 ] | ||||||
gap> DigraphIsKing(gr, 3, 4); | ||||||
true]]></Example> | ||||||
</Description> | ||||||
</ManSection> | ||||||
<#/GAPDoc> | ||||||
|
||||||
<#GAPDoc Label="IsSubdigraph"> | ||||||
<ManSection> | ||||||
<Oper Name="IsSubdigraph" Arg="super, sub"/> | ||||||
|
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.
The documentation should probably say what happens when
D
isn't a tournament, is an error thrown, orfalse
returned or an empty list?