Optimal union-find in Constraint Handling Rules

  • Authors:
  • Tom Schrijvers;Thom Frühwirth

  • Affiliations:
  • Department of Computer Science, K. U. Leuven, Belgium (e-mail: www.cs.kuleuven.ac.be/~toms/);Faculty of Computer Science, University of Ulm, Germany (e-mail: www.informatik.uni-ulm.de/pm/mitarbeiter/fruehwirth/)

  • Venue:
  • Theory and Practice of Logic Programming
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

Abstract

Constraint Handling Rules (CHR) is a committed-choice rule-based language that was originally intended for writing constraint solvers. In this paper we show that it is also possible to write the classic union-find algorithm and variants in CHR. The programs neither compromise in declarativeness nor efficiency. We study the time complexity of our programs: they match the almost-linear complexity of the best known imperative implementations. This fact is illustrated with experimental results.