Trees

Trees

Kai-Jie Lin Lv3

Trees

Definition 3.1

  • acyclic: if there are no cycles or circuits in the graph.
  • tree: acyclic and connected.
  • forest: acyclic graph.
  • leaf: vertex with degree 1.

Spanning Trees

Definition 3.2

A spanning tree is a spanning subgraph that is also a tree.

Definition 3.3

  • Given a weighted graph G=(V,E,w)G=(V,E,w), TT is a minimum spanning tree, or MST, of Gifitisaspanningtreewithleasttotalweight.G if it is a spanning tree with least total weight.

Kruskal’s Algorithm

  • Just sort all weighted edges and pick the one with least weight until the graph connected and without any cycle.

Prim’s Algorithm

  • Randomly pick a root. Add the least weight edge that incident to root. Then find the least weight edge among all edge that incident to the endpoint of TT until TT cotain all vertex and connected.

Tree Properties

Theorem 3.4

Every tree with at least two vertices has a leaf.

Theorem 3.6

A tree with nn vertices has n1n-1 edges n1\forall n\ge 1.

Theorem 3.11

Let TT be a graph with nn vertices.

TT is a tree.
    \iff TT is acyclic and contain n1n-1 edges.
    \iff TT is connected and contain n1n-1 edges.
    \iff There is a unique path between every pair of distinct vertice in TT.
    \iff TT is acyclic and for any edge ee from TT, T+eT+e contains exactly one cycle.

Tree Enumeration

Definition 3.13

Given a tree TT on n>2n \gt 2 vertices(labeld 1,2,…,n), the Prufer sequence of TT is a sequence (s1,s2,...,sn2)(s_{1},s_{2},...,s_{n-2}) of length n2n-2 defined as follows:

  • Let l1l_{1} be the leaf of TT with the smallest label.
  • Define T1T_{1} to be Tl1T-l_{1}.
  • For each i1i\ge 1, define Ti+1=Tili+1T_{i+1}=T_{i}-l_{i+1}, where li+1l_{i+1} is the leaf with the smallest label of TiT_{i}.
  • Define sis_{i} to be the neighbor of lil_{i}.
Comments