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

Function alternating_path

code/graph/bipartite_matching.cpp:4–12  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2bool* done;
3int* owner;
4int alternating_path(int left) {
5 if (done[left]) return 0;
6 done[left] = true;
7 rep(i,0,size(adj[left])) {
8 int right = adj[left][i];
9 if (owner[right] == -1 ||
10 alternating_path(owner[right])) {
11 owner[right] = left; return 1; } }
12 return 0; }
13// vim: cc=60 ts=2 sts=2 sw=2:

Callers 3

test_randFunction · 0.85
test_randFunction · 0.85
test_1Function · 0.85

Calls

no outgoing calls

Tested by 3

test_randFunction · 0.68
test_randFunction · 0.68
test_1Function · 0.68