Trees - Definition and Characterizations
Trees are among the most fundamental and well-studied structures in graph theory, appearing throughout mathematics and computer science as hierarchical data structures, parse trees, decision trees, and network designs.
A tree is a connected acyclic graph. Equivalently, a tree is a connected graph with no cycles. A forest is an acyclic graph (possibly disconnected), i.e., a disjoint union of trees.
A leaf is a vertex of degree 1. An internal vertex has degree at least 2.
Trees admit numerous equivalent characterizations, each revealing different structural properties and providing different proof techniques.
For a graph with vertices, the following are equivalent:
- is a tree (connected and acyclic)
- is connected and has edges
- is acyclic and has edges
- is minimally connected (removing any edge disconnects )
- is maximally acyclic (adding any edge creates exactly one cycle)
- Every pair of vertices in is connected by a unique path
A complete binary tree of height has vertices and edges. Each internal vertex has degree 3 (except the root with degree 2), and there are leaves at level . This structure is fundamental in data structures and algorithms.
A rooted tree is a tree with one distinguished vertex called the root. For any vertex , the parent is the unique neighbor closer to the root, and children are neighbors farther from the root. The height is the maximum distance from root to any vertex.
A binary tree is a rooted tree where each vertex has at most two children (often labeled left and right).
Every tree with vertices has at least two leaves. This follows because the sum of degrees distributed among vertices requires at least two vertices of degree 1 if the tree is connected.
For rooted trees, three standard traversal orders are:
- Preorder: Visit root, then recursively traverse subtrees
- Inorder (binary trees): Traverse left subtree, visit root, traverse right subtree
- Postorder: Recursively traverse subtrees, then visit root
These traversals have complexity and are fundamental to tree algorithms.
Trees provide optimal connectivity with minimal edges, making them essential for network design, spanning tree protocols in computer networks, and minimum cost connectivity problems.