Labeled Tree

Author

Eric W. Weisstein
June 2, 2004

This notebook downloaded from http://mathworld.wolfram.com/notebooks/GraphTheory/LabeledTree.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/LabeledTree.html.

©2005 Wolfram Research, Inc. except for portions noted otherwise

Counts

Length/@LabeledTrees/@Range[5]//Timing

Length/@LabeledTrees/@Range[6]//Timing

Table[Length[LabeledTrees[n]],{n,6}]//Timing

Table[n^(n-2),{n,10}]

Show[GraphicsArray[
Block[{$DisplayFunction=Identity},Map[ShowLabeledGraph[#,VertexStyle->Disk[.15],
PlotLabel->TraditionalForm[LabeledTreeToCode[#]]]&,Flatten[Partition[#,8,8,{1,1},{}]&/@LabeledTrees/@Range[4],1],
{2}]
]]]

g=CodeToLabeledTree[{1,2,1,3,3,5}];

Show[Graphics[{PointSize[.03],showLabeledGraph[RootedEmbedding[g,1],.1][[1]],Text[{1,2,1,3,3,5},{0,-3.5}]}],PlotRange->All]