mincut alg running perfectly in O((n^2)*m) time