New Features in Maple 2018 - GraphTheory - Maplesoft

What's New in Maple 2018

GraphTheory




The Graph Theory package is a collection of routines for creating, drawing, and manipulating graphs, and for testing graphs for particular properties.  Maple 2018 enhances the GraphTheory package with new functions, including: 

  • CliquePolynomial
  • DistancePolynomial
  • FindClique
  • GraphIntersection
  • IndependencePolynomial
  • IsReachable
  • Reachable

The SpecialGraphs subpackage also includes support for seven new graphs and families of graphs. 


Examples

FindClique 

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));
Typesetting:-mprintslash([G := `Graph 1: an undirected unweighted graph with 7 vertices and 9 edge(s)`], [GRAPHLN(undirected, unweighted, [1, 2, 3, 4, 5, 6, 7], Array(%id = 18446746447075703734), `GRA...
>  DrawGraph(G);
Plot_2d
>  FindClique(G, 3);
[1, 2, 3]
>  FindClique(G, 4);
[4, 5, 6, 7]

GraphIntersection 

GraphIntersection returns a graph G which is the intersection of the graphs G1,...,Gs, such that 

Vertices(G) = `union`(`union`(Vertices(G1), `⋯`), Vertices(Gs)) 

Edges(G) = `intersect`(`intersect`(Edges(G1), `⋯`), Edges(Gs)) 

>  G1 := Graph(5,{{1,2},{1,3},{1,4},{1,5}});
Typesetting:-mprintslash([G1 := `Graph 2: an undirected unweighted graph with 5 vertices and 4 edge(s)`], [GRAPHLN(undirected, unweighted, [1, 2, 3, 4, 5], Array(%id = 18446746447075673142), `GRAPHLN/...
>  G2 := Graph(5,{{1,2},{1,3},{1,4},{1,5},{2,3},{3,4},{4,5},{5,2}});
Typesetting:-mprintslash([G2 := `Graph 3: an undirected unweighted graph with 5 vertices and 8 edge(s)`], [GRAPHLN(undirected, unweighted, [1, 2, 3, 4, 5], Array(%id = 18446746447075675782), `GRAPHLN/...
>  DrawGraph(G1);
Plot_2d
>  DrawGraph(G2);
Plot_2d
>  DrawGraph(GraphIntersection(G1,G2));
Plot_2d

IndependencePolynomial 

IndependencePolynomialreturns the independence polynomial for the graph G in the variable x.  

>  with(SpecialGraphs):
>  P := Graph( {{1,2},{2,3},{3,4}} ); # a path
Typesetting:-mprintslash([P := `Graph 4: an undirected unweighted graph with 4 vertices and 3 edge(s)`], [GRAPHLN(undirected, unweighted, [1, 2, 3, 4], Array(%id = 18446746447055899694), `GRAPHLN/tabl...
>  IndependencePolynomial(P,x);
`+`(`*`(3, `*`(`^`(x, 2))), `*`(4, `*`(x)), 1)
&
>  C := CycleGraph( 5 ); # a cycle
Typesetting:-mprintslash([C := `Graph 5: an undirected unweighted graph with 5 vertices and 5 edge(s)`], [GRAPHLN(undirected, unweighted, [1, 2, 3, 4, 5], Array(%id = 18446746447055895838), `GRAPHLN/t...
>  IndependencePolynomial(C,x);
`+`(`*`(5, `*`(`^`(x, 2))), `*`(5, `*`(x)), 1)

New Special Graphs

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


Doyle Graph 

Gear Graph 

Gray Graph 

Nauru Graph 

> DrawGraph(DoyleGraph(5), style = spring)
DrawGraph(DoyleGraph(5), style = spring)
Plot_2d
> DrawGraph(GearGraph(8))
Plot_2d

> DrawGraph(GrayGraph())
Plot_2d
> DrawGraph(NauruGraph(5))
Plot_2d

Poussin Graph 

Turan Graph 

Tutte Graph 

 

> DrawGraph(PoussinGraph(), style = spring)
DrawGraph(PoussinGraph(), style = spring)
Plot_2d
> DrawGraph(TuranGraph(5, 4), style = spring)
DrawGraph(TuranGraph(5, 4), style = spring)
Plot_2d
> DrawGraph(TutteGraph(), style = spring)
DrawGraph(TutteGraph(), style = spring)
Plot_2d