Add transient support

Add transient support to the UnionFind data structure.