Update graph/edmonds-karp.cc
Signed-off-by: subcrip <contact@subc.rip>
This commit is contained in:
parent
92bc4771a8
commit
e09d8d20db
|
@ -4,14 +4,14 @@ struct edmonds_karp {
|
||||||
ll cap;
|
ll cap;
|
||||||
ll flow;
|
ll flow;
|
||||||
pair<int, int> rev;
|
pair<int, int> rev;
|
||||||
bool mark;
|
int mark;
|
||||||
};
|
};
|
||||||
|
|
||||||
vector<vector<edge>> edges;
|
vector<vector<edge>> edges;
|
||||||
|
|
||||||
edmonds_karp(int n) : edges(n + 1) {}
|
edmonds_karp(int n) : edges(n + 1) {}
|
||||||
|
|
||||||
void add_edge(int from, int to, ll cap, bool mark = false) {
|
void add_edge(int from, int to, ll cap, int mark = false) {
|
||||||
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});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue