 CompleteBinaryTree - Maple Help

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

 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

 > $\mathrm{with}\left(\mathrm{GraphTheory}\right):$
 > $\mathrm{with}\left(\mathrm{SpecialGraphs}\right):$
 > $G≔\mathrm{CompleteBinaryTree}\left(2\right)$
 ${G}{≔}{\mathrm{Graph 1: an undirected graph with 7 vertices and 6 edge\left(s\right)}}$ (1)
 > $\mathrm{Edges}\left(G\right)$
 $\left\{\left\{{1}{,}{2}\right\}{,}\left\{{1}{,}{5}\right\}{,}\left\{{2}{,}{3}\right\}{,}\left\{{2}{,}{4}\right\}{,}\left\{{5}{,}{6}\right\}{,}\left\{{5}{,}{7}\right\}\right\}$ (2)
 > $\mathrm{DrawGraph}\left(G\right)$ > $H≔\mathrm{CompleteKaryTree}\left(3,2\right)$
 ${H}{≔}{\mathrm{Graph 2: an undirected graph with 13 vertices and 12 edge\left(s\right)}}$ (3)
 > $\mathrm{Edges}\left(H\right)$
 $\left\{\left\{{1}{,}{2}\right\}{,}\left\{{1}{,}{6}\right\}{,}\left\{{1}{,}{10}\right\}{,}\left\{{2}{,}{3}\right\}{,}\left\{{2}{,}{4}\right\}{,}\left\{{2}{,}{5}\right\}{,}\left\{{6}{,}{7}\right\}{,}\left\{{6}{,}{8}\right\}{,}\left\{{6}{,}{9}\right\}{,}\left\{{10}{,}{11}\right\}{,}\left\{{10}{,}{12}\right\}{,}\left\{{10}{,}{13}\right\}\right\}$ (4)
 > $\mathrm{DrawGraph}\left(H\right)$ > $\mathrm{CA}≔\mathrm{CompleteKaryArborescence}\left(3,2\right)$
 ${\mathrm{CA}}{≔}{\mathrm{Graph 3: a directed graph with 13 vertices and 12 arc\left(s\right)}}$ (5)
 > $\mathrm{Edges}\left(\mathrm{CA}\right)$
 $\left\{\left[{1}{,}{2}\right]{,}\left[{1}{,}{3}\right]{,}\left[{1}{,}{4}\right]{,}\left[{2}{,}{5}\right]{,}\left[{2}{,}{6}\right]{,}\left[{2}{,}{7}\right]{,}\left[{3}{,}{8}\right]{,}\left[{3}{,}{9}\right]{,}\left[{3}{,}{10}\right]{,}\left[{4}{,}{11}\right]{,}\left[{4}{,}{12}\right]{,}\left[{4}{,}{13}\right]\right\}$ (6)
 > $\mathrm{CAA}≔\mathrm{CompleteKaryAntiArborescence}\left(3,2\right)$
 ${\mathrm{CAA}}{≔}{\mathrm{Graph 4: a directed graph with 13 vertices and 12 arc\left(s\right)}}$ (7)
 > $\mathrm{Edges}\left(\mathrm{CAA}\right)$
 $\left\{\left[{2}{,}{1}\right]{,}\left[{3}{,}{1}\right]{,}\left[{4}{,}{1}\right]{,}\left[{5}{,}{2}\right]{,}\left[{6}{,}{2}\right]{,}\left[{7}{,}{2}\right]{,}\left[{8}{,}{3}\right]{,}\left[{9}{,}{3}\right]{,}\left[{10}{,}{3}\right]{,}\left[{11}{,}{4}\right]{,}\left[{12}{,}{4}\right]{,}\left[{13}{,}{4}\right]\right\}$ (8) Compatibility

 • The vertexorder option was introduced in Maple 2019.