Why graphs need their own networks
Standard networks assume fixed grids or sequences. But social networks, molecules, and recommendation graphs are irregular: nodes have varying numbers of neighbors and no natural order. Graph neural networks, or GNNs, are built to learn directly on this structure.
The core idea
A GNN learns a vector for each node by aggregating information from its neighbors. Each layer lets a node gather a summary of its neighbors and combine it with its own features. Stack two layers and a node sees its two hop neighborhood.
What a layer does
- Message: each neighbor sends its current vector, possibly transformed.
- Aggregate: combine incoming messages with a permutation invariant function like sum or mean.
- Update: mix the aggregate with the node own vector to produce the next layer vector.
What you get
The final node vectors capture both features and structure. They feed downstream tasks: classify a node, predict a missing edge, or classify a whole graph. Popular variants include graph convolutional networks, GraphSAGE, and graph attention networks.
Key idea
Graph neural networks learn node vectors by aggregating neighbor information layer by layer, capturing both features and graph structure.