10

I was studying graph neural networks with this blog and came across a part where it states that if we want to row-normalize the adjacency matrix of a graph, then we multiply the inverse degree matrix to it as such:

$$A \rightarrow D^{-1}A$$

I’ve tried this myself with a toy example, and this does render the rows of the adjacency matrix $A$ to sum to $1$.

Perhaps this is due to my lack of understanding of basic graph theory, but why is this so? Is there a particular relationship between the degree and adjacency matrices of graphs?

Thanks in advance.

Sean
  • 1,537
  • This question can be more or less relevant: https://math.stackexchange.com/questions/1113467/why-laplacian-matrix-need-normalization-and-how-come-the-sqrt-of-degree-matrix – JoyfulPanda Aug 15 '24 at 23:45

1 Answers1

7

Row $i$ of $A$ contains $1$'s in columns $j$, where node $i$ is connected to node $j$, everywhere else it has zeros. So the sum of the row is exactly the number of edges of node $i$. Now $D$ is a diagonal matrix which contains in entry $(i, i)$ exactly the number of edges of node $i$. So if you compute $D^{-1} A$, you effectively multiply each row of $A$ with the inverse of its sum.

blat
  • 1,060