fix the effect of unpredictable iteration of HashSet/TreeSet on dp
algorithm!

This was an interesting issue I ran into. I wanted to have a
predictable iteration order of sets of sets. Naively, I thought
that using TreeSet would be nice here. But the mechanics of the code
are such that the sets are modified 'externally' after they are put
in another set! This is just the nature of union-find data structure.
This was affecting me in the dp algorithm because I was assuming
earlier that when I iterate the set of sets, the returned sets
would be according to the size-comparator that I pass on its
constructor. This assumption falls apart when the sets are modified
externally. So, when I needed a permutation of sets that are sorted
on their size, I had to resort to sorting :-).

1- retested with few more graphs.
2- curtailed the toString implementations.