Implemented Max Flow.