Graph theory · Definition

Tree

discrete mathematicsgraphstrees

Before you start you need to know

It is the minimal structure that keeps all vertices connected; it appears in hierarchies, networks and search algorithms.

Definition

A tree \(T=(V,E)\) is a connected graph that contains no cycles.

\[|E|=|V|-1\]

A tree with \(n\) vertices has exactly \(n-1\) edges. This is equivalent to the other characterizations: it is connected and acyclic; it is connected and removing any edge disconnects it; between each pair of vertices there is a unique simple path. Any of them can be taken as the definition and the rest become theorems.

Every tree with at least two vertices has at least two leaves, vertices of degree 1: the endpoints of a longest path are leaves. Removing a leaf leaves a smaller tree, which is why many proofs about trees go by induction on the number of vertices. An acyclic graph, not necessarily connected, is called a forest, and each of its components is a tree.

Guiding example: the path \(1,2,3,4,5\) is a tree with 5 vertices and 4 edges; adding the edge \(15\) creates a cycle and it stops being a tree. A typical mistake is to check only the number of edges: \(n-1\) edges are not enough, since a triangle plus an isolated vertex has 4 vertices and 3 edges but is not connected. Spanning trees and Cayley's formula, which counts \(n^{n-2}\) labeled trees, start from this idea.

Think about it

Is a graph with 5 vertices and 4 edges always a tree?

No: a triangle plus an edge between the other two vertices has 5 vertices and 4 edges, but it is not connected and has a cycle. It must also be connected or acyclic.

Exercises 10

References

  • Kenneth H. Rosen, Discrete Mathematics and Its Applications, 8th edition, McGraw-Hill, 2019. §11.1
  • Susanna S. Epp, Discrete Mathematics with Applications, 5th edition, Cengage, 2019. §10.5
  • Ralph P. Grimaldi, Discrete and Combinatorial Mathematics: An Applied Introduction, 5th edition, Pearson, 2003. §12.1