5 ms·
Graph theory offers one nice illustration of the transpose (for square matrices). Here's a directed graph: ⬐---------¬ n₁ → n₂ → n₃ It can be represented
by macawfish 9y ago
Graph theory offers one nice illustration of the transpose (for square matrices). Here's a directed graph:
⬐---------¬
n₁ → n₂ → n₃
It can be represented by this adjacency matrix:
X = [ 0 1 0 ]
[ 0 0 1 ]
[ 1 0 0 ]
See how there is a 1 for each row i and column j where there is an edge from node i to node j?
Okay, now look at the transpose, Xᵀ:
Xᵀ = [ 0 0 1 ]
[ 1 0 0 ]
[ 0 1 0 ]
If we interpret this matrix as an adjacency matrix, its graph looks like this:
⬐---------¬
n₃ → n₂ → n₁
Taking the transpose of a directed graph's adjacency matrix just reverses the direction of the edges!
P.S: some more cool things about adjacency matrices:
Imagine that a vector represents a node or set of nodes on a graph. Like this:
n₁ = [ 1 ], n₂ = [ 0 ], n₃ = [ 0 ],
[ 0 ] [ 1 ] [ 0 ]
[ 0 ] [ 0 ] [ 1 ]
Watch what happens when we multiply X with n₁:
X*n₁ = [ 0 0 1 ] [ 1 ] [ 0 ]
[ 1 0 0 ] * [ 0 ] = [ 1 ] = n₂
[ 0 1 0 ] [ 0 ] [ 0 ]
So the adjacency matrix is not only an index of edges, it's also a little machine that can push nodes around on a graph. You can even do it with two at a time:
X*(n₁ + n₂) = [ 0 0 1 ] [ 1 ] [ 0 ]
[ 1 0 0 ] * [ 1 ] = [ 1 ] = n₂ + n₃
[ 0 1 0 ] [ 0 ] [ 1 ]
If you're interested in diving further into algebraic representations of graphs, check out the Leavitt Path algebra: https://arxiv.org/abs/1410.1835 https://arxiv.org/abs/1410.1835
- thethirdone 9y agoNotably adjacency matrices are orthogonal so A^T = A^-1. This extends to probabilistic transitions as well.
- macawfish 9y agoWell, the adjacency matrix I used as an example is orthogonal, but they don't have to be. Any matrix with 1's and 0's can be interpreted as an unweighted adjacency matrix for an undirected graph (if the matrix is symmetric) or directed graph (if it's not symmetric). For example, here's an adjacency matrix that's not an orthogonal matrix: [ 1 0 ] [ 1 1 ]