- Assuming complete BFS and uniform random sampling are impossible...
- ... is there a way to sample the graph without incurring bias?
- Metropolis-Hastings random walk
- MCMC technique for sampling from a difficult to sample distribution
- Converges towards uniform random sampling
v = initial_seed_node
while stop_the_crawl is False:
w = random.choice(v.neighbors) # pick a neighbor at random
p = random.random() # 0 <= p < 1.0
if p <= v.degree/w.degree: v = w # walk to node w
else: pass # stay at node v
- Not the only modified random walk algorithm for unbiased graph sampling
- Whole subfield of research dedicated to these algorithms