Abstract
We address the problem of computing the distribution of induced connected subgraphs, aka graphlets or motifs, in large graphs. The current state-of-the-art algorithms estimate the motif counts via uniform sampling by leveraging the color coding technique. In this work, we extend the applicability of this approach by introducing a set of algorithmic optimizations and techniques that reduce the running time and space usage of color coding and improve the accuracy of the counts. We show how to optimize color coding to efficiently build a compact table of a representative subsample of all graphlets in the input graph. For 8-node motifs, we can build such a table in one hour for a graph with 65M nodes and 1.8B edges, which is $2,000\times$ larger than the state of the art. We then introduce a novel adaptive sampling scheme that breaks the “additive error barrier” of uniform sampling, guaranteeing multiplicative approximations. This allows us to count not only the most frequent motifs, but also extremely rare ones. Our results show that color coding is still the most promising approach to scalable motif counting.
Introduction
In network science, motifs (or graphlets) are small, connected subgraphs that serve as the fundamental building blocks of complex networks. Counting these motifs is crucial for understanding structures ranging from protein interactions to social networks. However, motif counting is computationally intractable for larger motifs ($k > 5$) due to exponential growth. Previous state-of-the-art methods relied on uniform sampling via "color coding," which suffers from an "additive error barrier": it identifies frequent motifs but misses rare ones that may appear only once in a trillion subgraphs.
Methodology
This research introduces two primary algorithms, MOTIVO and L8MOTIF, which optimize both the memory-intensive "build-up" phase and the accuracy-critical "sampling" phase.
Succinct Color Coding
Color coding uses dynamic programming to count "colorful" treelets. The authors optimize this through:
- Succinct Representations: Treelets are represented as bitstrings or 11-bit integers rather than pointer-heavy structures.
- Round Skipping: By using a balanced treelet decomposition, the most expensive final computation round can be skipped for most motifs.
- Variable-Length Encoding: Using Elias delta coding reduces the memory footprint of count tables by over 60%.
Adaptive Graphlet Sampling (AGS)
AGS is a novel greedy algorithm that breaks the additive error barrier. Unlike uniform sampling, AGS effectively "deletes" motifs once they are accurately counted, allowing the sampler to focus on rare events. This provides multiplicative guarantees, ensuring accuracy even for motifs with extremely low relative frequencies.
Experimental Setup and Datasets
The algorithms were evaluated on large-scale graphs from the SNAP and LAW repositories, including social networks (Facebook, Twitter, Friendster), web/citation graphs (DBLP, Amazon, Orkut), and user review graphs (Yelp).
The Friendster graph, containing 65 million nodes and 1.8 billion edges, represents a scale 2,000 times larger than previous color-coding implementations could process.
Key Results
- Scalability: L8MOTIF processed the 1.8B-edge Friendster graph for 8-node motifs in just over an hour on a single machine with 72GB of RAM.
- Rare Motif Detection: On the Yelp graph, while standard color coding (CC) found only the 2 most frequent 8-node motifs, AGS identified and accurately counted nearly 10,000 distinct motifs, some with frequencies as low as $10^{-21}$.
- Efficiency: MOTIVO achieved up to a 14,000x speedup in sampling rate and a 114x reduction in memory usage compared to original implementations.
Discussion and Future Work
The research demonstrates that non-uniform, adaptive sampling is essential for rare event detection in networks. While L8MOTIF is highly optimized for $k \le 8$, future work could extend these encoding strategies to larger motif sizes. Additionally, while the current focus is on single-machine performance for static graphs, the authors suggest that distributed computing and incremental updates for dynamic graphs are promising next steps.
Summary updated