I’ve mentioned the Moore-Penrose pseudoinverse of a matrix a few times, most recently last week. This post will give an application of the pseudoinverse: computing effective graph resistance.
Given a graph G, imagine replacing each edge with a one Ohm resistor. The effective resistance between two nodes in G is the electrical resistance between those the two nodes.
Calculating graph resistance requires inverting the graph Laplacian, but the graph Laplacian isn’t invertible. We’ll resolve this paradox shortly, but in the mean time this sounds like a job for the pseudoinverse, and indeed it is.
The graph Laplacian of a graph G is the matrix L = D − A where D is the diagonal matrix whose entries are the degrees of each node and A is the adjacency matrix. The vector of all 1’s
1 = (1, 1, 1, …, 1)
is in the null space of L but if G is connected then the null space is one dimensional. More generally, the dimension of the null space equals the number of components in G.
Calculating graph resistance requires solving the linear system
Lw = v
where v and w are orthogonal to 1. If the graph G is connected then the system has a unique solution. The graph Laplacian L is not invertable over the entire space, but it is invertable in the orthogonal complement to the null space.
The Moore-Penrose pseudoinverse L+ gives the graph resistance matrix. The graph resistance between two nodes a and b is given by
Rab = (ea − eb)T L+ (ea − eb)
where ei is is the vector that has all zero entries except for a 1 in the ith slot.
For more on graph resistance see Effective graph resistance by Wendy Ellens et al.
More spectral graph theory posts
- Measuing graph connectivity with eigenvalues
- Adding an edge increases eigenvalues
- Can you hear the shape of a network?
The post Effective graph resistance first appeared on John D. Cook.