Added Dinic's algorithm.