CompleteBinaryTree - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


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

Calling Sequence

CompleteBinaryTree(n,opts)

CompleteKaryTree(k,n,opts)

CompleteKaryArborescence(k,n)

CompleteKaryAntiArborescence(k,n)

Parameters

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

Options

• 

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.

Description

• 

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.

Examples

withGraphTheory:

withSpecialGraphs:

GCompleteBinaryTree2

GGraph 1: an undirected graph with 7 vertices and 6 edge(s)

(1)

EdgesG

1,2,1,5,2,3,2,4,5,6,5,7

(2)

DrawGraphG

HCompleteKaryTree3,2

HGraph 2: an undirected graph with 13 vertices and 12 edge(s)

(3)

EdgesH

1,2,1,6,1,10,2,3,2,4,2,5,6,7,6,8,6,9,10,11,10,12,10,13

(4)

DrawGraphH

CACompleteKaryArborescence3,2

CAGraph 3: a directed graph with 13 vertices and 12 arc(s)

(5)

EdgesCA

1,2,1,3,1,4,2,5,2,6,2,7,3,8,3,9,3,10,4,11,4,12,4,13

(6)

CAACompleteKaryAntiArborescence3,2

CAAGraph 4: a directed graph with 13 vertices and 12 arc(s)

(7)

EdgesCAA

2,1,3,1,4,1,5,2,6,2,7,2,8,3,9,3,10,3,11,4,12,4,13,4

(8)

Compatibility

• 

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