A basic union-find data structure for node.js