Skip to content

Commit

Permalink
Added documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
finnbuck committed Mar 30, 2022
1 parent 1f46844 commit 3f90318
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 0 deletions.
77 changes: 77 additions & 0 deletions doc/oper.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2227,3 +2227,80 @@ true
</Description>
</ManSection>
<#/GAPDoc>

<#GAPDoc Label="AmalgamDigraphs">
<ManSection>
<Oper Name="AmalgamDigraphs" Arg="D1, D2,
subdigraphVertices1, subdigraphVertices2"/>
<Returns>An immutable digraph and a record.</Returns>
<Description>

<C>AmalgamDigraphs</C> takes as input two digraphs <A>D1</A> and <A>D2</A>
and two lists of vertices <A>subdigraphVertices1</A> and
<A>subdigraphVertices2</A>, which correspond to two identical subdigraphs
of <A>D1</A> and <A>D2</A>. It returns a new digraph, the <E>amalgam
digraph</E> <C>AD</C>, which consists of <A>D1</A> and <A>D2</A> joined
together by their common subdigraph in such a way that the edge connectivity
between the vertices of <C>AD</C> matches the edge connectivity of
<A>D1</A> and <A>D2</A>.<P/>

It returns a <E>tuple</E> of size two, with the first element being
<C>AD</C> and the second element being <C>map</C>, which is a record which
maps each vertex's number in <A>D2</A> to the corresponding vertex's number
in <C>AD</C>. The mapping of the vertices of <A>D1</A> can be seen as the
<E>identity mapping</E>.

<Example><![CDATA[
gap> T := Digraph([[2, 3], [1, 3], [1, 2]]);;
gap> A := AmalgamDigraphs(T, T, [1, 2], [1, 2]);
[ <immutable digraph with 4 vertices, 10 edges>,
rec( 1 := 1, 2 := 2, 3 := 4 ) ]
gap> A := AmalgamDigraphs(A[1], T, [1, 2], [1, 2]);
[ <immutable digraph with 5 vertices, 14 edges>,
rec( 1 := 1, 2 := 2, 3 := 5 ) ]
gap> P := PetersenGraph();;
gap> G := Digraph([[2, 3, 4], [1, 3], [1, 2, 5], [1, 6], [3, 6], [4, 5]]);;
gap> A := AmalgamDigraphs(P, G, [1, 2, 7, 10, 5], [1, 3, 5, 6, 4]);
[ <immutable digraph with 11 vertices, 34 edges>,
rec( 1 := 1, 2 := 11, 3 := 2, 4 := 5, 5 := 7, 6 := 10 ) ]
]]></Example>
</Description>
</ManSection>
<#/GAPDoc>

<#GAPDoc Label="AmalgamDigraphsIsomorphic">
<ManSection>
<Oper Name="AmalgamDigraphsIsomorphic" Arg="D1, D2,
subdigraphVertices1, subdigraphVertices2"/>
<Returns>An immutable digraph and a record.</Returns>
<Description>

<C>AmalgamDigraphsIsomorphic</C> is meant to function very similarly to
<C>AmalgamDigraphs</C>. The difference is that in <C>AmalgamDigraphs</C>
<A>subdigraphVertices1</A> and <A>subdigraphVertices2</A> need not
necessarily describe identical subdigraphs of <A>D1</A> and <A>D2</A>,
but need only describe subdigraphs that are isomorphic to one another.
<C>AmalgamDigraphsIsomorphic</C> rearranges the entries of
<A>subdigraphVertices2</A> to obtain <C>newSubdigraphVertices2</C>
in such a way that the induced subdigraph in <A>D2</A> with the
vertices <C>newSubdigraphVertices2</C> is identical to the induced
subdigraph in <A>D1</A> with the vertices <C>subdigraphVertices1</C>.
<C>AmalgamDigraphsIsomorphic</C> then calls <C>AmalgamDigraphs</C>
with <C>newSubdigraphVertices2</C> in the place of
<A>subdigraphVertices2</A>.

<Example><![CDATA[
gap> P := PetersenGraph();;
gap> G := Digraph([[2, 3, 4], [1, 3], [1, 2, 5], [1, 6], [3, 6], [4, 5]]);;
gap> A := AmalgamDigraphs(P, G, [1, 2, 7, 10, 5], [1, 3, 5, 6, 4]);
[ <immutable digraph with 11 vertices, 34 edges>,
rec( 1 := 1, 2 := 11, 3 := 2, 4 := 5, 5 := 7, 6 := 10 ) ]
gap> A := AmalgamDigraphsIsomorphic(P, G, [1, 2, 7, 10, 5], [1, 4, 6, 3, 5]);
[ <immutable digraph with 11 vertices, 34 edges>,
rec( 1 := 1, 2 := 11, 3 := 5, 4 := 2, 5 := 10, 6 := 7 ) ]
gap> A := AmalgamDigraphs(P, G, [1, 2, 7, 10, 5], [1, 4, 6, 3, 5]);
Error, the two subdigraphs must be equal.
]]></Example>
</Description>
</ManSection>
<#/GAPDoc>
2 changes: 2 additions & 0 deletions doc/z-chap2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@
<#Include Label="DistanceDigraph">
<#Include Label="DigraphClosure">
<#Include Label="DigraphMycielskian">
<#Include Label="AmalgamDigraphs">
<#Include Label="AmalgamDigraphsIsomorphic">
</Section>

<Section><Heading>Random digraphs</Heading>
Expand Down

0 comments on commit 3f90318

Please sign in to comment.