Close
Close window
LeafPower - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.
Maplesoft logo
Maplesoft logo

Online Help

All Products Maple MapleSim


[フレーム] [フレーム]

GraphTheory

LeafPower

construct kth leaf power

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 graph with 10 vertices and 9 arcs

(1)
>

LP3LeafPowerT,3

LP3Graph 2: an undirected graph with 6 vertices and 9 edges

(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 graph with 5 vertices and 4 edges

(4)
>

EdgesPG

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

(5)
>

DrawGraphPG,style=circle

>

LP2LeafPowerPG,2

LP2Graph 4: an undirected graph with 2 vertices and 0 edges

(6)
>

EdgesLP2

(7)
>

LP4LeafPowerPG,4

LP4Graph 5: an undirected graph with 2 vertices and 1 edge

(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 .


Download Help Document

AltStyle によって変換されたページ (->オリジナル) /