Graph Neural Networks for Graph Drawing

Matteo Tiezzi, Gabriele Ciravegna, Marco Gori · DOI

Abstract

This paper introduces Graph Neural Drawers (GND), a framework that leverages Graph Neural Networks (GNNs) to automate the creation of aesthetically pleasing graph layouts. By utilizing Laplacian Positional Encodings and a "Neural Aesthete"—a differentiable proxy for non-smooth criteria like edge crossings—GND enables efficient optimization of graph visualizations through standard backpropagation.

Introduction

Visualizing complex relational data through node-link diagrams is essential for data analysis, yet generating readable layouts remains computationally challenging. Traditional force-directed or energy-based models often require extensive manual tuning and struggle to scale. While recent approaches have moved toward optimizing smooth aesthetic functions like "stress" via gradient descent, many critical visual goals—such as minimizing edge crossings—are discrete and non-differentiable. Furthermore, standard GNNs often fail to distinguish between isomorphic nodes in non-attributed graphs, leading to collapsed layouts where multiple nodes occupy the same coordinates.

The GND Framework

The Graph Neural Drawer (GND) framework addresses these challenges by treating graph drawing as a node-focused regression task. To resolve node indistinguishability, the authors employ Laplacian Positional Encodings (PE). These features act as a local coordinate system, allowing the GNN to perceive a node's position within the global topology. The framework evaluates several GNN backbones, including Graph Convolutional Networks (GCN), Graph Attention Networks (GAT), and Graph Isomorphism Networks (GIN).

The Neural Aesthete

A key innovation of this work is the Neural Aesthete, a separate Multi-Layer Perceptron (MLP) trained to predict edge intersections based on endpoint coordinates. Because the Neural Aesthete is a neural network, it provides a differentiable proxy for the discrete "edge-crossing" metric. This allows the main GND model to optimize for layout "beauty" using standard gradients.

Qualitative impact of the Neural Aesthete (NA-CROSS) on graph layout optimization.

As shown in the qualitative results above, the Neural Aesthete (NA-CROSS) significantly improves layout clarity when combined with traditional stress-minimization losses, effectively reducing visual clutter compared to random starts or stress-only approaches.

Evaluation and Results

The models were benchmarked on the ROME dataset (11,000+ real-world graphs) and the SPARSE dataset (10,000 synthetic Erdos-Renyi graphs). GND models were tested on their ability to mimic existing layouts (Kamada-Kawai and Spectral) and minimize aesthetic losses.

Quantitative comparison of GND models against competitors using the Procrustes Statistic.

Quantitative analysis using the Procrustes Statistic (where lower is better) demonstrates that GND models, particularly the GAT variant, significantly outperform baseline competitors. Beyond accuracy, a trained GND can generate layouts for unseen graphs in a single forward pass, offering a substantial speed advantage over iterative solvers for large-scale applications. While trained on small graphs, the models generalized well to graphs with up to 2,000 nodes.

Conclusion

GND represents a significant step forward in automated graph drawing. By replacing manual heuristics with learnable, differentiable proxies, the framework achieves high-quality visualizations with improved scalability. Future work may extend the Neural Aesthete concept to other aesthetic criteria, such as angular resolution or community structure preservation.

Summary updated

BibTeX
@article{tiezzi2021graph,
  author = {Matteo Tiezzi and Gabriele Ciravegna and Marco Gori},
  title = {{Graph Neural Networks for Graph Drawing}},
  journal = {IEEE Trans. Neural Networks Learn. Syst.},
  year = {2021},
  doi = {10.1109/tnnls.2022.3184967},
}
Figure