Parallel Filtered Graphs for Hierarchical Clustering

Shangdi Yu, Julian Shun

Abstract

Hierarchical clustering is a fundamental technique for uncovering multi-scale structures in complex datasets, yet its computational intensity often limits its application to large-scale data. This paper introduces PAR-TDBHT, a high-performance parallel framework for hierarchical clustering using filtered graphs. By parallelizing the construction of Triangulated Maximally Filtered Graphs (TMFG) and optimizing the Directed Bubble Hierarchical Tree (DBHT) algorithm, the researchers achieve speedups of up to three orders of magnitude over existing sequential implementations. Crucially, the framework maintains or improves clustering accuracy, providing a scalable solution for time-series analysis in domains ranging from finance to biology.

Introduction

Hierarchical clustering represents data structures as dendrograms, allowing researchers to observe how clusters emerge and merge at different levels of granularity. However, traditional methods typically require $\Theta(n^2)$ pairwise distance calculations, creating a significant bottleneck for modern datasets. To mitigate this, researchers often employ filtered graphs—sparse representations that retain only the most statistically significant edges while maintaining specific topological properties.

Two prominent methods in this space are the Planar Maximally Filtered Graph (PMFG) and its more computationally efficient successor, the Triangulated Maximally Filtered Graph (TMFG). When paired with the Directed Bubble Hierarchical Tree (DBHT) algorithm, these methods are highly effective at clustering complex time-series data. Despite their utility, existing implementations have remained strictly sequential. The incremental nature of TMFG construction—where vertices are added one by one to preserve planarity—has long been considered a barrier to parallelization. This work presents the first scalable parallel algorithms for both TMFG and DBHT.

The PAR-TDBHT Framework

The authors introduce the PAR-TDBHT framework, which addresses the sequential bottlenecks of filtered graph construction and tree directing through several algorithmic innovations.

1. Parallel TMFG Construction via Prefix-Based Insertion

Standard TMFG construction is a greedy, incremental process. To parallelize this, the authors propose prefix-based insertion. Instead of adding a single vertex, the algorithm identifies a "prefix" (a batch) of uninserted vertices that offer the highest "gain" (the sum of edge weights to an existing triangle in the graph).

To maintain the integrity of the graph structure, the framework uses parallel sorting and filtering to resolve conflicts. If multiple vertices in a batch target the same triangle for insertion, the algorithm either selects the vertex with the highest gain or redistributes the vertices across other available faces. This batching strategy transforms the $O(n)$ sequential steps into a logarithmic number of parallel rounds.

2. Optimized Parallel DBHT

The DBHT phase traditionally follows graph construction to extract the hierarchy. PAR-TDBHT optimizes this through three key mechanisms:

  • Bubble Tree on the Fly: The algorithm builds the "bubble tree" (the underlying structure for the hierarchy) during the TMFG construction phase. By recognizing that every vertex insertion creates a specific 4-clique (a "bubble"), the tree structure becomes a natural byproduct of the graph's growth.
  • Recursive Edge Direction: Directing the edges of the tree is necessary to establish the hierarchy. While original methods used Breadth-First Search (BFS) for every separating triangle—resulting in $O(n^2)$ complexity—the authors developed a novel recursive algorithm. This method computes edge directions in $O(n)$ total work by traversing the bubble tree and summing weights, making this phase computationally negligible.
  • Parallel Vertex Assignment: The final step involves assigning vertices to "converging bubbles" (local cluster centers). This is parallelized using a combination of parallel Dijkstra’s algorithm and priority concurrent writes.

Experimental Evaluation

The framework was evaluated on a 48-core machine using two primary data sources:

  1. UCR Time Series Archive: 18 datasets, including large-scale sets such as Crop ($n=19,412$) and StarLightCurves.
  2. US Stock Market Data: Daily closing prices for 1,614 stocks (2013–2019), using the Industry Classification Benchmark (ICB) as a ground truth for clustering accuracy.

Performance and Scalability

The parallel framework demonstrated massive performance gains. Compared to state-of-the-art MATLAB implementations, PAR-TDBHT achieved speedups ranging from 136x to 2483x. In terms of self-relative scalability, the TMFG construction achieved a 41.56x speedup on 48 cores compared to its own single-threaded execution, indicating high efficiency in the parallel implementation.

Clustering Quality

Beyond speed, the researchers found that the prefix-based insertion strategy often improved clustering quality. In evaluations using the Adjusted Rand Index (ARI), the method consistently outperformed standard average-linkage and complete-linkage clustering. On the US stock market data, the algorithm successfully recovered major industry sectors and identified sub-clusters that aligned more closely with expert classifications than the original sequential TMFG.

Discussion and Key Insights

A surprising finding of the study was the "prefix effect." While batch insertion was designed for speed, it also acted as a noise filter. By inserting multiple vertices at once, the algorithm avoids over-fitting to a single "best" edge that might be an outlier, leading to more robust cluster formations.

Furthermore, the shift from $O(n^2)$ to $O(n)$ for edge direction represents a significant theoretical and practical improvement. By exploiting the topological properties of the TMFG, the authors effectively broke the quadratic bottleneck that previously hindered DBHT scaling.

Conclusion and Future Work

PAR-TDBHT provides a powerful new tool for large-scale hierarchical clustering. By rethinking the incremental nature of filtered graphs, the authors have enabled the analysis of datasets that were previously computationally out of reach.

Future research will focus on addressing the remaining bottleneck: the All-Pairs Shortest Path (APSP) calculation, which now dominates the runtime after the other components have been optimized. Additionally, the team aims to explore more memory-efficient embedding techniques to handle even larger datasets where spectral preprocessing currently faces memory constraints.

Summary updated

BibTeX
@inproceedings{yu2023parallel,
  author = {Shangdi Yu and Julian Shun},
  title = {{Parallel Filtered Graphs for Hierarchical Clustering}},
  booktitle = {ICDE},
  year = {2023},
  doi = {10.1109/icde55515.2023.00153},
}
Figure