Update graph/edmonds-karp.cc
Signed-off-by: subcrip <contact@subc.rip>
This commit is contained in:
parent
7171088b6a
commit
42e20d7daf
|
@ -11,9 +11,9 @@ struct edmonds_karp {
|
||||||
|
|
||||||
edmonds_karp(int n) : edges(n + 1) {}
|
edmonds_karp(int n) : edges(n + 1) {}
|
||||||
|
|
||||||
void add_edge(int from, int to, ll cap, int mark = 0) {
|
void add_edge(int from, int to, ll cap, int mark = 0, int mark_rev = 0) {
|
||||||
edges[from].push_back({to, cap, 0, make_pair(to, int(edges[to].size())), mark});
|
edges[from].push_back({to, cap, 0, make_pair(to, int(edges[to].size())), mark});
|
||||||
edges[to].push_back({from, 0, 0, make_pair(from, int(edges[from].size() - 1)), mark});
|
edges[to].push_back({from, 0, 0, make_pair(from, int(edges[from].size() - 1)), mark_rev});
|
||||||
}
|
}
|
||||||
|
|
||||||
ll run(int s, int t) {
|
ll run(int s, int t) {
|
||||||
|
|
Loading…
Reference in New Issue