Compressing Graphs and Indexes with Recursive Graph Bisection

Laxman Dhulipala, Igor Kabiljo, Brian Karrer, Giuseppe Ottaviano, Sergey Pupyrev, Alon Shalita · DOI

Abstract

Graph reordering is a critical technique for enhancing the locality of graph representations, which is essential for efficient storage and processing in large-scale applications. This paper presents a unified, theoretically grounded approach to graph and index compression using recursive graph bisection. By reordering vertices to minimize a specific "logarithmic gap" cost function, we achieve significant improvements in compression ratios—up to 50% over standard methods. Our algorithm scales to process graphs with billions of vertices and hundreds of billions of edges, demonstrating its practical utility for modern web-scale datasets.

The Challenge of Massive Graph Storage

Modern digital ecosystems, from social networks to search engines, are built upon massive graphs. Storing these structures efficiently is a major engineering challenge. A common technique is delta-encoding: neighbors of a vertex (e.g., a user's friends or a term's associated documents) are sorted, and only the differences (gaps) between consecutive IDs are stored. Because smaller, more regular gaps require fewer bits, the efficiency of this method depends entirely on the IDs assigned to the vertices.

If "similar" vertices—those sharing many neighbors—are assigned distant IDs, the resulting gaps remain large and difficult to compress. Finding an optimal ordering to minimize these gaps is known as the Graph Reordering problem or the Document Identifier Assignment problem. Historically, these were treated as distinct challenges and addressed with heuristics that often lacked theoretical guarantees or failed to scale to the massive datasets encountered at companies like Facebook or Google.

A Unified Model for Compression

The researchers propose a unified framework called Bipartite Minimum Logarithmic Arrangement (BiMLogA). This model treats data as a bipartite graph consisting of "queries" (such as search terms or users) and "data" (such as documents or friends).

Comparison of the original graph structure with the MLogA and MLogGapA bipartite models used for optimization.

By modeling both search indexes and social graphs as bipartite structures, the authors created a single optimization tool that outperforms specialized heuristics in both domains. They also provide a theoretical "anchor" by proving that the Minimum Logarithmic Gap Arrangement (MLogGapA) problem is NP-hard, resolving a long-standing open question in the field.

Recursive Bisection: The Core Algorithm

The primary contribution of this work is a practical algorithm based on Recursive Graph Bisection (BP). The process follows a divide-and-conquer strategy:

  1. Divide: The algorithm takes a set of vertices and splits them into two equal-sized partitions ($V_1$ and $V_2$).
  2. Optimize: To perform the split, a heuristic similar to the Kernighan-Lin algorithm is used. Vertices are moved between partitions to minimize a cost function that estimates the total bits required for delta-encoding, assuming neighbors are uniformly distributed within the resulting partitions.
  3. Recurse: This process repeats for each partition until the subsets are small enough to be handled directly.
  4. Scale: To handle "Facebook-sized" data, the authors developed a multi-threaded C++ implementation for single machines and a distributed version using the Apache Giraph framework.

A key insight was the use of the "Log-Gap" Objective. Traditional "Linear Arrangement" objectives (minimizing $|u-v|$) do not perfectly align with modern integer encoders like Elias-Fano. The BP algorithm's cost function specifically targets the logarithmic nature of bit-widths, making it more effective for actual compression.

Experimental Results and Scalability

The BP method was evaluated on a diverse range of large-scale datasets, including public web crawls (Twitter, LiveJournal), standard search index benchmarks (Gov2, ClueWeb09), and massive private Facebook datasets (up to 1 billion vertices and 300 billion edges).

The results were consistently superior to state-of-the-art techniques like Layered Label Propagation (LLP) and Shingle ordering:

  • Compression Gains: BP achieved a 5% to 20% improvement in compression ratio over the best existing alternatives. Compared to the "Natural" (original) ordering, the gains reached as high as 50%.
  • Search Index Efficiency: On inverted indexes, BP reduced the space required by approximately 22% for Partitioned Elias-Fano encoding.
  • Performance: The implementation is highly efficient. A billion-vertex Facebook graph was processed in just a few hours on a distributed cluster, while the Twitter crawl (2.4B edges) took under three hours on a single machine.

Conclusion

Recursive graph bisection provides a robust, scalable, and theoretically sound solution for graph and index compression. By focusing on the logarithmic nature of gap encoding and utilizing a unified bipartite model, the BP algorithm significantly reduces the storage footprint of massive datasets. Future work may explore "tree orientation" to further improve locality and investigate how this reordering can enhance CPU cache performance during graph traversal.

Summary updated

BibTeX
@inproceedings{dhulipala2016compressing,
  author = {Laxman Dhulipala and Igor Kabiljo and Brian Karrer and Giuseppe Ottaviano and Sergey Pupyrev and Alon Shalita},
  title = {{Compressing Graphs and Indexes with Recursive Graph Bisection}},
  booktitle = {ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
  year = {2016},
  doi = {10.1145/2939672.2939862},
}
Figure