Skip to content
Snippets Groups Projects
Commit f847b1c9 authored by Bruno Freitas Tissei's avatar Bruno Freitas Tissei
Browse files

Fix bipartite_match

parent 39ab5757
No related branches found
No related tags found
No related merge requests found
/**
* Bipartite Matching
*
* Complexity (Time): O(V + E)
* Complexity (Space): O(V + E)
* Complexity (Time): O(V*E)
* Complexity (Space): O(V*E)
*/
vector<int> graph[MAX];
......@@ -15,7 +15,7 @@ int dfs(int x) {
cont[x] = 1;
for (auto i : graph[x])
if (match[i] == -1 || dfs(match[v])) {
if (match[i] == -1 || dfs(match[i])) {
match[i] = x;
return 1;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment