Add disjoint set data structure to p3