union_find: Union Find

Description Usage Arguments Details Value Methods References

View source: R/union_find.R

Description

Exports a UnionFind data structure exposed as an Rcpp Module.

Usage

1
union_find(size)

Arguments

size

the size of the disjoint set

Details

UnionFind, also called a disjoint-set, is a data structure that allows efficient tracking and unioning of elements in terms of connected components. To use the structure, instantiate it with a given (fixed) size of components, and then union or find as needed. This implementation uses path compression to speed up successive find operations.

Value

A queryable disjoint-set structure.

Methods

References

Tarjan, Robert Endre. "Efficiency of a good but not linear set union algorithm." Journal of the ACM (JACM) 22.2 (1975): 215-225.


peekxc/Mapper documentation built on June 12, 2020, 2:14 a.m.