mincycle, union find