Discovering Graph Generation Algorithms

Mihai Babiac, Karolis Martinkus, Roger WattenhoferarXiv 2023 · DOI

Introduction

Recent advancements in graph generation have been dominated by deep generative models such as Variational Autoencoders (VAEs) and Graph Neural Networks (GNNs). While these models are capable of capturing complex statistical distributions, they often function as "black boxes," offering little insight into the underlying rules of connectivity. Furthermore, they frequently struggle with extrapolation—failing to generate perfect structures, like grids, when asked to produce graphs significantly larger than those encountered during training.

This research proposes a paradigm shift: moving from learning distributions to discovering symbolic algorithms. By treating graph generation as a program synthesis problem, the authors demonstrate that evolutionary search can uncover interpretable Python programs that generate graphs with perfect generalization capabilities.

Algorithmic Program Synthesis

Instead of training a neural network to output an adjacency matrix, the system evolves Python functions that construct graphs step-by-step. These programs are represented as "code trees" that utilize nested loops to iterate over nodes and potential neighbors, combined with conditional logic and edge-manipulation commands like add_edge and remove_edge.

The representation of a graph-generating program as Python code, a code tree, and compiled bytecode.

To ensure computational efficiency during the millions of evaluations required for evolution, these code trees are compiled into a custom bytecode and executed within a highly optimized C++ framework. This approach allows the search to explore a vast space of potential algorithms while maintaining the interpretability of the final output.

Evolutionary Search and Fitness

The discovery process relies on evolutionary search, starting with empty programs and applying mutations such as line insertions, deletions, and variable changes. To guide this search, the authors employ a fitness function based on Maximum Mean Discrepancy (MMD), comparing the output of evolved programs to a target dataset.

A key technical innovation is the use of a randomly initialized, untrained Graph Isomorphism Network (GIN) as a feature extractor for the MMD calculation. This avoids the need for a pre-trained discriminator, leveraging the inherent structural encoding capabilities of the GNN architecture to distinguish between different graph topologies.

Results and Generalization

The method was evaluated on synthetic grid graphs, lobster graphs, and real-world protein graphs.

  • Interpretability: The evolved algorithms are human-readable. For grid graphs, the discovered logic clearly identifies the relationship between a node and its neighbors based on the grid's width.
  • Perfect Generalization: When provided with structural hints (like the width of a grid), the evolved algorithms achieved ideal extrapolation. Unlike deep learning models, these symbolic programs can generate perfect grids of any size, far exceeding the dimensions of the training data.
  • Complexity Limits: While successful on structured synthetic data, the method faced challenges with complex biological structures like protein graphs. The vast search space of possible algorithms makes it difficult to capture the full irregularity of real-world data without additional domain-specific primitives.
A complex graph structure representing the type of intricate biological data the method aims to model.

Conclusion

By evolving symbolic programs rather than training black-box models, this research highlights a path toward more interpretable and generalizable graph generation. While search scalability remains a challenge for highly complex graphs, the ability to discover the "true" generative logic of a structure represents a significant step forward in algorithmic discovery. Future work may involve expanding the library of primitives and exploring attributed graphs to further bridge the gap between symbolic search and real-world complexity.

Summary updated

BibTeX
@misc{babiac2023discovering,
  author = {Mihai Babiac and Karolis Martinkus and Roger Wattenhofer},
  title = {{Discovering Graph Generation Algorithms}},
  year = {2023},
  eprint = {2304.12895},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2304.12895},
}
Figure