Hostname: page-component-745bb68f8f-s22k5 Total loading time: 0 Render date: 2025-02-07T03:36:56.672Z Has data issue: false hasContentIssue false

Optimal union-find in Constraint Handling Rules

Published online by Cambridge University Press:  27 January 2006

TOM SCHRIJVERS
Affiliation:
Department of Computer Science, K. U. Leuven, Belgium (e-mail: www.cs.kuleuven.ac.be/~toms/)
THOM FRÜHWIRTH
Affiliation:
Faculty of Computer Science, University of Ulm, Germany (e-mail: www.informatik.uni-ulm.de/pm/mitarbeiter/fruehwirth/)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

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.

Type
Programming Pearl
Copyright
2006 Cambridge University Press