CoRe-GD: A Hierarchical Framework for Scalable Graph Visualization with GNNs

Florian Grötschla, Joël Mathys, Robert Veres, Roger Wattenhofer

Abstract

Graph visualization is a critical tool for interpreting complex relational data, yet achieving high-quality layouts for large-scale graphs remains a significant computational challenge. Traditional force-directed methods often struggle with local minima and scalability, while recent Graph Neural Network (GNN) approaches frequently hit a "scalability wall" due to $O(N^2)$ complexity or localized message-passing. This paper introduces CoRe-GD (Coarsening and Rewiring Framework for Graph Drawing), a hierarchical framework that combines a coarse-to-fine optimization strategy with a novel positional rewiring technique. CoRe-GD achieves state-of-the-art stress minimization and scales to graphs with tens of thousands of nodes, maintaining sub-quadratic runtime where previous neural methods failed.

Introduction

Visualizing a graph as a node-link diagram is essential for understanding the underlying structure of complex systems. The primary objective in graph drawing is often the minimization of stress, a metric that measures how well the Euclidean distances between nodes in a 2D or 3D layout reflect their shortest-path distances in the graph.

Despite its importance, optimizing stress is computationally expensive. Classical algorithms like MDS or force-directed solvers often converge to poor local minima or fail to scale to large datasets. While GNNs offer a promising alternative by learning to predict node positions, they face a fundamental trade-off: local message-passing fails to capture global structure, while fully connected layers lead to $O(N^2)$ complexity, making them impractical for large graphs. CoRe-GD bridges this gap by introducing a hierarchical solver that maintains global context while leveraging the efficiency of GNNs.

The CoRe-GD Framework

CoRe-GD is built upon three core methodological pillars designed to ensure both visual quality and computational efficiency:

1. Hierarchical Optimization

Rather than attempting to position all nodes simultaneously, CoRe-GD employs a "coarse-to-fine" strategy. The framework constructs a hierarchy of increasingly simplified versions of the graph. Optimization begins at the coarsest level, where "supernodes" are positioned to establish a global skeleton. The model then iteratively "un-coarsens" the graph, refining the layout at each level to incorporate finer local details. This approach prevents the "tangled" layouts common in non-hierarchical methods by resolving the global structure before addressing local constraints.

2. Positional Rewiring

Standard GNNs are constrained by the input graph's topology, passing information only along existing edges. However, effective graph drawing requires nodes to account for their spatial proximity to avoid overlaps and resolve visual conflicts. CoRe-GD introduces Positional Rewiring, which dynamically adds temporary edges based on current node positions using K-Nearest Neighbors (KNN) or Delaunay Triangulations. This allows nodes to "communicate" based on their spatial location, enabling the model to push apart nodes that are visually close but graph-theoretically distant.

3. Scale-Invariant Training

To ensure the model generalizes across graphs of varying sizes, the authors utilize a scale-invariant stress loss. Furthermore, they implement a replay buffer—a technique typically found in Reinforcement Learning. This buffer stores intermediate embeddings, allowing the GNN to learn from multiple refinement rounds without the instability or memory overhead usually associated with deep recursive architectures.

Experimental Evaluation

The authors evaluated CoRe-GD against a wide array of benchmarks, including the Rome dataset (~11,500 graphs), molecular datasets (ZINC), and large-scale real-world graphs from the Suitesparse Matrix Collection. To test extreme scaling, the model was also applied to Random Delaunay Graphs with up to 25,000 nodes.

Performance and Scalability

CoRe-GD demonstrated superior performance in both quality and efficiency:

  • State-of-the-Art Quality: On the Rome benchmark, CoRe-GD achieved a mean stress of 233.17, outperforming previous neural leaders like DeepGD (235.22) and classical solvers like Neato.
  • Extended Scalability: While previous neural models often failed at approximately 5,000 nodes due to GPU memory limits, CoRe-GD successfully processed graphs with 25,000 nodes.
  • Visual Fidelity: Qualitative analysis shows that CoRe-GD is particularly effective at unfolding regular structures, such as grids and meshes, which often appear distorted in other neural approaches.

Discussion and Future Work

CoRe-GD represents a significant step forward in making GNN-based graph drawing practical for real-world applications. By achieving sub-quadratic complexity, it provides a scalable alternative to handcrafted heuristics.

However, some bottlenecks remain. Currently, the Delaunay triangulation used for rewiring is computed on the CPU, which limits the overall speed of the pipeline. Future work will focus on GPU-accelerated rewiring implementations. Additionally, the authors suggest that the latent embeddings generated by CoRe-GD—which inherently encode pairwise distances—could serve as powerful positional encodings for Graph Transformers and other downstream machine learning tasks.

Conclusion

CoRe-GD successfully integrates hierarchical optimization and dynamic spatial communication into a GNN framework. This combination allows for the generation of high-quality, low-stress layouts for large-scale graphs, overcoming the scalability limitations that have previously hindered neural graph drawing methods.

Summary updated

BibTeX
@inproceedings{grotschla2024core,
  author = {Florian Grötschla and Joël Mathys and Robert Veres and Roger Wattenhofer},
  title = {{CoRe-GD: A Hierarchical Framework for Scalable Graph Visualization with GNNs}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=vtyasLn4RM},
}
Figure