calculating maximal flow in graph using Ford-Fulkerson