Abstract
Spectral clustering is a powerful technique for uncovering complex, non-linear structures in data, typically by solving the Normalised Cut problem. However, traditional spectral clustering is computationally expensive and inherently static, making it unsuitable for real-world graphs like social networks or financial logs that evolve continuously. This paper introduces a novel data structure for fully dynamic spectral clustering, allowing for real-time edge and node updates alongside efficient cluster membership queries. By introducing "Just-in-Time Sampling Trees," the authors maintain a small representative "coreset" of the graph, enabling high-quality clustering that is orders of magnitude faster than traditional methods on massive, evolving datasets, while providing strong theoretical guarantees.
The Challenge of Dynamic Graphs
In real-world applications, graphs are rarely static. Re-running a full spectral clustering algorithm every time a single edge is added or deleted is computationally prohibitive for large-scale systems. Previous attempts at dynamic spectral clustering either only supported edge additions (incremental), lacked rigorous theoretical guarantees, or suffered from update times too slow for practical use.
The core challenge addressed in this work is: How can we maintain an accurate clustering of a massive, constantly changing graph without starting from scratch after every update?
Methodology
To bridge the gap between dynamic graph theory and spectral clustering, the authors rely on two main pillars:
1. Coresets and Duality
The authors leverage a known mathematical equivalence between the Normalised Cut objective in graphs and Kernel $k$-means clustering. This equivalence allows them to utilize coresets—small, weighted subsets of the data that act as a highly accurate proxy for the entire dataset. By maintaining a coreset of a dynamic graph, the expensive clustering step only needs to be executed on this tiny subset rather than the full graph.
2. Just-in-Time (JIT) Sampling Trees
Building a coreset requires sampling nodes based on their "importance." In a static setting, this involves building a sampling tree in $O(n)$ time. In a dynamic setting, a single edge change could theoretically alter the sampling probabilities for every node, making standard trees highly inefficient.
The paper's central innovation is the JIT Sampling Tree. Instead of explicitly storing and updating every probability, the JIT tree stores auxiliary values (such as node degrees and subset sizes). It calculates actual sampling probabilities "just-in-time" only when a query is made. Consequently, edge updates only require updating a single path in the tree, reducing the worst-case edge update time to just $O(\log n)$.
Key Insights
- Decoupling Update from Query: By utilizing JIT trees, the computational burden is shifted away from frequent edge updates and deferred to the less frequent clustering queries.
- Independence from $n$: Once the tree is maintained, the size of the coreset depends primarily on the number of clusters $k$ and the error tolerance $\epsilon$, remaining largely independent of the total number of nodes $n$. This ensures massive scalability.
- Logical Timestamps: To avoid the $O(n)$ cost of "cleaning" the tree between queries, the system uses logical timestamps. If a node's data is older than the current query's timestamp, it is treated as stale and updated on the fly.
Experimental Setup and Results
The authors evaluated their approach on synthetic workloads (Stochastic Block Models with splitting, merging, and changing clusters) and real-world dynamic workloads (MNIST and EMNIST converted into dynamic $k$-nearest neighbor graphs).
Theoretical Guarantees
The worst-case edge update time is strictly $O(\log n)$. For a query to label all nodes in a set $Y$, the worst-case time is $O\left(kd_{\max}^2 \log(n) + \gamma(n,\epsilon,k,Y)\right)$, where $d_{\max}$ is the maximum degree and $\gamma$ encapsulates the underlying static solver time and coreset size parameters. Assuming $d_{\max}$ is polylogarithmic (common in sparse real-world graphs), this achieves the best-known trade-off between query and update times. The method also guarantees an approximation ratio of $\alpha \frac{1+\epsilon}{1-\epsilon}$, where $\alpha$ is the accuracy of the underlying static solver.
Empirical Performance
- Speed and Scalability: The JIT approach proved orders of magnitude faster than existing frameworks like "Merge&Reduce" and the "LS24" incremental algorithm. On the EMNIST dataset, query time remained relatively flat as the graph grew; by the end of the experiment, the JIT approach was 10x faster per query than the static baseline.
- Accuracy: Despite relying on a tiny coreset, the method maintained an Adjusted Rand Index (ARI) nearly identical to running the full algorithm on the entire graph.
Limitations and Future Work
While highly efficient for sparse graphs, the query time complexity's reliance on $d_{\max}^2$ means performance may degrade on dense graphs or those with extreme "hub" nodes. Additionally, like many coreset methods, performance is sensitive to the error tolerance parameter $\epsilon$, requiring a careful trade-off between coreset size and accuracy.
Future work points toward a "Topology Free" version of the data structure. The current implementation assumes access to the full graph topology; a topology-free variant would only require degree updates and an "oracle" to the graph, offering a promising direction for highly memory-constrained environments.
Summary updated