Graph Theory - Matrix-Tree Theorem



Matrix-Tree Theorem

The Matrix-Tree Theorem is a mathematical result that provides a way to calculate the number of spanning trees in a connected graph using its Laplacian matrix.

A spanning tree of a graph is a subset of the graph's edges that forms a tree, and it connects all the vertices together without any cycles. The theorem allows for the computation of the total number of spanning trees by performing a determinant calculation on the graph's Laplacian matrix.

Following are the important characteristics of the Matrix-Tree Theorem −

  • Laplacian Matrix: The Laplacian matrix is a square matrix derived from the adjacency matrix of the graph. It is used to represent the structure of the graph and contains information about the degree of each vertex and its connections to other vertices.
  • Spanning Trees Count: The theorem states that the number of spanning trees in a graph is given by the determinant of any cofactor of the Laplacian matrix. This determinant can be computed for practical use.

For example, to find the number of spanning trees in a graph, we first compute the Laplacian matrix of the graph, then choose any cofactor (a minor matrix obtained by removing one row and one column), and finally calculate the determinant of this cofactor. The resulting value gives the number of spanning trees for the graph.

Laplacian Matrix

Before diving into the Matrix-Tree Theorem, it is important to understand the Laplacian matrix of a graph, as it is central to the theorem.

The Laplacian matrix L of a graph is a square matrix that encodes the degree and adjacency information of the graph. For a graph with n vertices, the Laplacian matrix is an n n matrix defined as −

L = D - A

Where,

  • D is the degree matrix, a diagonal matrix where each entry represents the degree of the corresponding vertex.
  • A is the adjacency matrix, where each entry indicates whether two vertices are connected by an edge.

Example of a Laplacian Matrix

Consider the following undirected graph with 3 vertices (A, B, and C) and edges between A-B, B-C, and A-C −

  • Vertex A has degree 2 (edges A-B and A-C).
  • Vertex B has degree 2 (edges A-B and B-C).
  • Vertex C has degree 2 (edges A-C and B-C).

The adjacency matrix A and degree matrix D for this graph are −

Adjacency Matrix (A):
    A   B   C
A   0   1   1
B   1   0   1
C   1   1   0

Degree Matrix (D):
    A   B   C
A   2   0   0
B   0   2   0
C   0   0   2

The Laplacian matrix L is the difference between the degree matrix and the adjacency matrix −

Laplacian Matrix (L):
    A   B   C
A   2  -1  -1
B  -1   2  -1
C  -1  -1   2

Understanding the Matrix-Tree Theorem

The Matrix-Tree Theorem states that the number of spanning trees of a connected graph can be computed by evaluating the determinant of any cofactor of the Laplacian matrix of the graph.

Specifically, if we remove any row and the corresponding column from the Laplacian matrix and compute the determinant of the resulting matrix, the result will give the number of spanning trees.

Formulation of the Matrix-Tree Theorem

If G is a connected graph with Laplacian matrix L, and Ln-1,n-1 is the matrix obtained by deleting the n-th row and column from L, then the number of spanning trees of the graph is given by −

Number of Spanning Trees = det(L')

Where L' is the matrix formed by deleting any row and corresponding column from the Laplacian matrix L. This matrix is sometimes referred to as the reduced Laplacian matrix.

Co-factors of the Laplacian Matrix

The cofactor of a matrix is the signed determinant of the matrix that remains after removing one row and one column. The Matrix-Tree Theorem uses the cofactor of the Laplacian matrix to calculate the number of spanning trees in the graph.

Example of Matrix-Tree Theorem

Let us consider a simple graph with 3 vertices and 3 edges, as shown earlier. To find the number of spanning trees, we use the Laplacian matrix and remove one row and one column.

We start with the Laplacian matrix −

Laplacian Matrix (L):
    A   B   C
A   2  -1  -1
B  -1   2  -1
C  -1  -1   2

Now, we remove the third row and column (corresponding to vertex C), resulting in the following reduced matrix −

Reduced Laplacian Matrix (L'):
    A   B
A   2  -1
B  -1   2

The determinant of this matrix gives the number of spanning trees for the graph −

det(L') = (2)(2) - (-1)(-1) = 4 - 1 = 3

Thus, the graph has 3 spanning trees.

Generalization to Directed Graphs

In directed graphs, the Matrix-Tree Theorem can be extended by using the directed Laplacian matrix. The directed Laplacian incorporates both the in-degree and out-degree of each vertex, leading to a matrix that can be used to count spanning arborescences (directed spanning trees).

The number of spanning arborescences rooted at a particular vertex is given by the determinant of a cofactor of the directed Laplacian matrix.

Matrix-Tree Theorem for Multigraphs

The Matrix-Tree Theorem can also be extended to multigraphs, where multiple edges can exist between pairs of vertices.

In this case, the adjacency matrix and degree matrix need to be adjusted to account for multiple edges, but the core idea remains the same: the number of spanning trees can be computed using the cofactor of the Laplacian matrix.

Computational Complexity

Computing the determinant of a matrix, which is necessary for applying the Matrix-Tree Theorem, has a time complexity of O(n3) for a graph with n vertices. This makes the Matrix-Tree Theorem computationally feasible for graphs of moderate size but may be challenging for very large graphs. However, there are optimization techniques for specific types of graphs that can speed up the computation.

Advertisements