Abstract
This paper presents the first sublinear-time algorithm for sampling an arbitrary subgraph $H$ from a large graph $G$ with exact uniformity. Utilizing an augmented query model that includes edge sampling, the algorithm achieves a query complexity of $\tilde{O}(\min\{m, m^{\rho(H)}/\#H\})$, where $m$ is the number of edges and $\rho(H)$ is the fractional edge-cover number of $H$. This result establishes a computational equivalence between exactly uniform sampling and randomized approximate counting for cliques in the sublinear regime, providing a nearly optimal solution for motif discovery in massive networks.
Introduction
In the analysis of massive datasets, such as social networks or biological pathways, identifying specific motifs or subgraphs (e.g., triangles, stars, or cliques) is a fundamental task. However, the sheer scale of these graphs—often containing billions of edges—renders traditional linear-time algorithms impractical. Researchers must instead rely on sublinear-time algorithms that probe only a tiny fraction of the graph.
While previous research has produced algorithms for "almost uniform" sampling—where a subgraph is returned with a probability of $(1 \pm \epsilon)/\#H$—this paper addresses the more stringent requirement of exact uniformity. By ensuring every instance of $H$ has a probability of exactly $1/\#H$ of being selected, the authors eliminate the bias inherent in previous approximation methods.
The Augmented Query Model
The algorithm operates within the augmented general graph model. This model extends standard graph queries with a powerful primitive: edge sampling. The available queries include:
- Degree queries: Obtain the degree of a vertex.
- Neighbor queries: Identify the $i$-th neighbor of a vertex.
- Adjacency queries: Determine if an edge exists between two specific nodes.
- Edge sampling: Pick an edge uniformly at random from the entire graph $G$.
This model reflects the capabilities of modern graph databases and distributed systems where edge lists are often indexed, allowing for efficient random access.
Methodology
The core of the proposed algorithm is a combination of graph decomposition and rejection sampling. The complexity of the process is governed by the fractional edge-cover number ($\rho(H)$), which measures the minimum weight of edges required to cover all vertices in $H$.
1. Graph Decomposition
The algorithm leverages the property that any subgraph $H$ can be decomposed into a collection of vertex-disjoint components, specifically odd cycles and stars. This decomposition is guided by $\rho(H)$, which serves as the natural parameter for the complexity of subgraph problems.
2. Component Sampling
The algorithm samples these decomposed components independently. For instance, to sample an odd cycle, the algorithm samples several edges and employs a "wedge" sampling technique to close the loop. Stars are sampled by selecting a central edge and then exploring its neighborhood.
3. Rejection Sampling for Exactness
A significant challenge in uniform sampling is that a single subgraph $H$ may be formed by multiple different combinations of sampled components. To correct for this and ensure exact uniformity, the algorithm incorporates a final rejection sampling step. By applying a specific normalization probability (referenced as Line 15 of Algorithm 4 in the original text), the algorithm ensures that every copy of $H$ in the graph $G$ has an identical probability of being returned, effectively "leveling" the sampling distribution.
Key Theoretical Contributions
The Counting-Sampling Equivalence
A major insight of this work is the demonstration that in the augmented query model, exactly uniform sampling is computationally equivalent to randomized approximate counting. In the polynomial-time regime, the relationship between counting and sampling is often complex; however, this paper shows that for cliques, the two tasks share the same sublinear complexity bounds.
Complexity and Optimality
The algorithm achieves an expected time complexity of $\tilde{O}(m^{\rho(H)}/\#H)$. For $r$-cliques ($H = K_r$), the authors provide a lower bound proof showing that this complexity is nearly optimal. Any algorithm attempting to sample a clique with even constant probability must perform at least $\Omega(\min\{m, m^{r/2}/(\#K_r \cdot c^r)\})$ queries.
Discussion and Limitations
While the algorithm provides a robust theoretical framework for exact sampling, its practical application depends on the availability of the edge sampling primitive. While many modern systems support this, it may not be available in all streaming or highly restricted distributed environments. Additionally, the basic algorithm assumes the total number of edges $m$ is known, though the authors note that a $(1+\epsilon)$-approximation of $m$ can be used as a substitute with minimal impact on performance.
Future research may explore whether exact uniformity can be maintained in weaker query models, such as those relying solely on random walks rather than direct edge sampling.
Summary updated