GraphTheory Updates in Maple 2025
|
Description
|
|
A substantial effort was put into Graph Theory for Maple 2025, including new commands for graph computation and generation.
|
|
New commands
|
|
|
AllSimplePaths
|
|
The new AllSimplePaths command returns an iterator with which one can step through all paths from a given vertex to another vertex in a directed graph.
>
|
G1 := Graph({["A", "B"], ["A", "D"], ["B", "C"], ["C", "E"], ["D", "E"]});
|
| (1) |
>
|
iterator := AllSimplePaths( G1, "A", "E" );
|
| (2) |
| (4) |
|
|
Ancestors and Descendants
|
|
The new Ancestors command returns a list of ancestors of the given vertex in the given directed graph. The related new command Descendants returns a list of descendants of the given vertex.
| (7) |
>
|
Descendants( G1, "A" );
|
| (8) |
|
|
FindCycle
|
|
The new FindCycle command finds a cycle, if one exists in the given graph.
>
|
FindCycle( Graph( {["A", "B"], ["B", "C"], ["C", "A"]} ) );
|
| (10) |
|
|
IsCaterpillarTree and IsLobsterTree
|
|
The new IsCaterpillarTree command tests whether the graph is a caterpillar tree, a tree for which there is some path such that every vertex is either on the path or the neighbor of a vertex on the path.
>
|
CT := Graph({{1,4},{2,4},{3,4},{4,5},{5,6},{6,7},{7,8},{7,9}});
|
| (11) |
The new IsLobsterTree command tests whether the graph is lobster tree, a tree such that the result of removing all leaf vertices is a caterpillar tree.
>
|
LT := Graph({{1,2},{2,3},{3,4},{4,5},{3,6},{6,7},{3,8},{8,9}});
|
| (13) |
|
|
IsPlatonicGraph
|
|
The new IsPlatonicGraph command tests whether the graph is Platonic. The Platonic graphs consist of those graphs whose skeletons are the Platonic solids (polyhedra whose faces are identical).
>
|
IsPlatonicGraph( SpecialGraphs:-CubeGraph() );
|
|
|
LongestPath
|
|
The new LongestPath command computes the longest path within a given (directed) graph.
| (17) |
|
|
LowestCommonAncestors
|
|
The new LowestCommonAncestors command computes the set of lowest common ancestors in a given directed graph.
>
|
LowestCommonAncestors( G1, "C", "D" );
|
|
|
ModularityMatrix
|
|
The new ModularityMatrix command computes the modularity matrix of the graph G.
| (19) |
|
|
ResistanceDistance
|
|
The new ResistanceDistance command computes the resistance distance of the graph G.
>
|
ResistanceDistance(SpecialGraphs:-CubeGraph());
|
| (20) |
|
|
ShortestAncestralPath and ShortestDescendantPath
|
|
The new ShortestAncestralPath constructs the shortest ancestral path between two nodes in the given directed graph.
>
|
ShortestAncestralPath( G1, "C", "D") ;
|
| (21) |
You can similarly find the shortest descendent path.
|
|
|
New functionality for existing commands
|
|
|
IsReachable and Reachable
|
|
The IsReachable and Reachable commands now have a new option distance to constrain the distance within a given vertex.
>
|
IsReachable( G1, "A", "E", distance = 1 );
|
>
|
Reachable( G1, "A", distance = 1 );
|
|
|
ShortestPath
|
|
The ShortestPath command accepts an option avoidvertices to constrain the search space for a shortest path to avoid some specified set of vertices.
>
|
ShortestPath( G1, "A", "E" );
|
>
|
ShortestPath( G1, "A", "E", avoidvertices = {"D"} );
|
| (25) |
|
|
|
Additions to SpecialGraphs
|
|
The SpecialGraphs subpackage now includes commands for the F26a graph and Hanoi graph.
>
|
FG := SpecialGraphs:-F26AGraph();
|
| (26) |
>
|
HG4 := SpecialGraphs:-HanoiGraph(4);
|
| (27) |
|
|