Papers
Topics
Authors
Recent
Search
2000 character limit reached

Groupby Neighbors Random Walk (GNRW)

Updated 23 January 2026
  • The paper introduces GNRW, a higher-order Markov chain sampling method that leverages transition history to stratify neighbor groups and reduce query counts.
  • It preserves the stationary distribution of simple random walks while achieving lower asymptotic variance and faster convergence.
  • Empirical results on social networks demonstrate a 30–50% reduction in estimation error compared to baseline methods, validating its efficiency improvements.

Groupby Neighbors Random Walk (GNRW) is a higher-order Markov chain-based sampling method designed to improve the efficiency of random walk-based analytics over large online social networks, where the available query primitives typically only expose node neighbor queries. Unlike the baseline simple random walk (SRW), which suffers from slow mixing and high estimator variance due to its memoryless selection of neighbors, GNRW leverages the walk’s transition history to induce systematic stratification over neighbor groups, thereby reducing the number of queries required to achieve a specified estimation accuracy. The method achieves this efficiency gain without altering the stationary distribution of the walk, providing a statistically valid “drop-in” alternative to SRW for network sampling tasks (Zhou et al., 2015).

1. Formal Construction and Transition Dynamics

Let G=(V,E)G=(V,E) represent an undirected graph. The GNRW defined on GG is a Markov chain whose current state at step nn is XnVX_n \in V, with history-sensitive structures assigned to every directed edge (uv)(u \to v).

Given a fixed grouping function gg and node vVv \in V, partition the neighborhood N(v)N(v) as g(N(v))={S1,S2,...,Sm}g(N(v)) = \{S_1, S_2, ..., S_m\}, where each SiS_i is disjoint and GG0. These groups are typically defined by a measure attribute (e.g., degree, attribute values).

For each directed pair GG1, maintain:

  • GG2: the set of neighbor groups from GG3 already chosen following prior GG4 transitions.
  • For every GG5, a set GG6 of neighbors within GG7 visited after GG8 (both structures are sampling "without replacement").

The transition at step GG9—from nn0, nn1—selects nn2 by:

  1. Identifying remaining eligible groups nn3.
  2. If nn4, select nn5 with probability:

nn6

  1. Within nn7, let nn8. If nn9, pick XnVX_n \in V0 uniformly from XnVX_n \in V1; otherwise, reset XnVX_n \in V2 and sample XnVX_n \in V3 uniformly from XnVX_n \in V4. Update XnVX_n \in V5 and XnVX_n \in V6 accordingly.

The resulting two-level stratification--first over groups, then within groups--defines the transition kernel:

XnVX_n \in V7

where XnVX_n \in V8.

Both XnVX_n \in V9 and each (uv)(u \to v)0 reset when exhausted.

2. Implementation: Pseudocode

The GNRW sampler is initialized with arbitrary (uv)(u \to v)1 and a grouping function (uv)(u \to v)2:

vVv \in V4

3. Stationarity, Asymptotic Variance, and Statistical Properties

GNRW provably preserves the stationary distribution of the SRW: (uv)(u \to v)3. This is established via path block analysis: every return to a directed edge (uv)(u \to v)4 subdivides the walk into blocks. Under GNRW, all blocks associated with outgoing neighbors of (uv)(u \to v)5 are selected in a stratified "without replacement" fashion both across groups and within each group. Over the long run, every neighbor (uv)(u \to v)6 is visited with frequency (uv)(u \to v)7, so the marginal frequency at any node (uv)(u \to v)8 matches SRW.

For any bounded (uv)(u \to v)9, the empirical mean gg0 under GNRW achieves asymptotic variance gg1, due to stratified block sampling [Neal 2004]. This guarantees that the estimator is at least as efficient as that from SRW and strictly improves for attributes aligned with the chosen grouping.

4. Computational and Query-Efficiency Analysis

GNRW issues one "get neighbors" API query per transition, identical to SRW and related methods such as NB-SRW and CNRW. The additional bookkeeping—principally, maintaining S(u,v) and the gg2 per directed edge gg3—can be implemented using two hash-maps with amortized gg4 access and update, giving total space and time overhead gg5 after gg6 steps.

Crucially, since GNRW reduces both burn-in and estimator variance, the number of transitions (i.e., queries) required for a target estimation bias gg7 is strictly lower than or equal to SRW. Both “burn-in” to stationary and sample count for the desired estimator confidence are reduced in practice by GNRW-induced stratification (Zhou et al., 2015).

5. Empirical Performance and Results

Experimental comparisons on real and synthetic datasets demonstrate the empirical gains of GNRW over SRW, NB-SRW, and CNRW. Relative estimation errors after a fixed number of queries are consistently smallest for GNRW:

Dataset / Task SRW NB‐SRW CNRW GNRW
Google Plus (avg. degree @ 500 q.) 0.085 0.080 0.058 0.048
Yelp (avg. degree @ 300 q.) 0.33 0.29 0.26 0.20
Yelp (avg. review count @ 300 q.) 0.38 0.34 0.31 0.23
Facebook subgraph (KL div. @ 400 q.) 0.18 0.16 0.11 0.08

For synthetic barbell graphs, estimation error reductions of 30–50% are observed for GNRW versus SRW and NB‐SRW. In all tests:

  • GNRW < CNRW ≤ NB‐SRW < SRW <<< MHRW (MH Random Walk).
  • The maximum improvement is achieved when the grouping attribute matches the estimation target attribute (e.g., degree for average degree estimation).

6. Impact of Grouping Function and Practical Considerations

The grouping function gg8 critically determines stratification depth and estimator efficiency. When gg9 (i.e., each group is a singleton), GNRW reduces to CNRW. Grouping by relevant node attribute—such as degree (“GNRW‐by‐Degree”) for degree-based analytics or review count for review-based estimation—substantially improves mixing across targeted features and thus accelerates convergence. Randomized groupings (e.g., via hashing) offer limited improvements.

Group counts (vVv \in V0) that are too large (over-stratification) lead to unnecessary overhead; too small and stratification loses benefits. Empirically, values vVv \in V1 work well for social networks with typical node degrees in the range vVv \in V2–vVv \in V3.

A plausible implication is that for practical deployment, aligning groupings with the primary statistics of interest yields the greatest sampling efficiency (Zhou et al., 2015).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Groupby Neighbors Random Walk (GNRW).