mincut code