Introduction
Comparing two graphs is a fundamental challenge in computer science, particularly when dealing with massive datasets in social media, finance, and biology. Traditional metrics like graph isomorphism or graph edit distance are either computationally prohibitive or require explicit node-to-node correspondence. This paper introduces a node-agnostic, statistically grounded framework that measures network similarity in polynomial time.
Methodology
The proposed approach transforms the graph comparison problem into a statistical comparison of probability distributions through a three-step pipeline:
- All-Pairs Jaccard Distance: The authors utilize the Jaccard distance to measure the proportion of non-shared neighbors between any two nodes. This metric is extended to directed graphs by considering both predecessors and successors.
- Probabilistic Representation: Rather than a static matrix, the graph is represented as an empirical probability distribution of these internal Jaccard distances. This distribution effectively captures the "shape" of the network's connectivity.
- Statistical Comparison: The Kolmogorov-Smirnov (K-S) test is applied to compare the distributions of two graphs. The K-S statistic ($D$) measures the maximum vertical distance between their cumulative distribution functions, providing a normalized score of (dis)similarity.
Key Insights: Structure as a Distribution
The central innovation of this work is the observation that a network's structural identity is encoded in its distance distribution. For instance, random graphs typically exhibit unimodal distributions, whereas networks with community structures produce multi-modal distributions.
As shown in the figure above, an Erdős-Rényi (ER) graph results in a single-humped distribution, while a clustered model (like the PPM) shows a bimodal distribution—representing distances within clusters versus distances between them. This sensitivity allows the metric to detect structural changes even when basic properties like node and edge counts remain constant.
Results and Sensitivity
The framework demonstrated high discriminatory power across various synthetic models (ER, SBM, Configuration Model) and real-world datasets (email networks, Wikipedia votes, and power grids). A key finding is the method's extreme sensitivity to edge removal; removing a small percentage of edges shifts the distribution significantly more than removing nodes, making it an effective tool for detecting network attacks or failures.
Limitations and Future Work
While the K-S distance ($D$) serves as a robust heuristic for similarity, the authors note a statistical limitation: node-to-node distances within a graph are not strictly independent (i.i.d.). Consequently, the resulting p-values should be interpreted with caution. Future research aims to refine the statistical validity of these tests for real-time anomaly detection in dynamic data streams.
Summary updated