Thursday, August 03, 2006

A cubic tree



If it could be completed to a cubic graph, it would give a cubic Moore graph of diameter 3. I wish I knew how to produce a similar tree, but growing from an edge instead of from a vertex.

\documentclass{article}
\usepackage{tikz}

\thispagestyle{empty}

\begin{document}

\newcommand{\twochildren}{child{node{\null}}
child{node{\null}}}

\begin{tikzpicture}[style=thick,scale=0.5]

\tikzstyle{every node}=[circle,inner sep=2pt,draw]

\tikzstyle{level 1}=[sibling distance=20mm]

\tikzstyle{level 2}=[sibling distance=10mm]
\tikzstyle{level 3}=[sibling distance=5mm]

\node{\null}[grow'=right]

child{node{\null}

child{node{\null}\twochildren}

child{node{\null}\twochildren}
}
child{node{\null}
child{node{\null}\twochildren}

child{node{\null}\twochildren}
}
child{node{\null}

child{node{\null}\twochildren}

child{node{\null}\twochildren} };
\end{tikzpicture}

\end{document}

No comments: