add the disjoint_set data structure with advanced version