TreeGraph

TreeGraph[{v1,v2,},{u1,u2,}]

yields a tree where ui is the predecessor of vi.

TreeGraph[{e1,e2,}]

yields a tree with edges ej.

TreeGraph[{v1,v2,},{e1,e2,}]

yields a tree with vertices vi and edges ej.

TreeGraph[{,wi[vi,],},{,wj[ej,],}]

yields a tree with vertex and edge properties defined by the symbolic wrappers wk.

TreeGraph[{vivj,}]

uses rules vivj to specify a tree.

Details and Options

  • TreeGraph generates a Graph object.
  • TreeGraph supports the same vertices, edges, wrappers, and options as Graph.
  • A tree is a connected graph with no cycles.
  • TreeGraph can only represent trees.

Examples

open allclose all

Basic Examples  (1)

A tree from pairs of children and parents:

In[1]:=
Click for copyable input
Out[1]=

A tree from a list of vertices and edges:

In[2]:=
Click for copyable input
Out[2]=

Scope  (25)

Options  (82)

Applications  (4)

Properties & Relations  (9)

See Also

Graph  UndirectedEdge  DirectedEdge  TreeGraphQ  KaryTree  CompleteKaryTree  StarGraph  FindSpanningTree  TreePlot  PathGraph  PlanarGraph  TextStructure  Groupings

Introduced in 2010
(8.0)
| Updated in 2015
(10.3)