A graph G=(V,E) is encoded as matrices so neural networks can process it. The adjacency matrix A∈Rn×n has Aij=1 if nodes i,j share an edge (arbitrary weights for weighted graphs); the degree matrix D=diag(d1,…,dn) is diagonal with di=∑jAij. GNNs first add self-loops A~=A+I and then apply symmetric normalization D~−1/2A~D~−1/2, whose element form is (D~−1/2A~D~−1/2)ij=d~id~jA~ij — it preserves feature scale through propagation and prevents high-degree nodes from dominating (a celebrity's representation is not drowned by its own magnitude). The graph Laplacian L=D−A (normalized L=I−D−1/2AD−1/2) satisfies xTLx=∑(i,j)∈E(xi−xj)2 with eigenvalues in [0,2], and is the starting point for spectral GCN. Tasks split into three levels: node-level (node classification), edge-level (link prediction), and graph-level (graph classification/property prediction).
💡Use Cases
the entry point for modeling non-Euclidean data — social networks, molecular property prediction, recommendation, knowledge graphs; in interviews it is the prerequisite layer of the GNN series, often requiring hand-writing adjacency/degree matrices and deriving the element form of symmetric normalization.
⚡Key Problems Solved
CNNs/Transformers assume regular grids or sequences and cannot handle arbitrary graph topology. The adjacency matrix encodes structure into tensors that participate in matrix multiplication; symmetric normalization D~−1/2A~D~−1/2 makes aggregation weights inversely related to degree (high-degree nodes are not amplified, low-degree nodes are not ignored) while bounding the spectrum for numerically stable multi-layer propagation — the direct foundation of the GCN/GAT propagation rules.
🎯5 High-Frequency Exam Points
1
Define the adjacency matrix A and degree matrix D (Aij, di=∑jAij); why is adding self-loops A~=A+I necessary for GNNs?
2
Derive the element form of symmetric normalization D~−1/2A~D~−1/2, i.e. d~id~jA~ij, and explain why it prevents high-degree nodes from dominating aggregation.
3
Properties of the graph Laplacian L=D−A and normalized Laplacian L=I−D−1/2AD−1/2: the quadratic form xTLx=∑(i,j)(xi−xj)2 and the eigenvalue range [0,2].
4
Name one example for each of the three graph task levels (node/edge/graph), and what are the prediction targets and typical loss forms?
5
How to extend the basic matrix representation: weighted graphs, directed graphs (non-symmetric A), heterogeneous graphs (multiple edge types), and sparse storage for billion-node graphs?