Graph Theory - Maple Help

 Graph Theory

There have been several updates for the GraphTheory package in Maple 2017, including an update to the DrawGraph command to use a grayscale color scheme for graphs and the ability to control the graph drawing styles as well as several new commands.

Graph Drawing Options

By default, graphs in Maple 2017 are drawn using a grayscale color scheme.

You can now control many aspects of how a graph is drawn.  The colors, line weights, and font choices can be specified with the stylesheet option.  For details, see Graph Drawing Options.

$\mathrm{with}\left(\mathrm{GraphTheory}\right):$



You can use the graph drawing settings from previous versions of Maple by specifying stylesheet="legacy".  Animations and 3-D graph renderings currently do not support the stylesheet option.

Automorphism Groups

AutomorphismGroup

The new GraphTheory[AutomorphismGroup] command computes and returns the group of automorphisms of a given graph, represented as a permutation group.

 ${\mathrm{PG}}{≔}{\mathrm{Graph 1: an undirected unweighted graph with 10 vertices and 15 edge\left(s\right)}}$ (2.1.1)

 ${\mathrm{AG}}{≔}⟨\left({1}{,}{2}\right)\left({3}{,}{5}\right)\left({6}{,}{9}\right)\left({7}{,}{8}\right){,}\left({2}{,}{5}\right)\left({3}{,}{4}\right)\left({7}{,}{10}\right)\left({8}{,}{9}\right){,}\left({3}{,}{9}\right)\left({4}{,}{8}\right)\left({7}{,}{10}\right){,}\left({4}{,}{7}\right)\left({5}{,}{6}\right)\left({8}{,}{10}\right)⟩$ (2.1.2)

After the automorphism group is computed, you can use GroupTheory commands to analyze the computed group. Here we use GroupTheory[IdentifySmallGroup] and GroupTheory[AreIsomorphic] to confirm the identity of the generated group and demonstrate it is, in fact, isomorphic to symmetric group on 5 elements:

$\mathrm{IdentifySmallGroup}\left(\mathrm{AG}\right)$

 ${120}{,}{34}$ (2.1.3)

$\mathrm{AreIsomorphic}\left(\mathrm{AG},\mathrm{SymmetricGroup}\left(5\right)\right)$

 ${\mathrm{true}}$ (2.1.4)

DrawAutomorphism

The new GraphTheory[DrawAutomorphism] command enables visualizing the action of an automorphism of a graph as an animation.
When given a graph and a permutation corresponding to an automorphism, DrawAutomorphism produces an animation showing the action of each of the generators of the graph's automorphism group.

In the example below, we extract the generators of the computed automorphism group and create a permutation corresponding to a particular graph automorphism by multiplying all four generators. We then instruct DrawAutomorphismGroup to show this particular automorphism.

 ${g}{≔}\left[\left({1}{,}{2}\right)\left({3}{,}{5}\right)\left({6}{,}{9}\right)\left({7}{,}{8}\right){,}\left({2}{,}{5}\right)\left({3}{,}{4}\right)\left({7}{,}{10}\right)\left({8}{,}{9}\right){,}\left({3}{,}{9}\right)\left({4}{,}{8}\right)\left({7}{,}{10}\right){,}\left({4}{,}{7}\right)\left({5}{,}{6}\right)\left({8}{,}{10}\right)\right]$ (2.2.1)

 ${p}{≔}\left({1}{,}{6}{,}{7}{,}{3}{,}{2}\right)\left({4}{,}{9}{,}{5}{,}{10}{,}{8}\right)$ (2.2.2)

If one provides only the graph, DrawAutomorphism shows an animation of the automorphisms corresponding to each of the generators of the automorphism group, as returned by AutomorphismGroup.

$\mathrm{DrawAutomorphism}\left(\mathrm{PG}\right)$

The new commands GraphTheory[CanonicalGraph], GraphTheory[Eccentricity], and GraphTheory[Radius] enable the construction of new graph normal forms and the computation of quantities from graphs.

The CanonicalGraph command constructs a version of the input graph in which the vertices have been reordered such that the resulting graph is in a canonical form. The output is canonical in the sense that any two graphs $G$ and $H$ are isomorphic if and only if . In this example, the Foster cage graph and the Meringer graph serve as examples of graphs which are both cage graphs with the same number of vertices and edges, but are nevertheless not isomorphic.

 ${\mathrm{Graph 2: an undirected unweighted graph with 30 vertices and 75 edge\left(s\right)}}$ (3.1)

$\mathrm{CanonicalGraph}\left(\mathrm{SpecialGraphs}:-\mathrm{MeringerGraph}\left(\right)\right)$

 ${\mathrm{Graph 3: an undirected unweighted graph with 30 vertices and 75 edge\left(s\right)}}$ (3.2)

 ${\mathrm{false}}$ (3.3)

The new command Eccentricity computes the eccentricity of the graph at a specified vertex or, if not specified, computes the list of eccentricities at each vertex. The eccentricity of a vertex $v$ is the maximum graph distance between $v$ and any other vertex in the graph.

 $\left[{3}{,}{3}{,}{3}{,}{3}{,}{3}{,}{3}{,}{3}{,}{3}{,}{4}{,}{4}{,}{4}{,}{4}{,}{4}{,}{4}{,}{4}{,}{4}\right]$ (3.4)

The maximum eccentricity over the entire graph is known as the graph diameter and can be computed with GraphTheory[Diameter] (also available in previous Maple versions).

 ${4}$ (3.5)

The minimum eccentricity over the entire graph is known as the graph radius, and it can be computed directly using the new command Radius:

 ${3}$ (3.6)

Support for Digraph6 Format

The general-purpose commands Import and Export as well as the GraphTheory commands GraphTheory[ImportGraph], GraphTheory[ExportGraph], and GraphTheory[ConvertGraph] now support the Digraph6 graph format.  The Digraph6 format is a concise text-based format for serializing a directed graph.

Digraph6 Format

$\mathrm{GraphTheory}:-\mathrm{DrawGraph}\left(\mathrm{Import}\left("example/dgex.d6",\mathrm{base}=\mathrm{datadir}\right)\right)$

New Special Graphs

The SpecialGraphs subpackage now includes built-in commands to generate the following special graphs:

Book Graph

Chvatal Graph

Folkman Graph

 >
 >
 >

Franklin Graph

Frucht Graph

Hoffman Graph

 >
 > $\mathrm{DrawGraph}\left(\mathrm{SpecialGraphs}:-\mathrm{FruchtGraph}\left(\right)\right)$
 >