Shortened max-flow code.