Skip to main content
QUICK REVIEW

[Paper Review] Counting Triangles in Massive Graphs with MapReduce

Tamara G. Kolda, Ali Pınar|Jan 24, 2013
Data Management and AlgorithmsComputer Science7 citations
TL;DR

This paper presents a scalable MapReduce-based implementation of wedge-sampling for efficient triangle counting in massive graphs, enabling accurate estimation of global and degree-binned clustering coefficients and triangle statistics on graphs with up to 240 million nodes and 8.5 billion edges—processing the largest such graph in under an hour with 0.33 seconds per million edges plus overhead.

ABSTRACT

Graphs and networks are used to model interactions in a variety of contexts. There is a growing need to quickly assess the characteristics of a graph in order to understand its underlying structure. Some of the most useful metrics are triangle-based and give a measure of the connectedness of mutual friends. This is often summarized in terms of clustering coefficients, which measure the likelihood that two neighbors of a node are themselves connected. Computing these measures exactly for large-scale networks is prohibitively expensive in both memory and time. However, a recent wedge sampling algorithm has proved successful in efficiently and accurately estimating clustering coefficients. In this paper, we describe how to implement this approach in MapReduce to deal with massive graphs. We show results on publicly-available networks, the largest of which is 132M nodes and 4.7B edges, as well as artificially generated networks (using the Graph500 benchmark), the largest of which has 240M nodes and 8.5B edges. We can estimate the clustering coefficient by degree bin (e.g., we use exponential binning) and the number of triangles per bin, as well as the global clustering coefficient and total number of triangles, in an average of 0.33 seconds per million edges plus overhead (approximately 225 seconds total for our configuration). The technique can also be used to study triangle statistics such as the ratio of the highest and lowest degree, and we highlight differences between social and non-social networks. To the best of our knowledge, these are the largest triangle-based graph computations published to date.

Motivation & Objective

  • To address the computational infeasibility of exact triangle counting in large-scale graphs due to high memory and time costs.
  • To enable efficient, scalable estimation of clustering coefficients and triangle statistics on massive networks using distributed computing.
  • To demonstrate that wedge-sampling in MapReduce can handle graphs with over 100M nodes and 8.5B edges, overcoming load balancing and data distribution challenges.
  • To provide fine-grained analysis of triangle characteristics, including degree assortativity and binned clustering coefficients, for both real and synthetic networks.
  • To validate the method on real-world and Graph500 benchmark graphs, showing it achieves high accuracy with minimal overhead.

Proposed method

  • The method uses wedge-sampling: sampling vertex pairs as potential wedge centers and checking if the closing edge exists to form a triangle.
  • MapReduce is used to distribute edge data across nodes, with multiple phases to compute vertex degrees, sample wedges, and verify triangle closure.
  • Degree distributions are computed in Phase 1a, with wedge sampling performed in Phase 2c using vertex degree-based probability distributions.
  • The algorithm uses exponential binning to group vertices by degree and compute degree-wise clustering coefficients and triangle counts per bin.
  • Special data structures minimize data shuffling during MapReduce phases, particularly in phases reading the full edge list (1a, 2c, 3b).
  • Optional labeling phases (4a, 4b) annotate sampled triangles with degree information for downstream analysis like degree assortativity.

Experimental results

Research questions

  • RQ1Can wedge-sampling be effectively parallelized in the MapReduce framework to scale to massive graphs with over 100M nodes and 8.5B edges?
  • RQ2Does the MapReduce-based wedge-sampling approach achieve accurate estimation of global and degree-binned clustering coefficients with low variance and low computational overhead?
  • RQ3How do triangle degree assortativity and clustering profiles differ between social networks (e.g., hollywood-2011) and non-social networks (e.g., Graph500, uk-union)?
  • RQ4To what extent does the Graph500 benchmark generate networks with realistic triangle and clustering properties compared to real-world data?
  • RQ5Can the same MapReduce pipeline efficiently compute multiple clustering metrics (global, binned, degree-assortative) at near-identical cost to a single global coefficient?

Key findings

  • The largest graph processed had 240 million nodes and 8.5 billion edges, with analysis completed in under one hour on a 32-node Hadoop cluster.
  • The method required approximately 0.33 seconds per million edges plus 225 seconds of fixed overhead, demonstrating linear scalability with edge count.
  • For the hollywood-2011 social network, triangle degree assortativity showed a strong positive correlation between min and max degrees, indicating assortative mixing.
  • In contrast, the uk-union web graph and Graph500 networks showed nearly invariant average max-degree across min-degree bins, indicating lack of assortativity.
  • The method estimated the number of triangles with high accuracy, with results on 5 million wedge samples matching expected values within acceptable variance.
  • The approach enabled efficient computation of degree-wise clustering coefficients and triangle counts per bin, with no need to store the full graph in memory.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.