Graph generation by sequential edge prediction

Davide Bacciu, Alessio Micheli, Marco Podda

Introduction

Generating realistic graphs is a fundamental challenge in domains ranging from drug discovery to social network analysis. Unlike continuous data, graphs are discrete structures with exponential complexity: a graph with $N$ nodes has $2^{N(N-1)}$ possible undirected configurations. Furthermore, standard deep learning techniques, which rely on back-propagation through continuous spaces, struggle with the "all-or-nothing" nature of edges. Finally, evaluating graph quality is non-trivial, as there is no single universal metric for "graph quality."

This paper proposes a novel approach that transforms graph generation into a sequence prediction problem. By using two cooperating Recurrent Neural Networks (RNNs) to predict edges sequentially, the authors circumvent the need for complex graph-native architectures while achieving state-of-the-art results.

Methodology: Sequential Edge Prediction

The core innovation lies in representing a graph $G$ as an ordered sequence of edges. To achieve a consistent representation, the authors apply a labeling function based on a Breadth-First Search (BFS) tree. This orders nodes by their discovery time, and edges are then sorted lexicographically (e.g., $(0,1)$ before $(0,2)$).

The generation process is decomposed into two steps handled by Gated Recurrent Units (GRUs):

  • Network 1 (Source Prediction): This network learns the sequence of the first elements in the edge pairs, effectively deciding which node will serve as the "source" for the next set of connections.
  • Network 2 (Target Prediction): Conditioned on the output of the first network, this GRU predicts the "target" node to complete the edge.
The two-network architecture: Network 1 predicts source nodes, while Network 2 predicts target nodes to form the edge sequence.

By maintaining a latent representation of the graph's connectivity as it is built edge-by-edge, the model captures complex structural dependencies. During training, "teacher forcing" is used to stabilize learning, while inference involves sampling from the predicted probability distributions.

Experimental Setup

The model was evaluated on five diverse datasets to ensure robustness across different structural patterns:

  1. Ladders: Synthetic ladder-shaped graphs.
  2. Community: Synthetic graphs with two dense, weakly connected clusters.
  3. Ego: Real-world citation network subsets from Citeseer.
  4. Enzymes & Proteins: Real-world protein structures.

Performance was measured using Kullback-Leibler Divergence (KL-D) to compare the degree distributions (DD) and clustering coefficients (CC) of generated graphs against the test sets.

Results and Analysis

The sequential approach proved remarkably effective, often outperforming both classical graph theory models and more complex deep learning architectures.

Comparative performance metrics (DD and CC) across Ladders, Community, and Ego datasets. Lower values indicate better alignment with the ground truth.

Key findings include:

  • Superiority over Baselines: The model outperformed Erdős-Rényi (E-R) and Barabási-Albert (B-A) models by several orders of magnitude in most metrics.
  • State-of-the-Art Performance: The model achieved the best scores on the Ladders, Enzymes, and Ego datasets, performing comparably to the more complex GraphRNN on others.
  • Efficiency: The model is computationally feasible; for instance, training on the Enzymes dataset took approximately 2 hours and 45 minutes.

The results suggest that imposing a specific order (via BFS) allows standard RNNs to treat graph generation like language modeling, capturing intricate structural patterns without specialized graph-native layers.

Limitations and Future Work

While successful, the authors note several avenues for future research. The choice of node ordering (BFS) is critical and may introduce biases. Additionally, the current model focuses solely on topology; incorporating node features (e.g., atom types in molecules) is a necessary step for practical applications in chemistry. Finally, scaling the sequential edge prediction to massive networks with thousands of nodes remains an open challenge due to the resulting sequence lengths.

Summary updated

BibTeX
@inproceedings{bacciu2019graph,
  author = {Davide Bacciu and Alessio Micheli and Marco Podda},
  title = {{Graph generation by sequential edge prediction}},
  booktitle = {ESANN},
  year = {2019},
}
Figure