diff options
| author | Paul Jungeblut <paul.jungeblut@gmail.com> | 2017-07-15 12:51:30 +0200 |
|---|---|---|
| committer | Paul Jungeblut <paul.jungeblut@gmail.com> | 2017-07-15 12:51:30 +0200 |
| commit | fbc9d4d19a8c197fe7d2541ae70d76cbc14879d2 (patch) | |
| tree | 3832142bbe66dd1617c0d43d2bbee4387cff5465 /graph/dinicScaling.cpp | |
| parent | d969b7873b60f12d37e58497c07622d5eaca2cea (diff) | |
Small changes to make dinics algorithm more robust.
Diffstat (limited to 'graph/dinicScaling.cpp')
| -rw-r--r-- | graph/dinicScaling.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/graph/dinicScaling.cpp b/graph/dinicScaling.cpp index 0d188a8..ebbcc27 100644 --- a/graph/dinicScaling.cpp +++ b/graph/dinicScaling.cpp @@ -1,3 +1,5 @@ +// Laufzeit: O(|V|^2*|E|) +// Knoten müssen von 0 nummeriert sein. const int INF = 0x3FFFFFFF, MAXN = 500; struct edge { int a, b; ll f, c; }; int n, m, pt[MAXN], d[MAXN], s, t; @@ -6,7 +8,7 @@ vector<int> g[MAXN]; ll flow = 0, lim; queue<int> q; -void add_edge(int a, int b, ll c) { +void addEdge(int a, int b, ll c) { g[a].push_back(e.size()); e.push_back(edge {a, b, 0, c}); g[b].push_back(e.size()); |
