Implement a bottom up DP with O(n^2) time/space complexity for min cut problem.