Scalable edge clustering of dynamic graphs via weighted line graphs

Michael Ostroski, Geoffrey Sanders, Trevor Steil, Roger PearceJ. Complex Networks 2023

TL;DR

This paper introduces a novel method for clustering edges in dynamic graphs, which are common in representing real-world interactions over time. By constructing a "line graph skeleton" and applying a hierarchical clustering algorithm, they efficiently discover meaningful "conversations" or groups of related events, even in massive datasets with billions of edges. This approach offers a scalable and insightful way to analyze complex temporal network data.

What Problem Does This Paper Address?

Analyzing dynamic graphs, where relationships (edges) change over time, is crucial for understanding phenomena like social interactions, communication networks, and security threats. Traditional graph clustering methods often focus on grouping nodes (e.g., identifying communities of users) and struggle with the sheer scale and temporal complexity of real-world data. Specifically, clustering edges to find groups of related interactions (termed "conversations" in the paper) is challenging because:

  • Scale: Real-world dynamic graphs can have billions of edges, making it computationally prohibitive to build and analyze traditional graph structures like line graphs, which can grow quadratically with the number of nodes.
  • Temporal Dynamics: Events occur at specific times, and their relationships are often time-dependent. Simple snapshot-based or global time-discretization methods can miss crucial short-term or multi-scale temporal patterns.
  • Edge-Centric Analysis: Sometimes, understanding the patterns of interactions (edges) is more important than just grouping the entities involved (nodes), especially in areas like anomaly detection where specific sequences of events are of interest.

This paper aims to bridge this gap by providing a scalable and effective method for edge clustering in dynamic graphs that respects temporal relationships.

Methods

The core of the paper's contribution lies in its novel approach to edge clustering, which avoids explicitly constructing the full, computationally expensive line graph.

  • Increment-Weighted Line Graph: The authors first define an "increment-weighted line graph" where nodes represent edges from the original dynamic graph. An edge exists between two nodes in this line graph if the corresponding original edges share a vertex and occur in a temporally causal order (tip-to-tail and time-ordered). The weight of this line graph edge reflects the time difference between the original edges, with smaller weights indicating closer temporal proximity.
  • Line Graph Skeleton: To overcome the scalability issues of the full line graph, they introduce the "Line Graph Skeleton." This is a sparse subgraph of the line graph that preserves the essential connectivity information needed for clustering. It's constructed by a node-local process, where each node in the original graph computes a local minimum spanning tree (MST) of its incident edges in the line graph. The union of these local MSTs forms the Line Graph Skeleton. This significantly reduces the graph size while retaining crucial structural properties.
  • Hierarchical Agglomerative Clustering (HDBSCAN-inspired): The clustering itself is performed on the Line Graph Skeleton using a hierarchical agglomerative clustering approach, drawing inspiration from HDBSCAN. This method is robust to noise, can find clusters of varying shapes and sizes, and importantly, only requires the MST of the graph for computation.
  • Discrete Dendrogram: For very large datasets where even the Line Graph Skeleton might be too large for a full dendrogram computation, they propose a "discrete dendrogram" approach. This involves discretizing the weight thresholds into a fixed number of bins, creating a coarser but computationally feasible representation of the clustering hierarchy.

Datasets

The paper evaluates its approach on two datasets:

  • Email Network Dataset: A smaller, anonymized email sender-receiver dataset from a European research institution, spanning 18 months with 986 nodes and 329,910 edges. This dataset is used to showcase the detailed properties of the clustering output.
  • Reddit Comments Dataset: A massive dataset of 15 years of Reddit comments, representing 7.21 billion dynamic multigraph edge records (comments) between 836 million author accounts. This dataset is used to demonstrate the scalability and performance of the distributed algorithm.

Key Insights and Ideas

  • Line Graph Skeleton as a Scalable Proxy: The most significant insight is that a sparse "Line Graph Skeleton" can effectively represent the connectivity of the full line graph for clustering purposes. This bypasses the quadratic complexity bottleneck of traditional line graph analysis.
  • Edge Clustering for "Conversations": The method naturally identifies groups of related events ("conversations") rather than just communities of users. This is particularly useful for understanding the flow of information and detecting anomalous interaction patterns.
  • Temporal Causality is Key: The definition of edges in the line graph explicitly incorporates temporal causality (tip-to-tail and time-ordered), which is crucial for accurately modeling dynamic interactions.
  • HDBSCAN's Adaptability: The paper demonstrates how the core principles of density-based clustering (like HDBSCAN), particularly its reliance on MSTs, can be effectively adapted to graph-based data and the specific challenges of dynamic graphs.
  • Scalability Achieved: The distributed implementation shows that even massive datasets can be clustered in a reasonable time, making this approach practical for real-world applications.

Key Results

  • Scalable Performance: The algorithm can cluster a graph with O(10 billion) edges in just a few minutes on 256 nodes of a distributed compute environment.
  • Email Network Analysis: On the email dataset, the clustering identified 15,986 clusters from 177,836 edges, with cluster sizes ranging from 5 to 175 records. The analysis revealed that most clusters are small and short-lived (under 8 hours), capturing fine-grained temporal interactions.
  • Reddit Data Performance: The distributed approach demonstrated strong scaling for constructing the dendrogram on the Reddit dataset, achieving reasonable performance up to 256 compute nodes. The line graph skeleton construction and dendrogram computation for 15 years of Reddit data took under 4 minutes.
  • Qualitative Insights: The clusters found exhibit unique structures, often not clique-like, reflecting the temporal and causal relationships between events. This provides a richer understanding of network dynamics than traditional node-clustering methods.

Limitations and Future Work

  • Discrete Dendrogram Resolution: The discrete dendrogram approach, while necessary for scalability, introduces a loss of resolution. The authors suggest that non-uniform bin spacing might be beneficial for better capturing fine-grained clusters.
  • Generalization to Hypergraphs: The paper discusses extensions to dynamic hypergraphs, where relationships can involve more than two entities. The proposed framework can be adapted, but further research is needed to explore specific metrics and algorithms for hypergraph edge clustering.
  • General Line Graph Weights: The current work primarily uses time differences as edge weights. The authors suggest exploring more sophisticated weight functions that incorporate other edge or node properties, or even learning these weights adaptively.
  • Unstructured Data: Extending the approach to handle unstructured data living on vertices and edges is mentioned as a future direction.

Summary updated

BibTeX
@article{ostroski2023scalable,
  author = {Michael Ostroski and Geoffrey Sanders and Trevor Steil and Roger Pearce},
  title = {{Scalable edge clustering of dynamic graphs via weighted line graphs}},
  journal = {J. Complex Networks},
  year = {2023},
}
Figure