The dynamic equivalence problem

Published

2023-08-05

The dynamic equivalence problem illustrates trade-offs that we often see when designing algorithms. There are two operations we’d like to perform, find and union, and we can optimize either to have constant time complexity, but we can not achieve constant time complexity for both. (A proof exists for this due to Tarjan, but is well beyond the scope of this course. https://dl.acm.org/doi/10.1145/321879.321884)

Here we introduce the problem. We demonstrate some simple find and union operations, and set the stage for next week where we will implement various solutions in C++.

Supplemental materials:

Comprehension check:

  1. A connected component is a graph in which a ___________ exists between any two nodes in the graph.
  2. True or false? “Is connected to” is an example of an equivalence relation.
  3. The dynamic equivalence problem involves finding a good solution for performing two operations which we call ____________ and ______________.
  4. The “find” operation is one which takes two objects and determines if the two objects belong to the same _____________________________.
  5. The “union” operation is one which merges two equivalence classes by taking their _______________.
  6. True or false? We can design a solution to the dynamic equivalence problem that gives us a constant time for the find operation.
  7. True or false? We can design a solution to the dynamic equivalence problem that gives us a constant time for the union operation.
  8. True or false? We can design a solution to the dynamic equivalence problem that gives us constant time complexity for both the find operation and the union operation.
  9. An equivalence relation on some set S _________________ S (that is, each element in S is in exactly one equivalence class).
  10. The sets representing equivalence classes are ________________ (that is, the intersection of any two such sets is empty).

Answers: ʇuᴉoɾsᴉp / suoᴉʇᴉʇɹɐd / ǝslɐɟ / ǝnɹʇ / ǝnɹʇ / uoᴉun / ssɐlɔ ǝɔuǝlɐʌᴉnbǝ / uoᴉun / puᴉɟ / ǝnɹʇ / ɥʇɐd

Original author: Clayton Cafiero < [given name] DOT [surname] AT uvm DOT edu >

No generative AI was used in producing this material. This was written the old-fashioned way.

All materials copyright © 2020–2023, The University of Vermont. All rights reserved.