Abstract
Listing and counting triangles in graphs is a key algorithmic kernel for network analyses, including community detection, clustering coefficients, k-trusses, and triangle centrality. In this paper, we propose the novel concept of a cover-edge set that can be used to find triangles more efficiently. Leveraging the breadth-first search (BFS) method, we can quickly generate a compact cover-edge set. Novel sequential and parallel triangle counting algorithms that employ cover-edge sets are presented. The novel sequential algorithm performs competitively with the fastest previous approaches on both real and synthetic graphs, such as those from the Graph500 Benchmark and the MIT/Amazon/IEEE Graph Challenge. We implement 22 sequential algorithms for performance evaluation and comparison. At the same time, we employ OpenMP to parallelize 11 sequential algorithms, presenting an in-depth analysis of their parallel performance. Furthermore, we develop a distributed parallel algorithm that can asymptotically reduce communication on massive graphs. In our estimate from massive-scale Graph500 graphs, our distributed parallel algorithm can reduce the communication on a scale~36 graph by 1156x and on a scale~42 graph by 2368x. Comprehensive experiments are conducted on the recently launched Intel Xeon 8480+ processor and shed light on how graph attributes, such as topology, diameter, and degree distribution, can affect the performance of these algorithms.
Introduction
Triangle counting—the task of identifying sets of three mutually connected vertices—is a foundational operation in network science. It serves as a building block for complex analyses like fraud detection, community discovery, and structural analysis. However, as modern datasets scale to billions of edges, traditional counting methods face a significant bottleneck: data movement. In distributed systems, the common "wedge-checking" approach requires shuffling massive amounts of data across networks to verify triangle completion. This paper introduces Cover-Edge Triangle Counting (CETC), a strategy designed to prune the search space and drastically minimize communication overhead by identifying a subset of edges that must participate in every triangle.
Methodology: The Cover-Edge Set
The central innovation of this work is the Cover-Edge Set. By performing a Breadth-First Search (BFS) starting from a source node $s$, the algorithm categorizes every edge in the graph based on the relative levels of its endpoints.
As shown in Figure 1, edges are classified into three distinct types:
- Tree-Edges: Edges that form the BFS spanning tree.
- Strut-Edges: Non-tree edges connecting vertices on adjacent levels ($L_i$ and $L_{i+1}$).
- Horizontal-Edges: Edges connecting two vertices on the same level ($L_i$).
The researchers prove a critical geometric property: every triangle in a graph must contain at least one horizontal edge. By treating the set of horizontal edges as a "cover-edge set," the CETC algorithm only iterates through these specific edges to find triangles, skipping a significant number of redundant checks. Several variants were developed: CETC-Seq for sequential execution, CETC-Seq-FE (a hybrid approach that switches based on the covering ratio), and parallel versions (CETC-SM and CETC-DM) for shared and distributed memory architectures.
Experimental Setup and Datasets
The authors conducted a massive benchmarking effort using the recently launched Intel Xeon Platinum 8480+ processor. The performance of 22 sequential and 11 parallel algorithms was evaluated against:
- Real-world graphs: 12 datasets from the Stanford Network Analysis Project (SNAP), including social networks (soc-Epinions1), web crawls, and road networks (roadNet-CA).
- Synthetic graphs: Graph500 RMAT graphs, ranging from Scale 6 up to Scale 42 for communication estimates.
Key Results and Discussion
The most striking result is the reduction in communication for distributed systems. For massive synthetic graphs (Scale 42), the distributed CETC-DM algorithm is estimated to reduce communication by 2,368x compared to prior state-of-the-art wedge-checking methods. This efficiency is tied to the "covering ratio" ($c$)—the percentage of edges that are horizontal. Interestingly, as the scale of RMAT graphs increases, the covering ratio $c$ decreases, meaning the CETC method becomes more efficient as the data grows.
In sequential benchmarks, the CETC-Seq-S (Split) variant ranked among the top 4 fastest algorithms out of 22 tested, performing nearly as well as the highly-optimized "Forward-Hashed" algorithm. Parallel scaling was also robust; using 32 threads, the team observed speedups of up to 23.3x for certain parallel edge-iterator variants.
However, the performance is topology-dependent. The algorithm excels on "social-style" graphs with power-law distributions. Conversely, on road networks with long diameters and low vertex degrees, the overhead of the initial BFS can outweigh the benefits of the cover-edge pruning.
Conclusion
CETC offers a transformative approach to triangle counting by leveraging graph leveling to prune search spaces. While BFS overhead remains a factor for specific topologies, the massive reduction in communication makes it a premier candidate for distributed-scale graph analytics. Future work includes porting the cover-edge logic to GPU frameworks and adapting the concept for dynamic graphs where real-time updates are required.
Summary updated