GraphTheory
LeafPower
construct kth leaf power
Calling Sequence
Parameters
Description
Examples
Compatibility
LeafPower(T, k)
T
-
tree, arborescence, or anti-arborescence
k
positive integer
LeafPower(T,k) returns the kth leaf power of a given tree T. This is a graph whose vertices are the leaves of T and in which two vertices are connected if there is a path of length at most k between them in the original tree.
The input graph T may be directed or undirected.
The kth leaf power of T is an induced subgraph of the kth graph power of T.
with⁡GraphTheory:
T ≔ Newick⁡(((4,5,((3)2,9)7)6,10)8)1;
T≔Graph 1: a directed graph with 10 vertices and 9 arc(s)
LP3 ≔ LeafPower⁡T,3
LP3≔Graph 2: an undirected graph with 6 vertices and 9 edge(s)
Edges⁡LP3
1,4,1,5,1,10,3,9,4,5,4,9,4,10,5,9,5,10
The path graph on n nodes has only two leaves, the vertices 1 and n. The leaf power is empty unless k >= n-1.
PG ≔ PathGraph⁡5
PG≔Graph 3: an undirected graph with 5 vertices and 4 edge(s)
Edges⁡PG
1,2,2,3,3,4,4,5
DrawGraph⁡PG,style=circle
LP2 ≔ LeafPower⁡PG,2
LP2≔Graph 4: an undirected graph with 2 vertices and 0 edge(s)
Edges⁡LP2
∅
LP4 ≔ LeafPower⁡PG,4
LP4≔Graph 5: an undirected graph with 2 vertices and 1 edge(s)
Edges⁡LP4
1,5
The GraphTheory[LeafPower] command was introduced in Maple 2021.
For more information on Maple 2021 changes, see Updates in Maple 2021.
See Also
AdjacencyMatrix
GraphPower
Newick
ShortestPath
Download Help Document
What kind of issue would you like to report? (Optional)