GraphTheory
Maple 2018 enhances the GraphTheory package with new functions, including:
CliquePolynomial
DistancePolynomial
FindClique
GraphIntersection
IndependencePolynomial
IsReachable
Reachable
The ChromaticNumber function includes a new heuristic for graph coloring.
The SpecialGraphs subpackage also includes commands for eight new graphs.
Examples
New Special Graphs
FindClique returns a list of vertices which comprise a clique in the graph G. The optional parameter size specifies a size for the clique.
with⁡GraphTheory:
G≔GraphComplement⁡CompleteGraph⁡3,4
G≔Graph 1: an undirected unweighted graph with 7 vertices and 9 edge(s)
DrawGraph⁡G
FindClique⁡G,3
1,2,3
FindClique⁡G,4
4,5,6,7
GraphIntersection returns a graph G which is the intersection of the graphs G1,...,Gs, such that
Vertices⁡G=Vertices⁡G1∪⋯∪Vertices⁡Gs
Edges⁡G=Edges⁡G1∩⋯∩Edges⁡Gs
G1≔Graph⁡5,1,2,1,3,1,4,1,5
G1≔Graph 2: an undirected unweighted graph with 5 vertices and 4 edge(s)
G2≔Graph⁡5,1,2,1,3,1,4,1,5,2,3,2,5,3,4,4,5
G2≔Graph 3: an undirected unweighted graph with 5 vertices and 8 edge(s)
DrawGraph⁡G1
DrawGraph⁡G2
DrawGraph⁡GraphIntersection⁡G1,G2
IndependencePolynomial returns the independence polynomial for the graph G in the variable x.
with⁡SpecialGraphs:
P≔Graph⁡1,2,2,3,3,4
P≔Graph 4: an undirected unweighted graph with 4 vertices and 3 edge(s)
IndependencePolynomial⁡P,x
3⁢x2+4⁢x+1
C≔CycleGraph⁡5
C≔Graph 5: an undirected unweighted graph with 5 vertices and 5 edge(s)
IndependencePolynomial⁡C,x
5⁢x2+5⁢x+1
ChromaticNumber
ChromaticNumber returns the minimum number of colours necessary to colour the vertices of a graph so that no adjacent vertices are coloured the same. Maple 2018 includes a new heuristic, method=sat, which transforms the graph into an instance of the Boolean satisfiability problem which it then solves using the Logic[Satisfy] command. The new default heuristic, method=fastest, runs the two methods optimal and sat in parallel and returns the result of whichever method finishes first.
M≔MirzakhaniGraph⁡
M≔Graph 1: an undirected unweighted graph with 63 vertices and 183 edge(s)
ChromaticNumber⁡M,method=sat
3
The SpecialGraphs subpackage now includes built-in commands to generate the following special graphs:
Doyle Graph
Gear Graph
Gray Graph
Mirzakhani Graph
DrawGraphDoyleGraph5,style=spring
DrawGraphGearGraph8
DrawGraphGrayGraph
DrawGraph MirzakhaniGraph,style=spring
Nauru Graph
Poussin Graph
Turan Graph
Tutte Graph
DrawGraph NauruGraph5
DrawGraphPoussinGraph,style=spring
DrawGraphTuranGraph5,4,style=spring
DrawGraphTutteGraph,style=spring
Download Help Document