implement Ford-Fulkerson algorithm