UnionFind

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

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

View Full Document Right Arrow Icon
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.
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

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 Right Arrow Icon
Ask a homework question - tutors are online