Finished the min cut problem