title: Dynamic union find algorithm in Prolog
body: <p>Lets assume I have sets S1,..,Sn and we want to find
  smallest covers C1,..,Cm so that in each cover there are never disjoint
  connected components.</p>
  <p>for example with the sets S1=[X,Y], S2=[Y,Z], S3=[T] I
  would find the covers C1=[X,Y,Z] and C2=[T]. What about
  a dynamic algorithm that can split covers dynamically?</p>
  <p>Assume the element Y dies, then we are left with
  S1'=[X], S2'=[Z] and S3'=[T]. The covers are now
  C1'=[X], C2'=[Z] and C3'=[T]. So the number of covers
  has increased.</p>
  <p>The union find algorithm can determine a cover for a given
  collection of sets, but I am afraid that recalculating the full collection whenever an element dies, isn't efficient.</p>