Module UnionFind.Make
Build a union-find module from a key/value specification
Parameters
Signature
type key
= P.key
Elements that can be compared
type value
= P.value
Values associated with elements
val create : key list -> t
Create a union-find for the given elements. Elements are mapped to zero by default.
val find : t -> key -> key
Finds the representative of this key's equivalence class.
- raises Not_found
if the key does not belong to the UF
val find_value : t -> key -> value
Find value for the given element. The value is the monoid merge of all values associated to
key
's equivalence class.- raises Not_found
if
mem uf key
is false.