LeafPower - Maple Help

Online Help

All Products    Maple    MapleSim


GraphTheory

  

LeafPower

  

construct kth leaf power

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

LeafPower(T, k)

Parameters

T

-

tree, arborescence, or anti-arborescence

k

-

positive integer

Description

• 

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.

Examples

withGraphTheory:

TNewick(((4,5,((3)2,9)7)6,10)8)1;

TGraph 1: a directed unweighted graph with 10 vertices and 9 arc(s)

(1)

LP3LeafPowerT,3

LP3Graph 2: an undirected unweighted graph with 6 vertices and 9 edge(s)

(2)

EdgesLP3

1,4,1,5,1,10,3,9,4,5,4,9,4,10,5,9,5,10

(3)

The path graph on n nodes has only two leaves, the vertices 1 and n. The leaf power is empty unless k >= n-1.

PGPathGraph5

PGGraph 3: an undirected unweighted graph with 5 vertices and 4 edge(s)

(4)

EdgesPG

1,2,2,3,3,4,4,5

(5)

DrawGraphPG,style=circle

LP2LeafPowerPG,2

LP2Graph 4: an undirected unweighted graph with 2 vertices and 0 edge(s)

(6)

EdgesLP2

(7)

LP4LeafPowerPG,4

LP4Graph 5: an undirected unweighted graph with 2 vertices and 1 edge(s)

(8)

EdgesLP4

1,5

(9)

Compatibility

• 

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