×

zbMATH — the first resource for mathematics

Optimal union-find in constraint handling rules. (English) Zbl 1109.68029
Summary: 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.

MSC:
68N17 Logic programming
PDF BibTeX XML Cite
Full Text: DOI