update Dinic's Algorithm