UnionFind

# UnionFind - The Disjoint Set Abstract Data Type Equivalence...

This preview shows pages 1–2. Sign up to view the full content.

The Disjoint Set Abstract Data Type Equivalence Relations: Reflexive (a R a), Symmetric (aRb bRa), Transitive (aRb & bRc => aRc) Elements equivalent to each other form equivalent classes within a set. Equivalent elements form partition over a set: No element belongs to two equivalence classes, and every element belongs to some class Dynamic Equivalence Problem / Union-Find Algorithm Given a set, equivalence between the elements are gradually declared: {a, b, c, d, e, f, g} Steps: a Eq b: {{a, b}, c, d, e, f, g} e Eq c: {{a, b}, {c, e}, d, f, g} b Eq e: {{a, b, c, e}, d, f, g} f Eq g: {{a, b, c, e}, d, {f, g}} We have now 3 Equivalence classes in the set. Needs the set Union operation. Find where does e belong. Answer: First set, or set of ‘a,’ or … Typically needed for answering: does ‘a’ and ‘e’ are equivalent to each other? Doing Union also needs the Find algorithm: b Eq e: where does b and e belongs, then Union those two sets, if they are currently not equivalent.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 02/10/2012 for the course CSE 5211 taught by Professor Dmitra during the Spring '12 term at FIT.

### Page1 / 4

UnionFind - The Disjoint Set Abstract Data Type Equivalence...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online