Colorful triangle counting and a MapReduce implementation

  • Authors:
  • Rasmus Pagh;Charalampos E. Tsourakakis

  • Affiliations:
  • IT University of Copenhagen, Rued Langgaards Vej 7, DK-2300 København S, Denmark;Department of Mathematical Sciences, Carnegie Mellon University, 5000 Forbes Av., Pittsburgh, PA 15213, USA

  • Venue:
  • Information Processing Letters
  • Year:
  • 2012

Quantified Score

Hi-index 0.89

Visualization

Abstract

In this note we introduce a new randomized algorithm for counting triangles in graphs. We show that under mild conditions, the estimate of our algorithm is strongly concentrated around the true number of triangles. Specifically, let G be a graph with n vertices, t triangles and let @D be the maximum number of triangles an edge of G is contained in. Our randomized algorithm colors the vertices of G with N=1/p colors uniformly at random, counts monochromatic triangles, i.e., triangles whose vertices have the same color, and scales that count appropriately. We show that if p=max(@Dlognt,lognt) then for any constant @e0 our unbiased estimate T is concentrated around its expectation, i.e., Pr[|T-E[T]|=@eE[T]]=o(1). Finally, our algorithm is amenable to being parallelized. We present a simple MapReduce implementation of our algorithm.