Papers
Topics
Authors
Recent
Search
2000 character limit reached

GraphK: Variable-Size Graph Generation with Efficient Edge Construction

Published 19 Aug 2026 in cs.LG | (2608.18777v1)

Abstract: Graph generation models have advanced significantly with deep learning, yet they remain limited in scalability, flexibility, and ability to model underlying structures. We present GraphK, a novel encoder-sampler-decoder framework for graph generation that overcomes these challenges through structural flexibility and computational efficiency. Unlike autoregressive approaches constrained by vocabulary size (i.e. number of nodes in graph generation), GraphK allows for both upscaling (generating graphs with more nodes than the input) and downscaling, providing a flexible control over output graph size. By learning permutation-invariant latent representations and sampling new node embeddings via maximum likelihood estimation, GraphK generalizes across graph sizes and structures. For edge generation, we employ edge prediction with a KDTree-based top-k neighbor search in the latent space, reducing computational cost. Based on the manifold smoothness assumption, our method effectively captures graph properties. Experiments on synthetic and real-world datasets show that GraphK outperforms existing methods, accurately learns graph structures, and generates synthetic graphs without explicit definitions.

Summary

  • The paper introduces GraphK, an encoder–sampler–decoder framework that combines permutation-invariant node embeddings, Gaussian mixture sampling, and KDTree-based top-k edge construction to generate graphs of arbitrary size.
  • GraphK reduces decoding complexity to O(N log N), generates graphs with up to 50,000 nodes in under 10 seconds, and achieves 52% lower spectral MMD than GRAN on 400–500-node protein graphs.
  • GraphK preserves community structure, supports 10× upscaling and downscaling, and produces heavy-tailed degree distributions, but its latent-space smoothness assumption can miss non-local edges and struggles with grid-like graphs.

Overview

GraphK, introduced by Tugay, Olug, Ak, and Gunduz Oguducu (2608.18777), is a graph generation framework built on an encoder–sampler–decoder architecture that targets three persistent limitations of deep generative graph models: sensitivity to node ordering, restricted scalability in output size, and high computational cost. The framework encodes an input graph into permutation-invariant node embeddings (via Node2Vec or VGAE), fits a Gaussian Mixture Model (GMM) to those embeddings via maximum likelihood estimation, samples an arbitrary number of new embeddings from the fitted mixture, and reconstructs edges using a KDTree-based top-kk nearest neighbor search in latent space. The result is a lightweight generator whose decoding cost scales as O(NlogN)O(N \log N) rather than the quadratic cost of exhaustive pairwise edge prediction, and which explicitly supports both upscaling and downscaling of generated graphs relative to training inputs.

Motivation and positioning

The authors frame GraphK against three families of prior work. VAE-based methods such as GraphVAE decode full adjacency matrices of size Nmax2N_{\max}^2 and are effectively limited to graphs of 20–30 nodes; Graphite and JT-VAE improve on this but retain factorized decoders that struggle with complex dependencies. Autoregressive models—GraphRNN, DeepGMG, GRAN, BiGG—generate graphs sequentially and capture richer dependencies, but depend on node ordering (GRAN only approximates invariance by marginalizing over sampled orderings) and incur sequential or quadratic costs. Diffusion-based methods (EDP-GNN, GDSS, DiGress, Pard) achieve strong sample quality with permutation invariance but remain computationally heavy and have been demonstrated mainly on graphs of at most a few hundred nodes. The paper's comparison table positions GraphK as the only method in its survey combining full node-order invariance, low per-graph complexity, and explicit upscaling capability.

A notable theoretical contribution is the paper's discussion of exchangeability. By the Aldous–Hoover theorem, fully exchangeable projective graph models are conditionally independent-edge (graphon-like) models, which are almost surely dense unless edge probabilities are artificially downscaled—a downscaling that destroys realistic higher-order structure such as power-law degrees. GraphK takes what the authors describe as a pragmatic route: it is permutation-invariant at the embedding level but deliberately departs from the fully exchangeable regime by enforcing locality through asymmetric kk-NN selection in latent space. Because many nodes may select the same target, hubs can emerge despite each node emitting at most kk edges, yielding O(kn)O(kn) sparse graphs capable of reproducing heavy-tailed degree distributions.

Method

Encoder. The encoder maps a graph G=(V,E)G=(V,E) to latent embeddings Z={z1,,zN}\mathcal{Z}=\{z_1,\dots,z_N\}, ziRdz_i \in \mathbb{R}^d. The implementation supports shallow embeddings (Node2Vec, the default) and neural encoders (VGAE with GCN-parameterized Gaussian posteriors), and is modular with respect to any embedding technique; node features can be incorporated when available.

Sampler. A GMM with KK components is fit to the encoded embeddings via Expectation–Maximization. Generation proceeds by sampling a component according to the mixing weights and drawing embeddings from the corresponding Gaussian. Because the sampler operates on a continuous parameterized distribution rather than a discrete vocabulary, the number of generated nodes is decoupled entirely from training-set sizes—the mechanism underlying upscaling and downscaling. For graphs without clear community structure, the authors use a Variational Bayesian GMM to infer the component count automatically.

Decoder. Edges are formed under a manifold smoothness assumption: nodes close in Euclidean latent distance are likely connected. For each node, the top-O(NlogN)O(N \log N)0 neighbors are retrieved via a KDTree over the sampled embeddings (O(NlogN)O(N \log N)1 construction, O(NlogN)O(N \log N)2 queries), where O(NlogN)O(N \log N)3 is set to the mode of the input graph's degree distribution. Maximum degree is not capped at O(NlogN)O(N \log N)4, since inbound selections are unbounded. An optional learnable edge decoder (a two-layer binary classifier over Hadamard product, L1/L2 distances, and element-wise averages) refines candidate edges, with fine-tuning of encoder embeddings at a small learning rate (O(NlogN)O(N \log N)5); this mitigates the loss of inter-community edges when the encoder clusters communities tightly.

Empirical results

Evaluation uses MMD distances over Laplacian spectra, orbit counts, and motif distributions against ER, BA, GraphVAE, GraphRNN, NetGAN, BiGG, DiGress, and Pard on synthetic 2-block/3-block community graphs, protein contact graphs (918 graphs, 100–500 nodes), and CiteSeer (2,120-node largest component). Key findings:

Dataset GraphK strengths Notes
2-block community Best orbit (0.250) and motif (0.233) scores NetGAN attains lowest spectral score
Protein Spectral score 0.032, tied best with DiGress/Pard Pard slightly better on orbit/motif
CiteSeer Orbit 0.2511, beats BiGG and NetGAN GraphRNN, DiGress, Pard fail with OOM

On CiteSeer, all three of GraphRNN, DiGress, and Pard run out of memory during training, while GraphK completes—direct evidence for the scalability claim at moderate scale. Visual comparisons indicate GraphK preserves protein backbone structure better than GraphRNN, attributed to permutation invariance.

Permutation-invariance stress test. Using protein graphs partitioned into four size groups (100–500 nodes), GraphK is compared against GRAN under Laplacian-spectrum MMD. GRAN performs marginally better below 300 nodes (~15% lower spectral MMD), but beyond 300 nodes GRAN's spectral MMD degrades sharply (from O(NlogN)O(N \log N)6 to O(NlogN)O(N \log N)7), whereas GraphK achieves 52% lower spectral MMD than GRAN at 400–500 nodes. This crossover supports the hypothesis that order-sensitivity penalties grow with graph size.

Large-scale generation. Trained on a 10,000-node/~21,000-edge graph (Node2Vec encoding took ~6 minutes; GMM fitting 1.46 seconds), GraphK generates graphs up to 50,000 nodes in under 10 seconds of decoding time. The authors report BiGG's inference times as ~7 minutes for 10,000 nodes and ~20 minutes for 50,000 nodes, making GraphK's dot-product decoder 120× faster than BiGG at 50,000 nodes. This comparison relies on figures quoted from BiGG's own paper rather than re-measured under identical conditions, and it applies specifically to the dot-product decoder; a learnable neural decoder adds a constant-factor overhead per forward pass.

Upscaling/downscaling. On a three-block SBM graph with communities of roughly 200/100/100 nodes, GraphK upscales by a factor of 10 while preserving relative community sizes, then downscales back to the original scale retaining structural properties. The authors note practical relevance for privacy-preserving social network publication, traffic simulation, and data augmentation.

Additional ablations. A HOPE-encoder variant demonstrates directed graph generation by maintaining separate source/destination GMMs and matching O(NlogN)O(N \log N)8 against O(NlogN)O(N \log N)9 for outgoing-neighbor retrieval. On Gnutella05 (Nmax2N_{\max}^20), with Nmax2N_{\max}^21, generated graphs exhibit clear power-law-like degree distributions with hub degrees up to 54, confirming that asymmetric Nmax2N_{\max}^22-NN selection produces heavy tails despite fixed out-degree proposals. Finally, GMM-sampled embeddings used to augment a node classification task on CiteSeer improve XGBoost accuracy by 2% to 10% over the unaugmented baseline.

Limitations and open questions

The paper concedes two principal limitations. First, the decoder rests on the smoothness assumption: important edges between dissimilar nodes fall outside top-Nmax2N_{\max}^23 retrieval and are systematically missed. Relaxing this assumption or adding mechanisms that recover non-local connections remains open. Second, because embeddings preserve local structure, proximity-based reconnection reproduces similar topology and struggles with regular geometries such as grid or line graphs—an acknowledged blind spot that also constrained their choice of permutation-invariance test datasets (grid graphs were excluded for exactly this reason). Additional caveats worth noting: the number of GMM components must be chosen manually for community-structured graphs (VBGMM mitigates but does not eliminate this); the 120× speedup claim depends on cross-paper timing comparisons and the dot-product decoder; and the empirical evaluation of quality metrics covers graphs up to a few thousand nodes, with large-scale experiments assessed primarily through visual inspection and runtime rather than spectral/orbit/motif MMD.

Conclusion

GraphK offers a simple, computationally efficient alternative to autoregressive and diffusion-based graph generators: permutation-invariant structural embeddings, GMM-based sampling that decouples output size from training data, and KDTree-accelerated Nmax2N_{\max}^24-NN edge construction yielding near-linear generation cost. Its strongest demonstrated results are the 52% spectral-MMD advantage over GRAN on larger protein graphs, sub-10-second generation of 50,000-node graphs, preserved community proportions under 10× upscaling, and emergent power-law degrees on Gnutella05. The framework's dependence on the latent-space smoothness assumption and its difficulty with grid-like structures define the boundaries of these claims and the most direct questions for subsequent work.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Tweets

Sign up for free to view the 1 tweet with 0 likes about this paper.