Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions doc/attr.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1117,6 +1117,7 @@ gap> DigraphUndirectedGirth(D);
<#GAPDoc Label="ArticulationPoints">
<ManSection>
<Attr Name="ArticulationPoints" Arg="digraph"/>
<Attr Name="CutVertices" Arg="digraph"/>
<Returns>A list of vertices.</Returns>
<Description>
A connected digraph is <E>biconnected</E> if it is still connected (in the
Expand All @@ -1143,6 +1144,9 @@ gap> DigraphUndirectedGirth(D);
with articulation points, but no bridges.
<P/>

<Ref Attr="CutVertices"/> is a synonym for <Ref Attr="ArticulationPoints"/>.
<P/>

See also <Ref Prop="IsBiconnectedDigraph"/> and
<Ref Prop="IsBridgelessDigraph"/>.
<Example><![CDATA[
Expand Down
30 changes: 30 additions & 0 deletions doc/grahom.xml

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There seems to be a TODO:

gap/grahom.gd:45:DeclareAttribute("DigraphSmallestLastOrder", IsDigraph);  # TODO: document

which you could also delete.

Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,36 @@ gap> DigraphWelshPowellOrder(Digraph([[4], [9], [9], [],
</ManSection>
<#/GAPDoc>

<#GAPDoc Label="DigraphSmallestLastOrder">
<ManSection>
<Attr Name="DigraphSmallestLastOrder" Arg="digraph"/>
<Returns> A list of vertices.</Returns>
<Description>
<C>DigraphSmallestLastOrder</C> returns a list <C>order</C> containing each
of the vertices of <A>digraph</A> in smallest-last order, defined as
follows: <P/>

Let <M>D_n</M> be <A>digraph</A>. For <M>i = n, n-1, \ldots, 1</M>, the
vertex <C>order[i]</C> is a vertex of minimum degree in <M>D_i</M>, and
<M>D_{i-1}</M> is the subdigraph of <M>D_i</M> induced by removing
<C>order[i]</C>. The degree of a vertex here is the sum of the number of
out- and in-neighbours. <P/>

The result is not unique in general, since there may be several vertices
of minimum degree at any step; <C>DigraphSmallestLastOrder</C> tiebreaks
by taking the smallest such vertex.
<Example><![CDATA[
gap> D1 := Digraph([[2], [1, 3], [2]]);;
gap> DigraphSmallestLastOrder(D1);
[ 3, 2, 1 ]
gap> D2 := CompleteDigraph(3);;
gap> DigraphSmallestLastOrder(D2);
[ 3, 2, 1 ]
]]></Example>
</Description>
</ManSection>
<#/GAPDoc>

<#GAPDoc Label="DigraphEmbedding">
<ManSection>
<Oper Name="DigraphEmbedding" Arg="digraph1, digraph2"/>
Expand Down
36 changes: 30 additions & 6 deletions doc/oper.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1957,6 +1957,7 @@ rec( idom := [ 2, fail, 2, 2, 2 ], preorder := [ 2, 1, 3, 4, 5 ] )
<#GAPDoc Label="IsDigraphOutDominatingSet">
<ManSection>
<Oper Name="IsDigraphOutDominatingSet" Arg="digraph, list"/>
<Oper Name="IsDigraphDominatingSet" Arg="digraph, list"/>
<Oper Name="IsDigraphInDominatingSet" Arg="digraph, list"/>
<Returns><K>true</K> or <K>false</K>.</Returns>
<Description>
Expand All @@ -1973,7 +1974,10 @@ rec( idom := [ 2, fail, 2, 2, 2 ], preorder := [ 2, 1, 3, 4, 5 ] )
either in <M>S</M> or an out-neighbour of a vertex in <M>S</M>.
An <E>in-dominating set</E> of <A>digraph</A> is a subset <M>S</M> of
vertices of <A>digraph</A> such that every vertex of <A>digraph</A> is
either in <M>S</M> or an in-neighbour of a vertex in <M>S</M>.
either in <M>S</M> or an in-neighbour of a vertex in <M>S</M>. <P/>

<Ref Oper="IsDigraphDominatingSet"/> is a synonym for
<Ref Oper="IsDigraphOutDominatingSet"/>.

<Example><![CDATA[
gap> D := Digraph([[2, 4], [3], [1, 5], [3], [4]]);;
Expand Down Expand Up @@ -2290,6 +2294,7 @@ gap> DigraphDijkstra(D, 1, 2);
<#GAPDoc Label="ModularProduct">
<ManSection>
<Oper Name="ModularProduct" Arg="D1, D2"/>
<Oper Name="DigraphModularProduct" Arg="D1, D2"/>
<Returns>A digraph.</Returns>
<Description>
If <A>D1</A> and <A>D2</A> are digraphs without multiple edges, then
Expand All @@ -2313,7 +2318,10 @@ gap> DigraphDijkstra(D, 1, 2);
</List>

Notably, the complete (with loops) subdigraphs of <C>MPD</C> are
precisely the partial isomorphisms from <A>D1</A> to <A>D2</A>.
precisely the partial isomorphisms from <A>D1</A> to <A>D2</A>. <P/>

<Ref Oper="DigraphModularProduct"/> is a synonym for
<Ref Oper="ModularProduct"/>.

<Example><![CDATA[
gap> ModularProduct(Digraph([[1], [1, 2]]), Digraph([[], [2]]));
Expand All @@ -2333,6 +2341,7 @@ gap> ModularProduct(NullDigraph(0), CompleteDigraph(10));
<#GAPDoc Label="StrongProduct">
<ManSection>
<Oper Name="StrongProduct" Arg="D1, D2"/>
<Oper Name="DigraphStrongProduct" Arg="D1, D2"/>
<Returns>A digraph.</Returns>
<Description>
If <A>D1</A> and <A>D2</A> are digraphs without multiple edges,
Expand Down Expand Up @@ -2360,7 +2369,10 @@ gap> ModularProduct(NullDigraph(0), CompleteDigraph(10));
</List>

The SPD of two paths of lengths <C>m</C> and <C>n</C> is also the king's graph
for an <C>m</C> by <C>n</C> board.
for an <C>m</C> by <C>n</C> board. <P/>

<Ref Oper="DigraphStrongProduct"/> is a synonym for
<Ref Oper="StrongProduct"/>.

<Example><![CDATA[
gap> D1 := Digraph([[2], [1, 3, 4], [2, 5], [2, 5], [3, 4]]);
Expand All @@ -2380,6 +2392,7 @@ gap> StrongProduct(DigraphSymmetricClosure(ChainDigraph(3)),
<#GAPDoc Label="ConormalProduct">
<ManSection>
<Oper Name="ConormalProduct" Arg="D1, D2"/>
<Oper Name="DigraphConormalProduct" Arg="D1, D2"/>
<Returns>A digraph.</Returns>
<Description>
If <A>D1</A> and <A>D2</A> are digraphs without multiple edges,
Expand All @@ -2398,7 +2411,10 @@ gap> StrongProduct(DigraphSymmetricClosure(ChainDigraph(3)),
<Item>
There is an edge from <C>b</C> to <C>d</C> in <A>D2</A>.
</Item>
</List>
</List> <P/>

<Ref Oper="DigraphConormalProduct"/> is a synonym for
<Ref Oper="ConormalProduct"/>.

<Example><![CDATA[
gap> ConormalProduct(DigraphSymmetricClosure(CycleDigraph(7)),
Expand All @@ -2414,6 +2430,7 @@ gap> ConormalProduct(NullDigraph(0), CompleteDigraph(10));
<#GAPDoc Label="HomomorphicProduct">
<ManSection>
<Oper Name="HomomorphicProduct" Arg="D1, D2"/>
<Oper Name="DigraphHomomorphicProduct" Arg="D1, D2"/>
<Returns>A digraph.</Returns>
<Description>
If <A>D1</A> and <A>D2</A> are digraphs without multiple edges,
Expand All @@ -2433,7 +2450,10 @@ gap> ConormalProduct(NullDigraph(0), CompleteDigraph(10));
There is an edge from <C>a</C> to <C>c</C> in <A>D1</A> and no edge from
<C>b</C> to <C>d</C> in <A>D2</A>.
</Item>
</List>
</List> <P/>

<Ref Oper="DigraphHomomorphicProduct"/> is a synonym for
<Ref Oper="HomomorphicProduct"/>.

<Example><![CDATA[
gap> HomomorphicProduct(PetersenGraph(),
Expand Down Expand Up @@ -2476,6 +2496,7 @@ gap> OutNeighbours(D1);
<#GAPDoc Label="LexicographicProduct">
<ManSection>
<Oper Name="LexicographicProduct" Arg="D1, D2"/>
<Oper Name="DigraphLexicographicProduct" Arg="D1, D2"/>
<Returns>A digraph.</Returns>
<Description>
If <A>D1</A> and <A>D2</A> are digraphs without multiple edges,
Expand All @@ -2495,7 +2516,10 @@ gap> OutNeighbours(D1);
The vertices <C>a</C> and <C>c</C> of <A>D1</A> are equal and there is
an edge from <C>b</C> to <C>d</C> in <A>D2</A>.
</Item>
</List>
</List> <P/>

<Ref Oper="DigraphLexicographicProduct"/> is a synonym for
<Ref Oper="LexicographicProduct"/>.

<Example><![CDATA[
gap> LexicographicProduct(DigraphSymmetricClosure(CycleDigraph(3)),
Expand Down
5 changes: 4 additions & 1 deletion doc/prop.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1665,11 +1665,14 @@ false]]></Example>
<#GAPDoc Label="Is2EdgeTransitive">
<ManSection>
<Prop Name="Is2EdgeTransitive" Arg="digraph"/>
<Prop Name="IsTwoEdgeTransitive" Arg="digraph"/>
<Returns><K>true</K> or <K>false</K>.</Returns>
<Description>
If <A>digraph</A> is a digraph without multiple edges, then <C>Is2EdgeTransitive</C>
returns <K>true</K> if <A>digraph</A> is 2-edge transitive, and <K>false</K>
otherwise. If <A>digraph</A> has multiple edges, then <C>Is2EdgeTransitive</C> returns an error.
otherwise. If <A>digraph</A> has multiple edges, then <C>Is2EdgeTransitive</C> returns an error. <P/>

<Ref Prop="IsTwoEdgeTransitive"/> is a synonym for <Ref Prop="Is2EdgeTransitive"/>. <P/>

A digraph is <E>2-edge transitive</E> if its automorphism group
acts transitively on 2-edges via the action
Expand Down
49 changes: 49 additions & 0 deletions doc/weights.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,36 @@ gap> EdgeWeights(g);
</ManSection>
<#/GAPDoc>

<#GAPDoc Label="UnitEdgeWeightedDigraph">
<ManSection>
<Func Name="UnitEdgeWeightedDigraph" Arg="digraph"/>
<Returns>A digraph</Returns>
<Description>
<!-- TODO update/remove mutability when issue #860 is resolved -->
If <A>digraph</A> is immutable, <C>UnitEdgeWeightedDigraph</C> returns
an immutable edge-weighted copy of <A>digraph</A>, with all edge weights
set to 1. If <A>digraph</A> is mutable, the returned digraph will be
mutable, but will not have edge weights. <P/>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There should be a statement about what happens when digraph is mutable/immutable here.

See <Ref Attr="EdgeWeights"/>.
<!-- TODO update/remove D2 example when issue #860 is resolved -->
<Example><![CDATA[
gap> D := Digraph([[2], [1, 3], [1]]);
<immutable digraph with 3 vertices, 4 edges>
gap> D1 := UnitEdgeWeightedDigraph(D);
<immutable edge-weighted digraph with 3 vertices, 4 edges>
gap> EdgeWeights(D1);
[ [ 1 ], [ 1, 1 ], [ 1 ] ]
gap> D2 := Digraph(IsMutableDigraph, [[2], [1, 3], [1]]);;
gap> UnitEdgeWeightedDigraph(D2);
<mutable digraph with 3 vertices, 4 edges>
gap> HasEdgeWeights(D2);
false
]]></Example>
</Description>
</ManSection>
<#/GAPDoc>

<#GAPDoc Label="EdgeWeightedDigraphTotalWeight">
<ManSection>
<Attr Name="EdgeWeightedDigraphTotalWeight" Arg="digraph"/>
Expand All @@ -91,6 +121,25 @@ gap> EdgeWeightedDigraphTotalWeight(D);
</ManSection>
<#/GAPDoc>

<#GAPDoc Label="IsNegativeEdgeWeightedDigraph">
<ManSection>
<Prop Name="IsNegativeEdgeWeightedDigraph" Arg="digraph"/>
<Returns>A boolean.</Returns>
<Description>
If <A>digraph</A> has edge weights, then this returns <K>true</K> if
at least one edge has negative weight, and <K>false</K> otherwise. If
<A>digraph</A> has no edge weights, then an error is raised.
<Example><![CDATA[

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ideally the doc would also say what happens when digraph doesn't have edge weights.

gap> D := EdgeWeightedDigraph([[2], [1]], [[5], [10]]);;
gap> IsNegativeEdgeWeightedDigraph(D);
false
gap> D := EdgeWeightedDigraph([[2], [1]], [[-5], [10]]);;
gap> IsNegativeEdgeWeightedDigraph(D);
true]]></Example>
</Description>
</ManSection>
<#/GAPDoc>

<#GAPDoc Label="EdgeWeightedDigraphMinimumSpanningTree">
<ManSection>
<Attr Name="EdgeWeightedDigraphMinimumSpanningTree" Arg="digraph"/>
Expand Down
2 changes: 2 additions & 0 deletions doc/z-chap5.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
<Section><Heading>Edge Weights</Heading>
<#Include Label="EdgeWeights">
<#Include Label="EdgeWeightedDigraph">
<#Include Label="UnitEdgeWeightedDigraph">
<#Include Label="EdgeWeightedDigraphTotalWeight">
<#Include Label="IsNegativeEdgeWeightedDigraph">
<#Include Label="EdgeWeightedDigraphMinimumSpanningTree">
<#Include Label="EdgeWeightedDigraphShortestPaths">
<#Include Label="EdgeWeightedDigraphShortestPath">
Expand Down
1 change: 1 addition & 0 deletions doc/z-chap6.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ from} $E_a$ \emph{to} $E_b$. In this case we say that $E_a$ and $E_b$ are
<#Include Label="DigraphColouring">
<#Include Label="DigraphGreedyColouring">
<#Include Label="DigraphWelshPowellOrder">
<#Include Label="DigraphSmallestLastOrder">
<#Include Label="ChromaticNumber">
<#Include Label="DigraphCore">
<#Include Label="LatticeDigraphEmbedding">
Expand Down
2 changes: 1 addition & 1 deletion gap/grahom.gd
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ DeclareOperation("DigraphGreedyColouring", [IsDigraph, IsHomogeneousList]);
DeclareOperation("DigraphGreedyColouringNC", [IsDigraph, IsHomogeneousList]);

DeclareAttribute("DigraphWelshPowellOrder", IsDigraph);
DeclareAttribute("DigraphSmallestLastOrder", IsDigraph); # TODO: document
DeclareAttribute("DigraphSmallestLastOrder", IsDigraph);

DeclareOperation("IsDigraphEndomorphism", [IsDigraph, IsTransformation]);
DeclareOperation("IsDigraphHomomorphism",
Expand Down
2 changes: 1 addition & 1 deletion gap/weights.gd
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ DeclareGlobalFunction("EdgeWeightedDigraph");
DeclareProperty("IsNegativeEdgeWeightedDigraph", IsDigraph and HasEdgeWeights);
DeclareAttribute("EdgeWeightedDigraphTotalWeight",
IsDigraph and HasEdgeWeights);
DeclareAttribute("UnitEdgeWeightedDigraph", IsDigraph);
DeclareOperation("UnitEdgeWeightedDigraph", [IsDigraph]);

# 2. Edge Weight Copies
DeclareOperation("EdgeWeightsMutableCopy", [IsDigraph and HasEdgeWeights]);
Expand Down
Loading