MCPcopy Create free account
hub / github.com/SuprDewd/CompetitiveProgramming / augment

Method augment

code/graph/dinic.cpp:15–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13 e.push_back(edge(v,uv,head[u])); head[u]=(int)size(e)-1;
14 e.push_back(edge(u,vu,head[v])); head[v]=(int)size(e)-1;}
15 int augment(int v, int t, int f) {
16 if (v == t) return f;
17 for (int &i = curh[v], ret; i != -1; i = e[i].nxt)
18 if (e[i].cap > 0 && d[e[i].v] + 1 == d[v])
19 if ((ret = augment(e[i].v, t, min(f, e[i].cap))) > 0)
20 return (e[i].cap -= ret, e[i^1].cap += ret, ret);
21 return 0; }
22 int max_flow(int s, int t, bool res=true) {
23 e_store = e;
24 int l, r, f = 0, x;

Callers

nothing calls this directly

Calls 1

augmentFunction · 0.85

Tested by

no test coverage detected