-
Notifications
You must be signed in to change notification settings - Fork 1
/
planarforest_test.tex
85 lines (65 loc) · 5.25 KB
/
planarforest_test.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
\documentclass[a4paper, 11pt, pdftex]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{hyperref}
\usepackage{planarforest}
\begin{document}
\title{Test of planarforest package}
\author{Håkon Marthinsen}
\date{March 18, 2014}
\maketitle
\newnodecolor{r}{red}
\noindent
A forest is \emph{beautiful} if:
\begin{itemize}
\item Each subtree is beautiful.
\item The horizontal distance between two adjacent subtrees is one unit.
\item The roots of the subtrees are spaced out as evenly as possible.
\end{itemize}
A tree is \emph{beautiful} if:
\begin{itemize}
\item The forest you get by removing the root of the tree is beautiful.
\item The vertical distance between the root and the next level of nodes is one unit.
\item The horizontal position of the root is the median of the horizontal positions of the roots of the subtrees.
\end{itemize}
Additionaly:
\begin{itemize}
\item The tree consisting of a single node is beautiful.
\end{itemize}
\section*{Colors}
\forest{b[w,r]}
\section*{Planar trees of order 1--6}
\begin{tabular}{ll}
1 node & \forest{b} \\
2 nodes & \forest{b[b]} \\
3 nodes & \forest{b[b[b]]} \forest{b[b,b]} \\
4 nodes & \forest{b[b[b[b]]]} \forest{b[b[b,b]]} \forest{b[b,b[b]]} \forest{b[b[b],b]} \forest{b[b,b,b]} \\
5 nodes & \forest{b[b[b[b[b]]]]} \forest{b[b[b[b,b]]]} \forest{b[b[b,b[b]]]} \forest{b[b[b[b],b]]} \forest{b[b,b[b[b]]]} \forest{b[b[b[b]],b]} \forest{b[b[b,b,b]]} \forest{b[b,b[b,b]]} \forest{b[b[b,b],b]} \forest{b[b[b],b[b]]} \forest{b[b,b,b[b]]} \forest{b[b,b[b],b]} \forest{b[b[b],b,b]} \forest{b[b,b,b,b]} \\
6 nodes & \forest{b[b[b[b[b[b]]]]]} \forest{b[b[b[b[b,b]]]]} \forest{b[b[b[b,b[b]]]]} \forest{b[b[b[b[b],b]]]} \forest{b[b[b,b[b[b]]]]} \forest{b[b[b[b[b]],b]]} \forest{b[b,b[b[b[b]]]]} \forest{b[b[b[b[b]]],b]} \forest{b[b[b[b,b,b]]]} \forest{b[b[b,b[b,b]]]} \forest{b[b[b[b,b],b]]} \forest{b[b,b[b[b,b]]]} \forest{b[b[b[b,b]],b]} \forest{b[b[b[b],b[b]]]} \forest{b[b[b,b,b[b]]]} \forest{b[b[b,b[b],b]]} \forest{b[b[b[b],b,b]]} \forest{b[b,b[b,b[b]]]} \forest{b[b[b,b[b]],b]} \forest{b[b,b[b[b],b]]} \forest{b[b[b[b],b],b]} \forest{b[b[b],b[b[b]]]} \forest{b[b[b[b]],b[b]} \forest{b[b,b,b[b[b]]]} \forest{b[b,b[b[b]],b]} \forest{b[b[b[b]],b,b]} \\
& \forest{b[b[b,b],b,b]} \forest{b[b,b[b,b],b]} \forest{b[b,b,b[b,b]]} \forest{b[b[b,b,b,b]]} \forest{b[b,b[b,b,b]]} \forest{b[b[b,b,b],b]} \forest{b[b[b],b[b,b]]} \forest{b[b[b,b],b[b]} \forest{b[b,b[b],b[b]]} \forest{b[b[b],b,b[b]]} \forest{b[b[b],b[b],b]} \forest{b[b[b],b,b,b]} \forest{b[b,b[b],b,b]} \forest{b[b,b,b[b],b]} \forest{b[b,b,b,b[b]]} \forest{b[b,b,b,b,b]} \\
\end{tabular}
\section*{Planar forests of order 1--6}
\begin{tabular}{ll}
1 node & \forest{b} \\
2 nodes & \forest{b[b]} \forest{b,b} \\
3 nodes & \forest{b[b[b]]} \forest{b[b,b]} \forest{b,b[b]} \forest{b[b],b} \forest{b,b,b} \\
4 nodes & \forest{b[b[b[b]]]} \forest{b[b[b,b]]} \forest{b[b,b[b]]} \forest{b[b[b],b]} \forest{b,b[b[b]]} \forest{b[b[b]],b} \forest{b[b,b,b]} \forest{b,b[b,b]} \forest{b[b,b],b} \forest{b[b],b[b]} \forest{b,b,b[b]} \forest{b,b[b],b} \forest{b[b],b,b} \forest{b,b,b,b} \\
5 nodes & \forest{b[b[b[b[b]]]]} \forest{b[b[b[b,b]]]} \forest{b[b[b,b[b]]]} \forest{b[b[b[b],b]]} \forest{b[b,b[b[b]]]} \forest{b[b[b[b]],b]} \forest{b,b[b[b[b]]]} \forest{b[b[b[b]]],b} \forest{b[b[b,b,b]]} \forest{b[b,b[b,b]]} \forest{b[b[b,b],b]} \forest{b,b[b[b,b]]} \forest{b[b[b,b]],b} \forest{b[b[b],b[b]]} \forest{b[b,b,b[b]]} \forest{b[b,b[b],b]} \forest{b[b[b],b,b]} \forest{b,b[b,b[b]]} \forest{b[b,b[b]],b} \forest{b,b[b[b],b]} \forest{b[b[b],b],b} \forest{b[b],b[b[b]]} \forest{b[b[b]],b[b} \forest{b,b,b[b[b]]} \forest{b,b[b[b]],b} \forest{b[b[b]],b,b} \\
& \forest{b[b,b],b,b} \forest{b,b[b,b],b} \forest{b,b,b[b,b]} \forest{b[b,b,b,b]} \forest{b,b[b,b,b]} \forest{b[b,b,b],b} \forest{b[b],b[b,b]} \forest{b[b,b],b[b} \forest{b,b[b],b[b]} \forest{b[b],b,b[b]} \forest{b[b],b[b],b} \forest{b[b],b,b,b} \forest{b,b[b],b,b} \forest{b,b,b[b],b} \forest{b,b,b,b[b]} \forest{b,b,b,b,b} \\
\end{tabular}
\section*{Difficult forests}
\forest{b,b,b[b,b[b,b,b]],b,b[b,b,b[b,b]],b[b]} \forest{b[b,b],b,b,b[b],b[b,b]} \forest{b[b,b],b,b,b[b,b],b[b]} \forest{r,b[b,b,b[b,b[b,b,b]],b,b[b,b,b[b,b[b,b,b[b,b[b,b,b]],b,b[b,b,b[b,b]],b[b]]]],b[b[r,r,b[b,b[b,b,b]],b,b[b,b,b[b,b]],b[b]]]],b[b,b[b,b,b]],b,b[b,b,b[b,b]],b[b]}
\forest{b[b,b,b],b,b[b,b,b]}
\forest{b[b[b,b,b],b,b[b,b,b]]}
\forest{b[b,b,b[b,b,b]],b,b[b],b[b[b,b,b]]}
\forest{b[b,b[b,b]],b,b[b[b,b],b]}
\medskip
\noindent
\forest{w[b[b[b[b[b,b],b[b,b]],b[b[b,b],b[b,b]]],b[b[b[b,b],b[b,b]],b[b[b,b],b[b,b]]]],b,b[b,b,b,b],b[b[b[b[b,b],b[b,b]],b[b[b,b],b[b,b]]],b[b[b[b,b],b[b,b]],b[b[b,b],b[b,b]]]]]]}
\section*{License}
planarforest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
planarforest is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with planarforest.
If not, see \url{http://www.gnu.org/licenses/}.
\end{document}