Structural Node Embeddings with Homomorphism Counts

Hinrikus Wolf, Luca Oeljeklaus, Pascal Kühner, Martin GrohearXiv 2023 · DOI

Researchers at RWTH Aachen University have introduced a theoretically grounded and highly interpretable framework for graph machine learning. By shifting focus from "black-box" neural architectures toward classical graph theory, the authors demonstrate how counting structural patterns can produce competitive node embeddings that are inherently explainable.

Introduction

In contemporary graph machine learning, state-of-the-art models like Graph Convolutional Networks (GCNs) or Graph Attention Networks (GATs) typically generate node embeddings through iterative message passing. While effective, these embeddings are often difficult to interpret; it is challenging to pinpoint exactly which structural properties led to a specific classification.

This research addresses the need for explainable structural embeddings by leveraging the theory of graph homomorphisms. By counting how many ways small patterns (like trees or cycles) can be mapped onto a node's neighborhood, the framework creates features where every dimension has a clear structural origin—for instance, representing the number of 4-cycles passing through a specific node.

Methodology

The core approach involves counting mappings from a small "left-hand" pattern graph $H$ to a larger "right-hand" data graph $G$, ensuring a designated root $r$ in $H$ maps to the target node $v$ in $G$.

Figure 5: Illustration of homomorphism counts for different patterns $H$ (a triangle and a path) rooted at $r$ mapping to nodes $v$ and $v'$ in a graph $G$.

To maintain computational efficiency and avoid #P-complete complexity, the authors restrict patterns to classes with low treewidth, such as trees, binary trees, cycles, and paths. Furthermore, to incorporate node features (e.g., word vectors in citation networks), they introduce homomorphism tensors. Instead of a simple count, these tensors compute a weighted sum where weights are the products of the features of the nodes involved in the mapping. This allows the model to capture both structural and attribute-based information simultaneously.

Experimental Evaluation

The framework was evaluated on several standard benchmarks, including citation networks (Cora, Citeseer, OGBN-Arxiv) and synthetic benchmarks (DGL-Cluster, DGL-Pattern) designed to test community structure recognition. Because the resulting features are explicit counts of known structures, the authors utilized interpretable downstream classifiers like Random Forests and SVMs, creating a fully transparent end-to-end pipeline.

Results and Discussion

The experiments revealed that counting trees is theoretically equivalent to the 1-dimensional Weisfeiler-Leman (1-WL) test, defining the upper limit of standard GNN expressivity. However, counting cycles allows the model to capture spectral information that standard GNNs often fail to detect.

Figure 6: Performance comparison of various structural embeddings against standard GNN baselines across three citation datasets.

As shown in the results table, the "Tensor" approach—incorporating node labels into the counting process—was a primary driver of performance. On the Cora dataset, "Tensor Cycles" achieved an accuracy of 85.9%, outperforming standard GCNs (80.1%) and GATs (83.0%). While these methods do not always beat the absolute state-of-the-art neural architectures, they remain consistently competitive while providing significantly higher transparency.

Conclusion

This framework demonstrates that structural node embeddings based on homomorphism counts offer a viable, explainable alternative to traditional GNNs. While scalability on large, dense graphs like OGBN-Arxiv remains a challenge due to the computational cost of counting larger patterns, future work involving GPU-based parallelization and more complex graph classes may further bridge the gap between interpretability and performance.

Summary updated

BibTeX
@misc{wolf2023structural,
  author = {Hinrikus Wolf and Luca Oeljeklaus and Pascal Kühner and Martin Grohe},
  title = {{Structural Node Embeddings with Homomorphism Counts}},
  year = {2023},
  eprint = {2308.15283},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2308.15283},
}
Figure