Abstract
Counting and sampling small recurring patterns, or motifs, in massive graphs is a fundamental task in network analysis. This paper presents Sample-H, a sublinear-time algorithm that achieves decomposition-optimal complexity for arbitrary motifs. By introducing an efficient "Sample-a-Star" technique and a sequential sampling framework, the algorithm significantly improves upon previous state-of-the-art methods, particularly for sparse graphs. We provide both upper bounds for our algorithm and the first lower bounds for motifs with non-trivial decompositions.
Introduction
In domains like bioinformatics and social network analysis, identifying the frequency of specific motifs (e.g., triangles, cliques, or stars) is crucial for understanding network structure. However, as graph sizes reach billions of edges, classical algorithms become computationally prohibitive. Sublinear-time algorithms, which query only a small portion of the graph, offer a solution for approximate counting and uniform sampling.
Previous sublinear approaches decomposed a complex motif $H$ into "basic building blocks" such as odd cycles and stars. While foundational, these methods were often inefficient—particularly when sampling star components—and frequently performed redundant work by attempting to sample all components of a motif simultaneously.
Methodology: The Sample-H Framework
The proposed Sample-H algorithm introduces three key innovations to address these inefficiencies:
- The "Sample-a-Star" Upgrade: Traditional methods sampled $p$-stars by selecting $p$ random edges, a process with a very low success probability ($1/m^p$). Sample-H instead picks one edge to identify a potential center vertex and then uses neighbor queries to select the remaining $p-1$ neighbors. By normalizing degrees to a calculated upper bound ($d_{ub}$), the algorithm ensures uniform sampling without the exponential overhead of previous techniques.
- Sequential Sampling: Rather than attempting to find all components of a motif decomposition at once, Sample-H adopts a sequential approach. It verifies the full motif only after successfully sampling each required sub-component in order, preventing total restarts upon a single component failure.
- Augmented Query Model: The algorithm utilizes a standard query model including degree queries, $i$-th neighbor queries, pair queries (edge existence), and uniform random edge queries.
Theoretical Evaluation
As a theoretical contribution, this work evaluates the algorithm through mathematical proofs and analysis on specific graph families rather than empirical datasets:
- Erdős-Rényi Random Graphs: Demonstrating substantial speedups in sparse regimes.
- Bounded Arboricity Graphs: Analyzing performance on graphs that are globally sparse but may contain dense local subgraphs.
- Hard Graph Families: Using communication complexity to establish lower bounds for the motif sampling problem.
Key Insights
- Efficiency of Local Exploration: Starting star sampling from a single edge and exploring neighbors saves a factor of approximately $d_{avg}^{p-1}$ for every $p$-star, making it exponentially more efficient than blind edge selection.
- Decomposition-Optimality: For motifs whose optimal decomposition includes at least one odd cycle, Sample-H is proven to be near-optimal (within logarithmic factors).
- Moment Sampling Applications: The "Sample-a-Star" technique can be generalized to an $\ell_p$-sampler, allowing for vertex sampling based on the $p$-th moment of the degree distribution.
Results and Complexity
The expected running time of Sample-H is $O(\text{decomp-cost}(G, H, D^*) \cdot \text{poly}(\log n))$. This bound is strictly superior to the previous state-of-the-art $O(m^{\rho(H)}/\bar{h})$ for most graph types. Furthermore, the paper establishes the first lower bounds for motifs with multi-component decompositions. The sampling algorithm can also be extended to a $(1 \pm \epsilon)$-approximation counter with predictable overhead.
Discussion and Future Work
While Sample-H provides a significant leap in efficiency, several open questions remain. The "decomposition-optimality" proof currently requires the presence of at least one odd cycle; whether star-only motifs (like double stars) can be sampled even faster is an open problem. Additionally, the lower bound is tightest when an odd cycle is the sampling bottleneck. Future work may involve tuning the recursive sequential sampling approach for practical deployment on extremely large, complex motifs.
Summary updated