reset matching when entering edmonds algorithm
This commit is contained in:
parent
e232da1234
commit
48e225310c
1 changed files with 8 additions and 1 deletions
|
@ -31,7 +31,8 @@ std::vector<NodeId> path_to_forest_root(Graph const & graph, NodeId id)
|
|||
}
|
||||
|
||||
|
||||
Graph maximum_matching(Graph & graph)
|
||||
|
||||
Graph maximum_matching_from_initial_matching(Graph & graph)
|
||||
{
|
||||
graph.reset_forest();
|
||||
for(NodeId id = 0; id < graph.num_nodes(); ++id) {
|
||||
|
@ -119,4 +120,10 @@ Graph maximum_matching(Graph & graph)
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
Graph maximum_matching(Graph & graph) {
|
||||
graph.reset_matching();
|
||||
return maximum_matching_from_initial_matching(graph);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue