DeepGD: A Deep Learning Framework for Graph Drawing Using GNN

Xiaoqi Wang, Kevin Yen, Yifan Hu, Han-Wei Shen

Introduction

Graph drawing is a fundamental task in data visualization, involving the placement of nodes and edges to maximize network readability. Traditional methods, such as force-directed algorithms (e.g., Graphviz's "neato") or dimensionality reduction techniques (e.g., t-SNE), often struggle with two primary challenges: balancing conflicting aesthetic criteria and generalizing to diverse, unseen graph structures. DeepGD is a novel deep learning framework that addresses these hurdles by using Convolutional Graph Neural Networks (ConvGNNs) to generate high-quality layouts that generalize across various graph topologies.

Methodology

DeepGD is built upon a ConvGNN architecture designed for end-to-end aesthetic optimization. Unlike previous machine learning models that attempt to mimic existing algorithms, DeepGD optimizes aesthetic metrics directly through its loss function.

Architecture and Virtual Edges

To provide the model with global awareness of the graph layout, DeepGD incorporates "virtual edges" between all pairs of nodes, effectively treating the input as a complete graph. Edge features are used to encode the original graph-theoretic distances, ensuring the model retains structural information while allowing information to flow between distant nodes.

DeepGD architecture overview showing the input, residual, and output blocks.

The backbone of the network consists of residual blocks with skip connections. These blocks incorporate "iterative" features, such as current node distances and directions, mimicking the iterative updates found in classical stress majorization algorithms. This design allows the GNN to function as a learnable iterative solver.

Multi-Objective Optimization

DeepGD optimizes a composite loss function that accounts for multiple aesthetic goals, including Stress (matching layout distances to graph-theoretic distances), Minimum Angle, Edge Length Variation, and Node Occlusion. To manage these often-conflicting objectives, the authors implemented adaptive training strategies: Adaptive Weight normalizes losses based on their numerical scales, while SoftAdapt by Importance dynamically adjusts weights based on the rate of improvement for each metric.

Experimental Results

The model was trained primarily on the Rome Graphs dataset and evaluated on its ability to generalize to unseen structures and larger graphs from the SuiteSparse Matrix Collection.

Performance and Aesthetics

DeepGD demonstrates significant improvements over industry-standard baselines. When optimized for stress alone, it outperformed Graphviz (neato) by 5.43%. More impressively, when balancing stress and angular resolution, DeepGD improved the minimum angle by over 22% compared to Graphviz while maintaining competitive stress levels.

Visual comparison of graph layouts between DeepGD and baseline methods.

Efficiency and Generalization

A key advantage of DeepGD is its inference speed. Once trained, the model can generate a layout for a typical graph in approximately 0.049 seconds, making it suitable for real-time applications. Furthermore, the model's success on test sets confirms its ability to learn general layout principles rather than simply memorizing training examples.

Discussion and Future Work

While DeepGD represents a significant step forward, certain limitations remain. The use of virtual edges results in $O(N^2)$ complexity, which poses challenges for scaling to massive graphs. Additionally, the model's performance on specific structures like star graphs is limited by the diversity of the training data. Future research will focus on improving scalability and exploring methods to automatically learn human aesthetic preferences from labeled data.

Summary updated

BibTeX
@article{wang2021deepgd,
  author = {Xiaoqi Wang and Kevin Yen and Yifan Hu and Han-Wei Shen},
  title = {{DeepGD: A Deep Learning Framework for Graph Drawing Using GNN}},
  journal = {IEEE Computer Graphics and Applications},
  year = {2021},
  doi = {10.1109/mcg.2021.3093908},
}
Figure