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

Function mvc_bipartite

code/graph/bipartite_mvc.cpp:8–14  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6 alt[*it + g.N] = true;
7 if (g.R[*it] != -1 && !alt[g.R[*it]]) dfs(g, g.R[*it]); } }
8vi mvc_bipartite(bipartite_graph &g) {
9 vi res; g.maximum_matching();
10 alt.assign(g.N + g.M,false);
11 rep(i,0,g.N) if (g.L[i] == -1) dfs(g, i);
12 rep(i,0,g.N) if (!alt[i]) res.push_back(i);
13 rep(i,0,g.M) if (alt[g.N + i]) res.push_back(g.N + i);
14 return res; }
15// vim: cc=60 ts=2 sts=2 sw=2:

Callers 1

testFunction · 0.85

Calls 3

maximum_matchingMethod · 0.80
push_backMethod · 0.80
dfsFunction · 0.70

Tested by 1

testFunction · 0.68