implemented disjoint set data structure to solve prison transport