package flatunionfind

  1. Overview
  2. Docs

This module offers a union-find data structure based on disjoint set forests, with path compression and linking by rank. The data structure is stored in a flat integer vector.

module type UF = sig ... end

This signature describes the result of the functor FlatUnionFind.Make.

module type UFD = sig ... end

This signature describes the result of the functor FlatUnionFind.Wrap.

module Make () : UF

Applying the functor Make creates a fresh instance of the union-find data structure. This functor is generative: each application returns a new module, with its own mutable internal state and its own abstract type point.

module MakeWithData (D : sig ... end) () : UFD with type data = D.t

Applying the functor MakeWithData creates a fresh instance of the union-find data structure. In comparison with Make, this data structure offers one additional feature: it maintains a map of equivalence classes to user data. This functor is generative: each application returns a new module, with its own mutable internal state and its own abstract type point.

OCaml

Innovation. Community. Security.