Copy input matrix in mincut() to eliminate side effects
Improve decrement check in mincut()