Idris2Doc : Data.Graph.Indexed.Util.DisjointSet

Data.Graph.Indexed.Util.DisjointSet

(source)

Definitions

recordDisjointSet : Type->Nat->Type
  A simple [disjoint set](https://en.wikipedia.org/wiki/Disjoint-set_data_structure)
implementation.

This allows us to efficiently partition the values from 0 to `k-1`
into disjoint sets. Operations like `root`, `size`, and `union`
are de-facto amortized O(1).

Totality: total
Visibility: export
Constructor: 
DSF : MArraysk (DSNodek) ->DisjointSetsk

Projection: 
.arr : DisjointSetsk->MArraysk (DSNodek)
ds : (k : Nat) ->F1s (DisjointSetsk)
  Allocates a fresh `DisjointSet` data type with all
values from `0` to `k-1` in their own partition.

Totality: total
Visibility: export
root : DisjointSetsk->Fink->F1s (Fink)
  Returns the current root node of `x`, used for identifying
the partition, to which `x` currently belongs.

Totality: total
Visibility: export
size : DisjointSetsk->Fink->F1sNat
  Returns the size of the partition `x` currently belongs to.

Totality: total
Visibility: export
samePartition : DisjointSetsk->Fink->Fink->F1sBool
  Returns `True` if `x` and `y` belong to the same partition,
`False` otherwise.

Totality: total
Visibility: export
union : DisjointSetsk->Fink->Fink->F1's
  Computes the set union of the partitions of `x` and `y`.

Totality: total
Visibility: export
sets : DisjointSetsk->F1s (List (List (Fink)))
Totality: total
Visibility: export