package unionFind
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
Implementations of the union-find data structure
Install
dune-project
Dependency
Authors
Maintainers
Sources
archive.tar.gz
md5=a0c130e7c7500fc183a9f8dbc5c7b8a8
sha512=a1f591a3de021c9ce952a15dab904b4ccc4fe36750ccc20a868f9a9630f68cffe694dcf9fc1dca5675fb09b320175eeb3799069b7a4dd05714a5d1bb64ee814e
doc/CHANGES.html
CHANGES
2025/08/18
- A concurrent union-find algorithm is now available under the name
UnionFind.Concurrent. - OCaml 4.12 is now required. (
make testrequires OCaml 5.0.) - Fixed and improved documentation for
unionandmerge.
2022/01/22
- Strengthen the specification of
merge. It is now guaranteed that, if the user functionfraises an exception, then the union-find data structure is unaffected.
2022/01/09
- In
UnionFindandUnionFind.Make, introduce a new operationmerge, a variant ofunionthat is parameterized with a join functionf. The functionfis not allowed to perform reentrant accesses to the union-find data structure. - In
UnionFindonly, introduce an optimization that reduces the amount of memory allocation. This leads to a speed improvement of about 10% in the micro-benchmark.
2022/01/07
Incompatible changes in the signature
STORE, which appears in the type of the functorUnionFind.Make.- Instead of having every operation return a possibly-updated store, we assume that stores are updated in place. A new
copyoperation is introduced, so a persistent store is now simulated by a mutable store that can be copied in constant time. The main motivation for this change is that it makesUnionFind.Makemuch more pleasant to use in practice. - The operation
unionis no longer parameterized with a join functionf. This API was flawed and could lead to meaningless behavior if the functionfprovided by the user performed reentrant calls to the union-find algorithm. - The operation
unionnow returns a reference of type'a rrefinstead of a unit value. This makesUnionFind.Makeanalogous toUnionFind, which it was not.
- Instead of having every operation return a possibly-updated store, we assume that stores are updated in place. A new
- Expose
findamong the operations offered byUnionFind.Make. - Add
is_representativeto the operations offered byUnionFindand byUnionFind.Make. - Add a micro-benchmark, which is executed by
make test.
2022/01/01
- Improved documentation.
2020/03/20
- Add a fast path (an optimization) in the
findandeqfunctions, both in the basic union-find (UnionFind) and the one that is parameterized over a store (UnionFind.Make).
2019/08/27
- Initial release of the package.
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page