Module UnionFind.Make
Build a union-find module from a key/value specification
Parameters
Signature
type key= P.keyElements that can be compared
type value= P.valueValues associated with elements
val create : key list -> tCreate a union-find for the given elements. Elements are mapped to zero by default.
val find : t -> key -> keyFinds 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 -> valueFind 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 keyis false.