Goto Chapter: Top 1 2 3 4 5 6 7 8 9 A Bib Ind
 [Top of Book]  [Contents]   [Previous Chapter]   [Next Chapter] 

A Grape to Digraphs Command Map
 A.1 Functions to construct and modify graphs
 A.2 Functions to inspect graphs, vertices and edges
 A.3 Functions to determine regularity properties of graphs
 A.4 Some special vertex subsets of a graph
 A.5 Functions to construct new graphs from old
 A.6 Vertex-Colouring and Complete Subgraphs
 A.7 Automorphism groups and isomorphism testing for graphs

A Grape to Digraphs Command Map

Below is a table of Grape commands with the Digraphs counterparts. The sections in this chapter correspond to the chapters in the Grape manual.

A.1 Functions to construct and modify graphs

Grape command Digraphs command Comments
Graph Digraph (3.1-7) Used with the arguments of Graph in Grape, Digraph (3.1-7) will return an equivalent digraph.
EdgeOrbitsGraph EdgeOrbitsDigraph (3.1-10) The operation EdgeOrbitsDigraph (3.1-10) behaves the same as EdgeOrbitsDigraph in Grape.
NullGraph NullDigraph (3.5-16) or EmptyDigraph (3.5-16) Note that, unlike in Grape, the arguments of NullDigraph (3.5-16) and EmptyDigraph (3.5-16) are just non-negative integers. Since digraphs in Digraphs are immutable, there is no reason (although it is possible) to create a null digraph and then add edges, as you might be used to doing in Grape.
CompleteGraph CompleteDigraph (3.5-11) Note that, unlike in Grape, the argument to CompleteDigraph (3.5-11) is simply a non-negative integer indicating the number of vertices. By default a complete digraph in Digraphs does not have any loops. If you want a complete digraph with loops at every vertex, then use DigraphAddAllLoops (3.3-44).
JohnsonGraph JohnsonDigraph (3.5-23) The Grape function JohnsonGraph is equivalent to JohnsonDigraph (3.5-23).
CayleyGraph CayleyDigraph (3.1-12) The operation CayleyDigraph (3.1-12) behaves the same as CayleyGraph in Grape.
AddEdgeOrbit DigraphAddEdgeOrbit (3.3-18) Note that, unlike in Grape, digraphs in Digraphs are immutable, and this operation returns a new digraph, i.e. it does not modify the digraph given as an argument.
RemoveEdgeOrbit DigraphRemoveEdgeOrbit (3.3-23) Note that, unlike in Grape, digraphs in Digraphs are immutable, and this operation returns a new digraph, i.e. it does not modify the digraph given as an argument.
AssignVertexNames SetDigraphVertexLabels (5.1-10) and SetDigraphVertexLabel (5.1-9) Use SetDigraphVertexLabel (5.1-9) to set an individual vertex label and SetDigraphVertexLabels (5.1-10) to set all of the vertex labels.

A.2 Functions to inspect graphs, vertices and edges

Grape command Digraphs command Comments
IsGraph IsDigraph (3.1-1) IsDigraph (3.1-1) is a category and not a function like IsGraph.
OrderGraph DigraphNrVertices (5.1-2) The operation DigraphNrVertices (5.1-2) behaves the same as OrderGraph in Grape.
IsVertex(graph, v) v in DigraphVertices(digraph) The attribute DigraphVertices (5.1-1) can be used to return the list of vertices of a digraph, or if v is known to be a positive integer, then you can simply do v <= DigraphNrVertices(digraph)
VertexName DigraphVertexLabel (5.1-9) Unlike VertexName in Grape, the return value of DigraphVertexLabel (5.1-9) is mutable.
VertexNames DigraphVertexLabels (5.1-10) Unlike VertexNames in Grape, the return value of DigraphVertexLabels (5.1-10) is mutable.
Vertices DigraphVertices (5.1-1) The vertices of a digraph in Digraphs is always the range [1 .. n] where n is the number of vertices of the digraph. The operation DigraphVertices (5.1-1) behaves the same as Vertices in Grape.
VertexDegree OutDegreeOfVertex (5.2-10) (see also: InDegreeOfVertex (5.2-12)) The operation OutDegreeOfVertex (5.2-10) behaves the same as VertexDegree in Grape.
VertexDegrees OutDegreeSet (5.2-8) (see also: OutDegreeSequence (5.2-8), OutDegrees (5.2-8), InDegrees (5.2-9), InDegreeSequence (5.2-9), InDegreeSet (5.2-9)) The operation OutDegreeSet (5.2-8) behaves the same as VertexDegrees in Grape.
IsLoopy DigraphHasLoops (6.2-1) The operation DigraphHasLoops (6.2-1) behaves the same as IsLoopy in Grape.
IsSimpleGraph IsSymmetricDigraph (6.2-14) and not DigraphHasLoops (6.2-1) The Grape function IsSimpleGraph is equivalent to IsSymmetricDigraph (6.2-14) and not DigraphHasLoops (6.2-1).
Adjacency OutNeighboursOfVertex (5.2-11) (see also InNeighboursOfVertex (5.2-13)) The operation OutNeighboursOfVertex (5.2-11) behaves the same as Adjacency in Grape.
IsEdge IsDigraphEdge (5.1-15) The arguments of IsDigraphEdge (5.1-15) can be a digraph and an edge, or a digraph and two vertices. In the first form the operation IsDigraphEdge (5.1-15) behaves the same as IsEdge in Grape.
DirectedEdges DigraphEdges (5.1-3) The attribute DigraphEdges (5.1-3) behaves the same as DirectedEdges in Grape.
UndirectedEdges None There is no analogous function in Digraphs, and no plans to include one.
Distance DigraphShortestDistance (5.4-2) The operation DigraphShortestDistance (5.4-2) behaves the same as Distance in Grape.
Diameter DigraphDiameter (5.4-1) The attribute DigraphDiameter (5.4-1) behaves the same as Diameter in Grape.
Girth DigraphUndirectedGirth (5.4-8) The attribute DigraphUndirectedGirth (5.4-8) behaves the same as Girth in Grape except that in the case that the argument is a forest, infinity is returned by Digraphs whereas -1 is returned by Grape.
IsConnectedGraph IsStronglyConnectedDigraph (6.6-6) The attribute IsStronglyConnectedDigraph (6.6-6) behaves the same as IsConnectedGraph in Grape.
IsBipartite IsBipartiteDigraph (6.2-3) and IsSymmetricDigraph (6.2-14) The Grape function IsBipartite is equivalent to IsBipartiteDigraph (6.2-3) and IsSymmetricDigraph (6.2-14).
IsNullGraph IsNullDigraph (6.2-7) or IsEmptyDigraph (6.2-7) The Grape function IsNullGraph is equivalent to IsEmptyDigraph (6.2-7) and its synonym IsNullDigraph (6.2-7).
IsCompleteGraph IsCompleteDigraph (6.2-5) The Grape function IsCompleteGraph is roughly equivalent to IsCompleteDigraph (6.2-5) except that in Digraphs a complete digraph has no loops.

A.3 Functions to determine regularity properties of graphs

Grape command Digraphs command Comments
IsRegularGraph IsOutRegularDigraph (6.5-2) (see also IsInRegularDigraph (6.5-1) and IsRegularDigraph (6.5-3)) The Grape function IsRegularGraph is equivalent to IsOutRegularDigraph (6.5-2).
LocalParameters None The Grape function LocalParameters has no equivalent function in Digraphs, although this might change in the future.
GlobalParameters None The Grape function GlobalParameters has no equivalent function in Digraphs, although this might change in the future.
IsDistanceRegular IsDistanceRegularDigraph (6.5-4) The Grape function IsDistanceRegular is equivalent to IsDistanceRegularDigraph (6.5-4).
CollapsedAdjacencyMat None The Grape function CollapsedAdjacencyMat has no equivalent function in Digraphs, although this might change in the future.
OrbitalGraphColadjMats None The Grape function OrbitalGraphColadjMats has no equivalent function in Digraphs, although this might change in the future.
VertexTransitiveDRGs None The Grape function VertexTransitiveDRGs has no equivalent function in Digraphs, although this might change in the future.

A.4 Some special vertex subsets of a graph

Grape command Digraphs command Comments
ConnectedComponent DigraphConnectedComponent (5.4-10) When applied to a simple di/graph and a vertex, ConnectedComponent in Grape is equivalent to DigraphConnectedComponent (5.4-10). DigraphConnectedComponent (5.4-10) can also be applied to non-simple graphs (in the language of Grape).
ConnectedComponents DigraphConnectedComponents (5.4-9) When applied to a simple di/graph, ConnectedComponents in Grape is equivalent to DigraphConnectedComponents (5.4-9). DigraphConnectedComponents (5.4-9) can also be applied to non-simple graphs (in the language of Grape).
Bicomponents DigraphBicomponents (5.4-13) When applied to a simple bipartite di/graph, Bicomponents in Grape is equivalent to DigraphBicomponents (5.4-13). The definition of IsBipartiteDigraph (6.2-3) does not require its argument to be simple (in the language of Grape), i.e. the bipartite graphs in Grape are a proper subset of the bipartite digraphs in Digraphs.
DistanceSet DigraphDistanceSet (5.4-5) DistanceSet in Grape is equivalent to DigraphDistanceSet (5.4-5) in Digraphs.
Layers DigraphLayers (5.4-32) Layers in Grape is equivalent to DigraphLayers (5.4-32) in Digraphs.
IndependentSet DigraphIndependentSet (8.2-2) IndependentSet in Grape is equivalent to DigraphIndependentSet (8.2-2) in Digraphs.

A.5 Functions to construct new graphs from old

Grape command Digraphs command Comments
InducedSubgraph InducedSubdigraph (3.3-3) InducedSubdigraph (3.3-3) in Digraphs does not allow a third argument G specifying a group of automorphisms on the resultant graph. This may be included in a future release.
DistanceSetInduced None There is no analogous function in Digraphs, and no plans to include one.
DistanceGraph DistanceDigraph (3.3-45) DistanceGraph in Grape is equivalent to DistanceDigraph (3.3-45) in Digraphs.
ComplementGraph DigraphDual (3.3-11) DigraphDual (3.3-11) in Digraphs is equivalent to ComplementGraph in Grape with the optional argument comploops set to true (loops/nonloops are complemented).
PointGraph None There is no analogous function in Digraphs, and no plans to include one.
EdgeGraph EdgeUndirectedDigraph (3.3-41) EdgeGraph in Grape is equivalent to EdgeUndirectedDigraph (3.3-41) in Digraphs.
SwitchedGraph None There is no analogous function in Digraphs, and no plans to include one.
UnderlyingGraph DigraphSymmetricClosure (3.3-12) UnderlyingGraph in Grape is equivalent to DigraphSymmetricClosure (3.3-12) in Digraphs.
QuotientGraph QuotientDigraph (3.3-9) QuotientDigraph (3.3-9) in Digraphs takes a partition p of the vertices of the digraph, rather than a set of generating pairs. Hence, the equivalence might not be group-invariant. Also note that in Digraphs multiple edges may be created, whereas in Grape they are effectively combined into a single edge.
BipartiteDouble BipartiteDoubleDigraph (3.3-43) BipartiteDouble in Grape is equivalent to BipartiteDoubleDigraph (3.3-43) in Digraphs.
GeodesicsGraph None There is no analogous function in Digraphs, and no plans to include one.
CollapsedIndependentOrbitsGraph None There is no analogous function in Digraphs, although this feature might be implemented in the future.
CollapsedCompleteOrbitsGraph None There is no analogous function in Digraphs, although this feature might be implemented in the future.
NewGroupGraph None There is no analogous function in Digraphs. However, the same results would be possible by calling DigraphCopy (3.3-1) on the digraph to produce a copy gr, and then applying SetDigraphGroup(gr, G).

A.6 Vertex-Colouring and Complete Subgraphs

Grape command Digraphs command Comments
VertexColouring DigraphGreedyColouring (7.3-15) VertexColouring in Grape is equivalent to DigraphGreedyColouring (7.3-15) in Digraphs, except it returns a transformation rather than a list of vertex colors.
CompleteSubgraphs DigraphCliques (8.1-4) The functionality of CompleteSubgraphs in Grape is provided by DigraphCliques (8.1-4) and DigraphMaximalCliques (8.1-4) in Digraphs.
CompleteSubgraphsOfGivenSize DigraphCliques (8.1-4) Much of the functionality of CompleteSubgraphsOfGivenSize in Grape is provided by DigraphCliques (8.1-4) and DigraphMaximalCliques (8.1-4) in Digraphs, except that the functionality relating to vertex weights and partial colourings is not implemented.

A.7 Automorphism groups and isomorphism testing for graphs

Grape command Digraphs command Comments
AutGroupGraph AutomorphismGroup (7.2-2) AutGroupGraph in Grape is equivalent to AutomorphismGroup (7.2-2) in Digraphs.
GraphIsomorphism IsomorphismDigraphs (7.2-17) GraphIsomorphism in Grape is equivalent to IsomorphismDigraphs (7.2-17) in Digraphs. Note however that GraphIsomorphism's optional argument firstunbindcanon is not applicable, since the canonical labellings of a digraph are not portable between sessions.
IsIsomorphicGraph IsIsomorphicDigraph (7.2-15) IsIsomorphicGraph in Grape is equivalent to IsIsomorphicDigraph (7.2-15) in Digraphs. Note however that IsIsomorphicGraph's optional argument firstunbindcanon is not applicable, since the canonical labellings of a digraph are not portable between sessions.
GraphIsomorphismClassRepresentatives None There is no analogous function in Digraphs, although this feature might be implemented in the future.

 [Top of Book]  [Contents]   [Previous Chapter]   [Next Chapter] 
Goto Chapter: Top 1 2 3 4 5 6 7 8 9 A Bib Ind

generated by GAPDoc2HTML