Groups
Category
Rollback DSU (Disjoint Set Union with undo) lets you union sets and later revert to any previous state in LIFO order.
A DSU with weighted edges (also called a potential or difference-constraint union-find) maintains relative values between elements while still supporting near-constant-time merges and finds.