reset matching when entering edmonds algorithm

This commit is contained in:
Maximilian Keßler 2023-11-04 19:40:37 +01:00
parent e232da1234
commit 48e225310c
Signed by: max
GPG key ID: BCC5A619923C0BA5

View file

@ -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(); graph.reset_forest();
for(NodeId id = 0; id < graph.num_nodes(); ++id) { 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);
}
} }