diff options
Diffstat (limited to 'maxFlow')
| -rw-r--r-- | maxFlow/edmondsKarp.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/maxFlow/edmondsKarp.cpp b/maxFlow/edmondsKarp.cpp index a2be9a6..ccfb1d2 100644 --- a/maxFlow/edmondsKarp.cpp +++ b/maxFlow/edmondsKarp.cpp @@ -10,7 +10,7 @@ void augment(int v, int minEdge) { res[p[v]][v] -= f; res[v][p[v]] += f; }} -int main() { //first inititalize res, adjList, s and t +nt maxFlow() { //first inititalize res, adjList, s and t int mf = 0; while (true) { f = 0; @@ -29,5 +29,6 @@ int main() { //first inititalize res, adjList, s and t augment(t, INF); //add found path to max flow if (f == 0) break; mf += f; -}} -//max flow in mf}
\ No newline at end of file + } + return maxFlow; +}
\ No newline at end of file |
