Skip to content

Commit

Permalink
Merge pull request #19 from skku-npc/user/Jaemin
Browse files Browse the repository at this point in the history
Fix Dinic
  • Loading branch information
dotoleeoak authored Sep 29, 2020
2 parents d0cd8ba + 2d84979 commit 3ea2c70
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Dinic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ struct Dinic {
struct Edge {
int nxt;
flow_t res; // residual flow
size_t inv; // inversed edge index
size_t inv; // inverse edge index
Edge(int n, flow_t r, size_t v) : nxt(n), res(r), inv(v) {}
};

Expand All @@ -27,9 +27,9 @@ struct Dinic {
q[t++] = src;
for (int h = 0; h < t && !lvl[sink]; h++) {
int cur = q[h];
for (auto& e : graph[cur]) {
if (l[e.nxt] == 0 && e.res > 0) {
lvl[e.nxt] = l[cur] + 1;
for (auto& e : adj[cur]) {
if (lvl[e.nxt] == 0 && e.res > 0) {
lvl[e.nxt] = lvl[cur] + 1;
q[t++] = e.nxt;
}
}
Expand Down

0 comments on commit 3ea2c70

Please sign in to comment.