construct spanning tree
construct spanning forest
vertex of the graph
SpanningTree(G) returns a spanning tree of a connected graph G.
SpanningTree(G, r) returns a spanning tree of the connected component of G which contains vertex r.
SpanningForest(G) returns a spanning forest of the graph G.
By default, edge weights on G are ignored. To compute a minimal-weight spanning tree for a weighted graph, use MinimalSpanningTree.
A spanning tree for a graph G is a subgraph of G which contains all the vertices of G and is a tree.
A spanning forest for a graph G is a subgraph of G which contains all the vertices of G and is a forest.
P ≔ PetersenGraph⁡
P≔Graph 1: an undirected graph with 10 vertices and 15 edge(s)
T1 ≔ SpanningTree⁡P
T1≔Graph 2: an undirected graph with 10 vertices and 9 edge(s)
T2 ≔ SpanningTree⁡P,5:
G ≔ GraphUnion⁡CycleGraph⁡1,2,3,CycleGraph⁡4,5,6
G≔Graph 3: an undirected graph with 6 vertices and 6 edge(s)
Graph 4: an undirected graph with 6 vertices and 2 edge(s)
Graph 5: an undirected graph with 6 vertices and 4 edge(s)
The GraphTheory[SpanningForest] command was introduced in Maple 2021.
For more information on Maple 2021 changes, see Updates in Maple 2021.
Download Help Document