Tree Construction & Representation

The Wolfram Language provides functions to construct trees representing rooted, ordered, labeled trees with arbitrary data, which can be used in input, output and general documents. Trees can be constructed from nested structures such as rules and expressions, or as the result of converting a tree given as a graph. They can be generated randomly, or systematically by giving recursive rules for the data and children.

Tree represent a general tree with data and subtrees

NestTree construct a tree by nesting a function

RandomTree generate a random tree

Basic Constructors

RulesTree construct a tree from nested rules

ExpressionTree construct a tree from the structure of an expression

GraphTree convert a tree graph to a tree object

Tree Graphs

TreeGraph create a tree graph from vertices and edges

KaryTree, CompleteKaryTree create a -ary tree graph

StarGraph  ▪  PathGraph  ▪  FindSpanningTree  ▪  ClusteringTree  ▪  Dendrogram