<html><head><title>[grape] 2 Functions to construct and modify graphs</title></head>
<body text="#000000" bgcolor="#ffffff">
[<a href = "chapters.htm">Up</a>] [<a href ="CHAP001.htm">Previous</a>] [<a href ="CHAP003.htm">Next</a>] [<a href = "theindex.htm">Index</a>]
<h1>2 Functions to construct and modify graphs</h1><p>
<P>
<H3>Sections</H3>
<oL>
<li> <A HREF="CHAP002.htm#SECT001">Graph</a>
<li> <A HREF="CHAP002.htm#SECT002">EdgeOrbitsGraph</a>
<li> <A HREF="CHAP002.htm#SECT003">NullGraph</a>
<li> <A HREF="CHAP002.htm#SECT004">CompleteGraph</a>
<li> <A HREF="CHAP002.htm#SECT005">JohnsonGraph</a>
<li> <A HREF="CHAP002.htm#SECT006">HammingGraph</a>
<li> <A HREF="CHAP002.htm#SECT007">CayleyGraph</a>
<li> <A HREF="CHAP002.htm#SECT008">GeneralizedOrbitalGraphs</a>
<li> <A HREF="CHAP002.htm#SECT009">AddEdgeOrbit</a>
<li> <A HREF="CHAP002.htm#SECT010">RemoveEdgeOrbit</a>
<li> <A HREF="CHAP002.htm#SECT011">AssignVertexNames</a>
</ol><p>
<p>
This chapter describes the functions used to construct and modify graphs.
<p>
<p>
<h2><a name="SECT001">2.1 Graph</a></h2>
<p><p>
<a name = "SSEC001.1"></a>
<li><code>Graph( </code><var>G</var><code>, </code><var>L</var><code>, </code><var>act</var><code>, </code><var>rel</var><code> )</code>
<li><code>Graph( </code><var>G</var><code>, </code><var>L</var><code>, </code><var>act</var><code>, </code><var>rel</var><code>, </code><var>invt</var><code> )</code>
<p>
This is the most general and useful way of constructing a graph
in GRAPE.
<p>
First suppose that the optional boolean parameter <var>invt</var> is unbound or
has value <code>false</code>. Then <var>L</var> should be a list of elements of a set <var>S</var> on
which the group <var>G</var> acts, with the action given by the function <var>act</var>. The
parameter <var>rel</var> should be a boolean function defining a <var>G</var>-invariant
relation on <var>S</var> (so that for <var>g</var> in <var>G</var>, <var>x,y</var> in <var>S</var>, <var><var>rel</var>(x,y)</var>
if and only if <var><var>rel</var>(<var>act</var>(x,g),<var>act</var>(y,g))</var>). Then the function <code>Graph</code>
returns a graph <var>gamma</var> which has as vertex-names (an immutable copy of)
<pre>
Concatenation( Orbits( <G>, <L>, <act> ) )
</pre>
(the concatenation of the distinct orbits of the elements in <var>L</var> under
<var>G</var>), and for vertices <var>v,w</var> of <var>gamma</var>, <var>[v,w]</var> is an edge if and only if
<pre>
<rel>( VertexName( <gamma>, <v> ), VertexName( <gamma>, <w> ) ).
</pre>
(Note that you may choose to have <var>G</var> act trivially on <var>S</var>, in
which case <var>G</var> could be given as the trivial permutation group,
<code>Group( () )</code>, and <var>act</var> could be given as the trivial action,
<code>function(x,g) return x; end</code>.)
<p>
Now if the parameter <var>invt</var> exists and has value <code>true</code>, then it is
assumed that <var>L</var> is invariant under <var>G</var> with respect to action <var>act</var>.
Then the function <code>Graph</code> behaves as above, except that the vertex-names
of <var>gamma</var> become (an immutable copy of) <var>L</var>.
<p>
The group associated with the graph <var>gamma</var> returned is the image of <var>G</var>
acting via <var>act</var> on <code></code><var>gamma</var><code>.names</code>.
<p>
For example, we may use <code>Graph</code> to construct the Petersen graph as follows:
<p>
<pre>
gap> Petersen := Graph( SymmetricGroup(5), [[1,2]], OnSets,
> function(x,y) return Intersection(x,y)=[]; end );
rec(
isGraph := true,
order := 10,
group := Group( [ ( 1, 2, 3, 5, 7)( 4, 6, 8, 9,10), ( 2, 4)( 6, 9)( 7,10)
] ),
schreierVector := [ -1, 1, 1, 2, 1, 1, 1, 1, 2, 2 ],
adjacencies := [ [ 3, 5, 8 ] ],
representatives := [ 1 ],
names := [ [ 1, 2 ], [ 2, 3 ], [ 3, 4 ], [ 1, 3 ], [ 4, 5 ], [ 2, 4 ],
[ 1, 5 ], [ 3, 5 ], [ 1, 4 ], [ 2, 5 ] ] )
</pre>
<p>
The function <code>Graph</code> may be used to construct a graph in GRAPE format
from an adjacency matrix
<a name = "I0"></a>
for that graph. For
example, suppose you have an <var>n</var> by <var>n</var> adjacency matrix <var>A</var> for a graph
<var>gamma</var>, so that the vertex-set of <var>gamma</var> is <var>{1,...,n}</var>, and
<var>[i,j]</var> is an edge of <var>gamma</var> if and only if <var>A[i][j]=1</var>. Then the graph
<var>gamma</var> in GRAPE-graph format, with associated group the trivial group,
is returned by <code>Graph( Group(()), [1..n], OnPoints, function(x,y) return
A[x][y]=1; end, true );</code>
<p>
<pre>
gap> A := [[0,1,0],[1,0,0],[0,0,1]];
[ [ 0, 1, 0 ], [ 1, 0, 0 ], [ 0, 0, 1 ] ]
gap> gamma := Graph( Group(()), [1..3], OnPoints,
> function(x,y) return A[x][y]=1; end,
> true );
rec( adjacencies := [ [ 2 ], [ 1 ], [ 3 ] ], group := Group(()),
isGraph := true, names := [ 1, 2, 3 ], order := 3,
representatives := [ 1, 2, 3 ], schreierVector := [ -1, -2, -3 ] )
</pre>
<p>
<p>
<h2><a name="SECT002">2.2 EdgeOrbitsGraph</a></h2>
<p><p>
<a name = "SSEC002.1"></a>
<li><code>EdgeOrbitsGraph( </code><var>G</var><code>, </code><var>edges</var><code> )</code>
<li><code>EdgeOrbitsGraph( </code><var>G</var><code>, </code><var>edges</var><code>, </code><var>n</var><code> )</code>
<p>
This is a common way of constructing a graph in GRAPE.
<p>
This function returns the (directed) graph with vertex-set <var>{1,...,
<var>n</var>}</var>, edge-set <var>cup<sub>ein<var>edges</var></sub> e<sup><var>G</var></sup></var>, and associated
(permutation) group <var>G</var>, which must act naturally on <var>{1,...,<var>n</var>}</var>.
The parameter <var>edges</var> should be a list of edges (lists of length 2 of
vertices), although a singleton edge will be understood as an edge-list
of length 1. The parameter <var>n</var> may be omitted, in which case <var>n</var> is
taken to be the largest point moved by <var>G</var>.
<p>
Note that <var>G</var> may be the trivial permutation group (<code>Group( () )</code> in
<font face="Gill Sans,Helvetica,Arial">GAP</font> notation), in which case the (directed) edges of <var>gamma</var> are
simply those in the list <var>edges</var>.
<p>
<pre>
gap> EdgeOrbitsGraph( Group((1,3),(1,2)(3,4)), [[1,2],[4,5]], 5 );
rec(
isGraph := true,
order := 5,
group := Group( [ (1,3), (1,2)(3,4) ] ),
schreierVector := [ -1, 2, 1, 2, -2 ],
adjacencies := [ [ 2, 4, 5 ], [ ] ],
representatives := [ 1, 5 ],
isSimple := false )
</pre>
<p>
<p>
<h2><a name="SECT003">2.3 NullGraph</a></h2>
<p><p>
<a name = "SSEC003.1"></a>
<li><code>NullGraph( </code><var>G</var><code> )</code>
<li><code>NullGraph( </code><var>G</var><code>, </code><var>n</var><code> )</code>
<p>
This function returns the null graph (graph with no edges) with vertex-set
<var>{1,...,<var>n</var>}</var>, and associated (permutation) group <var>G</var>. The parameter
<var>n</var> may be omitted, in which case <var>n</var> is taken to be the largest point
moved by <var>G</var>.
<p>
See also <a href="CHAP003.htm#SSEC020.1">IsNullGraph</a>.
<p>
<pre>
gap> NullGraph( Group( (1,2,3) ), 4 );
rec(
isGraph := true,
order := 4,
group := Group( [ (1,2,3) ] ),
schreierVector := [ -1, 1, 1, -2 ],
adjacencies := [ [ ], [ ] ],
representatives := [ 1, 4 ],
isSimple := true )
</pre>
<p>
<p>
<h2><a name="SECT004">2.4 CompleteGraph</a></h2>
<p><p>
<a name = "SSEC004.1"></a>
<li><code>CompleteGraph( </code><var>G</var><code> )</code>
<li><code>CompleteGraph( </code><var>G</var><code>, </code><var>n</var><code> )</code>
<li><code>CompleteGraph( </code><var>G</var><code>, </code><var>n</var><code>, </code><var>mustloops</var><code> )</code>
<p>
This function returns the complete graph with vertex-set
<var>{1,...,<var>n</var>}</var> and associated (permutation) group <var>G</var>. The parameter
<var>n</var> may be omitted, in which case <var>n</var> is taken to be the largest point
moved by <var>G</var>. The optional boolean parameter <var>mustloops</var> determines
whether the complete graph has all loops present or no loops (default:
<code>false</code> (no loops)).
<p>
See also <a href="CHAP003.htm#SSEC021.1">IsCompleteGraph</a>.
<p>
<pre>
gap> CompleteGraph( Group( (1,2,3), (1,2) ) );
rec(
isGraph := true,
order := 3,
group := Group( [ (1,2,3), (1,2) ] ),
schreierVector := [ -1, 1, 1 ],
adjacencies := [ [ 2, 3 ] ],
representatives := [ 1 ],
isSimple := true )
</pre>
<p>
<p>
<h2><a name="SECT005">2.5 JohnsonGraph</a></h2>
<p><p>
<a name = "SSEC005.1"></a>
<li><code>JohnsonGraph( </code><var>n</var><code>, </code><var>e</var><code> )</code>
<p>
Let <var>n</var> and <var>e</var> be integers, with <var><var>n</var>ge<var>e</var>ge0</var>. Then this function
returns a graph <var>gamma</var> isomorphic to the Johnson graph <var>J(<var>n</var>,<var>e</var>)</var>.
The vertices (actually the vertex-names) of <var>gamma</var> are the <var>e</var>-subsets
of <var>{1,..., <var>n</var>}</var>, with <var>x</var> joined to <var>y</var> if and only if <var>|x capy|
= <var>e</var>-1</var>. The group associated with <var>gamma</var> is the image of the symmetric
group <var>S<sub><var>n</var></sub></var> acting on the <var>e</var>-subsets of <var>{1,...,<var>n</var>}</var>.
<p>
<pre>
gap> JohnsonGraph(5,3);
rec(
isGraph := true,
order := 10,
group := Group( [ ( 1, 7,10, 6, 3)( 2, 8, 4, 9, 5), ( 4, 7)( 5, 8)( 6, 9)
] ),
schreierVector := [ -1, 1, 1, 2, 1, 1, 1, 2, 1, 1 ],
adjacencies := [ [ 2, 3, 4, 5, 7, 8 ] ],
representatives := [ 1 ],
names := [ [ 1, 2, 3 ], [ 1, 2, 4 ], [ 1, 2, 5 ], [ 1, 3, 4 ], [ 1, 3, 5 ],
[ 1, 4, 5 ], [ 2, 3, 4 ], [ 2, 3, 5 ], [ 2, 4, 5 ], [ 3, 4, 5 ] ],
isSimple := true )
</pre>
<p>
<p>
<h2><a name="SECT006">2.6 HammingGraph</a></h2>
<p><p>
<a name = "SSEC006.1"></a>
<li><code>HammingGraph( </code><var>d</var><code>, </code><var>q</var><code> )</code>
<p>
Let <var>d</var> and <var>q</var> be positive integers. Then this function returns a
graph <var>gamma</var> isomorphic to the Hamming graph <var>H(<var>d</var>,<var>q</var>)</var>. The vertices
(actually the vertex-names) of <var>gamma</var> are the <var>d</var>-vectors with entries
in <var>{1,...,<var>q</var>}</var>, with <var>x</var> joined to <var>y</var> if and only if <var>x</var> and <var>y</var>
differ in exactly one coordinate (that is, <var>x</var> and <var>y</var> are at Hamming
distance 1). The group associated with <var>gamma</var> is the image of the wreath
product of the symmetric group <var>S<sub><var>q</var></sub></var> with the symmetric group
<var>S<sub><var>d</var></sub></var>, in its product action on the vertices.
<p>
<pre>
gap> H:=HammingGraph(3,4);
rec( adjacencies := [ [ 2, 3, 4, 5, 9, 13, 17, 33, 49 ] ],
group := <permutation group with 8 generators>, isGraph := true,
names := [ [ 1, 1, 1 ], [ 1, 1, 2 ], [ 1, 1, 3 ], [ 1, 1, 4 ],
[ 1, 2, 1 ], [ 1, 2, 2 ], [ 1, 2, 3 ], [ 1, 2, 4 ], [ 1, 3, 1 ],
[ 1, 3, 2 ], [ 1, 3, 3 ], [ 1, 3, 4 ], [ 1, 4, 1 ], [ 1, 4, 2 ],
[ 1, 4, 3 ], [ 1, 4, 4 ], [ 2, 1, 1 ], [ 2, 1, 2 ], [ 2, 1, 3 ],
[ 2, 1, 4 ], [ 2, 2, 1 ], [ 2, 2, 2 ], [ 2, 2, 3 ], [ 2, 2, 4 ],
[ 2, 3, 1 ], [ 2, 3, 2 ], [ 2, 3, 3 ], [ 2, 3, 4 ], [ 2, 4, 1 ],
[ 2, 4, 2 ], [ 2, 4, 3 ], [ 2, 4, 4 ], [ 3, 1, 1 ], [ 3, 1, 2 ],
[ 3, 1, 3 ], [ 3, 1, 4 ], [ 3, 2, 1 ], [ 3, 2, 2 ], [ 3, 2, 3 ],
[ 3, 2, 4 ], [ 3, 3, 1 ], [ 3, 3, 2 ], [ 3, 3, 3 ], [ 3, 3, 4 ],
[ 3, 4, 1 ], [ 3, 4, 2 ], [ 3, 4, 3 ], [ 3, 4, 4 ], [ 4, 1, 1 ],
[ 4, 1, 2 ], [ 4, 1, 3 ], [ 4, 1, 4 ], [ 4, 2, 1 ], [ 4, 2, 2 ],
[ 4, 2, 3 ], [ 4, 2, 4 ], [ 4, 3, 1 ], [ 4, 3, 2 ], [ 4, 3, 3 ],
[ 4, 3, 4 ], [ 4, 4, 1 ], [ 4, 4, 2 ], [ 4, 4, 3 ], [ 4, 4, 4 ] ],
order := 64, representatives := [ 1 ],
schreierVector := [ -1, 5, 5, 5, 3, 5, 5, 5, 3, 5, 5, 5, 3, 5, 5, 5, 1, 5,
5, 5, 3, 5, 5, 5, 3, 5, 5, 5, 3, 5, 5, 5, 1, 5, 5, 5, 3, 5, 5, 5, 3,
5, 5, 5, 3, 5, 5, 5, 1, 5, 5, 5, 3, 5, 5, 5, 3, 5, 5, 5, 3, 5, 5, 5 ] )
gap> GlobalParameters(H);
[ [ 0, 0, 9 ], [ 1, 2, 6 ], [ 2, 4, 3 ], [ 3, 6, 0 ] ]
</pre>
<p>
<p>
<h2><a name="SECT007">2.7 CayleyGraph</a></h2>
<p><p>
<a name = "SSEC007.1"></a>
<li><code>CayleyGraph( </code><var>G</var><code> )</code>
<li><code>CayleyGraph( </code><var>G</var><code>, </code><var>gens</var><code> )</code>
<li><code>CayleyGraph( </code><var>G</var><code>, </code><var>gens</var><code>, </code><var>undirected</var><code> )</code>
<p>
Given a group <var>G</var> and a generating list <var>gens</var> for <var>G</var>, <code>CayleyGraph(
</code><var>G</var><code>, </code><var>gens</var><code> )</code> returns a Cayley graph for <var>G</var> with respect to <var>gens</var>.
The generating list <var>gens</var> is optional, and if omitted, then <var>gens</var> is
taken to be <code>GeneratorsOfGroup( </code><var>G</var><code> )</code>. The boolean argument <var>undirected</var>
is also optional, and if <var>undirected</var>=<code>true</code> (the default), then the
returned graph is undirected (as if <var>gens</var> was closed under inversion,
whether or not it is).
<p>
The Cayley graph <var>caygraph</var> which is returned is defined as follows:
the vertices (actually the vertex-names) of <var>caygraph</var> are the elements
of <var>G</var>; if <var>undirected</var>=<code>true</code> (the default) then vertices <var>x,y</var> are
joined by an edge if and only if there is a <var>g</var> in the list <var>gens</var> with
<var>y=gx</var> or <var>y=g<sup>-1</sup>x</var>; if <var>undirected</var>=<code>false</code> then <var>[x,y]</var> is an edge
if and only if there is a <var>g</var> in <var>gens</var> with <var>y=gx</var>.
<p>
The permutation group <code></code><var>caygraph</var><code>.group</code> associated with <var>caygraph</var> is
the image of <var>G</var> acting in its right regular representation.
<p>
<strong>Note</strong> It is not checked whether <var>G</var> is actually generated by <var>gens</var>.
However, even if <var>G</var> is not generated by <var>gens</var>, the function still
works as described above (as long as <var>gens</var> is contained in <var>G</var>), but
returns a ``Cayley graph'' which is not connected.
<p>
<pre>
gap> C:=CayleyGraph(SymmetricGroup(4),[(1,2),(2,3),(3,4)]);
rec(
isGraph := true,
order := 24,
group :=
Group( [ ( 1,10,17,19)( 2, 9,18,20)( 3,12,14,21)( 4,11,13,22)( 5, 7,16,23)
( 6, 8,15,24), ( 1, 7)( 2, 8)( 3, 9)( 4,10)( 5,11)( 6,12)(13,15)
(14,16)(17,18)(19,21)(20,22)(23,24) ] ),
schreierVector := [ -1, 1, 1, 2, 2, 1, 2, 2, 2, 1, 1, 1, 1, 2, 2, 1, 1, 2,
1, 1, 2, 2, 1, 2 ],
adjacencies := [ [ 2, 3, 7 ] ],
representatives := [ 1 ],
names := [ (), (3,4), (2,3), (2,3,4), (2,4,3), (2,4), (1,2), (1,2)(3,4),
(1,2,3), (1,2,3,4), (1,2,4,3), (1,2,4), (1,3,2), (1,3,4,2), (1,3),
(1,3,4), (1,3)(2,4), (1,3,2,4), (1,4,3,2), (1,4,2), (1,4,3), (1,4),
(1,4,2,3), (1,4)(2,3) ],
isSimple := true )
gap> Girth(C);
4
gap> Diameter(C);
6
</pre>
<p>
<p>
<h2><a name="SECT008">2.8 GeneralizedOrbitalGraphs</a></h2>
<p><p>
<a name = "SSEC008.1"></a>
<li><code>GeneralizedOrbitalGraphs( </code><var>G</var><code> )</code>
<li><code>GeneralizedOrbitalGraphs( </code><var>G</var><code>, </code><var>k</var><code> )</code>
<p>
Suppose <var>G</var> is a non-trivial transitive permutation group
on <var>{1,...,n}</var>, where <var>n</var> is the largest point moved by <var>G</var>.
Then this function returns a list of distinct generalized
orbital graphs for <var>G</var>, where a <strong>generalized orbital graph</strong>
<a name = "I1"></a>
for <var>G</var> is a (simple) graph with vertex set <var>{1,...,n}</var> and
undirected-edge set a union of zero or more <var>G</var>-orbits of 2-subsets
of <var>{1,...,n}</var>.
<p>
The optional second parameter <var>k</var> (default: <code>false</code>) must be <code>false</code>,
<code>true</code>, or a non-negative integer. If <var>k</var>=<code>true</code> then all the generalized
orbital graphs for <var>G</var> are in the returned list, if <var>k</var>=<code>false</code> (the
default) then only the non-null generalized orbital graphs for <var>G</var> are in
this list, and if <var>k</var> is a non-negative integer then the list consists
of all the generalized orbital graphs for <var>G</var> whose undirected-edge set
is the union of exactly <var>k</var> <var>G</var>-orbits of 2-subsets of <var>{1,...,n}</var>.
<p>
The group associated with each graph in the returned list is <var>G</var>.
<p>
<pre>
gap> G:=JohnsonGraph(7,3).group;;
gap> L:=GeneralizedOrbitalGraphs(G);;
gap> List(L,VertexDegrees);
[ [ 12 ], [ 30 ], [ 34 ], [ 16 ], [ 18 ], [ 22 ], [ 4 ] ]
gap> List(L,Diameter);
[ 3, 2, 1, 2, 2, 2, 3 ]
gap> C:=CyclicGroup(IsPermGroup,6);
Group([ (1,2,3,4,5,6) ])
gap> GeneralizedOrbitalGraphs(C,1);
[ rec( adjacencies := [ [ 2, 6 ] ], group := Group([ (1,2,3,4,5,6) ]),
isGraph := true, order := 6, representatives := [ 1 ],
schreierVector := [ -1, 1, 1, 1, 1, 1 ] ),
rec( adjacencies := [ [ 3, 5 ] ], group := Group([ (1,2,3,4,5,6) ]),
isGraph := true, order := 6, representatives := [ 1 ],
schreierVector := [ -1, 1, 1, 1, 1, 1 ] ),
rec( adjacencies := [ [ 4 ] ], group := Group([ (1,2,3,4,5,6) ]),
isGraph := true, isSimple := true, order := 6, representatives := [ 1 ],
schreierVector := [ -1, 1, 1, 1, 1, 1 ] ) ]
</pre>
<p>
<p>
<h2><a name="SECT009">2.9 AddEdgeOrbit</a></h2>
<p><p>
<a name = "SSEC009.1"></a>
<li><code>AddEdgeOrbit( </code><var>gamma</var><code>, </code><var>e</var><code> )</code>
<li><code>AddEdgeOrbit( </code><var>gamma</var><code>, </code><var>e</var><code>, </code><var>H</var><code> )</code>
<p>
This procedure adds the orbit of <var>e</var> under <code></code><var>gamma</var><code>.group</code> to the
edge-set of the graph <var>gamma</var>. The parameter <var>e</var> must be a sequence of
length 2 of vertices of <var>gamma</var>. If the optional third parameter <var>H</var> is
given then it is assumed that <code></code><var>e</var><code>[2]</code> has the same orbit under <var>H</var> as
it does under the stabilizer in <code></code><var>gamma</var><code>.group</code> of <code></code><var>e</var><code>[1]</code>, and this
knowledge can speed up the procedure.
<p>
Note that if <code></code><var>gamma</var><code>.group</code> is trivial then this procedure simply adds the
single (directed) edge <var>e</var> to <var>gamma</var>.
<p>
See also <a href="CHAP002.htm#SSEC010.1">RemoveEdgeOrbit</a>.
<p>
<pre>
gap> gamma := NullGraph( Group( (1,3), (1,2)(3,4) ) );;
gap> AddEdgeOrbit( gamma, [4,3] );
gap> gamma;
rec(
isGraph := true,
order := 4,
group := Group( [ (1,3), (1,2)(3,4) ] ),
schreierVector := [ -1, 2, 1, 2 ],
adjacencies := [ [ 2, 4 ] ],
representatives := [ 1 ],
isSimple := true )
gap> GlobalParameters(gamma);
[ [ 0, 0, 2 ], [ 1, 0, 1 ], [ 2, 0, 0 ] ]
</pre>
<p>
<p>
<h2><a name="SECT010">2.10 RemoveEdgeOrbit</a></h2>
<p><p>
<a name = "SSEC010.1"></a>
<li><code>RemoveEdgeOrbit( </code><var>gamma</var><code>, </code><var>e</var><code> )</code>
<li><code>RemoveEdgeOrbit( </code><var>gamma</var><code>, </code><var>e</var><code>, </code><var>H</var><code> )</code>
<p>
This procedure removes the orbit of <var>e</var> under <code></code><var>gamma</var><code>.group</code> from the
edge-set of the graph <var>gamma</var>. The parameter <var>e</var> must be a sequence of
length 2 of vertices of <var>gamma</var>, but if <var>e</var> is not an edge of <var>gamma</var>
then this procedure has no effect. If the optional third parameter <var>H</var>
is given then it is assumed that <code></code><var>e</var><code>[2]</code> has the same orbit under <var>H</var>
as it does under the stabilizer in <code></code><var>gamma</var><code>.group</code> of <code></code><var>e</var><code>[1]</code>, and
this knowledge can speed up the procedure.
<p>
See also <a href="CHAP002.htm#SSEC009.1">AddEdgeOrbit</a>.
<p>
<pre>
gap> gamma := CompleteGraph( Group( (1,3), (1,2)(3,4) ) );;
gap> RemoveEdgeOrbit( gamma, [1,3] );
gap> gamma;
rec(
isGraph := true,
order := 4,
group := Group( [ (1,3), (1,2)(3,4) ] ),
schreierVector := [ -1, 2, 1, 2 ],
adjacencies := [ [ 2, 4 ] ],
representatives := [ 1 ],
isSimple := true )
gap> GlobalParameters(gamma);
[ [ 0, 0, 2 ], [ 1, 0, 1 ], [ 2, 0, 0 ] ]
</pre>
<p>
<p>
<h2><a name="SECT011">2.11 AssignVertexNames</a></h2>
<p><p>
<a name = "SSEC011.1"></a>
<li><code>AssignVertexNames( </code><var>gamma</var><code>, </code><var>names</var><code> )</code>
<p>
This procedure allows the user to give new names for the vertices of
<var>gamma</var>, by specifying a list <var>names</var> (of length <code></code><var>gamma</var><code>.order</code>) of
vertex-names for the vertices of <var>gamma</var>, such that <code></code><var>names</var><code>[</code><var>i</var><code>]</code>
contains the user's name for the i-th vertex of gamma.
<p>
An immutable copy of <var>names</var> is assigned to <code></code><var>gamma</var><code>.names</code>.
<p>
See also <a href="CHAP003.htm#SSEC005.1">VertexNames</a> and <a href="CHAP003.htm#SSEC004.1">VertexName</a>.
<p>
<pre>
gap> gamma := NullGraph( Group(()), 3 );
rec(
isGraph := true,
order := 3,
group := Group( [ () ] ),
schreierVector := [ -1, -2, -3 ],
adjacencies := [ [ ], [ ], [ ] ],
representatives := [ 1, 2, 3 ],
isSimple := true )
gap> AssignVertexNames( gamma, ["a","b","c"] );
gap> gamma;
rec(
isGraph := true,
order := 3,
group := Group( [ () ] ),
schreierVector := [ -1, -2, -3 ],
adjacencies := [ [ ], [ ], [ ] ],
representatives := [ 1, 2, 3 ],
isSimple := true,
names := [ "a", "b", "c" ] )
</pre>
<p>
[<a href = "chapters.htm">Up</a>] [<a href ="CHAP001.htm">Previous</a>] [<a href ="CHAP003.htm">Next</a>] [<a href = "theindex.htm">Index</a>]
<P>
<address>grape manual<br>September 2025
</address></body></html>
¤ Dauer der Verarbeitung: 0.37 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.