Don't rush into a union: take time to find your roots

  • Authors:
  • Mihai Pătraşcu;Mikkel Thorup

  • Affiliations:
  • AT&T Labs, Florham Park,NJ, NJ, USA;AT&T Labs, Florham Park,NJ, NJ, USA

  • Venue:
  • Proceedings of the forty-third annual ACM symposium on Theory of computing
  • Year:
  • 2011

Quantified Score

Hi-index 0.00

Visualization

Abstract

We present a new threshold phenomenon in data structure lower bounds where slightly reduced update times lead to exploding query times. Consider incremental connectivity, letting tu be the time to insert an edge and tq be the query time. For tu = Omega(tq), the problem is equivalent to the well-understood union-find problem: proc{InsertEdge}(s,t) can be implemented by Union(Find(s), Find(t)). This gives worst-case time tu = tq = O(lg n / lg lg n) and amortized tu = tq = O(α(n)). By contrast, we show that if tu = o(lg n / lg lg n), the query time explodes to tq ≥ n1-o(1). In other words, if the data structure doesn't have time to find the roots of each disjoint set (tree) during edge insertion, there is no effective way to organize the information! For amortized complexity, we demonstrate a new inverse-Ackermann type trade-off in the regime tu = o(tq). A similar lower bound is given for fully dynamic connectivity, where an update time of o(lg n) forces the query time to be n1-o(1). This lower bound allows for amortization and Las Vegas randomization, and comes close to the known O(lg n • (lg lg n)O(1)) upper bound.