Random Edge Coding: One-Shot Bits-Back Coding of Large Labeled Graphs

Daniel Severo, James Townsend, Ashish Khisti, Alireza MakhzaniarXiv 2023 · DOI

Abstract

Compressing massive, individual graphs presents a unique "one-shot" challenge where traditional entropy coding is often hindered by the arbitrary ordering of edges. We present Random Edge Coding (REC), a lossless compression framework that achieves theoretical optimality by treating edge permutations as a latent variable. By integrating bits-back coding via Asymmetric Numeral Systems (ANS) and a parameter-free Polya’s Urn model, REC provides a scalable, integer-arithmetic solution that matches the theoretical entropy limit for edge-invariant models. Our evaluation on large-scale social networks demonstrates that REC achieves near-zero gaps to optimality and outperforms state-of-the-art ad-hoc compressors.

Introduction

The compression of large-scale networks, such as social graphs or internet topologies, is fundamentally a "one-shot" problem. Unlike standard data streams where models can be learned over multiple instances, a single massive graph must be compressed efficiently without prior examples. A significant hurdle in this domain is that graphs are inherently unordered; however, standard entropy coding requires data to be sequenced. Existing "ad-hoc" compressors often rely on engineering heuristics to find patterns but lack a rigorous information-theoretic foundation.

Random Edge Coding (REC) bridges this gap by formalizing the compression process through the lens of latent variable modeling. By treating the specific sequence of edges as a hidden variable, REC utilizes bits-back coding to eliminate the overhead associated with storing an arbitrary order.

Methodology: Random Edge Coding

The core innovation of REC is the application of Bits-Back Coding to graph structures. In this framework, the compressor "decodes" a random permutation from the existing bitstream to determine the order in which edges are processed. This effectively uses the "randomness" already present in the compressed state to make choices, allowing the information to be "taken back" during the encoding process.

The Random Edge Coding (REC) process using bits-back coding to handle edge permutations.

REC employs an incremental sampling strategy where edges and vertices are sampled one by one without replacement. To assign probabilities to these edges, the authors utilize a Polya’s Urn model. This parameter-free model follows a "rich-get-richer" principle, where nodes with higher existing degrees are more likely to receive new connections—a characteristic common in real-world "hub" networks. Crucially, the algorithm is implemented using exact integer arithmetic, avoiding the numerical drift issues common in floating-point neural compressors.

Experimental Evaluation

The authors evaluated REC on several large-scale real-world networks from the SNAP and Network Repository collections, including social networks (YouTube, FourSquare, Digg, Gowalla) and topology/citation networks (Skitter, DBLP).

The results demonstrate that REC is theoretically optimal for any edge-permutation invariant model. As shown in the performance table, the gap between the actual compressed size and the theoretical minimum (Graph NLL) was 0.0% for nearly all datasets.

Performance of REC across various network datasets compared to theoretical optimal Graph NLL.

On the YouTube dataset (9.3M edges), REC achieved a compression rate of 15.19 bits-per-edge, surpassing established methods such as Pool Compression (15.38) and SlashBurn (17.03). The method scales quasi-linearly ($O(m \log m)$), making it practical for graphs with millions of nodes.

Conclusion

Random Edge Coding provides a robust, theoretically grounded approach to one-shot graph compression. By treating edge ordering as a latent variable and utilizing bits-back coding, REC achieves near-perfect efficiency relative to the underlying probabilistic model. While the current implementation uses a Polya’s Urn model, the REC framework is compatible with any edge-invariant model. Future work may involve integrating more sophisticated Graph Neural Networks (GNNs) to further improve compression ratios on diverse network topologies.

Summary updated

BibTeX
@misc{severo2023random,
  author = {Daniel Severo and James Townsend and Ashish Khisti and Alireza Makhzani},
  title = {{Random Edge Coding: One-Shot Bits-Back Coding of Large Labeled Graphs}},
  year = {2023},
  eprint = {2305.09705},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2305.09705},
}
Figure