Efficient and near-optimal algorithms for sampling connected subgraphs

Marco Bressan

Introduction

Sampling small connected subgraphs, known as graphlets, is a fundamental task in network science, bioinformatics, and social network analysis. These local structures, such as 5-node cliques or 4-node paths, provide critical insights into the underlying architecture of massive networks. However, achieving both perfect uniformity and computational efficiency has remained a significant algorithmic challenge. This paper introduces the first truly efficient algorithm for uniform graphlet sampling (UGS) and a sublinear-time variant for approximate sampling (APX-UGS), while also establishing near-tight theoretical bounds for classic random walk techniques.

Problem Statement: The Uniform Graphlet Sampling Challenge

The Uniform Graphlet Sampling problem requires selecting a $k$-node connected induced subgraph from a graph $G$ such that every possible graphlet has an exactly equal probability of being chosen. Traditional approaches often suffer from two main issues:

  1. Sparsity and Connectivity: Randomly picking $k$ vertices rarely results in a connected subgraph.
  2. Sampling Bias: Methods that grow subgraphs from a seed vertex often become biased toward dense regions of the graph.

Existing solutions were either prohibitively slow—often requiring time proportional to the entire graph size for each sample—or provided only approximate uniformity with weak theoretical guarantees.

Methodology

The paper addresses these challenges through three distinct algorithmic contributions:

1. Uniform Graphlet Sampler (UGS)

The UGS algorithm utilizes a novel two-phase approach. The core innovation is the use of a "1-degree-dominating order" (1-DD order) to regularize the graph. By repeatedly removing the highest-degree vertex, the algorithm imposes a structure that mitigates the "curse of rejection." This ordering ensures that the local neighborhood of any vertex behaves similarly to a regular graph, allowing for highly efficient rejection sampling based on randomly grown spanning trees.

2. Epsilon-Uniform Sampler (APX-UGS)

For extremely large graphs where even linear-time preprocessing is unfeasible, the APX-UGS algorithm provides a sublinear-time alternative. It employs graph sketching and cut-size estimation to approximate the UGS process. Remarkably, it achieves a preprocessing time of $O(n \log n)$, making it independent of the number of edges $m$ in dense graphs.

3. Random Walk Analysis

The author provides a near-optimal bound on the mixing time for $k$-graphlet walks. By establishing a connection between the relaxation times of the graphlet walk and the original graph's random walk using line graphs, the paper proves that the walk mixes in $t(G) \cdot k^{O(k)} \rho(G)^{k-1} \log n$ time, where $\rho(G)$ is the ratio between maximum and minimum degrees.

Key Results

The proposed algorithms significantly outperform previous state-of-the-art methods in both theoretical complexity and practical applicability.

Comparison of graphlet sampling algorithms across preprocessing time, space, and sampling efficiency.

As shown in the table above, the UGS algorithm is the first to break the $\Theta(n+m)$ barrier per sample for uniform output, requiring only $k^{O(k)} \log \Delta$ expected time after preprocessing. Furthermore, the APX-UGS algorithm demonstrates that $\epsilon$-uniform samples can be obtained in time sublinear to the number of edges, which is nearly optimal in the graph access model.

Discussion and Future Work

While these algorithms represent a major step forward, they maintain an exponential dependence on the graphlet size $k$ ($k^{O(k)}$). Although $k$ is typically small (3–10) in most practical applications, this remains a bottleneck for larger subgraphs. Additionally, the sublinear algorithm's sampling time has a high polynomial dependence on $1/\epsilon$. Future research could focus on optimizing these constants and implementing these theoretical frameworks in distributed environments like Spark or Giraph to evaluate their performance on web-scale datasets.

Summary updated

BibTeX
@inproceedings{bressan2021efficient,
  author = {Marco Bressan},
  title = {{Efficient and near-optimal algorithms for sampling connected subgraphs}},
  booktitle = {STOC},
  year = {2021},
  doi = {10.1145/3406325.3451042},
}
Figure