Skip to content

Commit bf5a76f

Browse files
committed
Two less lines in PushRelabel
1 parent 4b3e356 commit bf5a76f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

content/graph/PushRelabel.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,8 @@ struct PushRelabel {
2525

2626
void add_edge(int s, int t, Flow cap, Flow rcap=0) {
2727
if (s == t) return;
28-
Edge a = {t, sz(g[t]), 0, cap};
29-
Edge b = {s, sz(g[s]), 0, rcap};
30-
g[s].push_back(a);
31-
g[t].push_back(b);
28+
g[s].push_back({t, sz(g[t]), 0, cap});
29+
g[t].push_back({s, sz(g[s])-1, 0, rcap});
3230
}
3331

3432
void add_flow(Edge& e, Flow f) {

0 commit comments

Comments
 (0)