TERMINOLOGY &
CHARACTERIZATION
OF TREES
MARYJOY D. LLANDA
PhD in Science Education – Math Student
Source: Discrete Mathematics – Richard Johnsonbaugh (2007)
A (free) tree T is a simple
graph satisfying the
following:
If v and w are vertices in T,
there is a unique path from v
to w.
Rooted tree
A rooted tree is a tree
where one of its
vertices is designated
the root.
Source: Discrete Mathematics – Richard Johnsonbaugh (2007)
If we designate the winner as the root,
the single-elimination tournament as
shown in Figure 9.1.2 is a rooted
tree.
Notice that if v and w are vertices in
this graph, there is a unique simple
path from v to w. For example, the
unique simple path from to is
Source: Discrete Mathematics – Richard Johnsonbaugh (2007)
▪ Rooted trees are typically drawn
with their roots at the top.
▪ Figure 9.1.4 shows the way the
tree of Figure 9.1.2 would be drawn
(with as root).
Source: Discrete Mathematics – Richard Johnsonbaugh (2007)
Level of a vertex and tree height
Let T be a rooted tree:
▪ The level l(v) of a vertex v is the length of the
simple path from v to the root of the tree
▪ The height h of a rooted tree T is the
maximum of all level numbers of its vertices.
▪ Example:
▪ The vertices in the
rooted tree of Figure 9.1.4 are on (respectively)
levels 0, 1, 1, 2, 2, 2, 2. The height of the tree is 2.
Source: Discrete Mathematics – Richard Johnsonbaugh (2007)
▪A rooted tree is
often used to
specify
hierarchical
relationships.
▪ Modern computer operating Fig 9.1.7
systems organize folders and files
using a tree structure. A folder
contains other folders and files.
▪ Figure 9.1.7 shows the Windows
Explorer display of folders on the
left and files on the right on a
particular computer. Figure 9.1.8
shows the same structure as a
rooted tree.
The most common way to represent
characters internally in a computer is by
using fixed-length bit strings.
Huffman codes, which represent characters
by variable-length bit strings, provide
alternatives to ASCII and other fixed-length
codes. The idea is to use short bit strings to
represent the most frequently used characters
and to use longer bit strings to represent less
frequently used characters.
As an example, let us decode
the string 01010111
R
As an example, let us decode
the string 010 0111
R A
As an example, let us decode
the string 010 0111
R AT
Terminology
▪ Parent
▪ Ancestor
▪ Child
▪ Descendant
▪ Siblings
▪ Terminal vertices
▪ Internal/branch vertices
▪ Subtrees
Terminology
Internal and external vertices
▪ An internal vertex is a vertex
that has at least one child
▪ A terminal vertex is a vertex
that has no children
▪ The tree in the example has 4
internal vertices and 4
terminal vertices
Subtrees
A subtree of a tree T is a
tree T' such that
▪ V(T') V(T) and
▪ E(T') E(T)
Terminology
A portion of the family tree of the ancient
Greek gods is shown in Figure 9.2.1. (Not
all children are listed.) As shown, we can regard
a family tree as a rooted tree. The
vertices adjacent to a vertex v and on the
next-lower level are the children of v. For
example, Kronos’s children are Zeus,
Poseidon, Hades, and Ares. The
terminology adapted from a family tree is
used routinely for any rooted tree.
In the rooted tree of Figure 9.2.1,
(a) The parent of Eros is Aphrodite.
Terminology (b) The ancestors of Hermes are Zeus, Kronos,
and Uranus.
(c) The children of Zeus are Apollo, Athena,
Hermes, and Heracles.
(d) The descendants of Kronos are Zeus,
Poseidon, Hades, Ares, Apollo, Athena, Hermes,
and Heracles.
(e) Aphrodite and Prometheus are siblings.
(f) The terminal vertices are Eros, Apollo,
Athena, Hermes, Heracles, Poseidon, Hades,
Ares, Atlas, and Prometheus.
(g) The internal vertices are Uranus, Aphrodite,
Kronos, and Zeus.
(h) The subtree rooted at Kronos is shown at
fig. 9.2.2.
Terminology
(h) The subtree rooted at Kronos is shown at
fig. 9.2.2.
A tree is a connected graph with no cycles.
Q1: Consider the tree below. Suppose you remove an
edge. What happens? Does it remain connected?
1 a 2 b 3
Suppose let’s
c
remove edge d.
4
e
d What happened?
6
5
https://www.youtube.com/watch?v=4pbn0sMLnc4
A tree is a connected graph with no cycles.
Q1: Consider the tree below. Suppose you remove an
edge. What happens? Does it remain connected?
1 a 2 b 3
Suppose let’s
c
remove edge d.
4
e
What happened?
6
5
https://www.youtube.com/watch?v=4pbn0sMLnc4
A tree is a connected graph with no cycles.
1 a 2 b 3
It did not matter which edge you
opted to remove; you disconnect
c 4
the graph if you remove any
edge.
e Thus, you can think of a tree as
d
having as few edges as possible
6 and still be connected.
5
https://www.youtube.com/watch?v=4pbn0sMLnc4
A tree is a connected graph with no cycles.
Q2: Suppose you add an edge (without adding a new vertex).
What happens? Does it remain without a cycle?
1 a 2 b 3
Let’s add an edge f
c 4 connecting vertices 2 & 4.
Does the graph remain
e
d without a cycle?
6
5
https://www.youtube.com/watch?v=4pbn0sMLnc4
A tree is a connected graph with no cycles.
Q2: Suppose you add an edge (without adding a new vertex).
What happens? Does it remain without a cycle?
1 a 2 b 3
No matter where you add an
c 4 edge (without adding a new
vertex), the graph cannot
e
remain without a cycle.
d
Therefore, a tree is a
6 connected graph with no
5
cycles.
https://www.youtube.com/watch?v=4pbn0sMLnc4
Acyclic graph
A graph with no cycles is called an acyclic
graph. A tree is a connected, acyclic graph.
The converse is also true; every connected,
acyclic graph is a tree.
Q3: How many (n) vertices and edges are there in this
graph?
1 a 2 b 3
vertices = n = 6
c 4
edges = n – 1 = 5
e
d
6
5
https://www.youtube.com/watch?v=4pbn0sMLnc4
Theorem 9.2.3
If T is a graph with n vertices, the following are equivalent:
a) T is a tree
b) T is connected and acyclic
(“acyclic” = having no cycles)
c) T is connected and has n-1 edges
d) T is acyclic and has n-1 edges
Proof of Theorem is on page 449-451 of Discrete Mathematics – Richard Johnsonbaugh (2007)
Thank you for listening.
God bless us all. ☺