Message passing is the core mechanism through which a graph neural network builds context-aware node representations. Each atom or protein residue starts with a feature vector, then repeatedly receives messages from neighboring nodes, aggregates them, and updates its own vector. section 11.4 section 11.8
A message-passing round follows three steps:
- Form a message from each node connected by an edge. section 11.4
- Aggregate messages with a permutation-invariant operation such as a sum or mean, so neighbor ordering does not affect the result. section 11.4
- Update the node vector using the aggregate and its current value; stacking k rounds propagates information across k edges. section 11.4
Molecular and protein graphs
For drug-target affinity prediction, atoms and residues provide initial node features, while bonds or structural proximity provide edges. In PyTorch Geometric, node features occupy x, edges occupy edge_index with source and target rows, and optional edge features occupy edge_attr. These tensors support variable-sized graph batching. section 11.4 section 11.8
Use the GCN update equation to connect neighbor aggregation, self-information, learned weights, and the activation function. section 11.4












