ordered tree
A tree is, by definition, a partially ordered set. An ordered tree is a tree equipped with a linear extension. In other words, its a linear order on the nodes of the tree that obeys the parent-child relationship of the tree. By Zorn’s lemma, every tree can be ordered. When a tree is finite, the linear extension of the tree can be constructed inductively:
-
1.
First, label the nodes of : each label is an -tuple of positive integers, for some ,
-
(a)
the root of is labeled ,
-
(b)
if a node of has been labeled , and if the children of are , then label each by .
From this labeling process, we see that the (direct) children of the root have labels . In general, if a node is of level , its label is a -tuple starting with . It is easy to see that each label corresponds to a unique node of : for if two distinct nodes are of different level, their labels are clearly different. However, if they are of the same level, then the last components of their labels are distinct.
-
(a)
-
2.
Next, order the labels of the nodes lexicographically. In other words, given an -tuple and an -tuple , compare them componentwise, starting from the first. There are two cases:
-
(a)
either all components match, where , or
-
(b)
, but for all , where .
Then iff in the first case, or in the second. This ordering on the labels induces an ordering on the nodes: for nodes and with labels and ,
This ordering on the nodes is linear, and extends the partial ordering on .
-
(a)
For example, below are two diagrams of the same tree. The one on the right is labeled by the method above:
By ordering the labels, we get the corresponding ordering of the nodes:
Title | ordered tree |
---|---|
Canonical name | OrderedTree |
Date of creation | 2013-03-22 19:00:11 |
Last modified on | 2013-03-22 19:00:11 |
Owner | CWoo (3771) |
Last modified by | CWoo (3771) |
Numerical id | 5 |
Author | CWoo (3771) |
Entry type | Definition |
Classification | msc 03E05 |