Improve handling of cutoff in edmonds_karp_core.