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

Network two-sample test for block models

Chung Kyong Nguen, Arash A. Amini, Oscar Hernan Madrid Padilla

Introduction: The Challenge of Network Comparison

Comparing two groups of networks is a notoriously difficult task in data science. For instance, determining whether the social structures of two different schools are statistically identical cannot be achieved by simply comparing their adjacency matrices. The students (nodes) in one school have no direct relationship to the students in another. This lack of "vertex correspondence" transforms a straightforward comparison into a variation of the graph isomorphism problem, which is computationally grueling.

Most existing network comparison tools assume vertex correspondence, meaning they expect node $i$ in the first graph to represent the same entity as node $i$ in the second. In many real-world scenarios—such as comparing brain networks across different patients or protein interactions across species—this assumption fails. Nodes are unlabeled, and the total number of nodes frequently varies. Without labels, comparing two networks requires finding the optimal alignment or permutation of nodes, typically formulated as a Quadratic Assignment Problem (QAP), which is NP-hard.

The Proposed Solution

In "Network two-sample test for block models," researchers Nguen, Madrid-Padilla, and Amini provide an elegant, scalable solution to this problem. By combining the flexibility of Stochastic Block Models (SBMs) with a novel spectral matching technique, they develop a statistical test that functions effectively even when networks have different sizes and lack node labels.

The core contribution is a new statistical test designed to determine if two sets of unlabeled networks originate from the same underlying model. By utilizing SBMs as a "universal approximator" and introducing a fast spectral matching algorithm to align community structures, the authors deliver a test that is both mathematically consistent and significantly more powerful than existing methods.

Methodology: Spectral Matching and the SBM-TS Test

The researchers adopt the Stochastic Block Model (SBM) as their foundational framework. An SBM can be conceptualized as a "histogram" for networks: it groups nodes into $K$ communities and defines a connectivity matrix $B$ that describes the probability of edges forming between those communities.

The methodology relies on a two-stage approach:

  1. Spectral Matching: Instead of attempting to solve the NP-hard QAP to align two connectivity matrices $B_1$ and $B_2$, the authors employ an eigenvalue decomposition (EVD) approach. They prove that if the eigenvalues of the connectivity matrix are distinct and well-separated—a property they define as being "(η, θ)-friendly"—the eigenvectors contain all the necessary information to recover the correct node permutation. This innovation reduces a combinatorial challenge into a fast linear assignment problem.
  2. The SBM-TS Test: Once the networks are aligned to a common reference framework, the algorithm aggregates edge counts across all networks within each sample. It then constructs a chi-squared ($\chi^2$) test statistic based on the differences between these aggregate estimates.

Experimental Validation

The authors validated their approach on a diverse mix of synthetic and real-world datasets:

  • Synthetic Models: Standard SBMs, Graphons (representing the limit of dense graphs), and Random Dot Product Graphs (RDPG).
  • COLLAB Dataset: A collection of 5,000 scientific collaboration networks spanning High Energy Physics, Condensed Matter Physics, and Astrophysics.
  • SW-GOT Dataset: Character interaction networks from the Star Wars and Game of Thrones universes. These present a unique challenge because the number of characters varies wildly between individual episodes or books.

Key Insights and Results

The study yields several important insights into network analysis:

  • SBM as a Universal Approximator: SBMs are not strictly limited to "blocky" networks. With a sufficiently large number of communities ($K$), an SBM can approximate almost any smooth network model (such as a graphon), making this test a highly versatile non-parametric tool.
  • The "Bin-then-Test" Strategy: The approach conceptually mirrors Pearson’s chi-squared test for continuous data. Just as continuous data is binned into a contingency table to test distributions, this method "bins" network nodes into communities to test connectivity patterns.
  • Scalability: Because the matching algorithm operates on the $K \times K$ connectivity matrix rather than the $n \times n$ adjacency matrix, the test remains highly efficient even for massive networks.

Empirically, the authors proved that under the null hypothesis (i.e., the models are identical), their test statistic converges to a $\chi^2$ distribution with $K(K+1)/2$ degrees of freedom, allowing for accurate p-value calculations. In head-to-head comparisons, their method (SBM-TS) consistently outperformed competitors like ASE-MMD (which lacks a matching mechanism) and NCLM (based on subgraph counting). Furthermore, the test maintained high statistical power and correctly identified structural differences even when data was generated from non-SBM models.

Limitations and Future Directions

While highly effective, the method does have certain constraints. The spectral matching relies on the connectivity matrix having distinct eigenvalues (the "friendly" requirement). If a network is perfectly symmetric, creating repeated eigenvalues, the matching process might fail. Additionally, the user must specify the number of communities ($K$). Although the authors propose a data-driven bootstrap method to select $K$, this remains a classic challenge in network analysis.

For future work, the authors suggest exploring "low-rank" matching—using only the most informative eigenvectors—to further improve robustness in extremely noisy settings. They also aim to extend their formal theoretical guarantees to encompass the broader class of graphon models.

Summary updated

BibTeX
@inproceedings{nguen2025network,
  author = {Chung Kyong Nguen and Arash A. Amini and OSCAR HERNAN MADRID PADILLA},
  title = {{Network two-sample test for block models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=pFL7RThdFN},
}
Figure