ProofComplete

Trees and Networks - Key Proof

The fundamental relationship between vertices and edges in trees is both elegant and essential for understanding tree structure.

DefinitionTree Edge-Vertex Relationship

Every tree with nn vertices has exactly n−1n-1 edges.

Proof by Induction:

We prove by strong induction on nn.

Base case: For n=1n = 1, a tree with 1 vertex (isolated) has 0 edges. Indeed, 1−1=01 - 1 = 0. ✓

Inductive hypothesis: Assume every tree with k<nk < n vertices has exactly k−1k-1 edges.

Inductive step: Let TT be a tree with nn vertices where n≥2n \geq 2.

Since TT is connected and n≥2n \geq 2, there exists at least one edge. Since TT is acyclic and connected, there exists a leaf vertex vv (a vertex of degree 1).

To see why a leaf exists: Since TT is connected with n≥2n \geq 2, every vertex has degree ≥1\geq 1. If all vertices had degree ≥2\geq 2, we could construct an infinite simple path (start anywhere, always move to an unvisited neighbor, which exists by degree ≥2\geq 2). But TT is finite, so this is impossible. Thus some vertex has degree exactly 1 (a leaf).

Remove the leaf vv and its incident edge e={v,u}e = \{v, u\} to get T′=T−v−eT' = T - v - e.

Claim: T′T' is a tree.

  • Connected: Any path in TT not using vv is still in T′T'. Any path using vv must enter and exit via uu (since vv is a leaf), so we can route around vv.
  • Acyclic: Removing an edge can't create cycles.

By the inductive hypothesis, T′T' has (n−1)(n-1) vertices and (n−1)−1=n−2(n-1) - 1 = n-2 edges.

Therefore, TT has nn vertices and (n−2)+1=n−1(n-2) + 1 = n-1 edges. ✓

This completes the induction. □\square

Alternative Proof (Direct):

We can also prove this directly by showing:

  1. Every connected graph with nn vertices has at least n−1n-1 edges
  2. Every acyclic graph with nn vertices has at most n−1n-1 edges

Proof of (1): Build a spanning tree by BFS. Add edges one at a time, each connecting a new vertex. This requires at least n−1n-1 edges.

Proof of (2): If a graph with nn vertices and kk connected components is acyclic, each component is a tree. Component ii with nin_i vertices has ni−1n_i - 1 edges. Total edges: ∑(ni−1)=n−k≤n−1\sum(n_i - 1) = n - k \leq n - 1.

Since trees are both connected (k=1k=1) and acyclic, they have exactly n−1n-1 edges. □\square

ExampleConsequences
  1. Adding any edge to a tree creates exactly one cycle
  2. A connected graph with nn vertices and n−1n-1 edges is a tree
  3. A forest with nn vertices and kk components has n−kn-k edges
  4. The complete graph KnK_n has (n2)=n(n−1)2\binom{n}{2} = \frac{n(n-1)}{2} edges, so an MST removes n(n−1)2−(n−1)=(n−1)(n−2)2\frac{n(n-1)}{2} - (n-1) = \frac{(n-1)(n-2)}{2} edges
Remark

This relationship makes trees maximally sparse connected graphs: removing any edge disconnects them, and adding any edge creates a cycle. The formula ∣E∣=∣V∣−1|E| = |V| - 1 provides a quick check for tree identification. In computational complexity, many tree algorithms achieve O(n)O(n) time precisely because trees have linear edge count. The sparsity also makes trees amenable to dynamic programming: many optimization problems have recurrence relations on trees that exploit their recursive decomposition at any edge.