Skip to Content
Combinatorics

5. Cayley's Formula

2019-09-04Original-language archivelegacy assets may be incomplete
  • Cayley's formula: There are nn2n^{n-2} different trees on nn distinct vertices

Double Counting

  • Count: # of sequences of adding directed edges to an empty graph to form a rooted tree
    • From a Tree: Tnn(n1)!=n!TnT_nn(n-1)!=n!T_n
    • From an empty graph: k=0n2n(nk1)=nn2n!\prod_{k=0}^{n-2}n(n-k-1)=n^{n-2}n!

Prüfer code

  • encoder:
    • T1=TT_1=T
    • for i=1 to n-1
      • uiu_i: smallest leaf in TiT_i
      • (ui,vi)(u_i,v_i): edge in TiT_i
      • Ti+1=Ti\uiT_{i+1}=T_i\backslash u_i
    • return (v1,v2,,vn2)(v_1,v_2,\cdots,v_{n-2})
  • decoder:
    • T=,vn1=nT=\emptyset,v_{n-1}=n
    • for i=1 to n-1
      • uiu_i: smallest not in {u1,,ui1}{vi,,vn1}\{u_1,\cdots,u_{i-1}\}\cup\{v_i,\cdots,v_{n-1}\}
      • T={ui,vi}T\cup=\{u_i,v_i\}
    • return TT

Kirchhoff's Matrix-Tree Theorem

  • Adjacent matrix AA: Aij=[{i,j}E]A_{ij}=[\{i,j\}\in E]
  • Degree matrix DD: Dij=deg(i)[i=j]D_{ij}=\text{deg}(i)[i=j]
  • incidence matrix: Bn×mB_{n\times m}
B(i,e)={1e={i,j}i<j1e={i,j}i>j0o.w.B(i,e)=\begin{cases} 1 & e=\{i,j\}\wedge i<j\newline -1 & e=\{i,j\}\wedge i>j\newline 0 & o.w. \end{cases}
  • Laplacian matrix: L=DAL=D-A
    • xLxT=12ijE(xixj)2xLx^T=\frac{1}{2}\sum_{ij\in E}(x_i-x_j)^2
    • L=BBTL=BB^T
    • Li,i=BiBiTL_{i,i}=B_iB_i^T
  • Kirchhoff's Matrix-Tree Theorem
    • Li,iL_{i,i}: submatrix of LL obtained by removing the ith row and ith collumn
    • t(G)t(G): number of spanning trees in GG
    • i,t(G)=det(Li,i)\forall i,t(G)=\det(L_{i,i})
  • Cauchy-Binet Theorem
    • det(AB)=SC[m]ndet(A[n],S)det(BS,[n])\det(AB)=\sum_{S\in C_{[m]}^n}\det(A_{[n],S})\det(B_{S,[n]})
    • A[n],S{\displaystyle A_{[n],S}} and BS,[n]{\displaystyle B_{S,[n]}} denote, respectively, the n×n{\displaystyle n\times n} submatrices of AA and BB, consisting of the columns of AA, or the rows of BB, indexed by elements of SS
  • det(B[n]\{i},S)=±1\det(B_{[n]\backslash\{i\},S})=\pm 1 if SS is a spanning tree of GG o.w. 00
  • det(Li,i)=S([m]n1)det(C[n1],S)2.{\displaystyle {\begin{aligned}\det(L_{i,i})&=\sum _{S\in {[m] \choose n-1}}\det(C_{[n-1],S})^{2}.\end{aligned}}}