Efficient Estimation of Shortest-Path Distance Distributions to Samples in Graphs
Alan Zhu, Jiaqi Ma, Qiaozhu Mei
TL;DR
This work presents an accurate and efficient framework to estimate the distribution of shortest-path distances to a sample (DSPD) without access to the full graph, enabling principled evaluation of sampling methods for large graphs. It builds on the configuration model and extends to community-structured graphs by contracting the sample into a supernode and, for SBM graphs, tracking within- and across-block degree distributions. The approach yields high accuracy on graphs without strong community structure and remains practically useful for downstream tasks even when SBM-induced accuracy degrades, with substantial efficiency gains over empirical DSPD computation. Overall, the framework offers a practical tool for informing sampling decisions in large-scale networks and sets the stage for real-world validations.
Abstract
As large graph datasets become increasingly common across many fields, sampling is often needed to reduce the graphs into manageable sizes. This procedure raises critical questions about representativeness as no sample can capture the properties of the original graph perfectly, and different parts of the graph are not evenly affected by the loss. Recent work has shown that the distances from the non-sampled nodes to the sampled nodes can be a quantitative indicator of bias and fairness in graph machine learning. However, to our knowledge, there is no method for evaluating how a sampling method affects the distribution of shortest-path distances without actually performing the sampling and shortest-path calculation. In this paper, we present an accurate and efficient framework for estimating the distribution of shortest-path distances to the sample, applicable to a wide range of sampling methods and graph structures. Our framework is faster than empirical methods and only requires the specification of degree distributions. We also extend our framework to handle graphs with community structures. While this introduces a decrease in accuracy, we demonstrate that our framework remains highly accurate on downstream comparison-based tasks. Code is publicly available at https://github.com/az1326/shortest_paths.
