Max flow, min cut, minimum spanning tree, Union Find keeps state