NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Two-Sample Tests for Large Random Graphs Using Network Statistics

Debarghya Ghoshdastidar, Maurilio Gutzeit, Alexandra Carpentier, Ulrike von Luxburg

Abstract

We consider a two-sample hypothesis testing problem where distributions are defined on the space of undirected graphs, and only one observation from each model is available. This scenario is common in large-scale network analysis, such as comparing the structural properties of different social media platforms. We present a general principle for two-sample hypothesis testing that avoids specific assumptions about the network generation process. Our approach relies on the concentration of network statistics, leading to a consistent test that is shown to be minimax optimal for certain statistics, such as spectral measures and triangle counts.

Introduction

In traditional statistical inference, hypothesis testing typically requires multiple independent and identically distributed (i.i.d.) samples to characterize a distribution. However, in the study of massive networks—such as the friendship graph of Facebook or the professional connections on LinkedIn—we often possess only a single observation of the entire system. Comparing these unique objects to determine if they originate from the same underlying generative model is a fundamental challenge in network science.

This problem is inherently "ill-posed" due to several factors: the graphs may have different numbers of nodes, and there is usually no natural vertex correspondence (i.e., no way to map a specific user on one platform to their counterpart on another). In "Two-Sample Tests for Large Random Graphs Using Network Statistics," Ghoshdastidar et al. propose a non-parametric framework that overcomes these hurdles by leveraging the mathematical phenomenon of concentration.

The Concentration Principle

The core insight of this research is that for sufficiently large graphs, certain global network statistics ($f$) "concentrate" around their expected values. As the number of nodes increases, the inherent randomness in the graph generation process averages out, making a single observation a reliable proxy for the underlying distribution's parameters.

The Proposed Test Statistic

The authors define a general test statistic $T$ based on the distance between observed statistics from two graphs, $G$ and $G'$:

$$T(G, G') = \frac{d(f(G), f(G'))}{2\hat{\sigma}(G) + 2\hat{\sigma}(G')}$$

In this formulation:

  • $d$ represents a distance metric.
  • $f(G)$ is the chosen network statistic (e.g., triangle density).
  • $\hat{\sigma}$ is an estimate of the statistic's fluctuation (standard deviation).

The decision rule is straightforward: if $T > 1$, the null hypothesis (that the graphs come from the same distribution) is rejected. This framework allows for the comparison of graphs of different sizes by using normalized statistics.

Analyzed Network Statistics

The paper demonstrates the efficacy of this framework using two primary types of statistics:

  1. Average Probability of Triangles: This captures local clustering and transitivity within the network.
  2. Normalized Largest $k$ Singular Values: These spectral measures capture the macro-structure of the graph, such as community organization and connectivity patterns.

Theoretical Results and Optimality

The authors provide rigorous proofs for the following:

  • Uniform Consistency: The test is shown to be uniformly consistent, meaning the probability of both Type I (false positive) and Type II (false negative) errors vanishes as the graph size increases.
  • Minimax Optimality: For spectral statistics, the test is minimax optimal. This implies that the test can distinguish between two models as long as their difference exceeds a fundamental theoretical limit known as the "detection boundary." No other statistical test can perform better in terms of the minimum separation required for detection.
  • Efficiency: While the triangle-based test is slightly less efficient than the spectral test (by a logarithmic factor), it remains a robust and computationally accessible alternative for many applications.

Experimental Framework

To validate the theoretical findings, the authors utilized synthetic random graph models, which allow for controlled testing of the detection boundary:

  • Inhomogeneous Erdős-Rényi (IER) Graphs: Models where edge probabilities are independent but can vary between node pairs.
  • Random Geometric Graphs (Geom): Models where edges are determined by the physical or latent proximity of nodes in a metric space.

Discussion and Limitations

While the proposed method is powerful, its success depends heavily on the choice of the network statistic $f$. If two graph distributions differ in ways that the chosen statistic does not capture—for instance, having identical triangle densities but different average path lengths—the test will fail to reject the null hypothesis.

Furthermore, concentration occurs more slowly in very sparse networks. Proving similar consistency results for "ultra-sparse" graphs remains an open challenge. The authors also suggest that while the test is designed for large-scale limits, techniques like bootstrapping could potentially improve performance on smaller, finite graphs, though developing model-independent bootstrap methods for networks is a complex task for future research.

Conclusion

This work provides a robust mathematical foundation for comparing large networks without the need for multiple samples or vertex correspondence. By shifting the focus to the concentration of network statistics, the authors offer a scalable and theoretically grounded solution to a pervasive problem in modern data science.

Summary updated

BibTeX
@inproceedings{ghoshdastidar2017two,
  author = {Debarghya Ghoshdastidar and Maurilio Gutzeit and Alexandra Carpentier and Ulrike von Luxburg},
  title = {{Two-Sample Tests for Large Random Graphs Using Network Statistics}},
  booktitle = {Conference on Learning Theory},
  year = {2017},
}
Figure