MEX-wrapper to the Boykov-Kolmogorov min-cut/max-flow algorithm