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

Method dfs

code/graph/hopcroft_karp.cpp:20–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18 dist(R[*u]) = dist(v) + 1, q[r++] = R[*u]; } }
19 return dist(-1) != INF; }
20 bool dfs(int v) {
21 if(v != -1) {
22 iter(u, adj[v])
23 if(dist(R[*u]) == dist(v) + 1)
24 if(dfs(R[*u])) {
25 R[*u] = v, L[v] = *u;
26 return true; }
27 dist(v) = INF;
28 return false; }
29 return true; }
30 void add_edge(int i, int j) { adj[i].push_back(j); }
31 int maximum_matching() {
32 int matching = 0;

Callers

nothing calls this directly

Calls 2

iterFunction · 0.70
dfsFunction · 0.70

Tested by

no test coverage detected