GraphTheory[SpecialGraphs]
CompleteBinaryTree
construct complete binary tree
CompleteKaryTree
construct complete k-ary tree
CompleteKaryArborescence
construct complete k-ary arborescence
CompleteKaryAntiArborescence
construct complete k-ary anti-arborescence
Calling Sequence
Parameters
Options
Description
Examples
Compatibility
CompleteBinaryTree(n,opts)
CompleteKaryTree(k,n,opts)
CompleteKaryArborescence(k,n)
CompleteKaryAntiArborescence(k,n)
k
-
positive integer indicating the degree of the root
n
positive integer indicating the depth of the tree
opts
(optional) one or more options as specified below
vertexorder=breadthfirst or depthfirst
Specifies whether the order of vertices in the graph should follow a breadth-first or depth-first traversal of the tree. The default is depthfirst.
The CompleteBinaryTree(n) command constructs the complete binary tree with depth n.
The CompleteKaryTree(k,n) command constructs the complete k-ary tree with depth n for a given k.
The CompleteKaryArborescence(k,n) command constructs the complete k-ary arborescence with depth n.
The CompleteKaryAntiArborescence(k,n) command constructs the complete k-ary anti-arborescence with depth n.
with⁡GraphTheory:
with⁡SpecialGraphs:
G≔CompleteBinaryTree⁡2
G≔Graph 1: an undirected graph with 7 vertices and 6 edge(s)
Edges⁡G
1,2,1,5,2,3,2,4,5,6,5,7
DrawGraph⁡G
H≔CompleteKaryTree⁡3,2
H≔Graph 2: an undirected graph with 13 vertices and 12 edge(s)
Edges⁡H
1,2,1,6,1,10,2,3,2,4,2,5,6,7,6,8,6,9,10,11,10,12,10,13
DrawGraph⁡H
CA≔CompleteKaryArborescence⁡3,2
CA≔Graph 3: a directed graph with 13 vertices and 12 arc(s)
Edges⁡CA
1,2,1,3,1,4,2,5,2,6,2,7,3,8,3,9,3,10,4,11,4,12,4,13
CAA≔CompleteKaryAntiArborescence⁡3,2
CAA≔Graph 4: a directed graph with 13 vertices and 12 arc(s)
Edges⁡CAA
2,1,3,1,4,1,5,2,6,2,7,2,8,3,9,3,10,3,11,4,12,4,13,4
The vertexorder option was introduced in Maple 2019.
For more information on Maple 2019 changes, see Updates in Maple 2019.
The GraphTheory[SpecialGraphs][CompleteKaryArborescence] and GraphTheory[SpecialGraphs][CompleteKaryAntiArborescence] commands were introduced in Maple 2022.
For more information on Maple 2022 changes, see Updates in Maple 2022.
See Also
SpecialGraphs
Download Help Document