fix some small bugs
redo the disconnectivity graph algorithm using existing algorithms

the dgraph algorithm is very similar to minimum spanning tree algorithm.
We now use the UnionFind algorithm in networkx in a very similar way to
the minimum spanning tree algorithm to make things a bit cleaner